@zuzjs/ui 0.7.7 → 0.7.9
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/dist/cjs/comps/Accordion/index.js +2 -1
- package/dist/cjs/comps/Actionbar/index.d.ts +1 -1
- package/dist/cjs/comps/Actionbar/index.js +3 -2
- package/dist/cjs/comps/Alert/index.d.ts +1 -1
- package/dist/cjs/comps/Alert/index.js +1 -0
- package/dist/cjs/comps/AutoComplete/index.js +1 -0
- package/dist/cjs/comps/Avatar/index.js +3 -2
- package/dist/cjs/comps/Box/index.d.ts +1 -2
- package/dist/cjs/comps/Box/index.js +15 -13
- package/dist/cjs/comps/Button/index.d.ts +2 -2
- package/dist/cjs/comps/Button/index.js +4 -3
- package/dist/cjs/comps/Button/types.d.ts +1 -1
- package/dist/cjs/comps/CheckBox/index.d.ts +2 -2
- package/dist/cjs/comps/CheckBox/index.js +2 -1
- package/dist/cjs/comps/ColorScheme/index.d.ts +3 -2
- package/dist/cjs/comps/ColorScheme/index.js +29 -9
- package/dist/cjs/comps/ColorScheme/types.d.ts +4 -0
- package/dist/cjs/comps/ColorScheme/types.js +1 -0
- package/dist/cjs/comps/ContextMenu/index.js +4 -4
- package/dist/cjs/comps/CookiesConsent/index.js +3 -2
- package/dist/cjs/comps/Cover/index.d.ts +1 -1
- package/dist/cjs/comps/Cover/index.js +3 -2
- package/dist/cjs/comps/Crumb/index.d.ts +4 -0
- package/dist/cjs/comps/Crumb/index.js +13 -0
- package/dist/cjs/comps/Crumb/types.d.ts +11 -0
- package/dist/cjs/comps/Crumb/types.js +1 -0
- package/dist/cjs/comps/Drawer/index.js +17 -15
- package/dist/cjs/comps/Editor/Timeline/index.js +4 -3
- package/dist/cjs/comps/Editor/index.js +2 -1
- package/dist/cjs/comps/Fab/index.d.ts +1 -2
- package/dist/cjs/comps/Fab/index.js +2 -1
- package/dist/cjs/comps/Filters/index.d.ts +4 -1
- package/dist/cjs/comps/Filters/index.js +1 -0
- package/dist/cjs/comps/Form/index.d.ts +3 -59
- package/dist/cjs/comps/Form/index.js +5 -7
- package/dist/cjs/comps/Form/types.d.ts +43 -0
- package/dist/cjs/comps/Form/types.js +1 -0
- package/dist/cjs/comps/Icon/index.d.ts +1 -1
- package/dist/cjs/comps/Icon/index.js +2 -2
- package/dist/cjs/comps/Image/index.js +1 -1
- package/dist/cjs/comps/Input/index.js +1 -0
- package/dist/cjs/comps/KeyboardKeys/index.d.ts +8 -0
- package/dist/cjs/comps/KeyboardKeys/index.js +33 -0
- package/dist/cjs/comps/KeyboardKeys/types.d.ts +13 -0
- package/dist/cjs/comps/KeyboardKeys/types.js +51 -0
- package/dist/cjs/comps/Label/index.js +1 -1
- package/dist/cjs/comps/List/index.d.ts +4 -1
- package/dist/cjs/comps/List/index.js +5 -4
- package/dist/cjs/comps/List/item.d.ts +6 -3
- package/dist/cjs/comps/List/item.js +6 -1
- package/dist/cjs/comps/List/types.d.ts +4 -1
- package/dist/cjs/comps/Network/index.js +6 -7
- package/dist/cjs/comps/Overlay/index.js +2 -1
- package/dist/cjs/comps/Pagination/index.js +3 -2
- package/dist/cjs/comps/Password/index.js +2 -1
- package/dist/cjs/comps/PinInput/index.js +2 -1
- package/dist/cjs/comps/ProgressBar/index.js +1 -0
- package/dist/cjs/comps/Radio/index.js +1 -0
- package/dist/cjs/comps/ScrollView/index.d.ts +5 -0
- package/dist/cjs/comps/ScrollView/index.js +13 -0
- package/dist/cjs/comps/ScrollView/types.d.ts +6 -0
- package/dist/cjs/comps/ScrollView/types.js +1 -0
- package/dist/cjs/comps/Search/index.d.ts +7 -10
- package/dist/cjs/comps/Search/index.js +12 -7
- package/dist/cjs/comps/Search/types.d.ts +12 -0
- package/dist/cjs/comps/Search/types.js +1 -0
- package/dist/cjs/comps/Segmented/index.d.ts +3 -2
- package/dist/cjs/comps/Segmented/index.js +6 -5
- package/dist/cjs/comps/Segmented/item.d.ts +4 -1
- package/dist/cjs/comps/Segmented/item.js +16 -14
- package/dist/cjs/comps/Segmented/types.d.ts +5 -1
- package/dist/cjs/comps/Select/index.d.ts +2 -4
- package/dist/cjs/comps/Select/index.js +4 -3
- package/dist/cjs/comps/Select/optionItem.d.ts +4 -1
- package/dist/cjs/comps/Select/optionItem.js +1 -0
- package/dist/cjs/comps/Select/types.d.ts +1 -1
- package/dist/cjs/comps/Sheet/index.d.ts +1 -1
- package/dist/cjs/comps/Sheet/index.js +12 -8
- package/dist/cjs/comps/Sidebar/index.js +1 -0
- package/dist/cjs/comps/Slider/index.d.ts +1 -1
- package/dist/cjs/comps/Slider/index.js +3 -2
- package/dist/cjs/comps/Span/index.js +1 -0
- package/dist/cjs/comps/Spinner/index.d.ts +1 -1
- package/dist/cjs/comps/Spinner/index.js +4 -7
- package/dist/cjs/comps/Switch/index.d.ts +1 -1
- package/dist/cjs/comps/Switch/index.js +2 -1
- package/dist/cjs/comps/TabView/body.js +1 -0
- package/dist/cjs/comps/TabView/index.d.ts +1 -1
- package/dist/cjs/comps/TabView/index.js +1 -0
- package/dist/cjs/comps/TabView/tab.d.ts +4 -1
- package/dist/cjs/comps/TabView/tab.js +1 -0
- package/dist/cjs/comps/TabView/types.d.ts +2 -2
- package/dist/cjs/comps/Table/col.d.ts +9 -6
- package/dist/cjs/comps/Table/col.js +1 -0
- package/dist/cjs/comps/Table/index.js +13 -5
- package/dist/cjs/comps/Table/row.d.ts +4 -1
- package/dist/cjs/comps/Table/row.js +5 -3
- package/dist/cjs/comps/Table/types.d.ts +88 -1
- package/dist/cjs/comps/Text/index.d.ts +2 -0
- package/dist/cjs/comps/Text/index.js +4 -2
- package/dist/cjs/comps/TextArea/index.d.ts +2 -0
- package/dist/cjs/comps/TextArea/index.js +3 -3
- package/dist/cjs/comps/TextWheel/index.js +1 -0
- package/dist/cjs/comps/Tooltip/index.d.ts +1 -2
- package/dist/cjs/comps/Tooltip/index.js +2 -1
- package/dist/cjs/comps/Treeview/index.d.ts +1 -2
- package/dist/cjs/comps/Treeview/index.js +3 -1
- package/dist/cjs/comps/Treeview/item.d.ts +3 -2
- package/dist/cjs/comps/Treeview/item.js +12 -7
- package/dist/cjs/comps/Treeview/types.d.ts +6 -2
- package/dist/cjs/comps/VideoPlayer/index.d.ts +2 -0
- package/dist/cjs/comps/VideoPlayer/index.js +7 -0
- package/dist/cjs/comps/index.d.ts +26 -18
- package/dist/cjs/comps/index.js +8 -0
- package/dist/cjs/funs/css.d.ts +3 -3
- package/dist/cjs/funs/css.js +20 -18
- package/dist/cjs/funs/index.d.ts +3 -1
- package/dist/cjs/funs/index.js +14 -3
- package/dist/cjs/funs/stylesheet.js +5 -0
- package/dist/cjs/hooks/index.d.ts +15 -9
- package/dist/cjs/hooks/index.js +14 -7
- package/dist/cjs/hooks/useAnchorPosition.d.ts +1 -2
- package/dist/cjs/hooks/useAnchorPosition.js +1 -0
- package/dist/cjs/hooks/useBase.js +27 -13
- package/dist/cjs/hooks/useCalendar.js +1 -0
- package/dist/cjs/hooks/useColorScheme.js +2 -2
- package/dist/cjs/hooks/useContextMenu.js +1 -0
- package/dist/cjs/hooks/useDB.js +1 -0
- package/dist/cjs/hooks/useDebounce.js +2 -1
- package/dist/cjs/hooks/useDelayed.d.ts +17 -0
- package/dist/cjs/hooks/useDelayed.js +26 -0
- package/dist/cjs/hooks/useDevice.js +1 -0
- package/dist/cjs/hooks/useDimensions.js +2 -1
- package/dist/cjs/hooks/useDom.d.ts +2 -0
- package/dist/cjs/hooks/useDom.js +3 -0
- package/dist/cjs/hooks/useDomMutation.d.ts +3 -0
- package/dist/cjs/hooks/useDomMutation.js +19 -0
- package/dist/cjs/hooks/useDrag.js +2 -1
- package/dist/cjs/hooks/useFileManager.d.ts +2 -0
- package/dist/cjs/hooks/useFileManager.js +3 -0
- package/dist/cjs/hooks/useImage.js +1 -0
- package/dist/cjs/hooks/useIntersectionObserver.js +2 -1
- package/dist/cjs/hooks/useMediaPlayer.d.ts +32 -0
- package/dist/cjs/hooks/useMediaPlayer.js +86 -0
- package/dist/cjs/hooks/useMergedRefs.d.ts +2 -0
- package/dist/cjs/hooks/useMergedRefs.js +14 -0
- package/dist/cjs/hooks/useMutationObserver.d.ts +3 -0
- package/dist/cjs/hooks/useMutationObserver.js +20 -0
- package/dist/cjs/hooks/useNetworkStatus.js +2 -1
- package/dist/cjs/hooks/usePlayer.d.ts +32 -0
- package/dist/cjs/hooks/usePlayer.js +85 -0
- package/dist/cjs/hooks/useResizeObserver.js +2 -1
- package/dist/cjs/hooks/useScrollbar.d.ts +16 -0
- package/dist/cjs/hooks/useScrollbar.js +160 -0
- package/dist/cjs/hooks/useSheet.js +1 -0
- package/dist/cjs/hooks/useShortcuts.d.ts +7 -0
- package/dist/cjs/hooks/useShortcuts.js +29 -0
- package/dist/cjs/hooks/useSlider.d.ts +7 -0
- package/dist/cjs/hooks/useSlider.js +23 -0
- package/dist/cjs/hooks/useTruncateText.d.ts +2 -0
- package/dist/cjs/hooks/useTruncateText.js +17 -0
- package/dist/cjs/hooks/useViewTransition.d.ts +2 -0
- package/dist/cjs/hooks/useViewTransition.js +13 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/types/enums.d.ts +1 -0
- package/dist/cjs/types/enums.js +1 -0
- package/dist/cjs/types/index.d.ts +2 -1
- package/dist/cjs/types/interfaces.d.ts +2 -0
- package/dist/css/styles.css +1 -1
- package/dist/esm/comps/Accordion/index.js +2 -1
- package/dist/esm/comps/Actionbar/index.d.ts +1 -1
- package/dist/esm/comps/Actionbar/index.js +3 -2
- package/dist/esm/comps/Alert/index.d.ts +1 -1
- package/dist/esm/comps/Alert/index.js +1 -0
- package/dist/esm/comps/AutoComplete/index.js +1 -0
- package/dist/esm/comps/Avatar/index.js +3 -2
- package/dist/esm/comps/Box/index.d.ts +1 -2
- package/dist/esm/comps/Box/index.js +15 -13
- package/dist/esm/comps/Button/index.d.ts +2 -2
- package/dist/esm/comps/Button/index.js +4 -3
- package/dist/esm/comps/Button/types.d.ts +1 -1
- package/dist/esm/comps/CheckBox/index.d.ts +2 -2
- package/dist/esm/comps/CheckBox/index.js +2 -1
- package/dist/esm/comps/ColorScheme/index.d.ts +3 -2
- package/dist/esm/comps/ColorScheme/index.js +29 -9
- package/dist/esm/comps/ColorScheme/types.d.ts +4 -0
- package/dist/esm/comps/ColorScheme/types.js +1 -0
- package/dist/esm/comps/ContextMenu/index.js +4 -4
- package/dist/esm/comps/CookiesConsent/index.js +3 -2
- package/dist/esm/comps/Cover/index.d.ts +1 -1
- package/dist/esm/comps/Cover/index.js +3 -2
- package/dist/esm/comps/Crumb/index.d.ts +4 -0
- package/dist/esm/comps/Crumb/index.js +13 -0
- package/dist/esm/comps/Crumb/types.d.ts +11 -0
- package/dist/esm/comps/Crumb/types.js +1 -0
- package/dist/esm/comps/Drawer/index.js +17 -15
- package/dist/esm/comps/Editor/Timeline/index.js +4 -3
- package/dist/esm/comps/Editor/index.js +2 -1
- package/dist/esm/comps/Fab/index.d.ts +1 -2
- package/dist/esm/comps/Fab/index.js +2 -1
- package/dist/esm/comps/Filters/index.d.ts +4 -1
- package/dist/esm/comps/Filters/index.js +1 -0
- package/dist/esm/comps/Form/index.d.ts +3 -59
- package/dist/esm/comps/Form/index.js +5 -7
- package/dist/esm/comps/Form/types.d.ts +43 -0
- package/dist/esm/comps/Form/types.js +1 -0
- package/dist/esm/comps/Icon/index.d.ts +1 -1
- package/dist/esm/comps/Icon/index.js +2 -2
- package/dist/esm/comps/Image/index.js +1 -1
- package/dist/esm/comps/Input/index.js +1 -0
- package/dist/esm/comps/KeyboardKeys/index.d.ts +8 -0
- package/dist/esm/comps/KeyboardKeys/index.js +33 -0
- package/dist/esm/comps/KeyboardKeys/types.d.ts +13 -0
- package/dist/esm/comps/KeyboardKeys/types.js +51 -0
- package/dist/esm/comps/Label/index.js +1 -1
- package/dist/esm/comps/List/index.d.ts +4 -1
- package/dist/esm/comps/List/index.js +5 -4
- package/dist/esm/comps/List/item.d.ts +6 -3
- package/dist/esm/comps/List/item.js +6 -1
- package/dist/esm/comps/List/types.d.ts +4 -1
- package/dist/esm/comps/Network/index.js +6 -7
- package/dist/esm/comps/Overlay/index.js +2 -1
- package/dist/esm/comps/Pagination/index.js +3 -2
- package/dist/esm/comps/Password/index.js +2 -1
- package/dist/esm/comps/PinInput/index.js +2 -1
- package/dist/esm/comps/ProgressBar/index.js +1 -0
- package/dist/esm/comps/Radio/index.js +1 -0
- package/dist/esm/comps/ScrollView/index.d.ts +5 -0
- package/dist/esm/comps/ScrollView/index.js +13 -0
- package/dist/esm/comps/ScrollView/types.d.ts +6 -0
- package/dist/esm/comps/ScrollView/types.js +1 -0
- package/dist/esm/comps/Search/index.d.ts +7 -10
- package/dist/esm/comps/Search/index.js +12 -7
- package/dist/esm/comps/Search/types.d.ts +12 -0
- package/dist/esm/comps/Search/types.js +1 -0
- package/dist/esm/comps/Segmented/index.d.ts +3 -2
- package/dist/esm/comps/Segmented/index.js +6 -5
- package/dist/esm/comps/Segmented/item.d.ts +4 -1
- package/dist/esm/comps/Segmented/item.js +16 -14
- package/dist/esm/comps/Segmented/types.d.ts +5 -1
- package/dist/esm/comps/Select/index.d.ts +2 -4
- package/dist/esm/comps/Select/index.js +4 -3
- package/dist/esm/comps/Select/optionItem.d.ts +4 -1
- package/dist/esm/comps/Select/optionItem.js +1 -0
- package/dist/esm/comps/Select/types.d.ts +1 -1
- package/dist/esm/comps/Sheet/index.d.ts +1 -1
- package/dist/esm/comps/Sheet/index.js +12 -8
- package/dist/esm/comps/Sidebar/index.js +1 -0
- package/dist/esm/comps/Slider/index.d.ts +1 -1
- package/dist/esm/comps/Slider/index.js +3 -2
- package/dist/esm/comps/Span/index.js +1 -0
- package/dist/esm/comps/Spinner/index.d.ts +1 -1
- package/dist/esm/comps/Spinner/index.js +4 -7
- package/dist/esm/comps/Switch/index.d.ts +1 -1
- package/dist/esm/comps/Switch/index.js +2 -1
- package/dist/esm/comps/TabView/body.js +1 -0
- package/dist/esm/comps/TabView/index.d.ts +1 -1
- package/dist/esm/comps/TabView/index.js +1 -0
- package/dist/esm/comps/TabView/tab.d.ts +4 -1
- package/dist/esm/comps/TabView/tab.js +1 -0
- package/dist/esm/comps/TabView/types.d.ts +2 -2
- package/dist/esm/comps/Table/col.d.ts +9 -6
- package/dist/esm/comps/Table/col.js +1 -0
- package/dist/esm/comps/Table/index.js +13 -5
- package/dist/esm/comps/Table/row.d.ts +4 -1
- package/dist/esm/comps/Table/row.js +5 -3
- package/dist/esm/comps/Table/types.d.ts +88 -1
- package/dist/esm/comps/Text/index.d.ts +2 -0
- package/dist/esm/comps/Text/index.js +4 -2
- package/dist/esm/comps/TextArea/index.d.ts +2 -0
- package/dist/esm/comps/TextArea/index.js +3 -3
- package/dist/esm/comps/TextWheel/index.js +1 -0
- package/dist/esm/comps/Tooltip/index.d.ts +1 -2
- package/dist/esm/comps/Tooltip/index.js +2 -1
- package/dist/esm/comps/Treeview/index.d.ts +1 -2
- package/dist/esm/comps/Treeview/index.js +3 -1
- package/dist/esm/comps/Treeview/item.d.ts +3 -2
- package/dist/esm/comps/Treeview/item.js +12 -7
- package/dist/esm/comps/Treeview/types.d.ts +6 -2
- package/dist/esm/comps/VideoPlayer/index.d.ts +2 -0
- package/dist/esm/comps/VideoPlayer/index.js +7 -0
- package/dist/esm/comps/index.d.ts +26 -18
- package/dist/esm/comps/index.js +8 -0
- package/dist/esm/funs/css.d.ts +3 -3
- package/dist/esm/funs/css.js +20 -18
- package/dist/esm/funs/index.d.ts +3 -1
- package/dist/esm/funs/index.js +14 -3
- package/dist/esm/funs/stylesheet.js +5 -0
- package/dist/esm/hooks/index.d.ts +15 -9
- package/dist/esm/hooks/index.js +14 -7
- package/dist/esm/hooks/useAnchorPosition.d.ts +1 -2
- package/dist/esm/hooks/useAnchorPosition.js +1 -0
- package/dist/esm/hooks/useBase.js +27 -13
- package/dist/esm/hooks/useCalendar.js +1 -0
- package/dist/esm/hooks/useColorScheme.js +2 -2
- package/dist/esm/hooks/useContextMenu.js +1 -0
- package/dist/esm/hooks/useDB.js +1 -0
- package/dist/esm/hooks/useDebounce.js +2 -1
- package/dist/esm/hooks/useDelayed.d.ts +17 -0
- package/dist/esm/hooks/useDelayed.js +26 -0
- package/dist/esm/hooks/useDevice.js +1 -0
- package/dist/esm/hooks/useDimensions.js +2 -1
- package/dist/esm/hooks/useDom.d.ts +2 -0
- package/dist/esm/hooks/useDom.js +3 -0
- package/dist/esm/hooks/useDomMutation.d.ts +3 -0
- package/dist/esm/hooks/useDomMutation.js +19 -0
- package/dist/esm/hooks/useDrag.js +2 -1
- package/dist/esm/hooks/useFileManager.d.ts +2 -0
- package/dist/esm/hooks/useFileManager.js +3 -0
- package/dist/esm/hooks/useImage.js +1 -0
- package/dist/esm/hooks/useIntersectionObserver.js +2 -1
- package/dist/esm/hooks/useMediaPlayer.d.ts +32 -0
- package/dist/esm/hooks/useMediaPlayer.js +86 -0
- package/dist/esm/hooks/useMergedRefs.d.ts +2 -0
- package/dist/esm/hooks/useMergedRefs.js +14 -0
- package/dist/esm/hooks/useMutationObserver.d.ts +3 -0
- package/dist/esm/hooks/useMutationObserver.js +20 -0
- package/dist/esm/hooks/useNetworkStatus.js +2 -1
- package/dist/esm/hooks/usePlayer.d.ts +32 -0
- package/dist/esm/hooks/usePlayer.js +85 -0
- package/dist/esm/hooks/useResizeObserver.js +2 -1
- package/dist/esm/hooks/useScrollbar.d.ts +16 -0
- package/dist/esm/hooks/useScrollbar.js +160 -0
- package/dist/esm/hooks/useSheet.js +1 -0
- package/dist/esm/hooks/useShortcuts.d.ts +7 -0
- package/dist/esm/hooks/useShortcuts.js +29 -0
- package/dist/esm/hooks/useSlider.d.ts +7 -0
- package/dist/esm/hooks/useSlider.js +23 -0
- package/dist/esm/hooks/useTruncateText.d.ts +2 -0
- package/dist/esm/hooks/useTruncateText.js +17 -0
- package/dist/esm/hooks/useViewTransition.d.ts +2 -0
- package/dist/esm/hooks/useViewTransition.js +13 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/types/enums.d.ts +1 -0
- package/dist/esm/types/enums.js +1 -0
- package/dist/esm/types/index.d.ts +2 -1
- package/dist/esm/types/interfaces.d.ts +2 -0
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef, useImperativeHandle, useRef, useState } from "react";
|
|
4
|
-
import Box from "../Box";
|
|
5
4
|
import { useAnchorPosition, useBase } from "../../hooks";
|
|
6
|
-
import MenuItem from "./item";
|
|
7
5
|
import { TRANSITION_CURVES } from "../../types/enums";
|
|
8
|
-
|
|
6
|
+
import Box from "../Box";
|
|
7
|
+
import MenuItem from "./item";
|
|
9
8
|
const ContextMenu = forwardRef((props, ref) => {
|
|
10
9
|
const { as, offsetX, offsetY, parent, items: _items, ...pops } = props;
|
|
11
10
|
const { className, style, rest } = useBase(pops);
|
|
@@ -30,7 +29,7 @@ const ContextMenu = forwardRef((props, ref) => {
|
|
|
30
29
|
...style,
|
|
31
30
|
top: position.top,
|
|
32
31
|
left: position.left
|
|
33
|
-
},
|
|
32
|
+
}, fx: {
|
|
34
33
|
from: { opacity: 0, y: 20 },
|
|
35
34
|
to: { opacity: 1, y: 0 },
|
|
36
35
|
curve: TRANSITION_CURVES.EaseInOut,
|
|
@@ -38,4 +37,5 @@ const ContextMenu = forwardRef((props, ref) => {
|
|
|
38
37
|
when: visible
|
|
39
38
|
}, ref: targetRef, ...rest, children: items.map((item, index) => _jsx(MenuItem, { ...{ ...item, index } }, `context-${item.label.toLowerCase()}-${index}`)) });
|
|
40
39
|
});
|
|
40
|
+
ContextMenu.displayName = `ContextMenu`;
|
|
41
41
|
export default ContextMenu;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef, useEffect, useState } from "react";
|
|
4
|
+
import { Position, TRANSITION_CURVES } from "../../types/enums";
|
|
4
5
|
import Box from "../Box";
|
|
5
|
-
import Text from "../Text";
|
|
6
6
|
import Button from "../Button";
|
|
7
|
-
import
|
|
7
|
+
import Text from "../Text";
|
|
8
8
|
const CookiesConsent = forwardRef((props, ref) => {
|
|
9
9
|
const [accepted, setAccepted] = useState(`wait`);
|
|
10
10
|
const { title, message, acceptLabel, rejectLabel, position } = props;
|
|
@@ -25,4 +25,5 @@ const CookiesConsent = forwardRef((props, ref) => {
|
|
|
25
25
|
delay: accepted == `accepted` ? 0 : 3
|
|
26
26
|
}, as: `--cookie-consent --${accepted} --${position || Position.Left} flex cols`, children: [_jsx(Text, { as: `--title`, children: title || `This site uses cookies` }), _jsx(Text, { as: `--message`, children: message || `We and selected third parties use cookies (or similar technologies) for technical purposes, to enhance and analyze site usage, to support our marketing efforts` }), _jsxs(Box, { as: `--footer flex aic`, children: [_jsx(Button, { onClick: e => handleAction(1), as: `--accept`, children: acceptLabel || `Accept All` }), _jsx(Button, { onClick: e => handleAction(0), as: `--reject`, children: rejectLabel || `Cancel` })] })] });
|
|
27
27
|
});
|
|
28
|
+
CookiesConsent.displayName = `CookiesConsent`;
|
|
28
29
|
export default CookiesConsent;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
|
-
import Box from "../Box";
|
|
5
|
-
import { SPINNER } from "../../types/enums";
|
|
6
4
|
import { useBase } from "../../hooks";
|
|
5
|
+
import { SPINNER } from "../../types/enums";
|
|
6
|
+
import Box from "../Box";
|
|
7
7
|
import Spinner from "../Spinner";
|
|
8
8
|
import Text from "../Text";
|
|
9
9
|
const Cover = forwardRef((props, ref) => {
|
|
@@ -17,4 +17,5 @@ const Cover = forwardRef((props, ref) => {
|
|
|
17
17
|
backgroundColor: `var(--cover-bg)`
|
|
18
18
|
}, ...rest, children: [_jsx(Spinner, { type: spinner || SPINNER.Simple }), !hideMessage && _jsx(Text, { className: `--label`, style: { color: `var(--cover-label)` }, children: message || `loading` })] });
|
|
19
19
|
});
|
|
20
|
+
Cover.displayName = `Cover`;
|
|
20
21
|
export default Cover;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import Box from "../Box";
|
|
4
|
+
import Button from "../Button";
|
|
5
|
+
import Icon from "../Icon";
|
|
6
|
+
import List from "../List";
|
|
7
|
+
import SVGIcons from "../svgicons";
|
|
8
|
+
import Text from "../Text";
|
|
9
|
+
const Crumb = forwardRef((props, ref) => {
|
|
10
|
+
const { items } = props;
|
|
11
|
+
return _jsx(List, { ref: ref, className: `--crumb flex aic`, direction: `rows`, seperator: _jsx(Box, { as: `--crumb-chevron`, children: SVGIcons.chevronRightOutline }), items: items.map((item, index, _items) => _jsxs(Button, { onClick: () => item.action?.(), className: `--crumb-item`, disabled: !_items[index + 1], children: [item.icon && _jsx(Icon, { as: `--crumb-icon`, name: item.icon }), _jsx(Text, { as: `--crumb-label`, children: item.label })] })) });
|
|
12
|
+
});
|
|
13
|
+
export default Crumb;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { useBase, useShortcuts } from "../../hooks";
|
|
5
5
|
import { DRAWER_SIDE, KeyCode, TRANSITION_CURVES } from "../../types/enums";
|
|
6
6
|
import Box from "../Box";
|
|
7
7
|
import Overlay from "../Overlay";
|
|
8
8
|
const Drawer = forwardRef((props, ref) => {
|
|
9
|
-
const {
|
|
9
|
+
const { from, speed, children, prerender, onClose, ...pops } = props;
|
|
10
10
|
const [render, setRender] = useState(undefined == prerender ? true : prerender);
|
|
11
11
|
const [visible, setVisible] = useState(false);
|
|
12
12
|
const divRef = useRef(null);
|
|
13
13
|
const [content, setContent] = useState(children);
|
|
14
|
+
const { className, style, rest } = useBase(pops);
|
|
15
|
+
useShortcuts([
|
|
16
|
+
{ keys: [KeyCode.Escape], callback: () => {
|
|
17
|
+
if (visible) {
|
|
18
|
+
onClose?.();
|
|
19
|
+
setVisible(false);
|
|
20
|
+
}
|
|
21
|
+
} }
|
|
22
|
+
]);
|
|
14
23
|
useEffect(() => {
|
|
15
24
|
setContent(children);
|
|
16
25
|
}, [children]);
|
|
17
|
-
|
|
18
|
-
bindKey(KeyCode.Escape, () => {
|
|
19
|
-
if (visible) {
|
|
20
|
-
onClose?.();
|
|
21
|
-
setVisible(false);
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
}, []);
|
|
25
|
-
const style = useMemo(() => {
|
|
26
|
+
const _style = useMemo(() => {
|
|
26
27
|
switch (from) {
|
|
27
28
|
case DRAWER_SIDE.Left:
|
|
28
29
|
return { from: { x: `-100vh` }, to: { x: 0 } };
|
|
@@ -52,12 +53,13 @@ const Drawer = forwardRef((props, ref) => {
|
|
|
52
53
|
onClose?.();
|
|
53
54
|
setVisible(false);
|
|
54
55
|
}
|
|
55
|
-
}, when: visible }), _jsxs(Box, { ref: divRef, className: `--drawer flex cols --${from ? from.toLowerCase() : `left`} fixed`, fx: {
|
|
56
|
-
from: { ...
|
|
57
|
-
to: { ...
|
|
56
|
+
}, when: visible }), _jsxs(Box, { ref: divRef, style: style, className: `--drawer flex cols ${className} --${from ? from.toLowerCase() : `left`} fixed`, fx: {
|
|
57
|
+
from: { ..._style.from, opacity: 0 },
|
|
58
|
+
to: { ..._style.to, opacity: 1 },
|
|
58
59
|
when: visible,
|
|
59
60
|
curve: TRANSITION_CURVES.EaseInOut,
|
|
60
61
|
duration: speed || .5,
|
|
61
|
-
}, ...
|
|
62
|
+
}, ...rest, children: [from == DRAWER_SIDE.Top || from == DRAWER_SIDE.Bottom ? _jsx(Box, { className: `--handle` }) : null, render ? content : visible ? content : null] })] });
|
|
62
63
|
});
|
|
64
|
+
Drawer.displayName = `Drawer`;
|
|
63
65
|
export default Drawer;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef, useEffect, useRef, useState } from "react";
|
|
4
|
+
import { DRAG_DIRECTION, SLIDER } from "../../../types/enums";
|
|
4
5
|
import Box from "../../Box";
|
|
5
6
|
import Button from "../../Button";
|
|
7
|
+
import Slider from "../../Slider";
|
|
6
8
|
import SVGIcons from "../../svgicons";
|
|
7
9
|
import Text from "../../Text";
|
|
8
|
-
import Layer from "./layer";
|
|
9
|
-
import Slider from "../../Slider";
|
|
10
|
-
import { DRAG_DIRECTION, SLIDER } from "../../../types/enums";
|
|
11
10
|
import ToolTip from "../../Tooltip";
|
|
11
|
+
import Layer from "./layer";
|
|
12
12
|
const Timeline = forwardRef((props, ref) => {
|
|
13
13
|
const { layers } = props;
|
|
14
14
|
const [selected, setSelected] = useState([]);
|
|
@@ -55,4 +55,5 @@ const Timeline = forwardRef((props, ref) => {
|
|
|
55
55
|
}
|
|
56
56
|
}, className: `--cursor abs` })] });
|
|
57
57
|
});
|
|
58
|
+
Timeline.displayName = `Timeline`;
|
|
58
59
|
export default Timeline;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import React, { forwardRef } from 'react';
|
|
4
|
-
import { EditorMode } from './types';
|
|
5
4
|
import Box from '../Box';
|
|
5
|
+
import { EditorMode } from './types';
|
|
6
6
|
const Editor = forwardRef((props, ref) => {
|
|
7
7
|
const [mode, setMode] = React.useState(EditorMode.Select);
|
|
8
8
|
return _jsx(Box, { as: `--ui-builder rel` });
|
|
9
9
|
});
|
|
10
|
+
Editor.displayName = `Editor`;
|
|
10
11
|
export default Editor;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import SVGIcons from "../svgicons";
|
|
2
|
-
import { Position } from "../../types/enums";
|
|
3
2
|
declare const Fab: import("react").ForwardRefExoticComponent<Omit<import("..").ButtonProps, "icon"> & {
|
|
4
3
|
icon?: string | keyof typeof SVGIcons;
|
|
5
|
-
position?: `${Position.Top | Position.Bottom}${Position.Left | Position.Right}`;
|
|
4
|
+
position?: `${import("../..").Position.Top | import("../..").Position.Bottom}${import("../..").Position.Left | import("../..").Position.Right}`;
|
|
6
5
|
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
7
6
|
export default Fab;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
+
import { Size } from "../../types/enums";
|
|
3
4
|
import Button from "../Button";
|
|
4
5
|
import SVGIcons from "../svgicons";
|
|
5
|
-
import { Size } from "../../types/enums";
|
|
6
6
|
const Fab = forwardRef((props, ref) => {
|
|
7
7
|
const { icon, size, position } = props;
|
|
8
8
|
return _jsx(Button, { className: `--fab fixed --${size || Size.Large} --${position || `bottomright`}`, children: icon || SVGIcons.plus });
|
|
9
9
|
});
|
|
10
|
+
Fab.displayName = `Fab`;
|
|
10
11
|
export default Fab;
|
|
@@ -3,5 +3,8 @@ export type FilterProps = {
|
|
|
3
3
|
names?: FILTER[];
|
|
4
4
|
strength?: number;
|
|
5
5
|
};
|
|
6
|
-
declare const Filters:
|
|
6
|
+
declare const Filters: {
|
|
7
|
+
(props: FilterProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
displayName: string;
|
|
9
|
+
};
|
|
7
10
|
export default Filters;
|
|
@@ -10,4 +10,5 @@ const Filters = (props) => {
|
|
|
10
10
|
useEffect(() => { }, [names]);
|
|
11
11
|
return _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", version: "1.1", children: _jsx("defs", { children: (names || [FILTER.Gooey]).map(name => filters[name](strength)) }) });
|
|
12
12
|
};
|
|
13
|
+
Filters.displayName = `Filters`;
|
|
13
14
|
export default Filters;
|
|
@@ -1,48 +1,6 @@
|
|
|
1
|
-
import { BoxProps } from "../Box";
|
|
2
1
|
import { dynamicObject } from "../../types";
|
|
3
2
|
import { SheetHandler } from "../Sheet";
|
|
4
|
-
import {
|
|
5
|
-
export type FormProps = BoxProps & {
|
|
6
|
-
/** Name of form, will be appended to --form-{name} in className
|
|
7
|
-
* whitespace will be replaced with dash (-)
|
|
8
|
-
*/
|
|
9
|
-
name?: string;
|
|
10
|
-
/** The URL to which the form data is submitted */
|
|
11
|
-
action?: string;
|
|
12
|
-
/** List of error messages for form validation */
|
|
13
|
-
errors?: dynamicObject;
|
|
14
|
-
/** Spinner properties for loading indicator */
|
|
15
|
-
spinner?: SPINNER;
|
|
16
|
-
/** Additional data to include with form submission */
|
|
17
|
-
withData?: dynamicObject;
|
|
18
|
-
/** Handler function called before form submission with validated form data */
|
|
19
|
-
beforeSubmit?: (data: FormData | dynamicObject) => void;
|
|
20
|
-
/** Handler function called on form submission with validated form data */
|
|
21
|
-
onSubmit?: (data: FormData | dynamicObject) => void;
|
|
22
|
-
/** Callback triggered upon successful form submission */
|
|
23
|
-
onSuccess?: (data: dynamicObject) => void;
|
|
24
|
-
/** Callback triggered when form submission encounters an error */
|
|
25
|
-
onError?: (error: any) => void;
|
|
26
|
-
/** Cover properties to display loading or processing message */
|
|
27
|
-
cover?: {
|
|
28
|
-
/** Background color of the loading cover */
|
|
29
|
-
color?: string;
|
|
30
|
-
/** Message displayed during loading */
|
|
31
|
-
message?: string;
|
|
32
|
-
} | SheetHandler;
|
|
33
|
-
resetOnSuccess?: boolean;
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* Exposes control methods for the Form component, such as setting loading states or hiding errors.
|
|
37
|
-
*/
|
|
38
|
-
export interface FormHandler {
|
|
39
|
-
/** Sets the loading state of the form */
|
|
40
|
-
setLoading: (mode: boolean) => void;
|
|
41
|
-
/** Hides any currently displayed error message */
|
|
42
|
-
hideError: () => void;
|
|
43
|
-
/** Resets the form to its initial state */
|
|
44
|
-
init: () => void;
|
|
45
|
-
}
|
|
3
|
+
import { FormHandler } from "./types";
|
|
46
4
|
/**
|
|
47
5
|
* {@link Form} is a controlled component designed to handle form data submission, validation, and display of loading or error states.
|
|
48
6
|
* It allows for optional server-side submission through an action endpoint and customizable success/error handling callbacks.
|
|
@@ -52,32 +10,18 @@ export interface FormHandler {
|
|
|
52
10
|
* @param props - Properties to configure form behavior, validation messages, submission handling, and visual feedback.
|
|
53
11
|
* @param ref - Reference to the {@link FormHandler} interface, exposing methods to control loading and error states from the parent.
|
|
54
12
|
*/
|
|
55
|
-
declare const Form: import("react").ForwardRefExoticComponent<BoxProps & {
|
|
56
|
-
/** Name of form, will be appended to --form-{name} in className
|
|
57
|
-
* whitespace will be replaced with dash (-)
|
|
58
|
-
*/
|
|
13
|
+
declare const Form: import("react").ForwardRefExoticComponent<import("..").BoxProps & {
|
|
59
14
|
name?: string;
|
|
60
|
-
/** The URL to which the form data is submitted */
|
|
61
15
|
action?: string;
|
|
62
|
-
/** List of error messages for form validation */
|
|
63
16
|
errors?: dynamicObject;
|
|
64
|
-
|
|
65
|
-
spinner?: SPINNER;
|
|
66
|
-
/** Additional data to include with form submission */
|
|
17
|
+
spinner?: import("../..").SPINNER;
|
|
67
18
|
withData?: dynamicObject;
|
|
68
|
-
/** Handler function called before form submission with validated form data */
|
|
69
19
|
beforeSubmit?: (data: FormData | dynamicObject) => void;
|
|
70
|
-
/** Handler function called on form submission with validated form data */
|
|
71
20
|
onSubmit?: (data: FormData | dynamicObject) => void;
|
|
72
|
-
/** Callback triggered upon successful form submission */
|
|
73
21
|
onSuccess?: (data: dynamicObject) => void;
|
|
74
|
-
/** Callback triggered when form submission encounters an error */
|
|
75
22
|
onError?: (error: any) => void;
|
|
76
|
-
/** Cover properties to display loading or processing message */
|
|
77
23
|
cover?: {
|
|
78
|
-
/** Background color of the loading cover */
|
|
79
24
|
color?: string;
|
|
80
|
-
/** Message displayed during loading */
|
|
81
25
|
message?: string;
|
|
82
26
|
} | SheetHandler;
|
|
83
27
|
resetOnSuccess?: boolean;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef, startTransition, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
4
|
-
import
|
|
4
|
+
import { addPropsToChildren, isEmail, withPost } from "../../funs";
|
|
5
5
|
import { useBase } from "../../hooks";
|
|
6
|
-
import Sheet, { isSheetHandler } from "../Sheet";
|
|
7
|
-
import Cover from "../Cover";
|
|
8
6
|
import { FORMVALIDATION, SHEET } from "../../types/enums";
|
|
9
|
-
import
|
|
7
|
+
import Box from "../Box";
|
|
8
|
+
import Cover from "../Cover";
|
|
9
|
+
import Sheet, { isSheetHandler } from "../Sheet";
|
|
10
10
|
/**
|
|
11
11
|
* {@link Form} is a controlled component designed to handle form data submission, validation, and display of loading or error states.
|
|
12
12
|
* It allows for optional server-side submission through an action endpoint and customizable success/error handling callbacks.
|
|
@@ -89,15 +89,12 @@ const Form = forwardRef((props, ref) => {
|
|
|
89
89
|
switch (_with.toUpperCase()) {
|
|
90
90
|
case FORMVALIDATION.Email:
|
|
91
91
|
return isEmail(el.value);
|
|
92
|
-
break;
|
|
93
92
|
case FORMVALIDATION.Uri:
|
|
94
93
|
console.log(`Add FORMVALIDATION.Uri`);
|
|
95
94
|
return false;
|
|
96
|
-
break;
|
|
97
95
|
case FORMVALIDATION.Password:
|
|
98
96
|
console.log(`Add FORMVALIDATION.Password`);
|
|
99
97
|
return false;
|
|
100
|
-
break;
|
|
101
98
|
case FORMVALIDATION.MatchField:
|
|
102
99
|
const [__, field] = el.getAttribute(`with`).split(`@`);
|
|
103
100
|
const _el = document.querySelector(`[name=${field.trim()}]`);
|
|
@@ -264,4 +261,5 @@ const Form = forwardRef((props, ref) => {
|
|
|
264
261
|
useEffect(_init, []);
|
|
265
262
|
return _jsxs(Box, { ref: innerRef, style: style, className: `--form flex rel ${className} ${name ? `--form-${name.replace(/\s+/g, `-`)}` : ``}`, propsToRemove: [`withData`, `action`, `onSubmit`, `onSuccess`, `onError`], children: [_jsx(Sheet, { ref: sheet, as: `--sheet-form` }), !isSheetHandler(cover) && _jsx(Cover, { message: cover ? cover.message || undefined : `working`, spinner: spinner, color: cover ? `color` in cover ? cover.color : `#ffffff` : `#ffffff`, when: loading }), buildChildren] });
|
|
266
263
|
});
|
|
264
|
+
Form.displayName = `Form`;
|
|
267
265
|
export default Form;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { dynamicObject, SheetHandler, SPINNER } from "../..";
|
|
2
|
+
import { BoxProps } from "../Box";
|
|
3
|
+
export type FormProps = BoxProps & {
|
|
4
|
+
/** Name of form, will be appended to --form-{name} in className
|
|
5
|
+
* whitespace will be replaced with dash (-)
|
|
6
|
+
*/
|
|
7
|
+
name?: string;
|
|
8
|
+
/** The URL to which the form data is submitted */
|
|
9
|
+
action?: string;
|
|
10
|
+
/** List of error messages for form validation */
|
|
11
|
+
errors?: dynamicObject;
|
|
12
|
+
/** Spinner properties for loading indicator */
|
|
13
|
+
spinner?: SPINNER;
|
|
14
|
+
/** Additional data to include with form submission */
|
|
15
|
+
withData?: dynamicObject;
|
|
16
|
+
/** Handler function called before form submission with validated form data */
|
|
17
|
+
beforeSubmit?: (data: FormData | dynamicObject) => void;
|
|
18
|
+
/** Handler function called on form submission with validated form data */
|
|
19
|
+
onSubmit?: (data: FormData | dynamicObject) => void;
|
|
20
|
+
/** Callback triggered upon successful form submission */
|
|
21
|
+
onSuccess?: (data: dynamicObject) => void;
|
|
22
|
+
/** Callback triggered when form submission encounters an error */
|
|
23
|
+
onError?: (error: any) => void;
|
|
24
|
+
/** Cover properties to display loading or processing message */
|
|
25
|
+
cover?: {
|
|
26
|
+
/** Background color of the loading cover */
|
|
27
|
+
color?: string;
|
|
28
|
+
/** Message displayed during loading */
|
|
29
|
+
message?: string;
|
|
30
|
+
} | SheetHandler;
|
|
31
|
+
resetOnSuccess?: boolean;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Exposes control methods for the Form component, such as setting loading states or hiding errors.
|
|
35
|
+
*/
|
|
36
|
+
export interface FormHandler {
|
|
37
|
+
/** Sets the loading state of the form */
|
|
38
|
+
setLoading: (mode: boolean) => void;
|
|
39
|
+
/** Hides any currently displayed error message */
|
|
40
|
+
hideError: () => void;
|
|
41
|
+
/** Resets the form to its initial state */
|
|
42
|
+
init: () => void;
|
|
43
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
2
|
import { forwardRef } from "react";
|
|
4
3
|
import { useBase } from "../../hooks";
|
|
5
|
-
import Span from "../Span";
|
|
6
4
|
import { Size } from "../../types/enums";
|
|
5
|
+
import Span from "../Span";
|
|
7
6
|
const Icon = forwardRef((props, ref) => {
|
|
8
7
|
const { name, pathCount, size, ...pops } = props;
|
|
9
8
|
const { className, style, rest } = useBase(pops);
|
|
10
9
|
return _jsx("div", { style: style, className: `icon-${name} --icon --${size || Size.Default} ${className}`.trim(), ref: ref, ...rest, children: Array(pathCount || 0).fill(0).map((p, i) => _jsx(Span, { className: `path${i + 1}` }, `${name}-layer-${i}`)) });
|
|
11
10
|
});
|
|
11
|
+
Icon.displayName = `Icon`;
|
|
12
12
|
export default Icon;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
2
|
import { forwardRef } from 'react';
|
|
4
3
|
import { useBase } from '../../hooks';
|
|
@@ -8,4 +7,5 @@ const Image = forwardRef((props, ref) => {
|
|
|
8
7
|
return null;
|
|
9
8
|
return _jsx("img", { ref: ref, style: style, className: `${className} flex`, ...rest });
|
|
10
9
|
});
|
|
10
|
+
Image.displayName = `Image`;
|
|
11
11
|
export default Image;
|
|
@@ -12,4 +12,5 @@ const Input = forwardRef((props, ref) => {
|
|
|
12
12
|
};
|
|
13
13
|
return _jsx("input", { className: `--input ${size || variant ? `--${size || variant}` : ``} flex ${className}`.trim(), style: style, onInput: handleInput, ref: ref, ...rest });
|
|
14
14
|
});
|
|
15
|
+
Input.displayName = `Input`;
|
|
15
16
|
export default Input;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Variant } from "../../types/enums";
|
|
2
|
+
import { KeyboardKey } from "./types";
|
|
3
|
+
declare const KeyBoardKeys: import("react").ForwardRefExoticComponent<import("..").BoxProps & {
|
|
4
|
+
keys: KeyboardKey | KeyboardKey[] | import("./types").KeyCombination;
|
|
5
|
+
children?: import("react").ReactNode;
|
|
6
|
+
variant?: Variant;
|
|
7
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export default KeyBoardKeys;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useMemo } from "react";
|
|
3
|
+
import { Variant } from "../../types/enums";
|
|
4
|
+
import Box from "../Box";
|
|
5
|
+
import Span from "../Span";
|
|
6
|
+
import { isKeyCombination, KeysLabelMap, KeysMap } from "./types";
|
|
7
|
+
const KeyBoardKeys = forwardRef(({ children, keys, variant }, ref) => {
|
|
8
|
+
const _meta = useMemo(() => {
|
|
9
|
+
if (isKeyCombination(keys)) {
|
|
10
|
+
let c = null;
|
|
11
|
+
let ks = String(keys).split(`+`)
|
|
12
|
+
.reduce((pa, ca, i, nxt) => {
|
|
13
|
+
if (nxt[i + 1]) {
|
|
14
|
+
pa.push(ca);
|
|
15
|
+
}
|
|
16
|
+
else
|
|
17
|
+
c = ca.toUpperCase();
|
|
18
|
+
return pa;
|
|
19
|
+
}, []);
|
|
20
|
+
return {
|
|
21
|
+
keys: ks,
|
|
22
|
+
children: c
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
keys,
|
|
27
|
+
children: String(children).toUpperCase()
|
|
28
|
+
};
|
|
29
|
+
}, [keys]);
|
|
30
|
+
return _jsxs(Box, { as: `--keyboard-keys --${variant || Variant.Small} flex aic`, children: [(Array.isArray(_meta.keys) ? _meta.keys : [_meta.keys]).map((k) => _jsx("abbr", { title: KeysLabelMap[k], children: KeysMap[k] }, k)), _jsx(Span, { children: _meta?.children ?? children })] });
|
|
31
|
+
});
|
|
32
|
+
KeyBoardKeys.displayName = `ZuzUI.KeyboardKeys`;
|
|
33
|
+
export default KeyBoardKeys;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { Variant } from "../../types/enums";
|
|
3
|
+
import { BoxProps } from "../Box";
|
|
4
|
+
export type KeyboardKey = "command" | "shift" | "ctrl" | "option" | "enter" | "delete" | "escape" | "tab" | "capslock" | "up" | "right" | "down" | "left" | "pageup" | "pagedown" | "home" | "end" | "help" | "space" | "fn" | "win" | "alt";
|
|
5
|
+
export type KeyCombination = `${KeyboardKey}+${KeyboardKey | string}`;
|
|
6
|
+
export declare const isKeyCombination: (value: KeyboardKey | KeyboardKey[] | KeyCombination) => value is KeyCombination;
|
|
7
|
+
export declare const KeysMap: Record<KeyboardKey, string>;
|
|
8
|
+
export declare const KeysLabelMap: Record<KeyboardKey, string>;
|
|
9
|
+
export type KeyboardKeyProps = BoxProps & {
|
|
10
|
+
keys: KeyboardKey | KeyboardKey[] | KeyCombination;
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
variant?: Variant;
|
|
13
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export const isKeyCombination = (value) => {
|
|
2
|
+
return typeof value === "string" && value.includes("+");
|
|
3
|
+
};
|
|
4
|
+
export const KeysMap = {
|
|
5
|
+
command: "⌘",
|
|
6
|
+
shift: "⇧",
|
|
7
|
+
ctrl: "⌃",
|
|
8
|
+
option: "⌥",
|
|
9
|
+
enter: "↵",
|
|
10
|
+
delete: "⌫",
|
|
11
|
+
escape: "⎋",
|
|
12
|
+
tab: "⇥",
|
|
13
|
+
capslock: "⇪",
|
|
14
|
+
up: "↑",
|
|
15
|
+
right: "→",
|
|
16
|
+
down: "↓",
|
|
17
|
+
left: "←",
|
|
18
|
+
pageup: "⇞",
|
|
19
|
+
pagedown: "⇟",
|
|
20
|
+
home: "↖",
|
|
21
|
+
end: "↘",
|
|
22
|
+
help: "?",
|
|
23
|
+
space: "␣",
|
|
24
|
+
fn: "Fn",
|
|
25
|
+
win: "⌘",
|
|
26
|
+
alt: "⌥",
|
|
27
|
+
};
|
|
28
|
+
export const KeysLabelMap = {
|
|
29
|
+
command: "Command",
|
|
30
|
+
shift: "Shift",
|
|
31
|
+
ctrl: "Control",
|
|
32
|
+
option: "Option",
|
|
33
|
+
enter: "Enter",
|
|
34
|
+
delete: "Delete",
|
|
35
|
+
escape: "Escape",
|
|
36
|
+
tab: "Tab",
|
|
37
|
+
capslock: "Caps Lock",
|
|
38
|
+
up: "Up",
|
|
39
|
+
right: "Right",
|
|
40
|
+
down: "Down",
|
|
41
|
+
left: "Left",
|
|
42
|
+
pageup: "Page Up",
|
|
43
|
+
pagedown: "Page Down",
|
|
44
|
+
home: "Home",
|
|
45
|
+
end: "End",
|
|
46
|
+
help: "Help",
|
|
47
|
+
space: "Space",
|
|
48
|
+
fn: "Fn",
|
|
49
|
+
win: "Win",
|
|
50
|
+
alt: "Alt",
|
|
51
|
+
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
2
|
import { forwardRef } from 'react';
|
|
4
3
|
import { useBase } from '../../hooks';
|
|
@@ -6,4 +5,5 @@ const Label = forwardRef((props, ref) => {
|
|
|
6
5
|
const { style, className, rest } = useBase(props);
|
|
7
6
|
return _jsx("label", { ref: ref, style: style, className: className, ...rest });
|
|
8
7
|
});
|
|
8
|
+
Label.displayName = `Label`;
|
|
9
9
|
export default Label;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { Size } from "../../types/enums";
|
|
2
2
|
declare const List: import("react").ForwardRefExoticComponent<import("../..").ZuzProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, "ref"> | Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref">, keyof import("../..").ZuzProps> & {
|
|
3
3
|
size?: Size;
|
|
4
|
+
variant?: import("../..").Variant;
|
|
4
5
|
items: import("./types").ListItem[];
|
|
6
|
+
direction?: "cols" | "rows";
|
|
7
|
+
seperator?: import("react").ReactNode;
|
|
5
8
|
ol?: boolean;
|
|
6
|
-
} & import("react").RefAttributes<
|
|
9
|
+
} & import("react").RefAttributes<HTMLUListElement | HTMLOListElement>>;
|
|
7
10
|
export default List;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { createElement, forwardRef } from "react";
|
|
3
3
|
import { useBase } from "../../hooks";
|
|
4
4
|
import { Size } from "../../types/enums";
|
|
5
5
|
import Item from "./item";
|
|
6
6
|
const List = forwardRef((props, ref) => {
|
|
7
|
-
const { items, size, ol, ...pops } = props;
|
|
7
|
+
const { items, size, direction, seperator, ol, ...pops } = props;
|
|
8
8
|
const { className, style, rest } = useBase(pops);
|
|
9
9
|
const Tag = ol == true ? 'ol' : 'ul';
|
|
10
10
|
return createElement(Tag, {
|
|
11
|
-
className: `--list --${size || Size.Small} flex cols ${className}`.trim(),
|
|
11
|
+
className: `--list --${size || Size.Small} flex ${direction ?? `cols`} ${className}`.trim(),
|
|
12
12
|
style, ref,
|
|
13
13
|
...rest,
|
|
14
|
-
children: items.map((item, index) => _jsx(Item, { meta: item }, `list-item-${typeof item == `string` ? String(item) : item.label}-${index}`))
|
|
14
|
+
children: items.map((item, index, _items) => _jsxs(_Fragment, { children: [_jsx(Item, { meta: item }, `list-item-${typeof item == `string` ? String(item) : item.label}-${index}`), seperator && _items[index + 1] ? _jsx("li", { className: `--list-seperator`, children: seperator }) : null] }))
|
|
15
15
|
});
|
|
16
16
|
});
|
|
17
|
+
List.displayName = `List`;
|
|
17
18
|
export default List;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { type ListItem } from "./types";
|
|
2
|
-
declare const Item:
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
declare const Item: {
|
|
3
|
+
(props: {
|
|
4
|
+
meta: ListItem;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
displayName: string;
|
|
7
|
+
};
|
|
5
8
|
export default Item;
|