@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,44 @@
|
|
|
1
|
+
const base = "kbq-button-d95067";
|
|
2
|
+
const hovered = "kbq-button-hovered-037da3";
|
|
3
|
+
const pressed = "kbq-button-pressed-508d5d";
|
|
4
|
+
const focusVisible = "kbq-button-focusVisible-e63c2b";
|
|
5
|
+
const progress = "kbq-button-progress-f454f0";
|
|
6
|
+
const disabled = "kbq-button-disabled-1df5f6";
|
|
7
|
+
const fullWidth = "kbq-button-fullWidth-c149b8";
|
|
8
|
+
const onlyIcon = "kbq-button-onlyIcon-e1268c";
|
|
9
|
+
const loader = "kbq-button-loader-467f28";
|
|
10
|
+
const content = "kbq-button-content-2e3014";
|
|
11
|
+
const label = "kbq-button-label-9f6f6b";
|
|
12
|
+
const s = {
|
|
13
|
+
base,
|
|
14
|
+
hovered,
|
|
15
|
+
pressed,
|
|
16
|
+
focusVisible,
|
|
17
|
+
progress,
|
|
18
|
+
disabled,
|
|
19
|
+
fullWidth,
|
|
20
|
+
onlyIcon,
|
|
21
|
+
loader,
|
|
22
|
+
content,
|
|
23
|
+
label,
|
|
24
|
+
"contrast-filled": "kbq-button-contrast-filled-606131",
|
|
25
|
+
"fade-contrast-filled": "kbq-button-fade-contrast-filled-8959de",
|
|
26
|
+
"fade-contrast-outline": "kbq-button-fade-contrast-outline-785e24",
|
|
27
|
+
"fade-theme-outline": "kbq-button-fade-theme-outline-a6684c",
|
|
28
|
+
"contrast-transparent": "kbq-button-contrast-transparent-da3653",
|
|
29
|
+
"theme-transparent": "kbq-button-theme-transparent-8a514f"
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
base,
|
|
33
|
+
content,
|
|
34
|
+
s as default,
|
|
35
|
+
disabled,
|
|
36
|
+
focusVisible,
|
|
37
|
+
fullWidth,
|
|
38
|
+
hovered,
|
|
39
|
+
label,
|
|
40
|
+
loader,
|
|
41
|
+
onlyIcon,
|
|
42
|
+
pressed,
|
|
43
|
+
progress
|
|
44
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ButtonOptions, HoverEvent } from '@koobiq/react-primitives';
|
|
3
|
+
export declare const buttonPropVariant: readonly ["contrast-filled", "contrast-transparent", "fade-contrast-filled", "fade-contrast-outline", "fade-theme-outline", "theme-transparent"];
|
|
4
|
+
export type ButtonPropVariant = (typeof buttonPropVariant)[number];
|
|
5
|
+
export type ButtonPropOnClick = ButtonOptions['onPress'];
|
|
6
|
+
export type ButtonBaseProps = {
|
|
7
|
+
/** The content of the component. */
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* The variant to use.
|
|
11
|
+
* @default contrast-filled
|
|
12
|
+
* */
|
|
13
|
+
variant?: ButtonPropVariant;
|
|
14
|
+
/**
|
|
15
|
+
* If `true`, the progress indicator is shown and the button becomes disabled.
|
|
16
|
+
* @default false
|
|
17
|
+
* */
|
|
18
|
+
progress?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* If `true`, the component is disabled.
|
|
21
|
+
* @default false
|
|
22
|
+
* */
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* If `true`, only the icon is shown, and the button has same sides.
|
|
26
|
+
* @default false
|
|
27
|
+
* */
|
|
28
|
+
onlyIcon?: boolean;
|
|
29
|
+
/** Additional CSS-classes. */
|
|
30
|
+
className?: string;
|
|
31
|
+
/**
|
|
32
|
+
* If `true`, the button will take up the full width of its container.
|
|
33
|
+
* @default false
|
|
34
|
+
* */
|
|
35
|
+
fullWidth?: boolean;
|
|
36
|
+
/** Icon placed before the children. */
|
|
37
|
+
startIcon?: ReactNode;
|
|
38
|
+
/** Icon placed after the children. */
|
|
39
|
+
endIcon?: ReactNode;
|
|
40
|
+
/** Unique identifier for testing purposes. */
|
|
41
|
+
'data-testid'?: string | number;
|
|
42
|
+
/** Handler that is called when a hover interaction starts. */
|
|
43
|
+
onHoverStart?: (e: HoverEvent) => void;
|
|
44
|
+
/** Handler that is called when a hover interaction ends. */
|
|
45
|
+
onHoverEnd?: (e: HoverEvent) => void;
|
|
46
|
+
onClick?: ButtonPropOnClick;
|
|
47
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const Checkbox: import("react").ForwardRefExoticComponent<Omit<Omit<import("@react-types/checkbox").AriaCheckboxProps, "onChange" | "isDisabled" | "isRequired" | "isInvalid" | "isReadOnly" | "isSelected" | "isIndeterminate" | "defaultSelected">, "defaultChecked" | "onChange" | "disabled" | "checked" | "required" | "error" | "readonly" | "indeterminate"> & {
|
|
2
|
+
error?: boolean;
|
|
3
|
+
checked?: boolean;
|
|
4
|
+
readonly?: boolean;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
indeterminate?: boolean;
|
|
8
|
+
defaultChecked?: boolean;
|
|
9
|
+
onChange?: (checked: boolean) => void;
|
|
10
|
+
} & {
|
|
11
|
+
className?: string;
|
|
12
|
+
size?: import("./types").CheckboxPropSize;
|
|
13
|
+
'data-testid'?: string | number;
|
|
14
|
+
labelPlacement?: import("./types").CheckboxPropLabelPlacement;
|
|
15
|
+
slotProps?: {
|
|
16
|
+
box?: import("react").ComponentPropsWithRef<"span">;
|
|
17
|
+
label?: import("react").ComponentPropsWithRef<"span">;
|
|
18
|
+
};
|
|
19
|
+
} & import("react").RefAttributes<HTMLLabelElement>>;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { clsx, mergeProps, isNotNil } from "@koobiq/react-core";
|
|
5
|
+
import { IconCheckS16, IconMinusS16 } from "@koobiq/react-icons";
|
|
6
|
+
import { Checkbox as Checkbox$1 } from "@koobiq/react-primitives";
|
|
7
|
+
import s from "./Checkbox.module.css.js";
|
|
8
|
+
const Checkbox = forwardRef(
|
|
9
|
+
(props, ref) => {
|
|
10
|
+
const {
|
|
11
|
+
size = "normal",
|
|
12
|
+
labelPlacement = "end",
|
|
13
|
+
children,
|
|
14
|
+
className,
|
|
15
|
+
slotProps,
|
|
16
|
+
indeterminate,
|
|
17
|
+
...other
|
|
18
|
+
} = props;
|
|
19
|
+
const commonProps = {
|
|
20
|
+
indeterminate,
|
|
21
|
+
className: ({
|
|
22
|
+
error,
|
|
23
|
+
checked,
|
|
24
|
+
hovered,
|
|
25
|
+
disabled,
|
|
26
|
+
focusVisible,
|
|
27
|
+
indeterminate: indeterminate2
|
|
28
|
+
}) => clsx(
|
|
29
|
+
s.base,
|
|
30
|
+
s[size],
|
|
31
|
+
error && s.error,
|
|
32
|
+
s[labelPlacement],
|
|
33
|
+
checked && s.checked,
|
|
34
|
+
hovered && s.hovered,
|
|
35
|
+
disabled && s.disabled,
|
|
36
|
+
focusVisible && s.focusVisible,
|
|
37
|
+
indeterminate2 && s.indeterminate,
|
|
38
|
+
className
|
|
39
|
+
),
|
|
40
|
+
...other
|
|
41
|
+
};
|
|
42
|
+
const boxProps = mergeProps({ className: s.checkbox }, slotProps?.box);
|
|
43
|
+
const labelProps = slotProps?.label;
|
|
44
|
+
return /* @__PURE__ */ jsx(
|
|
45
|
+
Checkbox$1,
|
|
46
|
+
{
|
|
47
|
+
"data-indeterminate": indeterminate,
|
|
48
|
+
...commonProps,
|
|
49
|
+
ref,
|
|
50
|
+
children: ({ checked, indeterminate: indeterminate2 }) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
51
|
+
/* @__PURE__ */ jsxs("span", { ...boxProps, children: [
|
|
52
|
+
checked && !indeterminate2 && /* @__PURE__ */ jsx(IconCheckS16, {}),
|
|
53
|
+
indeterminate2 && /* @__PURE__ */ jsx(IconMinusS16, {})
|
|
54
|
+
] }),
|
|
55
|
+
isNotNil(children) && /* @__PURE__ */ jsx("span", { ...labelProps, children })
|
|
56
|
+
] })
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
Checkbox.displayName = "Checkbox";
|
|
62
|
+
export {
|
|
63
|
+
Checkbox
|
|
64
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const base = "kbq-checkbox-72cf70";
|
|
2
|
+
const checkbox = "kbq-checkbox-checkbox-dbb3d9";
|
|
3
|
+
const normal = "kbq-checkbox-normal-646719";
|
|
4
|
+
const big = "kbq-checkbox-big-d7d5f1";
|
|
5
|
+
const hovered = "kbq-checkbox-hovered-a8a95e";
|
|
6
|
+
const checked = "kbq-checkbox-checked-e66779";
|
|
7
|
+
const error = "kbq-checkbox-error-3cdabd";
|
|
8
|
+
const focusVisible = "kbq-checkbox-focusVisible-c41061";
|
|
9
|
+
const indeterminate = "kbq-checkbox-indeterminate-efed4f";
|
|
10
|
+
const disabled = "kbq-checkbox-disabled-e359aa";
|
|
11
|
+
const start = "kbq-checkbox-start-5afa6a";
|
|
12
|
+
const end = "kbq-checkbox-end-0c77de";
|
|
13
|
+
const s = {
|
|
14
|
+
base,
|
|
15
|
+
checkbox,
|
|
16
|
+
normal,
|
|
17
|
+
big,
|
|
18
|
+
hovered,
|
|
19
|
+
checked,
|
|
20
|
+
error,
|
|
21
|
+
focusVisible,
|
|
22
|
+
indeterminate,
|
|
23
|
+
disabled,
|
|
24
|
+
start,
|
|
25
|
+
end
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
base,
|
|
29
|
+
big,
|
|
30
|
+
checkbox,
|
|
31
|
+
checked,
|
|
32
|
+
s as default,
|
|
33
|
+
disabled,
|
|
34
|
+
end,
|
|
35
|
+
error,
|
|
36
|
+
focusVisible,
|
|
37
|
+
hovered,
|
|
38
|
+
indeterminate,
|
|
39
|
+
normal,
|
|
40
|
+
start
|
|
41
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from 'react';
|
|
2
|
+
import type { UseCheckboxProps } from '@koobiq/react-primitives';
|
|
3
|
+
export declare const checkboxPropSize: readonly ["normal", "big"];
|
|
4
|
+
export type CheckboxPropSize = (typeof checkboxPropSize)[number];
|
|
5
|
+
export declare const checkboxPropLabelPlacement: readonly ["start", "end"];
|
|
6
|
+
export type CheckboxPropLabelPlacement = (typeof checkboxPropLabelPlacement)[number];
|
|
7
|
+
export type CheckboxProps = UseCheckboxProps & {
|
|
8
|
+
/** Additional CSS-classes. */
|
|
9
|
+
className?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Size.
|
|
12
|
+
* @default normal
|
|
13
|
+
* */
|
|
14
|
+
size?: CheckboxPropSize;
|
|
15
|
+
/** Unique identifier for testing purposes. */
|
|
16
|
+
'data-testid'?: string | number;
|
|
17
|
+
/**
|
|
18
|
+
* The position of the label.
|
|
19
|
+
* @default end
|
|
20
|
+
* */
|
|
21
|
+
labelPlacement?: CheckboxPropLabelPlacement;
|
|
22
|
+
/** The props used for each slot inside. */
|
|
23
|
+
slotProps?: {
|
|
24
|
+
box?: ComponentPropsWithRef<'span'>;
|
|
25
|
+
label?: ComponentPropsWithRef<'span'>;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef, ElementType } from 'react';
|
|
2
|
+
import type { ContainerBaseProps } from './index';
|
|
3
|
+
export declare const Container: import("@koobiq/react-core").PolyForwardComponent<"div", ContainerBaseProps, ElementType>;
|
|
4
|
+
export type ContainerProps<As extends ElementType = 'div'> = ComponentPropsWithRef<typeof Container<As>>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { polymorphicForwardRef, clsx } from "@koobiq/react-core";
|
|
3
|
+
import s from "./Container.module.css.js";
|
|
4
|
+
import { normalizeMaxInlineSize, normalizePosition, normalizeMargins } from "./utils.js";
|
|
5
|
+
import { useMatchedBreakpoints } from "../Provider/BreakpointsContext.js";
|
|
6
|
+
import { getResponsiveValue } from "../../utils/getResponsiveValue/getResponsiveValue.js";
|
|
7
|
+
const Container = polymorphicForwardRef(
|
|
8
|
+
(props, ref) => {
|
|
9
|
+
const {
|
|
10
|
+
as: Tag = "div",
|
|
11
|
+
margins: marginsProp = 0,
|
|
12
|
+
position: positionProp = "center",
|
|
13
|
+
fixed = false,
|
|
14
|
+
children,
|
|
15
|
+
className,
|
|
16
|
+
maxInlineSize: maxInlineSizeProp,
|
|
17
|
+
style: styleProp,
|
|
18
|
+
...other
|
|
19
|
+
} = props;
|
|
20
|
+
const breakpoints = useMatchedBreakpoints();
|
|
21
|
+
const maxInlineSize = getResponsiveValue(maxInlineSizeProp, breakpoints);
|
|
22
|
+
const position = getResponsiveValue(positionProp, breakpoints);
|
|
23
|
+
const margins = getResponsiveValue(marginsProp, breakpoints);
|
|
24
|
+
const style = {
|
|
25
|
+
...styleProp,
|
|
26
|
+
"--container-max-inline-size": fixed ? void 0 : normalizeMaxInlineSize(maxInlineSize),
|
|
27
|
+
"--container-position": normalizePosition(position),
|
|
28
|
+
"--container-margins": normalizeMargins(margins)
|
|
29
|
+
};
|
|
30
|
+
return /* @__PURE__ */ jsx(
|
|
31
|
+
Tag,
|
|
32
|
+
{
|
|
33
|
+
className: clsx(s.base, className),
|
|
34
|
+
style,
|
|
35
|
+
...other,
|
|
36
|
+
ref,
|
|
37
|
+
children
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
Container.displayName = "Container";
|
|
43
|
+
export {
|
|
44
|
+
Container
|
|
45
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import type { ResponsiveValue } from '../../utils';
|
|
3
|
+
export declare const containerMarginsProp: readonly [0, "3xs", "xxs", "xs", "s", "m", "l", "xl", "xxl", "3xl", "4xl", "5xl", "6xl", "7xl"];
|
|
4
|
+
export type ContainerMarginsProp = (typeof containerMarginsProp)[number];
|
|
5
|
+
export type ContainerMaxInlineSizeProp = CSSProperties['maxInlineSize'];
|
|
6
|
+
export declare const containerPositionProp: readonly ["start", "center", "end"];
|
|
7
|
+
export type ContainerPositionProp = (typeof containerPositionProp)[number];
|
|
8
|
+
export type ContainerBaseProps = {
|
|
9
|
+
/**
|
|
10
|
+
* Container position.
|
|
11
|
+
* @default center
|
|
12
|
+
* */
|
|
13
|
+
position?: ContainerPositionProp | ResponsiveValue<ContainerPositionProp>;
|
|
14
|
+
/** Determine the max-inline-size of the container. */
|
|
15
|
+
maxInlineSize?: ContainerMaxInlineSizeProp | ResponsiveValue<ContainerMaxInlineSizeProp>;
|
|
16
|
+
/**
|
|
17
|
+
* Margins are the space between content and the left and right edges of the screen.
|
|
18
|
+
* @default 0
|
|
19
|
+
* */
|
|
20
|
+
margins?: ContainerMarginsProp | ResponsiveValue<ContainerMarginsProp>;
|
|
21
|
+
/**
|
|
22
|
+
* If `true`, doesn't set the max-inline-size of the container.
|
|
23
|
+
* @default false
|
|
24
|
+
* */
|
|
25
|
+
fixed?: boolean;
|
|
26
|
+
/** The content of the component. */
|
|
27
|
+
children?: ReactNode;
|
|
28
|
+
/** Additional CSS-classes. */
|
|
29
|
+
className?: string;
|
|
30
|
+
/** Inline styles. */
|
|
31
|
+
style?: CSSProperties;
|
|
32
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const containerMarginsProp = [
|
|
2
|
+
0,
|
|
3
|
+
"3xs",
|
|
4
|
+
"xxs",
|
|
5
|
+
"xs",
|
|
6
|
+
"s",
|
|
7
|
+
"m",
|
|
8
|
+
"l",
|
|
9
|
+
"xl",
|
|
10
|
+
"xxl",
|
|
11
|
+
"3xl",
|
|
12
|
+
"4xl",
|
|
13
|
+
"5xl",
|
|
14
|
+
"6xl",
|
|
15
|
+
"7xl"
|
|
16
|
+
];
|
|
17
|
+
const containerPositionProp = ["start", "center", "end"];
|
|
18
|
+
export {
|
|
19
|
+
containerMarginsProp,
|
|
20
|
+
containerPositionProp
|
|
21
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ContainerMarginsProp, ContainerMaxInlineSizeProp, ContainerPositionProp } from './types';
|
|
2
|
+
export declare const normalizeMargins: (value: ContainerMarginsProp | undefined) => string | 0 | undefined;
|
|
3
|
+
export declare const normalizeMaxInlineSize: (value: ContainerMaxInlineSizeProp | undefined) => string | undefined;
|
|
4
|
+
export declare const normalizePosition: (value: ContainerPositionProp | undefined) => "0 auto" | "auto 0" | "auto";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { isString, isNumber } from "@koobiq/react-core";
|
|
2
|
+
const normalizeMargins = (value) => {
|
|
3
|
+
if (isString(value)) return `var(--kbq-size-${value})`;
|
|
4
|
+
return value;
|
|
5
|
+
};
|
|
6
|
+
const normalizeMaxInlineSize = (value) => {
|
|
7
|
+
if (isNumber(value)) return `${value}px`;
|
|
8
|
+
return value;
|
|
9
|
+
};
|
|
10
|
+
const normalizePosition = (value) => {
|
|
11
|
+
if (value === "start") return "0 auto";
|
|
12
|
+
if (value === "end") return "auto 0";
|
|
13
|
+
return "auto";
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
normalizeMargins,
|
|
17
|
+
normalizeMaxInlineSize,
|
|
18
|
+
normalizePosition
|
|
19
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef, useRef, useEffect } from "react";
|
|
4
|
+
import { useBoolean, useDOMRef, mergeProps, clsx, useElementSize, useEventListener, useMultiRef } from "@koobiq/react-core";
|
|
5
|
+
import { useDialog } from "@koobiq/react-primitives";
|
|
6
|
+
import { utilClasses } from "../../styles/utility.js";
|
|
7
|
+
import s from "./Dialog.module.css.js";
|
|
8
|
+
import { DialogContext } from "./DialogContext.js";
|
|
9
|
+
import { DialogCloseButton } from "./components/DialogCloseButton.js";
|
|
10
|
+
const Dialog = forwardRef(
|
|
11
|
+
({ onClose, children, slotProps, hideCloseButton, ...other }, ref) => {
|
|
12
|
+
const [topOverflow, { set: setTopOverflow }] = useBoolean();
|
|
13
|
+
const [bottomOverflow, { set: setBottomOverflow }] = useBoolean();
|
|
14
|
+
const contentRef = useRef(null);
|
|
15
|
+
const domRef = useDOMRef(ref);
|
|
16
|
+
const { dialogProps } = useDialog(other, domRef);
|
|
17
|
+
const showCloseButton = !hideCloseButton;
|
|
18
|
+
const rootProps = mergeProps(
|
|
19
|
+
{
|
|
20
|
+
className: clsx(s.base, utilClasses.typography["text-normal"]),
|
|
21
|
+
"data-close-button": showCloseButton,
|
|
22
|
+
"data-top-overflow": topOverflow,
|
|
23
|
+
"data-bottom-overflow": bottomOverflow
|
|
24
|
+
},
|
|
25
|
+
other,
|
|
26
|
+
dialogProps
|
|
27
|
+
);
|
|
28
|
+
const containerProps = mergeProps({
|
|
29
|
+
className: s.container
|
|
30
|
+
});
|
|
31
|
+
const updateOverflow = (element) => {
|
|
32
|
+
if (!element) return;
|
|
33
|
+
setTopOverflow(element.scrollTop > 0);
|
|
34
|
+
setBottomOverflow(
|
|
35
|
+
element.scrollTop + element.clientHeight < element.scrollHeight
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
const { ref: innerRef, height } = useElementSize();
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (contentRef.current) updateOverflow(contentRef.current);
|
|
41
|
+
}, [contentRef.current, height]);
|
|
42
|
+
useEventListener({
|
|
43
|
+
element: contentRef,
|
|
44
|
+
eventName: "scroll",
|
|
45
|
+
handler: () => {
|
|
46
|
+
updateOverflow(contentRef.current);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
return /* @__PURE__ */ jsx(
|
|
50
|
+
DialogContext.Provider,
|
|
51
|
+
{
|
|
52
|
+
value: {
|
|
53
|
+
close: onClose,
|
|
54
|
+
slots: { content: { ref: useMultiRef([contentRef, innerRef]) } }
|
|
55
|
+
},
|
|
56
|
+
children: /* @__PURE__ */ jsxs("section", { ...rootProps, ref: domRef, children: [
|
|
57
|
+
showCloseButton && /* @__PURE__ */ jsx(DialogCloseButton, { ...slotProps?.["close-button"] }),
|
|
58
|
+
/* @__PURE__ */ jsx("div", { ...containerProps, children })
|
|
59
|
+
] })
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
Dialog.displayName = "Dialog";
|
|
65
|
+
export {
|
|
66
|
+
Dialog
|
|
67
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const base = "kbq-dialog-4c737c";
|
|
2
|
+
const container = "kbq-dialog-container-a08202";
|
|
3
|
+
const header = "kbq-dialog-header-f96b65";
|
|
4
|
+
const closeButton = "kbq-dialog-closeButton-4b804e";
|
|
5
|
+
const content = "kbq-dialog-content-8f3b2a";
|
|
6
|
+
const footer = "kbq-dialog-footer-cf03d1";
|
|
7
|
+
const s = {
|
|
8
|
+
base,
|
|
9
|
+
container,
|
|
10
|
+
header,
|
|
11
|
+
closeButton,
|
|
12
|
+
content,
|
|
13
|
+
footer
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
base,
|
|
17
|
+
closeButton,
|
|
18
|
+
container,
|
|
19
|
+
content,
|
|
20
|
+
s as default,
|
|
21
|
+
footer,
|
|
22
|
+
header
|
|
23
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DialogContentProps } from './components';
|
|
2
|
+
export type DialogContextProps = {
|
|
3
|
+
close?(): void;
|
|
4
|
+
slots?: {
|
|
5
|
+
content?: DialogContentProps;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export declare const DialogContext: import("react").Context<DialogContextProps>;
|
|
9
|
+
export declare function useDialogProvider(): DialogContextProps;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ComponentRef } from 'react';
|
|
2
|
+
import { type ButtonProps } from '../../Button';
|
|
3
|
+
export type DialogCloseButtonRef = ComponentRef<'button'>;
|
|
4
|
+
export type DialogCloseButtonProps = ButtonProps;
|
|
5
|
+
export declare const DialogCloseButton: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
6
|
+
ref?: ((instance: HTMLButtonElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
7
|
+
}, "as" | keyof import("../..").ButtonBaseProps> & import("../..").ButtonBaseProps & {
|
|
8
|
+
as?: "button" | undefined;
|
|
9
|
+
}, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { mergeProps } from "@koobiq/react-core";
|
|
5
|
+
import { IconXmark16 } from "@koobiq/react-icons";
|
|
6
|
+
import { useLocalizedStringFormatter } from "@koobiq/react-primitives";
|
|
7
|
+
import s from "../Dialog.module.css.js";
|
|
8
|
+
import intlMessages from "../intl.json.js";
|
|
9
|
+
import { useDialogProvider } from "../DialogContext.js";
|
|
10
|
+
import { Button } from "../../Button/Button.js";
|
|
11
|
+
const DialogCloseButton = forwardRef(({ onClick, ...other }, ref) => {
|
|
12
|
+
const { close } = useDialogProvider();
|
|
13
|
+
const stringFormatter = useLocalizedStringFormatter(intlMessages);
|
|
14
|
+
return /* @__PURE__ */ jsx("div", { className: s.closeButton, children: /* @__PURE__ */ jsx(
|
|
15
|
+
Button,
|
|
16
|
+
{
|
|
17
|
+
...mergeProps({ onClick: close }, { onClick }),
|
|
18
|
+
"aria-label": stringFormatter.format("close"),
|
|
19
|
+
startIcon: /* @__PURE__ */ jsx(IconXmark16, {}),
|
|
20
|
+
variant: "contrast-transparent",
|
|
21
|
+
onlyIcon: true,
|
|
22
|
+
...other,
|
|
23
|
+
ref
|
|
24
|
+
}
|
|
25
|
+
) });
|
|
26
|
+
});
|
|
27
|
+
DialogCloseButton.displayName = "DialogCloseButton";
|
|
28
|
+
export {
|
|
29
|
+
DialogCloseButton
|
|
30
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode, ComponentRef } from 'react';
|
|
2
|
+
import { type ExtendableComponentPropsWithRef } from '@koobiq/react-core';
|
|
3
|
+
export type DialogContentRef = ComponentRef<'div'>;
|
|
4
|
+
export type DialogContentProps = ExtendableComponentPropsWithRef<{
|
|
5
|
+
/** Additional CSS-classes. */
|
|
6
|
+
className?: string;
|
|
7
|
+
/** The content of the component. */
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
/** Unique identifier for testing purposes. */
|
|
10
|
+
'data-testid'?: string;
|
|
11
|
+
}, 'div'>;
|
|
12
|
+
export declare const DialogContent: import("react").ForwardRefExoticComponent<Omit<DialogContentProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { useMultiRef, clsx } from "@koobiq/react-core";
|
|
5
|
+
import { utilClasses } from "../../../styles/utility.js";
|
|
6
|
+
import s from "../Dialog.module.css.js";
|
|
7
|
+
import { useDialogProvider } from "../DialogContext.js";
|
|
8
|
+
const DialogContent = forwardRef(
|
|
9
|
+
({ children, className, ...other }, ref) => {
|
|
10
|
+
const { slots } = useDialogProvider();
|
|
11
|
+
const { content: { ref: contextRef } = {} } = slots || {};
|
|
12
|
+
return /* @__PURE__ */ jsx(
|
|
13
|
+
"div",
|
|
14
|
+
{
|
|
15
|
+
ref: useMultiRef([ref, contextRef]),
|
|
16
|
+
className: clsx(
|
|
17
|
+
s.content,
|
|
18
|
+
utilClasses.typography["text-normal"],
|
|
19
|
+
className
|
|
20
|
+
),
|
|
21
|
+
...other,
|
|
22
|
+
children
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
DialogContent.displayName = "DialogContent";
|
|
28
|
+
export {
|
|
29
|
+
DialogContent
|
|
30
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode, ComponentRef } from 'react';
|
|
2
|
+
import type { ExtendableComponentPropsWithRef } from '@koobiq/react-core';
|
|
3
|
+
export type DialogFooterRef = ComponentRef<'div'>;
|
|
4
|
+
export type DialogFooterProps = ExtendableComponentPropsWithRef<{
|
|
5
|
+
/** Additional CSS-classes. */
|
|
6
|
+
className?: string;
|
|
7
|
+
/** The content of the component. */
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
/** Unique identifier for testing purposes. */
|
|
10
|
+
'data-testid'?: string;
|
|
11
|
+
}, 'div'>;
|
|
12
|
+
export declare const DialogFooter: import("react").ForwardRefExoticComponent<Omit<DialogFooterProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { clsx } from "@koobiq/react-core";
|
|
5
|
+
import s from "../Dialog.module.css.js";
|
|
6
|
+
const DialogFooter = forwardRef(
|
|
7
|
+
({ children, className, ...other }, ref) => /* @__PURE__ */ jsx("div", { ref, className: clsx(s.footer, className), ...other, children })
|
|
8
|
+
);
|
|
9
|
+
DialogFooter.displayName = "DialogFooter";
|
|
10
|
+
export {
|
|
11
|
+
DialogFooter
|
|
12
|
+
};
|