@koobiq/react-components 0.0.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +43 -0
- package/dist/components/Alert/Alert.d.ts +4 -0
- package/dist/components/Alert/Alert.js +78 -0
- package/dist/components/Alert/Alert.module.css.js +41 -0
- package/dist/components/Alert/components/AlertIcon/AlertIcon.d.ts +2 -0
- package/dist/components/Alert/components/AlertIcon/AlertIcon.js +19 -0
- package/dist/components/Alert/components/AlertIcon/AlertIcon.module.css.js +23 -0
- package/dist/components/Alert/components/AlertIcon/index.d.ts +1 -0
- package/dist/components/Alert/components/AlertIcon/types.d.ts +2 -0
- package/dist/components/Alert/components/AlertIcon/utils.d.ts +14 -0
- package/dist/components/Alert/components/AlertIcon/utils.js +23 -0
- package/dist/components/Alert/components/index.d.ts +1 -0
- package/dist/components/Alert/index.d.ts +2 -0
- package/dist/components/Alert/intl.json.js +11 -0
- package/dist/components/Alert/types.d.ts +43 -0
- package/dist/components/Alert/types.js +4 -0
- package/dist/components/Backdrop/Backdrop.d.ts +4 -0
- package/dist/components/Backdrop/Backdrop.js +52 -0
- package/dist/components/Backdrop/Backdrop.module.css.js +8 -0
- package/dist/components/Backdrop/index.d.ts +2 -0
- package/dist/components/Backdrop/types.d.ts +16 -0
- package/dist/components/Badge/Badge.d.ts +4 -0
- package/dist/components/Badge/Badge.js +32 -0
- package/dist/components/Badge/Badge.module.css.js +42 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Badge/types.d.ts +20 -0
- package/dist/components/Badge/types.js +22 -0
- package/dist/components/Button/Button.d.ts +4 -0
- package/dist/components/Button/Button.js +66 -0
- package/dist/components/Button/Button.module.css.js +44 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/Button/types.d.ts +47 -0
- package/dist/components/Button/types.js +11 -0
- package/dist/components/Checkbox/Checkbox.d.ts +19 -0
- package/dist/components/Checkbox/Checkbox.js +64 -0
- package/dist/components/Checkbox/Checkbox.module.css.js +41 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/Checkbox/types.d.ts +27 -0
- package/dist/components/Checkbox/types.js +6 -0
- package/dist/components/Container/Container.d.ts +4 -0
- package/dist/components/Container/Container.js +45 -0
- package/dist/components/Container/Container.module.css.js +8 -0
- package/dist/components/Container/index.d.ts +2 -0
- package/dist/components/Container/types.d.ts +32 -0
- package/dist/components/Container/types.js +21 -0
- package/dist/components/Container/utils.d.ts +4 -0
- package/dist/components/Container/utils.js +19 -0
- package/dist/components/Dialog/Dialog.d.ts +2 -0
- package/dist/components/Dialog/Dialog.js +67 -0
- package/dist/components/Dialog/Dialog.module.css.js +23 -0
- package/dist/components/Dialog/DialogContext.d.ts +9 -0
- package/dist/components/Dialog/DialogContext.js +12 -0
- package/dist/components/Dialog/components/DialogCloseButton.d.ts +9 -0
- package/dist/components/Dialog/components/DialogCloseButton.js +30 -0
- package/dist/components/Dialog/components/DialogContent.d.ts +12 -0
- package/dist/components/Dialog/components/DialogContent.js +30 -0
- package/dist/components/Dialog/components/DialogFooter.d.ts +12 -0
- package/dist/components/Dialog/components/DialogFooter.js +12 -0
- package/dist/components/Dialog/components/DialoglHeader.d.ts +12 -0
- package/dist/components/Dialog/components/DialoglHeader.js +21 -0
- package/dist/components/Dialog/components/index.d.ts +4 -0
- package/dist/components/Dialog/index.d.ts +4 -0
- package/dist/components/Dialog/intl.json.js +11 -0
- package/dist/components/Dialog/types.d.ts +26 -0
- package/dist/components/FieldComponents/FieldAddon/FieldAddon.d.ts +10 -0
- package/dist/components/FieldComponents/FieldAddon/FieldAddon.js +19 -0
- package/dist/components/FieldComponents/FieldAddon/FieldAddon.module.css.js +17 -0
- package/dist/components/FieldComponents/FieldAddon/index.d.ts +1 -0
- package/dist/components/FieldComponents/FieldCaption/FieldCaption.d.ts +8 -0
- package/dist/components/FieldComponents/FieldCaption/FieldCaption.js +21 -0
- package/dist/components/FieldComponents/FieldCaption/FieldCaption.module.css.js +8 -0
- package/dist/components/FieldComponents/FieldCaption/index.d.ts +1 -0
- package/dist/components/FieldComponents/FieldControl/FieldControl.d.ts +10 -0
- package/dist/components/FieldComponents/FieldControl/FieldControl.js +20 -0
- package/dist/components/FieldComponents/FieldControl/FieldControl.module.css.js +11 -0
- package/dist/components/FieldComponents/FieldControl/index.d.ts +1 -0
- package/dist/components/FieldComponents/FieldError/FieldError.d.ts +6 -0
- package/dist/components/FieldComponents/FieldError/FieldError.js +21 -0
- package/dist/components/FieldComponents/FieldError/FieldError.module.css.js +8 -0
- package/dist/components/FieldComponents/FieldError/index.d.ts +1 -0
- package/dist/components/FieldComponents/FieldInput/FieldInput.d.ts +12 -0
- package/dist/components/FieldComponents/FieldInput/FieldInput.js +34 -0
- package/dist/components/FieldComponents/FieldInput/FieldInput.module.css.js +20 -0
- package/dist/components/FieldComponents/FieldInput/index.d.ts +1 -0
- package/dist/components/FieldComponents/FieldInputGroup/FieldInputGroup.d.ts +11 -0
- package/dist/components/FieldComponents/FieldInputGroup/FieldInputGroup.js +41 -0
- package/dist/components/FieldComponents/FieldInputGroup/FieldInputGroup.module.css.js +14 -0
- package/dist/components/FieldComponents/FieldInputGroup/FieldInputGroupContext.d.ts +8 -0
- package/dist/components/FieldComponents/FieldInputGroup/FieldInputGroupContext.js +7 -0
- package/dist/components/FieldComponents/FieldInputGroup/index.d.ts +2 -0
- package/dist/components/FieldComponents/FieldLabel/FieldLabel.d.ts +9 -0
- package/dist/components/FieldComponents/FieldLabel/FieldLabel.js +24 -0
- package/dist/components/FieldComponents/FieldLabel/FieldLabel.module.css.js +14 -0
- package/dist/components/FieldComponents/FieldLabel/index.d.ts +1 -0
- package/dist/components/FieldComponents/FieldNumberControl/FieldNumberControl.d.ts +10 -0
- package/dist/components/FieldComponents/FieldNumberControl/FieldNumberControl.js +18 -0
- package/dist/components/FieldComponents/FieldNumberControl/FieldNumberControl.module.css.js +11 -0
- package/dist/components/FieldComponents/FieldNumberControl/index.d.ts +1 -0
- package/dist/components/FieldComponents/index.d.ts +8 -0
- package/dist/components/FormControlLabel/FormControlLabel.d.ts +2 -0
- package/dist/components/FormControlLabel/index.d.ts +2 -0
- package/dist/components/FormControlLabel/types.d.ts +32 -0
- package/dist/components/Grid/Grid.d.ts +4 -0
- package/dist/components/Grid/Grid.js +52 -0
- package/dist/components/Grid/Grid.module.css.js +8 -0
- package/dist/components/Grid/components/GridItem/GridItem.d.ts +4 -0
- package/dist/components/Grid/components/GridItem/GridItem.js +52 -0
- package/dist/components/Grid/components/GridItem/GridItem.module.css.js +8 -0
- package/dist/components/Grid/components/GridItem/index.d.ts +2 -0
- package/dist/components/Grid/components/GridItem/types.d.ts +22 -0
- package/dist/components/Grid/components/index.d.ts +1 -0
- package/dist/components/Grid/index.d.ts +3 -0
- package/dist/components/Grid/types.d.ts +30 -0
- package/dist/components/Grid/types.js +19 -0
- package/dist/components/Grid/utils.d.ts +2 -0
- package/dist/components/Grid/utils.js +8 -0
- package/dist/components/IconButton/IconButton.d.ts +4 -0
- package/dist/components/IconButton/IconButton.js +51 -0
- package/dist/components/IconButton/IconButton.module.css.js +43 -0
- package/dist/components/IconButton/index.d.ts +2 -0
- package/dist/components/IconButton/types.d.ts +36 -0
- package/dist/components/IconButton/types.js +13 -0
- package/dist/components/Input/Input.d.ts +22 -0
- package/dist/components/Input/Input.js +70 -0
- package/dist/components/Input/components/FieldAddon/FieldAddon.d.ts +10 -0
- package/dist/components/Input/components/FieldAddon/index.d.ts +1 -0
- package/dist/components/Input/components/FieldCaption/FieldCaption.d.ts +6 -0
- package/dist/components/Input/components/FieldCaption/index.d.ts +1 -0
- package/dist/components/Input/components/FieldControl/FieldControl.d.ts +9 -0
- package/dist/components/Input/components/FieldControl/index.d.ts +1 -0
- package/dist/components/Input/components/FieldError/FieldError.d.ts +7 -0
- package/dist/components/Input/components/FieldError/index.d.ts +1 -0
- package/dist/components/Input/components/FieldInput/FieldInput.d.ts +9 -0
- package/dist/components/Input/components/FieldInput/index.d.ts +1 -0
- package/dist/components/Input/components/FieldInputGroup/FieldInputGroup.d.ts +7 -0
- package/dist/components/Input/components/FieldInputGroup/index.d.ts +1 -0
- package/dist/components/Input/components/FieldLabel/FieldLabel.d.ts +9 -0
- package/dist/components/Input/components/FieldLabel/index.d.ts +1 -0
- package/dist/components/Input/components/index.d.ts +7 -0
- package/dist/components/Input/index.d.ts +2 -0
- package/dist/components/Input/types.d.ts +62 -0
- package/dist/components/Input/types.js +4 -0
- package/dist/components/InputNumber/InputNumber.d.ts +22 -0
- package/dist/components/InputNumber/InputNumber.js +72 -0
- package/dist/components/InputNumber/components/InputNumberCounterControls.d.ts +1 -0
- package/dist/components/InputNumber/components/InputNumberCounterControls.js +37 -0
- package/dist/components/InputNumber/components/InputNumberCounterControls.module.css.js +14 -0
- package/dist/components/InputNumber/components/index.d.ts +1 -0
- package/dist/components/InputNumber/index.d.ts +2 -0
- package/dist/components/InputNumber/types.d.ts +62 -0
- package/dist/components/InputNumber/types.js +4 -0
- package/dist/components/Link/Link.d.ts +4 -0
- package/dist/components/Link/Link.js +54 -0
- package/dist/components/Link/Link.module.css.js +32 -0
- package/dist/components/Link/index.d.ts +2 -0
- package/dist/components/Link/types.d.ts +25 -0
- package/dist/components/Modal/Modal.d.ts +2 -0
- package/dist/components/Modal/Modal.js +121 -0
- package/dist/components/Modal/Modal.module.css.js +20 -0
- package/dist/components/Modal/index.d.ts +4 -0
- package/dist/components/Modal/types.d.ts +68 -0
- package/dist/components/Modal/types.js +4 -0
- package/dist/components/Popover/Popover.d.ts +2 -0
- package/dist/components/Popover/Popover.js +147 -0
- package/dist/components/Popover/Popover.module.css.js +17 -0
- package/dist/components/Popover/index.d.ts +4 -0
- package/dist/components/Popover/types.d.ts +97 -0
- package/dist/components/Popover/types.js +19 -0
- package/dist/components/Popover/utils.d.ts +2 -0
- package/dist/components/Popover/utils.js +11 -0
- package/dist/components/ProgressBar/ProgressBar.d.ts +2 -0
- package/dist/components/ProgressBar/ProgressBar.js +57 -0
- package/dist/components/ProgressBar/ProgressBar.module.css.js +15 -0
- package/dist/components/ProgressBar/index.d.ts +2 -0
- package/dist/components/ProgressBar/types.d.ts +34 -0
- package/dist/components/ProgressBar/types.js +4 -0
- package/dist/components/ProgressSpinner/ProgressSpinner.d.ts +2 -0
- package/dist/components/ProgressSpinner/ProgressSpinner.js +68 -0
- package/dist/components/ProgressSpinner/ProgressSpinner.module.css.js +18 -0
- package/dist/components/ProgressSpinner/index.d.ts +2 -0
- package/dist/components/ProgressSpinner/types.d.ts +41 -0
- package/dist/components/ProgressSpinner/types.js +9 -0
- package/dist/components/ProgressSpinner/utils.d.ts +2 -0
- package/dist/components/ProgressSpinner/utils.js +18 -0
- package/dist/components/Provider/BreakpointsContext.d.ts +5 -0
- package/dist/components/Provider/BreakpointsContext.js +17 -0
- package/dist/components/Provider/BreakpointsProvider.d.ts +10 -0
- package/dist/components/Provider/BreakpointsProvider.js +15 -0
- package/dist/components/Provider/Provider.d.ts +6 -0
- package/dist/components/Provider/Provider.js +29 -0
- package/dist/components/Provider/ProviderContext.d.ts +3 -0
- package/dist/components/Provider/ProviderContext.js +12 -0
- package/dist/components/Provider/index.d.ts +5 -0
- package/dist/components/Provider/types.d.ts +16 -0
- package/dist/components/Provider/utils/index.d.ts +1 -0
- package/dist/components/Provider/utils/useBreakpoints.d.ts +2 -0
- package/dist/components/Provider/utils/useBreakpoints.js +15 -0
- package/dist/components/Provider/utils/useMatchedBreakpoints.d.ts +2 -0
- package/dist/components/RadioGroup/RadioContext.d.ts +6 -0
- package/dist/components/RadioGroup/RadioContext.js +9 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +2 -0
- package/dist/components/RadioGroup/RadioGroup.js +35 -0
- package/dist/components/RadioGroup/components/Radio/Radio.d.ts +12 -0
- package/dist/components/RadioGroup/components/Radio/Radio.js +44 -0
- package/dist/components/RadioGroup/components/Radio/Radio.module.css.js +38 -0
- package/dist/components/RadioGroup/components/Radio/index.d.ts +2 -0
- package/dist/components/RadioGroup/components/Radio/types.d.ts +27 -0
- package/dist/components/RadioGroup/components/Radio/types.js +6 -0
- package/dist/components/RadioGroup/components/RadioGroupDescription/RadioGroupDescription.d.ts +7 -0
- package/dist/components/RadioGroup/components/RadioGroupDescription/RadioGroupDescription.js +21 -0
- package/dist/components/RadioGroup/components/RadioGroupDescription/index.d.ts +1 -0
- package/dist/components/RadioGroup/components/RadioGroupLabel/RadioGroupLabel.d.ts +6 -0
- package/dist/components/RadioGroup/components/RadioGroupLabel/RadioGroupLabel.js +14 -0
- package/dist/components/RadioGroup/components/RadioGroupLabel/index.d.ts +1 -0
- package/dist/components/RadioGroup/components/index.d.ts +3 -0
- package/dist/components/RadioGroup/index.d.ts +4 -0
- package/dist/components/RadioGroup/types.d.ts +37 -0
- package/dist/components/RadioGroup/types.js +6 -0
- package/dist/components/SidePanel/SidePanel.d.ts +2 -0
- package/dist/components/SidePanel/SidePanel.js +125 -0
- package/dist/components/SidePanel/SidePanel.module.css.js +26 -0
- package/dist/components/SidePanel/index.d.ts +4 -0
- package/dist/components/SidePanel/types.d.ts +75 -0
- package/dist/components/SidePanel/types.js +6 -0
- package/dist/components/SkeletonBlock/SkeletonBlock.d.ts +2 -0
- package/dist/components/SkeletonBlock/SkeletonBlock.js +37 -0
- package/dist/components/SkeletonBlock/SkeletonBlock.module.css.js +12 -0
- package/dist/components/SkeletonBlock/index.d.ts +2 -0
- package/dist/components/SkeletonBlock/types.d.ts +18 -0
- package/dist/components/SkeletonBlock/utils.d.ts +2 -0
- package/dist/components/SkeletonBlock/utils.js +8 -0
- package/dist/components/SkeletonTypography/SkeletonTypography.d.ts +2 -0
- package/dist/components/SkeletonTypography/SkeletonTypography.js +44 -0
- package/dist/components/SkeletonTypography/SkeletonTypography.module.css.js +14 -0
- package/dist/components/SkeletonTypography/index.d.ts +2 -0
- package/dist/components/SkeletonTypography/types.d.ts +25 -0
- package/dist/components/SkeletonTypography/utils.d.ts +2 -0
- package/dist/components/SkeletonTypography/utils.js +18 -0
- package/dist/components/Textarea/Textarea.d.ts +21 -0
- package/dist/components/Textarea/Textarea.js +51 -0
- package/dist/components/Textarea/Textarea.module.css.js +7 -0
- package/dist/components/Textarea/components/TextareaContextConsumer/TextareaContextConsumer.d.ts +6 -0
- package/dist/components/Textarea/components/TextareaContextConsumer/TextareaContextConsumer.js +58 -0
- package/dist/components/Textarea/components/TextareaContextConsumer/index.d.ts +1 -0
- package/dist/components/Textarea/components/index.d.ts +1 -0
- package/dist/components/Textarea/index.d.ts +2 -0
- package/dist/components/Textarea/types.d.ts +67 -0
- package/dist/components/Textarea/types.js +6 -0
- package/dist/components/Textarea/utils/index.d.ts +1 -0
- package/dist/components/Textarea/utils/useTextareaAutosize.d.ts +2 -0
- package/dist/components/Textarea/utils/useTextareaAutosize.js +15 -0
- package/dist/components/Toggle/Toggle.d.ts +16 -0
- package/dist/components/Toggle/Toggle.js +42 -0
- package/dist/components/Toggle/Toggle.module.css.js +38 -0
- package/dist/components/Toggle/index.d.ts +2 -0
- package/dist/components/Toggle/types.d.ts +25 -0
- package/dist/components/Toggle/types.js +6 -0
- package/dist/components/Tooltip/Tooltip.d.ts +20 -0
- package/dist/components/Tooltip/Tooltip.js +119 -0
- package/dist/components/Tooltip/Tooltip.module.css.js +30 -0
- package/dist/components/Tooltip/index.d.ts +2 -0
- package/dist/components/Tooltip/types.d.ts +81 -0
- package/dist/components/Tooltip/types.js +25 -0
- package/dist/components/Typography/Typography.d.ts +4 -0
- package/dist/components/Typography/Typography.js +46 -0
- package/dist/components/Typography/Typography.module.css.js +23 -0
- package/dist/components/Typography/index.d.ts +2 -0
- package/dist/components/Typography/types.d.ts +31 -0
- package/dist/components/Typography/types.js +84 -0
- package/dist/components/index.d.ts +24 -0
- package/dist/components/layout/flex/flex.d.ts +25 -0
- package/dist/components/layout/flex/flex.js +74 -0
- package/dist/components/layout/flex/flex.module.css.js +92 -0
- package/dist/components/layout/flex/index.d.ts +1 -0
- package/dist/components/layout/index.d.ts +2 -0
- package/dist/components/layout/spacing/index.d.ts +1 -0
- package/dist/components/layout/spacing/spacing.d.ts +33 -0
- package/dist/components/layout/spacing/spacing.js +44 -0
- package/dist/components/layout/spacing/spacing.module.css.js +365 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +152 -0
- package/dist/style.css +3329 -0
- package/dist/styles/utility.d.ts +71 -0
- package/dist/styles/utility.js +77 -0
- package/dist/styles/utility.module.css.js +76 -0
- package/dist/utils/getResponsiveValue/getResponsiveValue.d.ts +3 -0
- package/dist/utils/getResponsiveValue/getResponsiveValue.js +18 -0
- package/dist/utils/getResponsiveValue/index.d.ts +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/package.json +42 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef, useRef } from "react";
|
|
4
|
+
import { useDOMRef, useBoolean, FocusableProvider, mergeProps, clsx } from "@koobiq/react-core";
|
|
5
|
+
import { useTooltipTriggerState, useTooltipTrigger, useOverlayPosition, useTooltip, Overlay } from "@koobiq/react-primitives";
|
|
6
|
+
import { Transition } from "react-transition-group";
|
|
7
|
+
import { utilClasses } from "../../styles/utility.js";
|
|
8
|
+
import s from "./Tooltip.module.css.js";
|
|
9
|
+
const Tooltip = forwardRef((props, ref) => {
|
|
10
|
+
const {
|
|
11
|
+
delay = 120,
|
|
12
|
+
disabled = false,
|
|
13
|
+
defaultOpen,
|
|
14
|
+
closeDelay = 120,
|
|
15
|
+
hideArrow = false,
|
|
16
|
+
variant = "contrast",
|
|
17
|
+
onOpenChange,
|
|
18
|
+
placement: placementProp = "top",
|
|
19
|
+
control,
|
|
20
|
+
children,
|
|
21
|
+
anchorRef,
|
|
22
|
+
crossOffset,
|
|
23
|
+
open: openProp,
|
|
24
|
+
offset: offsetProp,
|
|
25
|
+
arrowBoundaryOffset,
|
|
26
|
+
...other
|
|
27
|
+
} = props;
|
|
28
|
+
const showArrow = !hideArrow;
|
|
29
|
+
const offset = showArrow ? offsetProp : offsetProp || 4;
|
|
30
|
+
const state = useTooltipTriggerState({
|
|
31
|
+
delay,
|
|
32
|
+
closeDelay,
|
|
33
|
+
defaultOpen,
|
|
34
|
+
onOpenChange,
|
|
35
|
+
isOpen: openProp,
|
|
36
|
+
isDisabled: disabled,
|
|
37
|
+
...other
|
|
38
|
+
});
|
|
39
|
+
const domRef = useDOMRef(ref);
|
|
40
|
+
const controlRef = useRef(null);
|
|
41
|
+
const { triggerProps, tooltipProps } = useTooltipTrigger(
|
|
42
|
+
{
|
|
43
|
+
delay,
|
|
44
|
+
closeDelay,
|
|
45
|
+
defaultOpen,
|
|
46
|
+
onOpenChange,
|
|
47
|
+
isOpen: openProp,
|
|
48
|
+
isDisabled: disabled,
|
|
49
|
+
...other
|
|
50
|
+
},
|
|
51
|
+
state,
|
|
52
|
+
controlRef
|
|
53
|
+
);
|
|
54
|
+
const openState = state.isOpen;
|
|
55
|
+
const [opened, { on, off }] = useBoolean(openState);
|
|
56
|
+
const { overlayProps, arrowProps, placement } = useOverlayPosition({
|
|
57
|
+
offset,
|
|
58
|
+
crossOffset,
|
|
59
|
+
isOpen: opened,
|
|
60
|
+
maxHeight: 480,
|
|
61
|
+
overlayRef: domRef,
|
|
62
|
+
arrowBoundaryOffset,
|
|
63
|
+
placement: placementProp,
|
|
64
|
+
onClose: () => state.close(true),
|
|
65
|
+
targetRef: anchorRef || controlRef
|
|
66
|
+
});
|
|
67
|
+
const { tooltipProps: localTooltipProps } = useTooltip(overlayProps, state);
|
|
68
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
69
|
+
/* @__PURE__ */ jsx(FocusableProvider, { ...triggerProps, ref: controlRef, children: control?.({
|
|
70
|
+
ref: controlRef,
|
|
71
|
+
...triggerProps
|
|
72
|
+
}) }),
|
|
73
|
+
/* @__PURE__ */ jsx(
|
|
74
|
+
Transition,
|
|
75
|
+
{
|
|
76
|
+
onEnter: on,
|
|
77
|
+
timeout: 300,
|
|
78
|
+
onExited: off,
|
|
79
|
+
in: openState,
|
|
80
|
+
nodeRef: domRef,
|
|
81
|
+
unmountOnExit: true,
|
|
82
|
+
appear: true,
|
|
83
|
+
children: (transition) => /* @__PURE__ */ jsx(Overlay, { children: /* @__PURE__ */ jsxs(
|
|
84
|
+
"div",
|
|
85
|
+
{
|
|
86
|
+
...mergeProps(localTooltipProps, tooltipProps),
|
|
87
|
+
"data-arrow": showArrow,
|
|
88
|
+
"data-variant": variant,
|
|
89
|
+
"data-placement": placement,
|
|
90
|
+
"data-transition": transition,
|
|
91
|
+
className: clsx(
|
|
92
|
+
s.base,
|
|
93
|
+
s[variant],
|
|
94
|
+
utilClasses.typography["text-normal"]
|
|
95
|
+
),
|
|
96
|
+
...other,
|
|
97
|
+
ref: domRef,
|
|
98
|
+
children: [
|
|
99
|
+
showArrow && /* @__PURE__ */ jsx(
|
|
100
|
+
"div",
|
|
101
|
+
{
|
|
102
|
+
...arrowProps,
|
|
103
|
+
className: s.arrow,
|
|
104
|
+
"data-placement": placement
|
|
105
|
+
}
|
|
106
|
+
),
|
|
107
|
+
/* @__PURE__ */ jsx("div", { className: s.container, children: /* @__PURE__ */ jsx("div", { className: s.content, children }) })
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
) })
|
|
111
|
+
},
|
|
112
|
+
placement
|
|
113
|
+
)
|
|
114
|
+
] });
|
|
115
|
+
});
|
|
116
|
+
Tooltip.displayName = "Tooltip";
|
|
117
|
+
export {
|
|
118
|
+
Tooltip
|
|
119
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const base = "kbq-tooltip-0c8f57";
|
|
2
|
+
const container = "kbq-tooltip-container-9747af";
|
|
3
|
+
const content = "kbq-tooltip-content-b5dfb0";
|
|
4
|
+
const contrast = "kbq-tooltip-contrast-1d442f";
|
|
5
|
+
const error = "kbq-tooltip-error-267f02";
|
|
6
|
+
const warning = "kbq-tooltip-warning-312ad2";
|
|
7
|
+
const theme = "kbq-tooltip-theme-c23977";
|
|
8
|
+
const arrow = "kbq-tooltip-arrow-1d1044";
|
|
9
|
+
const s = {
|
|
10
|
+
base,
|
|
11
|
+
container,
|
|
12
|
+
content,
|
|
13
|
+
contrast,
|
|
14
|
+
"contrast-fade": "kbq-tooltip-contrast-fade-5a17ff",
|
|
15
|
+
error,
|
|
16
|
+
warning,
|
|
17
|
+
theme,
|
|
18
|
+
arrow
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
arrow,
|
|
22
|
+
base,
|
|
23
|
+
container,
|
|
24
|
+
content,
|
|
25
|
+
contrast,
|
|
26
|
+
s as default,
|
|
27
|
+
error,
|
|
28
|
+
theme,
|
|
29
|
+
warning
|
|
30
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { ReactNode, ComponentRef, Ref, ReactElement, HTMLAttributes, RefObject } from 'react';
|
|
2
|
+
import type { DataAttributeProps } from '@koobiq/react-core';
|
|
3
|
+
export type TooltipPropControl = (props: HTMLAttributes<HTMLButtonElement> & {
|
|
4
|
+
ref?: Ref<HTMLButtonElement>;
|
|
5
|
+
}) => ReactElement;
|
|
6
|
+
export declare const tooltipPropPlacement: readonly ["bottom", "bottom start", "bottom end", "top", "top start", "top end", "start", "start top", "start bottom", "end", "end top", "end bottom"];
|
|
7
|
+
export declare const tooltipPropVariant: readonly ["contrast", "contrast-fade", "error", "warning", "theme"];
|
|
8
|
+
export type TooltipPropVariant = (typeof tooltipPropVariant)[number];
|
|
9
|
+
export type TooltipPropPlacement = (typeof tooltipPropPlacement)[number];
|
|
10
|
+
export type TooltipProps = {
|
|
11
|
+
/**
|
|
12
|
+
* The variant to use.
|
|
13
|
+
* @default contrast
|
|
14
|
+
* */
|
|
15
|
+
variant?: TooltipPropVariant;
|
|
16
|
+
/** If `true`, the component is shown. */
|
|
17
|
+
open?: boolean;
|
|
18
|
+
/** The default open state. Use when the component is not controlled. */
|
|
19
|
+
defaultOpen?: boolean;
|
|
20
|
+
/** Handler that is called when the overlay's open state changes. */
|
|
21
|
+
onOpenChange?(open: boolean): void;
|
|
22
|
+
/**
|
|
23
|
+
* If `true`, the tooltip should be disabled, independent of the trigger.
|
|
24
|
+
* @default false
|
|
25
|
+
* */
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
/** The content of the component. */
|
|
28
|
+
children?: ReactNode;
|
|
29
|
+
/** The render function of the control for displaying the tooltip. */
|
|
30
|
+
control?: TooltipPropControl;
|
|
31
|
+
/**
|
|
32
|
+
* The placement of the element with respect to its anchor element.
|
|
33
|
+
* @default top
|
|
34
|
+
* */
|
|
35
|
+
placement?: TooltipPropPlacement;
|
|
36
|
+
/** The ref for the element which the popover positions itself with respect to. */
|
|
37
|
+
anchorRef?: RefObject<HTMLElement>;
|
|
38
|
+
/**
|
|
39
|
+
* The minimum distance the arrow's edge should be from the edge of the overlay element.
|
|
40
|
+
* @default 0
|
|
41
|
+
*/
|
|
42
|
+
arrowBoundaryOffset?: number;
|
|
43
|
+
/**
|
|
44
|
+
* The additional offset applied along the main axis between the element and its
|
|
45
|
+
* anchor element.
|
|
46
|
+
* @default 0
|
|
47
|
+
*/
|
|
48
|
+
offset?: number;
|
|
49
|
+
/**
|
|
50
|
+
* The additional offset applied along the cross axis between the element and its
|
|
51
|
+
* anchor element.
|
|
52
|
+
* @default 0
|
|
53
|
+
*/
|
|
54
|
+
crossOffset?: number;
|
|
55
|
+
/**
|
|
56
|
+
* If `true`, the arrow isn't shown.
|
|
57
|
+
* @default false
|
|
58
|
+
* */
|
|
59
|
+
hideArrow?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* The delay time for the tooltip to show up.
|
|
62
|
+
* @default 120
|
|
63
|
+
*/
|
|
64
|
+
delay?: number;
|
|
65
|
+
/**
|
|
66
|
+
* The delay time for the tooltip to close.
|
|
67
|
+
* @default 120
|
|
68
|
+
*/
|
|
69
|
+
closeDelay?: number;
|
|
70
|
+
/**
|
|
71
|
+
* By default, opens for both focus and hover. Can be made to open only for focus.
|
|
72
|
+
*/
|
|
73
|
+
trigger?: 'focus';
|
|
74
|
+
/**
|
|
75
|
+
* The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).
|
|
76
|
+
*/
|
|
77
|
+
id?: string;
|
|
78
|
+
/** Additional CSS-classes. */
|
|
79
|
+
className?: string;
|
|
80
|
+
} & DataAttributeProps;
|
|
81
|
+
export type TooltipRef = ComponentRef<'div'>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const tooltipPropPlacement = [
|
|
2
|
+
"bottom",
|
|
3
|
+
"bottom start",
|
|
4
|
+
"bottom end",
|
|
5
|
+
"top",
|
|
6
|
+
"top start",
|
|
7
|
+
"top end",
|
|
8
|
+
"start",
|
|
9
|
+
"start top",
|
|
10
|
+
"start bottom",
|
|
11
|
+
"end",
|
|
12
|
+
"end top",
|
|
13
|
+
"end bottom"
|
|
14
|
+
];
|
|
15
|
+
const tooltipPropVariant = [
|
|
16
|
+
"contrast",
|
|
17
|
+
"contrast-fade",
|
|
18
|
+
"error",
|
|
19
|
+
"warning",
|
|
20
|
+
"theme"
|
|
21
|
+
];
|
|
22
|
+
export {
|
|
23
|
+
tooltipPropPlacement,
|
|
24
|
+
tooltipPropVariant
|
|
25
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef, ElementType } from 'react';
|
|
2
|
+
import type { TypographyBaseProps } from './types.js';
|
|
3
|
+
export declare const Typography: import("@koobiq/react-core").PolyForwardComponent<"p", TypographyBaseProps, ElementType>;
|
|
4
|
+
export type TypographyProps<As extends ElementType = 'p'> = ComponentPropsWithRef<typeof Typography<As>>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { polymorphicForwardRef, clsx } from "@koobiq/react-core";
|
|
3
|
+
import { Text } from "@koobiq/react-primitives";
|
|
4
|
+
import { utilClasses } from "../../styles/utility.js";
|
|
5
|
+
import s from "./Typography.module.css.js";
|
|
6
|
+
const foregroundColor = utilClasses.color.foreground;
|
|
7
|
+
const textVariant = utilClasses.typography;
|
|
8
|
+
const Typography = polymorphicForwardRef(
|
|
9
|
+
({
|
|
10
|
+
variant = "text-normal",
|
|
11
|
+
color = "contrast",
|
|
12
|
+
as = "p",
|
|
13
|
+
children,
|
|
14
|
+
ellipsis,
|
|
15
|
+
display,
|
|
16
|
+
align,
|
|
17
|
+
className,
|
|
18
|
+
...other
|
|
19
|
+
}, ref) => /* @__PURE__ */ jsx(
|
|
20
|
+
Text,
|
|
21
|
+
{
|
|
22
|
+
as,
|
|
23
|
+
"data-align": align,
|
|
24
|
+
"data-color": color,
|
|
25
|
+
"data-variant": variant,
|
|
26
|
+
"data-display": display,
|
|
27
|
+
"data-ellipsis": ellipsis,
|
|
28
|
+
className: clsx(
|
|
29
|
+
s.base,
|
|
30
|
+
display && s[display],
|
|
31
|
+
ellipsis && s.ellipsis,
|
|
32
|
+
align && s[`align-${align}`],
|
|
33
|
+
textVariant[variant],
|
|
34
|
+
foregroundColor[color],
|
|
35
|
+
className
|
|
36
|
+
),
|
|
37
|
+
...other,
|
|
38
|
+
ref,
|
|
39
|
+
children
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
);
|
|
43
|
+
Typography.displayName = "Typography";
|
|
44
|
+
export {
|
|
45
|
+
Typography
|
|
46
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const base = "kbq-typography-645b00";
|
|
2
|
+
const block = "kbq-typography-block-b93e3b";
|
|
3
|
+
const inline = "kbq-typography-inline-0ef064";
|
|
4
|
+
const ellipsis = "kbq-typography-ellipsis-0ba98f";
|
|
5
|
+
const s = {
|
|
6
|
+
base,
|
|
7
|
+
block,
|
|
8
|
+
inline,
|
|
9
|
+
"inline-block": "kbq-typography-inline-block-027ced",
|
|
10
|
+
"align-start": "kbq-typography-align-start-c9f58b",
|
|
11
|
+
"align-end": "kbq-typography-align-end-1a6658",
|
|
12
|
+
"align-center": "kbq-typography-align-center-2d47fd",
|
|
13
|
+
"align-initial": "kbq-typography-align-initial-faf6dd",
|
|
14
|
+
"align-inherit": "kbq-typography-align-inherit-00f946",
|
|
15
|
+
ellipsis
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
base,
|
|
19
|
+
block,
|
|
20
|
+
s as default,
|
|
21
|
+
ellipsis,
|
|
22
|
+
inline
|
|
23
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export declare const typographyPropVariant: readonly ["display-big", "display-normal", "display-compact", "display-big-strong", "display-normal-strong", "display-compact-strong", "headline", "title", "subheading", "text-big", "text-big-strong", "text-big-medium", "text-normal", "text-normal-strong", "text-normal-medium", "text-compact", "text-compact-strong", "text-compact-medium", "caps-big", "caps-big-strong", "caps-normal", "caps-normal-strong", "caps-compact", "caps-compact-strong", "mono-big", "mono-big-strong", "mono-normal", "mono-normal-strong", "mono-compact", "mono-compact-strong", "mono-codeblock", "tabular-big", "tabular-big-strong", "tabular-normal", "tabular-normal-strong", "tabular-compact", "tabular-compact-strong", "italic-big", "italic-big-strong", "italic-normal", "italic-normal-strong", "italic-compact", "italic-compact-strong", "inherit"];
|
|
3
|
+
export type TypographyPropVariant = (typeof typographyPropVariant)[number];
|
|
4
|
+
export declare const typographyPropDisplay: readonly ["block", "inline", "inline-block"];
|
|
5
|
+
export type TypographyDisplayVariant = (typeof typographyPropDisplay)[number];
|
|
6
|
+
export declare const typographyPropAlign: readonly ["start", "center", "end", "initial", "inherit"];
|
|
7
|
+
export type TypographyPropAlign = (typeof typographyPropAlign)[number];
|
|
8
|
+
export declare const typographyPropColor: readonly ["white", "white-secondary", "theme", "theme-secondary", "contrast", "on-contrast", "contrast-secondary", "contrast-tertiary", "error", "error-secondary", "error-tertiary", "error-less", "success", "success-less", "success-secondary", "warning", "warning-secondary", "visited"];
|
|
9
|
+
export type TypographyPropColor = (typeof typographyPropColor)[number];
|
|
10
|
+
export type TypographyBaseProps = {
|
|
11
|
+
/**
|
|
12
|
+
* The variant to use.
|
|
13
|
+
* @default text-normal
|
|
14
|
+
* */
|
|
15
|
+
variant?: TypographyPropVariant;
|
|
16
|
+
/** Set the display for the component. */
|
|
17
|
+
display?: TypographyDisplayVariant;
|
|
18
|
+
/** Set the text-align on the component. */
|
|
19
|
+
align?: TypographyPropAlign;
|
|
20
|
+
/** Hidden overflow content will be replaced by an ellipsis. */
|
|
21
|
+
ellipsis?: boolean;
|
|
22
|
+
/** The content of the component. */
|
|
23
|
+
children?: ReactNode;
|
|
24
|
+
/** Additional CSS-classes. */
|
|
25
|
+
className?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Text color.
|
|
28
|
+
* @default contrast
|
|
29
|
+
* */
|
|
30
|
+
color?: TypographyPropColor;
|
|
31
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
const typographyPropVariant = [
|
|
2
|
+
"display-big",
|
|
3
|
+
"display-normal",
|
|
4
|
+
"display-compact",
|
|
5
|
+
"display-big-strong",
|
|
6
|
+
"display-normal-strong",
|
|
7
|
+
"display-compact-strong",
|
|
8
|
+
"headline",
|
|
9
|
+
"title",
|
|
10
|
+
"subheading",
|
|
11
|
+
"text-big",
|
|
12
|
+
"text-big-strong",
|
|
13
|
+
"text-big-medium",
|
|
14
|
+
"text-normal",
|
|
15
|
+
"text-normal-strong",
|
|
16
|
+
"text-normal-medium",
|
|
17
|
+
"text-compact",
|
|
18
|
+
"text-compact-strong",
|
|
19
|
+
"text-compact-medium",
|
|
20
|
+
"caps-big",
|
|
21
|
+
"caps-big-strong",
|
|
22
|
+
"caps-normal",
|
|
23
|
+
"caps-normal-strong",
|
|
24
|
+
"caps-compact",
|
|
25
|
+
"caps-compact-strong",
|
|
26
|
+
"mono-big",
|
|
27
|
+
"mono-big-strong",
|
|
28
|
+
"mono-normal",
|
|
29
|
+
"mono-normal-strong",
|
|
30
|
+
"mono-compact",
|
|
31
|
+
"mono-compact-strong",
|
|
32
|
+
"mono-codeblock",
|
|
33
|
+
"tabular-big",
|
|
34
|
+
"tabular-big-strong",
|
|
35
|
+
"tabular-normal",
|
|
36
|
+
"tabular-normal-strong",
|
|
37
|
+
"tabular-compact",
|
|
38
|
+
"tabular-compact-strong",
|
|
39
|
+
"italic-big",
|
|
40
|
+
"italic-big-strong",
|
|
41
|
+
"italic-normal",
|
|
42
|
+
"italic-normal-strong",
|
|
43
|
+
"italic-compact",
|
|
44
|
+
"italic-compact-strong",
|
|
45
|
+
"inherit"
|
|
46
|
+
];
|
|
47
|
+
const typographyPropDisplay = [
|
|
48
|
+
"block",
|
|
49
|
+
"inline",
|
|
50
|
+
"inline-block"
|
|
51
|
+
];
|
|
52
|
+
const typographyPropAlign = [
|
|
53
|
+
"start",
|
|
54
|
+
"center",
|
|
55
|
+
"end",
|
|
56
|
+
"initial",
|
|
57
|
+
"inherit"
|
|
58
|
+
];
|
|
59
|
+
const typographyPropColor = [
|
|
60
|
+
"white",
|
|
61
|
+
"white-secondary",
|
|
62
|
+
"theme",
|
|
63
|
+
"theme-secondary",
|
|
64
|
+
"contrast",
|
|
65
|
+
"on-contrast",
|
|
66
|
+
"contrast-secondary",
|
|
67
|
+
"contrast-tertiary",
|
|
68
|
+
"error",
|
|
69
|
+
"error-secondary",
|
|
70
|
+
"error-tertiary",
|
|
71
|
+
"error-less",
|
|
72
|
+
"success",
|
|
73
|
+
"success-less",
|
|
74
|
+
"success-secondary",
|
|
75
|
+
"warning",
|
|
76
|
+
"warning-secondary",
|
|
77
|
+
"visited"
|
|
78
|
+
];
|
|
79
|
+
export {
|
|
80
|
+
typographyPropAlign,
|
|
81
|
+
typographyPropColor,
|
|
82
|
+
typographyPropDisplay,
|
|
83
|
+
typographyPropVariant
|
|
84
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export * from './Provider';
|
|
2
|
+
export * from './Container';
|
|
3
|
+
export * from './Alert';
|
|
4
|
+
export * from './Button';
|
|
5
|
+
export * from './IconButton';
|
|
6
|
+
export * from './Typography';
|
|
7
|
+
export * from './Checkbox';
|
|
8
|
+
export * from './Link';
|
|
9
|
+
export * from './Badge';
|
|
10
|
+
export * from './Input';
|
|
11
|
+
export * from './Textarea';
|
|
12
|
+
export * from './InputNumber';
|
|
13
|
+
export * from './RadioGroup';
|
|
14
|
+
export * from './Toggle';
|
|
15
|
+
export * from './ProgressBar';
|
|
16
|
+
export * from './ProgressSpinner';
|
|
17
|
+
export * from './Grid';
|
|
18
|
+
export * from './SkeletonBlock';
|
|
19
|
+
export * from './SkeletonTypography';
|
|
20
|
+
export * from './Modal';
|
|
21
|
+
export * from './SidePanel';
|
|
22
|
+
export * from './Popover';
|
|
23
|
+
export * from './Tooltip';
|
|
24
|
+
export * from './layout';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const flexPropAlignItems: readonly ["flex-start", "flex-end", "center", "baseline", "stretch"];
|
|
2
|
+
export type FlexPropAlignItems = (typeof flexPropAlignItems)[number];
|
|
3
|
+
export declare const flexPropGap: readonly ["3xs", "xxs", "xs", "s", "m", "l", "xl", "xxl", "3xl", "4xl", "5l", "6xl", "7xl"];
|
|
4
|
+
export type FlexPropGap = (typeof flexPropGap)[number];
|
|
5
|
+
export declare const flexPropJustifyContent: readonly ["flex-start", "flex-end", "center", "space-between", "space-around", "space-evenly"];
|
|
6
|
+
export type FlexPropJustifyContent = (typeof flexPropJustifyContent)[number];
|
|
7
|
+
export declare const flexPropFlex: readonly ["flex", "inline-flex"];
|
|
8
|
+
export type FlexPropFlex = (typeof flexPropFlex)[number];
|
|
9
|
+
export declare const flexPropWrap: readonly ["nowrap", "wrap", "wrap-reverse"];
|
|
10
|
+
export type FlexPropWrap = (typeof flexPropWrap)[number];
|
|
11
|
+
export declare const flexPropDirection: readonly ["row", "row-reverse", "column", "column-reverse"];
|
|
12
|
+
export type FlexPropDirection = (typeof flexPropDirection)[number];
|
|
13
|
+
export declare const flexPropOrder: readonly [-1, 0, 1];
|
|
14
|
+
export type FlexPropOrder = (typeof flexPropOrder)[number];
|
|
15
|
+
export type FlexProps = {
|
|
16
|
+
alignItems?: FlexPropAlignItems;
|
|
17
|
+
justifyContent?: FlexPropJustifyContent;
|
|
18
|
+
flex?: FlexPropFlex;
|
|
19
|
+
wrap?: FlexPropWrap;
|
|
20
|
+
direction?: FlexPropDirection;
|
|
21
|
+
gap?: FlexPropGap;
|
|
22
|
+
order?: FlexPropOrder;
|
|
23
|
+
};
|
|
24
|
+
export type FlexParams = (props: FlexProps, className?: string) => string;
|
|
25
|
+
export declare const flex: FlexParams;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { clsx } from "@koobiq/react-core";
|
|
2
|
+
import s from "./flex.module.css.js";
|
|
3
|
+
const flexPropAlignItems = [
|
|
4
|
+
"flex-start",
|
|
5
|
+
"flex-end",
|
|
6
|
+
"center",
|
|
7
|
+
"baseline",
|
|
8
|
+
"stretch"
|
|
9
|
+
];
|
|
10
|
+
const flexPropGap = [
|
|
11
|
+
"3xs",
|
|
12
|
+
"xxs",
|
|
13
|
+
"xs",
|
|
14
|
+
"s",
|
|
15
|
+
"m",
|
|
16
|
+
"l",
|
|
17
|
+
"xl",
|
|
18
|
+
"xxl",
|
|
19
|
+
"3xl",
|
|
20
|
+
"4xl",
|
|
21
|
+
"5l",
|
|
22
|
+
"6xl",
|
|
23
|
+
"7xl"
|
|
24
|
+
];
|
|
25
|
+
const flexPropJustifyContent = [
|
|
26
|
+
"flex-start",
|
|
27
|
+
"flex-end",
|
|
28
|
+
"center",
|
|
29
|
+
"space-between",
|
|
30
|
+
"space-around",
|
|
31
|
+
"space-evenly"
|
|
32
|
+
];
|
|
33
|
+
const flexPropFlex = ["flex", "inline-flex"];
|
|
34
|
+
const flexPropWrap = ["nowrap", "wrap", "wrap-reverse"];
|
|
35
|
+
const flexPropDirection = [
|
|
36
|
+
"row",
|
|
37
|
+
"row-reverse",
|
|
38
|
+
"column",
|
|
39
|
+
"column-reverse"
|
|
40
|
+
];
|
|
41
|
+
const flexPropOrder = [-1, 0, 1];
|
|
42
|
+
const flex = (props, className) => {
|
|
43
|
+
const {
|
|
44
|
+
alignItems,
|
|
45
|
+
justifyContent,
|
|
46
|
+
flex: flex2,
|
|
47
|
+
wrap,
|
|
48
|
+
direction,
|
|
49
|
+
gap,
|
|
50
|
+
order: orderProp
|
|
51
|
+
} = props;
|
|
52
|
+
const order = String(orderProp);
|
|
53
|
+
return clsx(
|
|
54
|
+
s.base,
|
|
55
|
+
gap && s[`gap_${gap}`],
|
|
56
|
+
flex2 && s[`flex_${flex2}`],
|
|
57
|
+
wrap && s[`wrap_${wrap}`],
|
|
58
|
+
order && s[`order_${order}`],
|
|
59
|
+
direction && s[`direction_${direction}`],
|
|
60
|
+
alignItems && s[`alignItems_${alignItems}`],
|
|
61
|
+
justifyContent && s[`justifyContent_${justifyContent}`],
|
|
62
|
+
className
|
|
63
|
+
);
|
|
64
|
+
};
|
|
65
|
+
export {
|
|
66
|
+
flex,
|
|
67
|
+
flexPropAlignItems,
|
|
68
|
+
flexPropDirection,
|
|
69
|
+
flexPropFlex,
|
|
70
|
+
flexPropGap,
|
|
71
|
+
flexPropJustifyContent,
|
|
72
|
+
flexPropOrder,
|
|
73
|
+
flexPropWrap
|
|
74
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
const base = "kbq-flex-7624b3";
|
|
2
|
+
const alignItems_center = "kbq-flex-alignItems_center-05836e";
|
|
3
|
+
const alignItems_baseline = "kbq-flex-alignItems_baseline-1e77c2";
|
|
4
|
+
const alignItems_stretch = "kbq-flex-alignItems_stretch-f031de";
|
|
5
|
+
const justifyContent_center = "kbq-flex-justifyContent_center-5134e2";
|
|
6
|
+
const flex_flex = "kbq-flex-flex_flex-de4f74";
|
|
7
|
+
const wrap_wrap = "kbq-flex-wrap_wrap-78b98d";
|
|
8
|
+
const wrap_nowrap = "kbq-flex-wrap_nowrap-902a73";
|
|
9
|
+
const direction_row = "kbq-flex-direction_row-8fff0d";
|
|
10
|
+
const direction_column = "kbq-flex-direction_column-29b97b";
|
|
11
|
+
const order_0 = "kbq-flex-order_0-4a6164";
|
|
12
|
+
const order_1 = "kbq-flex-order_1-b5e24c";
|
|
13
|
+
const gap_3xs = "kbq-flex-gap_3xs-5c9d4e";
|
|
14
|
+
const gap_xxs = "kbq-flex-gap_xxs-035614";
|
|
15
|
+
const gap_xs = "kbq-flex-gap_xs-970b31";
|
|
16
|
+
const gap_s = "kbq-flex-gap_s-e9d292";
|
|
17
|
+
const gap_m = "kbq-flex-gap_m-21a099";
|
|
18
|
+
const gap_l = "kbq-flex-gap_l-47c05c";
|
|
19
|
+
const gap_xl = "kbq-flex-gap_xl-d76274";
|
|
20
|
+
const gap_xxl = "kbq-flex-gap_xxl-0e68cb";
|
|
21
|
+
const gap_3xl = "kbq-flex-gap_3xl-497012";
|
|
22
|
+
const gap_4xl = "kbq-flex-gap_4xl-0b7c71";
|
|
23
|
+
const gap_5xl = "kbq-flex-gap_5xl-ed56fe";
|
|
24
|
+
const gap_6xl = "kbq-flex-gap_6xl-0749d1";
|
|
25
|
+
const gap_7xl = "kbq-flex-gap_7xl-0a1536";
|
|
26
|
+
const s = {
|
|
27
|
+
base,
|
|
28
|
+
"alignItems_flex-start": "kbq-flex-alignItems_flex-start-56df74",
|
|
29
|
+
"alignItems_flex-end": "kbq-flex-alignItems_flex-end-951e7a",
|
|
30
|
+
alignItems_center,
|
|
31
|
+
alignItems_baseline,
|
|
32
|
+
alignItems_stretch,
|
|
33
|
+
"justifyContent_flex-start": "kbq-flex-justifyContent_flex-start-05ff2a",
|
|
34
|
+
"justifyContent_flex-end": "kbq-flex-justifyContent_flex-end-06a105",
|
|
35
|
+
justifyContent_center,
|
|
36
|
+
"justifyContent_space-between": "kbq-flex-justifyContent_space-between-02a3e5",
|
|
37
|
+
"justifyContent_space-around": "kbq-flex-justifyContent_space-around-42e955",
|
|
38
|
+
"justifyContent_space-evenly": "kbq-flex-justifyContent_space-evenly-b84975",
|
|
39
|
+
flex_flex,
|
|
40
|
+
"flex_inline-flex": "kbq-flex-flex_inline-flex-a712ef",
|
|
41
|
+
wrap_wrap,
|
|
42
|
+
wrap_nowrap,
|
|
43
|
+
"wrap_wrap-reverse": "kbq-flex-wrap_wrap-reverse-dbacf6",
|
|
44
|
+
direction_row,
|
|
45
|
+
"direction_row-reverse": "kbq-flex-direction_row-reverse-7fa95e",
|
|
46
|
+
direction_column,
|
|
47
|
+
"direction_column-reverse": "kbq-flex-direction_column-reverse-04ecc6",
|
|
48
|
+
"order_-1": "kbq-flex-order_-1-4f5108",
|
|
49
|
+
order_0,
|
|
50
|
+
order_1,
|
|
51
|
+
gap_3xs,
|
|
52
|
+
gap_xxs,
|
|
53
|
+
gap_xs,
|
|
54
|
+
gap_s,
|
|
55
|
+
gap_m,
|
|
56
|
+
gap_l,
|
|
57
|
+
gap_xl,
|
|
58
|
+
gap_xxl,
|
|
59
|
+
gap_3xl,
|
|
60
|
+
gap_4xl,
|
|
61
|
+
gap_5xl,
|
|
62
|
+
gap_6xl,
|
|
63
|
+
gap_7xl
|
|
64
|
+
};
|
|
65
|
+
export {
|
|
66
|
+
alignItems_baseline,
|
|
67
|
+
alignItems_center,
|
|
68
|
+
alignItems_stretch,
|
|
69
|
+
base,
|
|
70
|
+
s as default,
|
|
71
|
+
direction_column,
|
|
72
|
+
direction_row,
|
|
73
|
+
flex_flex,
|
|
74
|
+
gap_3xl,
|
|
75
|
+
gap_3xs,
|
|
76
|
+
gap_4xl,
|
|
77
|
+
gap_5xl,
|
|
78
|
+
gap_6xl,
|
|
79
|
+
gap_7xl,
|
|
80
|
+
gap_l,
|
|
81
|
+
gap_m,
|
|
82
|
+
gap_s,
|
|
83
|
+
gap_xl,
|
|
84
|
+
gap_xs,
|
|
85
|
+
gap_xxl,
|
|
86
|
+
gap_xxs,
|
|
87
|
+
justifyContent_center,
|
|
88
|
+
order_0,
|
|
89
|
+
order_1,
|
|
90
|
+
wrap_nowrap,
|
|
91
|
+
wrap_wrap
|
|
92
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './flex';
|