@inntechcorp/it-design 3.1.23 → 4.0.0-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/ACCESSIBILITY.md +517 -0
- package/README.md +88 -11
- package/dist/accordion/index.d.ts +2 -2
- package/dist/accordion/item/styled.d.ts +2 -2
- package/dist/accordion/styled.d.ts +1 -0
- package/dist/accordion/submenu/styled.d.ts +5 -5
- package/dist/alert/Description.d.ts +7 -0
- package/dist/alert/Title.d.ts +7 -0
- package/dist/alert/alert.style.error.d.ts +1 -1
- package/dist/alert/alert.style.info.d.ts +1 -1
- package/dist/alert/alert.style.neutral.d.ts +4 -0
- package/dist/alert/alert.style.success.d.ts +1 -1
- package/dist/alert/alert.style.warning.d.ts +1 -1
- package/dist/alert/index.d.ts +4 -2
- package/dist/alert/styled.d.ts +4 -8
- package/dist/alink/index.d.ts +2 -10
- package/dist/alink/styled.d.ts +1 -1
- package/dist/back-top/styled.d.ts +2 -2
- package/dist/button/button.style.default.d.ts +1 -1
- package/dist/button/button.style.filled.d.ts +1 -1
- package/dist/button/button.style.ghost.d.ts +1 -1
- package/dist/button/button.style.icon.d.ts +2 -2
- package/dist/button/button.style.link.d.ts +1 -1
- package/dist/button/button.style.outline.d.ts +1 -1
- package/dist/button/button.style.size.d.ts +4 -1
- package/dist/button/button.style.solid.d.ts +1 -1
- package/dist/button/index.d.ts +10 -2
- package/dist/button/styled.d.ts +3 -12
- package/dist/calendar/day/Day.d.ts +2 -2
- package/dist/calendar/day/styled.d.ts +1 -1
- package/dist/calendar/header/styled.d.ts +6 -6
- package/dist/calendar/index.d.ts +11 -3
- package/dist/calendar/styled.d.ts +6 -6
- package/dist/card/Card.d.ts +9 -0
- package/dist/card/CardAction.d.ts +7 -0
- package/dist/card/CardContent.d.ts +7 -0
- package/dist/card/CardDescription.d.ts +7 -0
- package/dist/card/CardFooter.d.ts +8 -0
- package/dist/card/CardHeader.d.ts +8 -0
- package/dist/card/CardTabs.d.ts +7 -0
- package/dist/card/CardTitle.d.ts +7 -0
- package/dist/card/index.d.ts +8 -3
- package/dist/card/styles.d.ts +9 -9
- package/dist/checkbox/group/index.d.ts +1 -1
- package/dist/checkbox/group/styled.d.ts +1 -1
- package/dist/checkbox/index.d.ts +1 -1
- package/dist/checkbox/styled.d.ts +6 -5
- package/dist/context/ITDContext.d.ts +3 -2
- package/dist/context/ITDThemeProvider.d.ts +8 -0
- package/dist/context/styled.d.ts +1 -1
- package/dist/datepicker/index.d.ts +2 -2
- package/dist/datepicker/styled.d.ts +5 -5
- package/dist/enums/enum.d.ts +138 -8
- package/dist/flex/index.d.ts +1 -1
- package/dist/flex/styled.d.ts +2 -2
- package/dist/floating/Arrow.d.ts +17 -0
- package/dist/floating/FloatingContent.d.ts +60 -0
- package/dist/floating/mergeTriggerProps.d.ts +8 -0
- package/dist/form/context/FormContext.d.ts +5 -2
- package/dist/form/context/FormStore.d.ts +6 -3
- package/dist/form/control/Control.d.ts +1 -1
- package/dist/form/control/styled.d.ts +1 -1
- package/dist/form/group/Group.d.ts +1 -1
- package/dist/form/group/styled.d.ts +1 -1
- package/dist/form/index.d.ts +5 -5
- package/dist/form/item/Item.d.ts +2 -3
- package/dist/form/validation/Validator.d.ts +2 -3
- package/dist/form/wrapper/FormWrapper.d.ts +2 -2
- package/dist/helpers/binary/GetTypeByFileType.d.ts +2 -2
- package/dist/helpers/country/GetCountryCodeByCurrencyCode.d.ts +1 -1
- package/dist/helpers/country/GetCountryCodeByLanguage.d.ts +1 -1
- package/dist/helpers/css/FindSelector.d.ts +10 -0
- package/dist/helpers/currency/ConvertCurrency.d.ts +1 -1
- package/dist/helpers/currency/GetCurrencyFormat.d.ts +9 -0
- package/dist/helpers/currency/GetCurrencySymbol.d.ts +1 -1
- package/dist/helpers/datetime/FormatTime.d.ts +1 -1
- package/dist/helpers/datetime/dayjsSetup.d.ts +1 -1
- package/dist/helpers/index.d.ts +36 -32
- package/dist/helpers/locale/getLocaleDateByString.d.ts +1 -0
- package/dist/helpers/svg/styles.d.ts +1 -1
- package/dist/helpers/theme/Color.d.ts +19 -0
- package/dist/helpers/theme/GenerateColorScale.d.ts +16 -0
- package/dist/helpers/theme/cssVariables.d.ts +30 -0
- package/dist/helpers/theme/dark.d.ts +3 -0
- package/dist/helpers/theme/index.d.ts +9 -0
- package/dist/helpers/theme/light.d.ts +3 -0
- package/dist/helpers/theme/themes.d.ts +5 -0
- package/dist/helpers/theme/tokens.d.ts +392 -0
- package/dist/hooks/index.d.ts +15 -15
- package/dist/hooks/useAddExternalCSS.d.ts +4 -5
- package/dist/hooks/useAvoidCollision.d.ts +6 -1
- package/dist/hooks/useComponentSize.d.ts +1 -1
- package/dist/hooks/useConnectionStatus.d.ts +1 -1
- package/dist/hooks/useFloatingPosition.d.ts +63 -0
- package/dist/hooks/useFloatingTrigger.d.ts +64 -0
- package/dist/hooks/useFocusTrap.d.ts +36 -0
- package/dist/hooks/useOnClickOutside.d.ts +1 -1
- package/dist/hooks/useSingleQuery.d.ts +1 -1
- package/dist/hovercard/HoverCard.d.ts +12 -0
- package/dist/hovercard/HoverCardContent.d.ts +22 -0
- package/dist/hovercard/HoverCardTrigger.d.ts +17 -0
- package/dist/hovercard/hoverCardContext.d.ts +7 -0
- package/dist/hovercard/index.d.ts +4 -0
- package/dist/html/header/H1.d.ts +1 -1
- package/dist/html/header/H2.d.ts +1 -1
- package/dist/html/header/H3.d.ts +1 -1
- package/dist/html/header/H4.d.ts +1 -1
- package/dist/html/header/index.d.ts +4 -4
- package/dist/html/header/styled.d.ts +4 -4
- package/dist/icons/index.d.ts +11 -14
- package/dist/image/index.d.ts +1 -2
- package/dist/image/styled.d.ts +5 -2
- package/dist/index.cjs.js +2702 -2559
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +168 -1786
- package/dist/index.es.js +22339 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.iife.js +5728 -0
- package/dist/index.iife.js.map +1 -0
- package/dist/index.umd.js +5728 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/input/index.d.ts +29 -2
- package/dist/input/style.settings.d.ts +9 -0
- package/dist/input/styled.d.ts +16 -18
- package/dist/label/index.d.ts +6 -0
- package/dist/label/style.settings.d.ts +9 -0
- package/dist/label/styled.d.ts +27 -0
- package/dist/link/index.d.ts +1 -10
- package/dist/locales/en/{calendar.json → calendar.json.d.ts} +4 -2
- package/dist/locales/en/{itd.json → itd.json.d.ts} +35 -20
- package/dist/locales/{calendar.json → tr/calendar.json.d.ts} +4 -2
- package/dist/locales/{itd.json → tr/itd.json.d.ts} +35 -21
- package/dist/logger/index.d.ts +9 -0
- package/dist/modal/container/ModalContainer.d.ts +4 -4
- package/dist/modal/container/styled.d.ts +2 -2
- package/dist/modal/context/ModalContext.d.ts +23 -14
- package/dist/modal/index.d.ts +7 -22
- package/dist/modal/modal/Modal.d.ts +2 -2
- package/dist/modal/modal/styled.d.ts +11 -11
- package/dist/notification/container/Container.d.ts +5 -0
- package/dist/notification/container/styled.d.ts +1 -0
- package/dist/notification/context/NotificationsContext.d.ts +2 -2
- package/dist/notification/index.d.ts +1 -1
- package/dist/notification/item/Item.d.ts +12 -0
- package/dist/notification/item/styled.d.ts +1166 -0
- package/dist/popover/Popover.d.ts +42 -0
- package/dist/popover/PopoverContent.d.ts +34 -0
- package/dist/popover/PopoverTrigger.d.ts +26 -0
- package/dist/popover/index.d.ts +4 -0
- package/dist/primitives/Slot.d.ts +36 -0
- package/dist/progress/styled.d.ts +1 -1
- package/dist/radio/button/RadioButton.d.ts +2 -2
- package/dist/radio/button/styled.d.ts +8 -9
- package/dist/radio/group/Group.d.ts +3 -3
- package/dist/radio/group/styled.d.ts +1 -1
- package/dist/radio/index.d.ts +2 -2
- package/dist/reportWebVitals.d.ts +2 -0
- package/dist/result/index.d.ts +2 -2
- package/dist/result/styled.d.ts +9 -9
- package/dist/select/dropdown/Dropdown.d.ts +20 -0
- package/dist/select/dropdown/styled.d.ts +14 -0
- package/dist/select/index.d.ts +1 -1
- package/dist/select/option/Option.d.ts +14 -6
- package/dist/select/option/styled.d.ts +4 -4
- package/dist/select/selector/Selector.d.ts +3 -0
- package/dist/select/selector/selectorinput/SelectorInput.d.ts +6 -0
- package/dist/select/selector/selectorinput/styled.d.ts +2 -0
- package/dist/select/selector/styled.d.ts +16 -0
- package/dist/select/style.settings.d.ts +83 -26
- package/dist/select/styled.d.ts +5 -3
- package/dist/setupTests.d.ts +1 -0
- package/dist/spin/styled.d.ts +4 -4
- package/dist/status/styled.d.ts +1 -1
- package/dist/stories/Accordion.d.ts +0 -1
- package/dist/stories/Accordion.stories.d.ts +3 -3
- package/dist/stories/Alert.stories.d.ts +18 -4
- package/dist/stories/AlertComposition.d.ts +2 -0
- package/dist/stories/AlertComposition.stories.d.ts +17 -0
- package/dist/stories/Button.d.ts +0 -1
- package/dist/stories/Button.stories.d.ts +16 -4
- package/dist/stories/Card.stories.d.ts +3 -2
- package/dist/stories/Checkbox.stories.d.ts +3 -3
- package/dist/stories/CheckboxGroup.stories.d.ts +3 -3
- package/dist/stories/CheckboxGroupControl.stories.d.ts +3 -3
- package/dist/stories/ColorScale.d.ts +10 -0
- package/dist/stories/ColorScale.stories.d.ts +24 -0
- package/dist/stories/ColorScaleCompare.d.ts +8 -0
- package/dist/stories/ColorScaleCompare.stories.d.ts +47 -0
- package/dist/stories/DatePicker.d.ts +0 -1
- package/dist/stories/DatePicker.stories.d.ts +3 -3
- package/dist/stories/Form.d.ts +1 -1
- package/dist/stories/Form.stories.d.ts +13 -3
- package/dist/stories/Header.d.ts +0 -1
- package/dist/stories/Header.stories.d.ts +5 -5
- package/dist/stories/HoverCard.d.ts +2 -0
- package/dist/stories/HoverCard.stories.d.ts +18 -0
- package/dist/stories/Input.d.ts +0 -1
- package/dist/stories/Input.stories.d.ts +86 -4
- package/dist/stories/ModalManager.d.ts +0 -1
- package/dist/stories/ModalManager.stories.d.ts +2 -2
- package/dist/stories/Page.d.ts +0 -1
- package/dist/stories/Page.stories.d.ts +2 -2
- package/dist/stories/Popover.d.ts +2 -0
- package/dist/stories/Popover.stories.d.ts +40 -0
- package/dist/stories/Progress.stories.d.ts +3 -3
- package/dist/stories/RadioGroup.stories.d.ts +3 -3
- package/dist/stories/Result.stories.d.ts +3 -3
- package/dist/stories/Select.d.ts +0 -1
- package/dist/stories/Select.stories.d.ts +16 -6
- package/dist/stories/Status.stories.d.ts +3 -3
- package/dist/stories/Switch.stories.d.ts +12 -5
- package/dist/stories/Table.stories.d.ts +2 -2
- package/dist/stories/Tabs.stories.d.ts +3 -3
- package/dist/stories/TextArea.d.ts +0 -1
- package/dist/stories/TextArea.stories.d.ts +11 -4
- package/dist/stories/Tooltip.d.ts +1 -0
- package/dist/stories/Tooltip.stories.d.ts +35 -0
- package/dist/stories/Upload.stories.d.ts +3 -8
- package/dist/stories/root/index.d.ts +1 -2
- package/dist/stories/select.styled.d.ts +1 -1
- package/dist/switch/index.d.ts +1 -1
- package/dist/switch/styled.d.ts +4 -4
- package/dist/table/index.d.ts +2 -2
- package/dist/table/styled.d.ts +5 -5
- package/dist/tabs/index.d.ts +1 -1
- package/dist/tabs/styles.d.ts +4 -9
- package/dist/textarea/index.d.ts +1 -1
- package/dist/textarea/styled.d.ts +6 -8
- package/dist/tinyscrollbar/index.d.ts +1 -2
- package/dist/tinyscrollbar/scroll.styled.d.ts +1 -1
- package/dist/tinyscrollbar/styled.d.ts +1 -1
- package/dist/tooltip/Tooltip.d.ts +12 -0
- package/dist/tooltip/TooltipContent.d.ts +15 -0
- package/dist/tooltip/TooltipTrigger.d.ts +19 -0
- package/dist/tooltip/index.d.ts +4 -0
- package/dist/tooltip/tooltipContext.d.ts +7 -0
- package/dist/types/AccordionItemProps.d.ts +1 -1
- package/dist/types/AccordionProps.d.ts +1 -1
- package/dist/types/AccordionSubMenuProps.d.ts +1 -1
- package/dist/types/AlertProps.d.ts +6 -6
- package/dist/types/ButtonProps.d.ts +13 -31
- package/dist/types/CalendarProps.d.ts +4 -5
- package/dist/types/CardProps.d.ts +7 -3
- package/dist/types/CheckboxProps.d.ts +7 -3
- package/dist/types/DatePickerProps.d.ts +8 -7
- package/dist/types/FlexProps.d.ts +2 -2
- package/dist/types/FormProps.d.ts +10 -8
- package/dist/types/ITDProps.d.ts +4 -2
- package/dist/types/InputProps.d.ts +12 -18
- package/dist/types/LabelProps.d.ts +7 -0
- package/dist/types/ModalProps.d.ts +2 -2
- package/dist/types/PopoverProps.d.ts +10 -0
- package/dist/types/RadioProps.d.ts +3 -4
- package/dist/types/ResultProps.d.ts +2 -1
- package/dist/types/SelectProps.d.ts +22 -16
- package/dist/types/SingleQueryProps.d.ts +1 -1
- package/dist/types/StatusProps.d.ts +2 -2
- package/dist/types/SwitchProps.d.ts +4 -1
- package/dist/types/TableProps.d.ts +3 -2
- package/dist/types/TabsProps.d.ts +1 -1
- package/dist/types/TextAreaProps.d.ts +3 -3
- package/dist/types/Theme.d.ts +103 -0
- package/dist/types/UploadProps.d.ts +3 -40
- package/dist/upload/index.d.ts +2 -2
- package/dist/upload/styled.d.ts +11 -45
- package/dist/utils/CommonStyledComponents.d.ts +18 -0
- package/dist/utils/ErrorAnnouncement.d.ts +25 -0
- package/dist/utils/GetButtonSizeSlug.d.ts +6 -0
- package/dist/utils/GetIconSizeBySize.d.ts +1 -1
- package/dist/utils/GetSizeBySizeSlug.d.ts +2 -2
- package/dist/utils/GetSizeSlugBySize.d.ts +5 -2
- package/dist/utils/InlineSVGCached.d.ts +1 -1
- package/dist/utils/index.d.ts +6 -4
- package/package.json +87 -64
- package/dist/button/button.style.SVG.d.ts +0 -4
- package/dist/button/button.style.circle.d.ts +0 -4
- package/dist/button/button.style.strecth.d.ts +0 -4
- package/dist/cropper/index.d.ts +0 -44
- package/dist/global.css +0 -146
- package/dist/icons/FileDocument.d.ts +0 -6
- package/dist/icons/FileExcel.d.ts +0 -5
- package/dist/icons/FilePdf.d.ts +0 -5
- package/dist/index.d.mts +0 -716
- package/dist/index.esm.js +0 -5584
- package/dist/locales/tr/calendar.json +0 -30
- package/dist/locales/tr/itd.json +0 -325
- package/dist/select/menu/Menu.d.ts +0 -14
- package/dist/select/menu/styled.d.ts +0 -8
- package/dist/select/toggle/Toggle.d.ts +0 -3
- package/dist/select/toggle/label/floating/FloatingLabel.d.ts +0 -12
- package/dist/select/toggle/label/floating/styled.d.ts +0 -8
- package/dist/select/toggle/label/single/SingleLabel.d.ts +0 -18
- package/dist/select/toggle/label/single/styled.d.ts +0 -2
- package/dist/select/toggle/styled.d.ts +0 -24
- package/dist/stories/ButtonIcon.d.ts +0 -2
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CSS Variables Generator
|
|
3
|
+
* tokens.ts'deki değerleri CSS custom properties'e dönüştürür
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Design token'larını CSS variables olarak inject eder
|
|
7
|
+
* Bu fonksiyon ITDThemeProvider tarafından otomatik çağrılır
|
|
8
|
+
*/
|
|
9
|
+
export declare function injectDesignTokens(): void;
|
|
10
|
+
/**
|
|
11
|
+
* CSS variables'ları export et (dokümantasyon için)
|
|
12
|
+
*/
|
|
13
|
+
export declare const CSS_VARIABLES_MAP: {
|
|
14
|
+
readonly '--itd-text-xs': "0.725rem";
|
|
15
|
+
readonly '--itd-text-sm': "0.75rem";
|
|
16
|
+
readonly '--itd-text-md': "0.825rem";
|
|
17
|
+
readonly '--itd-text-df': "0.875rem";
|
|
18
|
+
readonly '--itd-text-lg': "0.875rem";
|
|
19
|
+
readonly '--itd-text-xl': "0.875rem";
|
|
20
|
+
readonly '--itd-font-weight-normal': 400;
|
|
21
|
+
readonly '--itd-font-weight-medium': 500;
|
|
22
|
+
readonly '--itd-font-weight-semibold': 600;
|
|
23
|
+
readonly '--itd-font-weight-bold': 700;
|
|
24
|
+
readonly '--itd-spacing': "0.25rem";
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Verilen theme objesini CSS variables olarak inject eder
|
|
28
|
+
* @param theme - Styled-components theme objesi
|
|
29
|
+
*/
|
|
30
|
+
export declare function injectThemeColors(theme: Record<string, string>): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as AddDefaultThemeStyle } from '../../AddDefaultThemeStyle';
|
|
2
|
+
export { default as UpdateThemeStyle } from '../../UpdateThemeStyle';
|
|
3
|
+
export { default as GenerateColorScale, generateColorScaleFromBase } from '../../GenerateColorScale';
|
|
4
|
+
export { hexToRgba, withOpacity, getContrastText } from '../../Color';
|
|
5
|
+
export { default as lightTheme } from '../../light';
|
|
6
|
+
export { default as darkTheme } from '../../dark';
|
|
7
|
+
export { default as themes } from '../../themes.js';
|
|
8
|
+
export { TYPOGRAPHY_TOKENS, SPACING_TOKENS, ICON_TOKENS, INPUT_SIZE_MAP, SELECT_SIZE_MAP, BUTTON_SIZE_MAP, ALERT_TOKENS, CARD_TOKENS, MODAL_TOKENS } from '../../tokens';
|
|
9
|
+
export { injectDesignTokens, injectThemeColors, CSS_VARIABLES_MAP } from '../../cssVariables';
|
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Design Tokens - Merkezi tasarım değerleri
|
|
3
|
+
* Tüm componentler bu token'ları kullanmalı
|
|
4
|
+
*/
|
|
5
|
+
export declare const TYPOGRAPHY_TOKENS: {
|
|
6
|
+
readonly fontSize: {
|
|
7
|
+
readonly xs: "0.725rem";
|
|
8
|
+
readonly sm: "0.75rem";
|
|
9
|
+
readonly md: "0.825rem";
|
|
10
|
+
readonly df: "0.875rem";
|
|
11
|
+
readonly lg: "0.875rem";
|
|
12
|
+
readonly xl: "0.875rem";
|
|
13
|
+
};
|
|
14
|
+
readonly lineHeight: {
|
|
15
|
+
readonly xs: "0.725rem";
|
|
16
|
+
readonly sm: "0.75rem";
|
|
17
|
+
readonly md: "0.825rem";
|
|
18
|
+
readonly df: "0.875rem";
|
|
19
|
+
readonly lg: "0.875rem";
|
|
20
|
+
readonly xl: "0.875rem";
|
|
21
|
+
};
|
|
22
|
+
readonly fontWeight: {
|
|
23
|
+
readonly normal: 400;
|
|
24
|
+
readonly medium: 500;
|
|
25
|
+
readonly semibold: 600;
|
|
26
|
+
readonly bold: 700;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export declare const SPACING_TOKENS: {
|
|
30
|
+
readonly paddingX: {
|
|
31
|
+
readonly xs: "0.625rem";
|
|
32
|
+
readonly sm: "0.625rem";
|
|
33
|
+
readonly md: "0.75rem";
|
|
34
|
+
readonly df: "0.75rem";
|
|
35
|
+
readonly lg: "0.9375rem";
|
|
36
|
+
readonly xl: "0.9375rem";
|
|
37
|
+
};
|
|
38
|
+
readonly height: {
|
|
39
|
+
readonly xs: "1.75rem";
|
|
40
|
+
readonly sm: "2rem";
|
|
41
|
+
readonly md: "2.125rem";
|
|
42
|
+
readonly df: "2.25rem";
|
|
43
|
+
readonly lg: "2.5rem";
|
|
44
|
+
readonly xl: "2.75rem";
|
|
45
|
+
};
|
|
46
|
+
readonly gap: {
|
|
47
|
+
readonly xs: "0.25rem";
|
|
48
|
+
readonly sm: "0.5rem";
|
|
49
|
+
readonly md: "0.75rem";
|
|
50
|
+
readonly df: "0.875rem";
|
|
51
|
+
readonly lg: "1rem";
|
|
52
|
+
readonly xl: "1.25rem";
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Icon ve Image size tokenları
|
|
57
|
+
* Select, Button gibi componentlerde kullanılan icon boyutları
|
|
58
|
+
*/
|
|
59
|
+
export declare const ICON_TOKENS: {
|
|
60
|
+
readonly image: {
|
|
61
|
+
readonly xs: {
|
|
62
|
+
readonly width: "0.875rem";
|
|
63
|
+
readonly height: "0.875rem";
|
|
64
|
+
};
|
|
65
|
+
readonly sm: {
|
|
66
|
+
readonly width: "1rem";
|
|
67
|
+
readonly height: "1rem";
|
|
68
|
+
};
|
|
69
|
+
readonly md: {
|
|
70
|
+
readonly width: "1.125rem";
|
|
71
|
+
readonly height: "1.125rem";
|
|
72
|
+
};
|
|
73
|
+
readonly df: {
|
|
74
|
+
readonly width: "1.25rem";
|
|
75
|
+
readonly height: "1.25rem";
|
|
76
|
+
};
|
|
77
|
+
readonly lg: {
|
|
78
|
+
readonly width: "1.25rem";
|
|
79
|
+
readonly height: "1.25rem";
|
|
80
|
+
};
|
|
81
|
+
readonly xl: {
|
|
82
|
+
readonly width: "1.375rem";
|
|
83
|
+
readonly height: "1.375rem";
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
readonly arrow: {
|
|
87
|
+
readonly xs: {
|
|
88
|
+
readonly width: "0.825rem";
|
|
89
|
+
readonly height: "0.825rem";
|
|
90
|
+
};
|
|
91
|
+
readonly sm: {
|
|
92
|
+
readonly width: "0.825rem";
|
|
93
|
+
readonly height: "0.825rem";
|
|
94
|
+
};
|
|
95
|
+
readonly md: {
|
|
96
|
+
readonly width: "1rem";
|
|
97
|
+
readonly height: "1rem";
|
|
98
|
+
};
|
|
99
|
+
readonly df: {
|
|
100
|
+
readonly width: "1rem";
|
|
101
|
+
readonly height: "1rem";
|
|
102
|
+
};
|
|
103
|
+
readonly lg: {
|
|
104
|
+
readonly width: "1.125rem";
|
|
105
|
+
readonly height: "1.125rem";
|
|
106
|
+
};
|
|
107
|
+
readonly xl: {
|
|
108
|
+
readonly width: "1.125rem";
|
|
109
|
+
readonly height: "1.125rem";
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
readonly button: {
|
|
113
|
+
readonly xs: {
|
|
114
|
+
readonly width: "0.75rem";
|
|
115
|
+
readonly height: "0.75rem";
|
|
116
|
+
};
|
|
117
|
+
readonly sm: {
|
|
118
|
+
readonly width: "0.875rem";
|
|
119
|
+
readonly height: "0.875rem";
|
|
120
|
+
};
|
|
121
|
+
readonly md: {
|
|
122
|
+
readonly width: "1rem";
|
|
123
|
+
readonly height: "1rem";
|
|
124
|
+
};
|
|
125
|
+
readonly df: {
|
|
126
|
+
readonly width: "1rem";
|
|
127
|
+
readonly height: "1rem";
|
|
128
|
+
};
|
|
129
|
+
readonly lg: {
|
|
130
|
+
readonly width: "1.125rem";
|
|
131
|
+
readonly height: "1.125rem";
|
|
132
|
+
};
|
|
133
|
+
readonly xl: {
|
|
134
|
+
readonly width: "1.25rem";
|
|
135
|
+
readonly height: "1.25rem";
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
readonly default: {
|
|
139
|
+
readonly xs: "0.75rem";
|
|
140
|
+
readonly sm: "0.875rem";
|
|
141
|
+
readonly md: "1rem";
|
|
142
|
+
readonly df: "1rem";
|
|
143
|
+
readonly lg: "1.25rem";
|
|
144
|
+
readonly xl: "1.5rem";
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* Input componentleri için ortak size mapping
|
|
149
|
+
* Input, Textarea gibi text input elementleri
|
|
150
|
+
*/
|
|
151
|
+
export declare const INPUT_SIZE_MAP: {
|
|
152
|
+
readonly xs: {
|
|
153
|
+
readonly height: "1.75rem";
|
|
154
|
+
readonly paddingX: "0.625rem";
|
|
155
|
+
readonly fontSize: "0.725rem";
|
|
156
|
+
readonly lineHeight: "0.725rem";
|
|
157
|
+
readonly fontWeight: 400;
|
|
158
|
+
};
|
|
159
|
+
readonly sm: {
|
|
160
|
+
readonly height: "2rem";
|
|
161
|
+
readonly paddingX: "0.625rem";
|
|
162
|
+
readonly fontSize: "0.75rem";
|
|
163
|
+
readonly lineHeight: "0.75rem";
|
|
164
|
+
readonly fontWeight: 400;
|
|
165
|
+
};
|
|
166
|
+
readonly md: {
|
|
167
|
+
readonly height: "2.125rem";
|
|
168
|
+
readonly paddingX: "0.75rem";
|
|
169
|
+
readonly fontSize: "0.825rem";
|
|
170
|
+
readonly lineHeight: "0.825rem";
|
|
171
|
+
readonly fontWeight: 400;
|
|
172
|
+
};
|
|
173
|
+
readonly df: {
|
|
174
|
+
readonly height: "2.25rem";
|
|
175
|
+
readonly paddingX: "0.75rem";
|
|
176
|
+
readonly fontSize: "0.875rem";
|
|
177
|
+
readonly lineHeight: "0.875rem";
|
|
178
|
+
readonly fontWeight: 400;
|
|
179
|
+
};
|
|
180
|
+
readonly lg: {
|
|
181
|
+
readonly height: "2.5rem";
|
|
182
|
+
readonly paddingX: "0.9375rem";
|
|
183
|
+
readonly fontSize: "0.875rem";
|
|
184
|
+
readonly lineHeight: "0.875rem";
|
|
185
|
+
readonly fontWeight: 500;
|
|
186
|
+
};
|
|
187
|
+
readonly xlg: {
|
|
188
|
+
readonly height: "2.75rem";
|
|
189
|
+
readonly paddingX: "0.9375rem";
|
|
190
|
+
readonly fontSize: "0.875rem";
|
|
191
|
+
readonly lineHeight: "0.875rem";
|
|
192
|
+
readonly fontWeight: 500;
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
/**
|
|
196
|
+
* Select componentleri için ortak size mapping
|
|
197
|
+
* Select, Dropdown gibi seçim elementleri
|
|
198
|
+
* NOT: Input ile tamamen aynı değerleri kullanır
|
|
199
|
+
*/
|
|
200
|
+
export declare const SELECT_SIZE_MAP: {
|
|
201
|
+
readonly xs: {
|
|
202
|
+
readonly height: "1.75rem";
|
|
203
|
+
readonly paddingX: "0.625rem";
|
|
204
|
+
readonly fontSize: "0.725rem";
|
|
205
|
+
readonly lineHeight: "0.725rem";
|
|
206
|
+
readonly fontWeight: 400;
|
|
207
|
+
};
|
|
208
|
+
readonly sm: {
|
|
209
|
+
readonly height: "2rem";
|
|
210
|
+
readonly paddingX: "0.625rem";
|
|
211
|
+
readonly fontSize: "0.75rem";
|
|
212
|
+
readonly lineHeight: "0.75rem";
|
|
213
|
+
readonly fontWeight: 400;
|
|
214
|
+
};
|
|
215
|
+
readonly md: {
|
|
216
|
+
readonly height: "2.125rem";
|
|
217
|
+
readonly paddingX: "0.75rem";
|
|
218
|
+
readonly fontSize: "0.825rem";
|
|
219
|
+
readonly lineHeight: "0.825rem";
|
|
220
|
+
readonly fontWeight: 400;
|
|
221
|
+
};
|
|
222
|
+
readonly df: {
|
|
223
|
+
readonly height: "2.25rem";
|
|
224
|
+
readonly paddingX: "0.75rem";
|
|
225
|
+
readonly fontSize: "0.875rem";
|
|
226
|
+
readonly lineHeight: "0.875rem";
|
|
227
|
+
readonly fontWeight: 400;
|
|
228
|
+
};
|
|
229
|
+
readonly lg: {
|
|
230
|
+
readonly height: "2.5rem";
|
|
231
|
+
readonly paddingX: "0.9375rem";
|
|
232
|
+
readonly fontSize: "0.875rem";
|
|
233
|
+
readonly lineHeight: "0.875rem";
|
|
234
|
+
readonly fontWeight: 500;
|
|
235
|
+
};
|
|
236
|
+
readonly xlg: {
|
|
237
|
+
readonly height: "2.75rem";
|
|
238
|
+
readonly paddingX: "0.9375rem";
|
|
239
|
+
readonly fontSize: "0.875rem";
|
|
240
|
+
readonly lineHeight: "0.875rem";
|
|
241
|
+
readonly fontWeight: 500;
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
/**
|
|
245
|
+
* Button componentleri için size mapping
|
|
246
|
+
* Regular button ve icon-only button boyutları
|
|
247
|
+
*/
|
|
248
|
+
export declare const BUTTON_SIZE_MAP: {
|
|
249
|
+
readonly xs: {
|
|
250
|
+
readonly minWidth: "1.75rem";
|
|
251
|
+
readonly minHeight: "1.75rem";
|
|
252
|
+
readonly padding: "0 0.625rem";
|
|
253
|
+
readonly fontSize: "0.725rem";
|
|
254
|
+
readonly lineHeight: "0.725rem";
|
|
255
|
+
readonly fontWeight: 500;
|
|
256
|
+
readonly iconSize: {
|
|
257
|
+
readonly width: "0.75rem";
|
|
258
|
+
readonly height: "0.75rem";
|
|
259
|
+
};
|
|
260
|
+
readonly spinnerSize: "0.75rem";
|
|
261
|
+
readonly spinnerBorder: "1px";
|
|
262
|
+
};
|
|
263
|
+
readonly sm: {
|
|
264
|
+
readonly minWidth: "2rem";
|
|
265
|
+
readonly minHeight: "2rem";
|
|
266
|
+
readonly padding: "0 0.9375rem";
|
|
267
|
+
readonly fontSize: "0.75rem";
|
|
268
|
+
readonly lineHeight: "0.75rem";
|
|
269
|
+
readonly fontWeight: 500;
|
|
270
|
+
readonly iconSize: {
|
|
271
|
+
readonly width: "0.875rem";
|
|
272
|
+
readonly height: "0.875rem";
|
|
273
|
+
};
|
|
274
|
+
readonly spinnerSize: "1rem";
|
|
275
|
+
readonly spinnerBorder: "2px";
|
|
276
|
+
};
|
|
277
|
+
readonly md: {
|
|
278
|
+
readonly minWidth: "2.125rem";
|
|
279
|
+
readonly minHeight: "2.125rem";
|
|
280
|
+
readonly padding: "0 0.9375rem";
|
|
281
|
+
readonly fontSize: "0.825rem";
|
|
282
|
+
readonly lineHeight: "0.825rem";
|
|
283
|
+
readonly fontWeight: 500;
|
|
284
|
+
readonly iconSize: {
|
|
285
|
+
readonly width: "1rem";
|
|
286
|
+
readonly height: "1rem";
|
|
287
|
+
};
|
|
288
|
+
readonly spinnerSize: "1rem";
|
|
289
|
+
readonly spinnerBorder: "2px";
|
|
290
|
+
};
|
|
291
|
+
readonly df: {
|
|
292
|
+
readonly minWidth: "2.25rem";
|
|
293
|
+
readonly minHeight: "2.25rem";
|
|
294
|
+
readonly padding: "0 0.9375rem";
|
|
295
|
+
readonly fontSize: "0.875rem";
|
|
296
|
+
readonly lineHeight: "0.875rem";
|
|
297
|
+
readonly fontWeight: 500;
|
|
298
|
+
readonly iconSize: {
|
|
299
|
+
readonly width: "1rem";
|
|
300
|
+
readonly height: "1rem";
|
|
301
|
+
};
|
|
302
|
+
readonly spinnerSize: "1rem";
|
|
303
|
+
readonly spinnerBorder: "2px";
|
|
304
|
+
};
|
|
305
|
+
readonly lg: {
|
|
306
|
+
readonly minWidth: "2.5rem";
|
|
307
|
+
readonly minHeight: "2.5rem";
|
|
308
|
+
readonly padding: "0 1.25rem";
|
|
309
|
+
readonly fontSize: "0.875rem";
|
|
310
|
+
readonly lineHeight: "0.875rem";
|
|
311
|
+
readonly fontWeight: 500;
|
|
312
|
+
readonly iconSize: {
|
|
313
|
+
readonly width: "1.125rem";
|
|
314
|
+
readonly height: "1.125rem";
|
|
315
|
+
};
|
|
316
|
+
readonly spinnerSize: "1.125rem";
|
|
317
|
+
readonly spinnerBorder: "2px";
|
|
318
|
+
};
|
|
319
|
+
readonly xlg: {
|
|
320
|
+
readonly minWidth: "2.75rem";
|
|
321
|
+
readonly minHeight: "2.75rem";
|
|
322
|
+
readonly padding: "0 1.25rem";
|
|
323
|
+
readonly fontSize: "0.875rem";
|
|
324
|
+
readonly lineHeight: "0.875rem";
|
|
325
|
+
readonly fontWeight: 500;
|
|
326
|
+
readonly iconSize: {
|
|
327
|
+
readonly width: "1.25rem";
|
|
328
|
+
readonly height: "1.25rem";
|
|
329
|
+
};
|
|
330
|
+
readonly spinnerSize: "1.25rem";
|
|
331
|
+
readonly spinnerBorder: "3px";
|
|
332
|
+
};
|
|
333
|
+
};
|
|
334
|
+
/**
|
|
335
|
+
* Alert component için özel token'lar
|
|
336
|
+
*/
|
|
337
|
+
export declare const ALERT_TOKENS: {
|
|
338
|
+
readonly title: {
|
|
339
|
+
readonly fontSize: "0.875rem";
|
|
340
|
+
readonly lineHeight: "1rem";
|
|
341
|
+
readonly fontWeight: 500;
|
|
342
|
+
};
|
|
343
|
+
readonly description: {
|
|
344
|
+
readonly fontSize: "0.8125rem";
|
|
345
|
+
readonly lineHeight: "1rem";
|
|
346
|
+
readonly fontWeight: 400;
|
|
347
|
+
};
|
|
348
|
+
readonly icon: {
|
|
349
|
+
readonly size: "1rem";
|
|
350
|
+
readonly marginTop: "0.125rem";
|
|
351
|
+
};
|
|
352
|
+
readonly spacing: {
|
|
353
|
+
readonly gap: "0.875rem";
|
|
354
|
+
readonly padding: "0.875rem";
|
|
355
|
+
};
|
|
356
|
+
};
|
|
357
|
+
/**
|
|
358
|
+
* Card component için özel token'lar
|
|
359
|
+
*/
|
|
360
|
+
export declare const CARD_TOKENS: {
|
|
361
|
+
readonly padding: {
|
|
362
|
+
readonly xs: "0.5rem";
|
|
363
|
+
readonly sm: "0.75rem";
|
|
364
|
+
readonly md: "1rem";
|
|
365
|
+
readonly lg: "1.25rem";
|
|
366
|
+
};
|
|
367
|
+
readonly borderRadius: {
|
|
368
|
+
readonly sm: "0.375rem";
|
|
369
|
+
readonly md: "0.5rem";
|
|
370
|
+
readonly lg: "0.75rem";
|
|
371
|
+
};
|
|
372
|
+
};
|
|
373
|
+
/**
|
|
374
|
+
* Modal component için özel token'lar
|
|
375
|
+
*/
|
|
376
|
+
export declare const MODAL_TOKENS: {
|
|
377
|
+
readonly title: {
|
|
378
|
+
readonly fontSize: "0.9375rem";
|
|
379
|
+
readonly lineHeight: "1.375rem";
|
|
380
|
+
readonly fontWeight: 600;
|
|
381
|
+
};
|
|
382
|
+
readonly description: {
|
|
383
|
+
readonly fontSize: "0.8125rem";
|
|
384
|
+
readonly lineHeight: "1.25rem";
|
|
385
|
+
readonly fontWeight: 400;
|
|
386
|
+
};
|
|
387
|
+
readonly padding: {
|
|
388
|
+
readonly sm: "1rem";
|
|
389
|
+
readonly md: "1.25rem";
|
|
390
|
+
readonly lg: "1.5rem";
|
|
391
|
+
};
|
|
392
|
+
};
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export { default as useReCaptcha } from '
|
|
2
|
-
export { default as useConstructor } from '
|
|
3
|
-
export { default as useAddExternalCSS } from '
|
|
4
|
-
export { default as useOnClickOutside } from '
|
|
5
|
-
export { default as useOnESCKeyDown } from '
|
|
6
|
-
export { default as useSingleQuery } from '
|
|
7
|
-
export { default as useMultiQuery } from '
|
|
8
|
-
export { default as useOnResize } from '
|
|
9
|
-
export { default as useConnectionStatus } from '
|
|
10
|
-
export { default as useComponentSize } from '
|
|
11
|
-
export { default as useCoreFetch } from '
|
|
12
|
-
export { default as useContextBridge } from '
|
|
13
|
-
export { default as useKeyboardShortcut } from '
|
|
14
|
-
export { default as useOrientation } from '
|
|
15
|
-
export { default as useAvoidCollision } from '
|
|
1
|
+
export { default as useReCaptcha } from '../useReCaptcha';
|
|
2
|
+
export { default as useConstructor } from '../useConstructor';
|
|
3
|
+
export { default as useAddExternalCSS } from '../useAddExternalCSS';
|
|
4
|
+
export { default as useOnClickOutside } from '../useOnClickOutside';
|
|
5
|
+
export { default as useOnESCKeyDown } from '../useOnESCKeyDown';
|
|
6
|
+
export { default as useSingleQuery } from '../useSingleQuery';
|
|
7
|
+
export { default as useMultiQuery } from '../useMultiQuery';
|
|
8
|
+
export { default as useOnResize } from '../useOnResize';
|
|
9
|
+
export { default as useConnectionStatus } from '../useConnectionStatus';
|
|
10
|
+
export { default as useComponentSize } from '../useComponentSize';
|
|
11
|
+
export { default as useCoreFetch } from '../useCoreFetch';
|
|
12
|
+
export { default as useContextBridge } from '../useContextBridge';
|
|
13
|
+
export { default as useKeyboardShortcut } from '../useKeyboardShortcut';
|
|
14
|
+
export { default as useOrientation } from '../useOrientation';
|
|
15
|
+
export { default as useAvoidCollision } from '../useAvoidCollision';
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
*
|
|
3
3
|
* ADD EXTERNAL CSS
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* component ekrandan silinirse yüklediği yazı da silinir.
|
|
5
|
+
* Load dynamic css files. If the css file to be loaded has already been added, it will not be loaded again.
|
|
6
|
+
* If the component that loads it is removed from the screen, the css it loads will also be removed.
|
|
8
7
|
*
|
|
9
|
-
* @param link string
|
|
10
|
-
* @param temporary boolean
|
|
8
|
+
* @param link string (the css file to be loaded)
|
|
9
|
+
* @param temporary boolean (if true, the css file will be removed when the component that loads it is removed from the screen)
|
|
11
10
|
*
|
|
12
11
|
*/
|
|
13
12
|
declare const useAddExternalCSS: (link: string, temporary?: boolean) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
type UseAvoidCollisionOpts = {
|
|
2
|
-
/** .chat-bubble, .cookie-
|
|
2
|
+
/** ".chat-bubble", ".whatsapp-button", ".cookie-consent", "[data-fixed-obstacle='true']" gibi engellerin CSS seçicileri */
|
|
3
3
|
obstacles?: string[];
|
|
4
4
|
/** Sağa/sola yerleşim - şu an sağ-alt odaklı, gerekirse geliştirilebilir */
|
|
5
5
|
corner?: "bottom-right" | "bottom-left" | "bottom-center";
|
|
@@ -10,6 +10,11 @@ type UseAvoidCollisionOpts = {
|
|
|
10
10
|
/** Otomatik algıda en az kaç px boşluk bırakalım */
|
|
11
11
|
minGap?: number;
|
|
12
12
|
};
|
|
13
|
+
/**
|
|
14
|
+
* Use avoid collision
|
|
15
|
+
*
|
|
16
|
+
* Avoid collision with obstacles.
|
|
17
|
+
*/
|
|
13
18
|
declare const useAvoidCollision: ({ obstacles, corner, autoAvoid, extraBottom, minGap, }?: UseAvoidCollisionOpts) => {
|
|
14
19
|
bottomOffset: number;
|
|
15
20
|
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { ComponentXPositions, ComponentYPositions } from '../enums/enum';
|
|
3
|
+
type Placement = ComponentYPositions | ComponentXPositions;
|
|
4
|
+
/**
|
|
5
|
+
* Use floating position options
|
|
6
|
+
*
|
|
7
|
+
* Options for the useFloatingPosition hook.
|
|
8
|
+
*/
|
|
9
|
+
export type UseFloatingPositionOptions = {
|
|
10
|
+
/** Is the floating element open? */
|
|
11
|
+
isOpen: boolean;
|
|
12
|
+
/** Trigger element ref */
|
|
13
|
+
triggerRef: RefObject<HTMLElement | null>;
|
|
14
|
+
/** Floating content ref */
|
|
15
|
+
contentRef: RefObject<HTMLElement | null>;
|
|
16
|
+
/** Placement preference */
|
|
17
|
+
placement?: Placement;
|
|
18
|
+
/** Offset (pixels) */
|
|
19
|
+
offset?: number;
|
|
20
|
+
/** Show arrow? (for offset calculation) */
|
|
21
|
+
showArrow?: boolean;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Floating position
|
|
25
|
+
*
|
|
26
|
+
* Position of the floating element.
|
|
27
|
+
*/
|
|
28
|
+
export type FloatingPosition = {
|
|
29
|
+
/** Top position */
|
|
30
|
+
top: number;
|
|
31
|
+
/** Left position */
|
|
32
|
+
left: number;
|
|
33
|
+
/** Actual placement */
|
|
34
|
+
actualPlacement: Placement;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* Floating element (tooltip, popover, hovercard) position calculation
|
|
39
|
+
*
|
|
40
|
+
* - Calculate the position of the floating element based on the trigger element
|
|
41
|
+
* - Check for viewport collision (outside the viewport)
|
|
42
|
+
* - Flip the placement if it collides (if it collides, flip to the other side)
|
|
43
|
+
* - Update on scroll and resize
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* const { position } = useFloatingPosition({
|
|
48
|
+
* isOpen,
|
|
49
|
+
* triggerRef,
|
|
50
|
+
* contentRef,
|
|
51
|
+
* placement: 'top',
|
|
52
|
+
* offset: 8
|
|
53
|
+
* });
|
|
54
|
+
*
|
|
55
|
+
* <div style={{ top: position.top, left: position.left }}>
|
|
56
|
+
* Content
|
|
57
|
+
* </div>
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export declare function useFloatingPosition({ isOpen, triggerRef, contentRef, placement, offset: customOffset, showArrow }: UseFloatingPositionOptions): {
|
|
61
|
+
position: FloatingPosition;
|
|
62
|
+
};
|
|
63
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { TriggerTypes } from '../enums/enum';
|
|
2
|
+
import { MouseEvent as ReactMouseEvent } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Use floating trigger options
|
|
5
|
+
*
|
|
6
|
+
* Options for the useFloatingTrigger hook.
|
|
7
|
+
*/
|
|
8
|
+
export type UseFloatingTriggerOptions = {
|
|
9
|
+
/** Trigger type - auto-extracted from TriggerTypes enum */
|
|
10
|
+
trigger?: `${TriggerTypes}`;
|
|
11
|
+
/** Open delay (ms) */
|
|
12
|
+
openDelay?: number;
|
|
13
|
+
/** Close delay (ms) */
|
|
14
|
+
closeDelay?: number;
|
|
15
|
+
/** Close on click outside */
|
|
16
|
+
closeOnClickOutside?: boolean;
|
|
17
|
+
/** Initial state for manual control */
|
|
18
|
+
defaultOpen?: boolean;
|
|
19
|
+
/** Controlled mode */
|
|
20
|
+
open?: boolean;
|
|
21
|
+
/** On open change */
|
|
22
|
+
onOpenChange?: (open: boolean) => void;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Return type for useFloatingTrigger
|
|
26
|
+
*/
|
|
27
|
+
export type UseFloatingTriggerResult = {
|
|
28
|
+
isOpen: boolean;
|
|
29
|
+
open: () => void;
|
|
30
|
+
close: () => void;
|
|
31
|
+
toggle: () => void;
|
|
32
|
+
getTriggerProps: () => any;
|
|
33
|
+
getContentProps: () => {
|
|
34
|
+
ref: (el: HTMLElement | null) => void;
|
|
35
|
+
onClick?: (e: ReactMouseEvent) => void;
|
|
36
|
+
onMouseEnter?: () => void;
|
|
37
|
+
onMouseLeave?: () => void;
|
|
38
|
+
};
|
|
39
|
+
triggerRef: React.RefObject<HTMLElement | null>;
|
|
40
|
+
contentRef: React.RefObject<HTMLElement | null>;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* Floating element interaction logic
|
|
45
|
+
*
|
|
46
|
+
* - Trigger with hover, click, focus or manual
|
|
47
|
+
* - Configurable delays
|
|
48
|
+
* - Check for click outside
|
|
49
|
+
* - Controlled or uncontrolled mode
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```tsx
|
|
53
|
+
* const floating = useFloatingTrigger({
|
|
54
|
+
* trigger: TriggerTypes.HOVER,
|
|
55
|
+
* openDelay: 700,
|
|
56
|
+
* closeDelay: 0
|
|
57
|
+
* });
|
|
58
|
+
*
|
|
59
|
+
* <div {...floating.getTriggerProps()}>
|
|
60
|
+
* Trigger
|
|
61
|
+
* </div>
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export declare function useFloatingTrigger({ trigger, openDelay, closeDelay, closeOnClickOutside, defaultOpen, open: controlledOpen, onOpenChange, }?: UseFloatingTriggerOptions): UseFloatingTriggerResult;
|