@handijitcom/ui 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +1023 -2
- package/build/base.css +1 -0
- package/build/calendar.cjs +2 -0
- package/build/calendar.cjs.map +1 -0
- package/build/calendar.css +1 -0
- package/build/calendar.js +741 -0
- package/build/calendar.js.map +1 -0
- package/build/charts.cjs +2 -0
- package/build/charts.cjs.map +1 -0
- package/build/charts.css +1 -0
- package/build/charts.js +1866 -0
- package/build/charts.js.map +1 -0
- package/build/chat.cjs +4 -0
- package/build/chat.cjs.map +1 -0
- package/build/chat.css +1 -0
- package/build/chat.js +1126 -0
- package/build/chat.js.map +1 -0
- package/build/components/Accordion/index.cjs +2 -0
- package/build/components/Accordion/index.cjs.map +1 -0
- package/build/components/Accordion/index.d.cts +29 -0
- package/build/components/Accordion/index.d.ts +29 -0
- package/build/components/Accordion/index.js +42 -0
- package/build/components/Accordion/index.js.map +1 -0
- package/build/components/Accordion/style.css +1 -0
- package/build/components/Alert/index.cjs +2 -0
- package/build/components/Alert/index.cjs.map +1 -0
- package/build/components/Alert/index.d.cts +15 -0
- package/build/components/Alert/index.d.ts +15 -0
- package/build/components/Alert/index.js +32 -0
- package/build/components/Alert/index.js.map +1 -0
- package/build/components/Alert/style.css +1 -0
- package/build/components/Avatar/index.cjs +2 -0
- package/build/components/Avatar/index.cjs.map +1 -0
- package/build/components/Avatar/index.d.cts +26 -0
- package/build/components/Avatar/index.d.ts +26 -0
- package/build/components/Avatar/index.js +57 -0
- package/build/components/Avatar/index.js.map +1 -0
- package/build/components/Avatar/style.css +1 -0
- package/build/components/Badge/index.cjs +2 -0
- package/build/components/Badge/index.cjs.map +1 -0
- package/build/components/Badge/index.d.cts +21 -0
- package/build/components/Badge/index.d.ts +21 -0
- package/build/components/Badge/index.js +26 -0
- package/build/components/Badge/index.js.map +1 -0
- package/build/components/Badge/style.css +1 -0
- package/build/components/BottomSheet/index.cjs +2 -0
- package/build/components/BottomSheet/index.cjs.map +1 -0
- package/build/components/BottomSheet/index.d.cts +21 -0
- package/build/components/BottomSheet/index.d.ts +21 -0
- package/build/components/BottomSheet/index.js +85 -0
- package/build/components/BottomSheet/index.js.map +1 -0
- package/build/components/BottomSheet/style.css +1 -0
- package/build/components/Breadcrumb/index.cjs +2 -0
- package/build/components/Breadcrumb/index.cjs.map +1 -0
- package/build/components/Breadcrumb/index.d.cts +20 -0
- package/build/components/Breadcrumb/index.d.ts +20 -0
- package/build/components/Breadcrumb/index.js +31 -0
- package/build/components/Breadcrumb/index.js.map +1 -0
- package/build/components/Breadcrumb/style.css +1 -0
- package/build/components/Button/index.cjs +2 -0
- package/build/components/Button/index.cjs.map +1 -0
- package/build/components/Button/index.d.cts +32 -0
- package/build/components/Button/index.d.ts +32 -0
- package/build/components/Button/index.js +88 -0
- package/build/components/Button/index.js.map +1 -0
- package/build/components/Button/style.css +1 -0
- package/build/components/Card/index.cjs +2 -0
- package/build/components/Card/index.cjs.map +1 -0
- package/build/components/Card/index.d.cts +51 -0
- package/build/components/Card/index.d.ts +51 -0
- package/build/components/Card/index.js +58 -0
- package/build/components/Card/index.js.map +1 -0
- package/build/components/Card/style.css +1 -0
- package/build/components/Carousel/index.cjs +2 -0
- package/build/components/Carousel/index.cjs.map +1 -0
- package/build/components/Carousel/index.d.cts +24 -0
- package/build/components/Carousel/index.d.ts +24 -0
- package/build/components/Carousel/index.js +111 -0
- package/build/components/Carousel/index.js.map +1 -0
- package/build/components/Carousel/style.css +1 -0
- package/build/components/Checkbox/index.cjs +2 -0
- package/build/components/Checkbox/index.cjs.map +1 -0
- package/build/components/Checkbox/index.d.cts +15 -0
- package/build/components/Checkbox/index.d.ts +15 -0
- package/build/components/Checkbox/index.js +50 -0
- package/build/components/Checkbox/index.js.map +1 -0
- package/build/components/Checkbox/style.css +1 -0
- package/build/components/Chip/index.cjs +2 -0
- package/build/components/Chip/index.cjs.map +1 -0
- package/build/components/Chip/index.d.cts +27 -0
- package/build/components/Chip/index.d.ts +27 -0
- package/build/components/Chip/index.js +67 -0
- package/build/components/Chip/index.js.map +1 -0
- package/build/components/Chip/style.css +1 -0
- package/build/components/ChipGroup/index.cjs +2 -0
- package/build/components/ChipGroup/index.cjs.map +1 -0
- package/build/components/ChipGroup/index.d.cts +53 -0
- package/build/components/ChipGroup/index.d.ts +53 -0
- package/build/components/ChipGroup/index.js +81 -0
- package/build/components/ChipGroup/index.js.map +1 -0
- package/build/components/ChipGroup/style.css +1 -0
- package/build/components/CodeBadge/index.cjs +2 -0
- package/build/components/CodeBadge/index.cjs.map +1 -0
- package/build/components/CodeBadge/index.d.cts +36 -0
- package/build/components/CodeBadge/index.d.ts +36 -0
- package/build/components/CodeBadge/index.js +62 -0
- package/build/components/CodeBadge/index.js.map +1 -0
- package/build/components/CodeBadge/style.css +1 -0
- package/build/components/Combobox/index.cjs +2 -0
- package/build/components/Combobox/index.cjs.map +1 -0
- package/build/components/Combobox/index.d.cts +8 -0
- package/build/components/Combobox/index.d.ts +8 -0
- package/build/components/Combobox/index.js +332 -0
- package/build/components/Combobox/index.js.map +1 -0
- package/build/components/Combobox/style.css +1 -0
- package/build/components/CommandPalette/index.cjs +2 -0
- package/build/components/CommandPalette/index.cjs.map +1 -0
- package/build/components/CommandPalette/index.d.cts +37 -0
- package/build/components/CommandPalette/index.d.ts +37 -0
- package/build/components/CommandPalette/index.js +181 -0
- package/build/components/CommandPalette/index.js.map +1 -0
- package/build/components/CommandPalette/style.css +1 -0
- package/build/components/ConfirmDialog/index.cjs +2 -0
- package/build/components/ConfirmDialog/index.cjs.map +1 -0
- package/build/components/ConfirmDialog/index.d.cts +34 -0
- package/build/components/ConfirmDialog/index.d.ts +34 -0
- package/build/components/ConfirmDialog/index.js +85 -0
- package/build/components/ConfirmDialog/index.js.map +1 -0
- package/build/components/CopyField/index.cjs +2 -0
- package/build/components/CopyField/index.cjs.map +1 -0
- package/build/components/CopyField/index.d.cts +20 -0
- package/build/components/CopyField/index.d.ts +20 -0
- package/build/components/CopyField/index.js +44 -0
- package/build/components/CopyField/index.js.map +1 -0
- package/build/components/CopyField/style.css +1 -0
- package/build/components/DataTable/index.cjs +2 -0
- package/build/components/DataTable/index.cjs.map +1 -0
- package/build/components/DataTable/index.d.cts +60 -0
- package/build/components/DataTable/index.d.ts +60 -0
- package/build/components/DataTable/index.js +109 -0
- package/build/components/DataTable/index.js.map +1 -0
- package/build/components/DataTable/style.css +1 -0
- package/build/components/DateField/index.cjs +2 -0
- package/build/components/DateField/index.cjs.map +1 -0
- package/build/components/DateField/index.d.cts +57 -0
- package/build/components/DateField/index.d.ts +57 -0
- package/build/components/DateField/index.js +90 -0
- package/build/components/DateField/index.js.map +1 -0
- package/build/components/DateField/style.css +1 -0
- package/build/components/Directory/index.cjs +2 -0
- package/build/components/Directory/index.cjs.map +1 -0
- package/build/components/Directory/index.d.cts +51 -0
- package/build/components/Directory/index.d.ts +51 -0
- package/build/components/Directory/index.js +46 -0
- package/build/components/Directory/index.js.map +1 -0
- package/build/components/Directory/style.css +1 -0
- package/build/components/Disclosure/index.cjs +2 -0
- package/build/components/Disclosure/index.cjs.map +1 -0
- package/build/components/Disclosure/index.d.cts +34 -0
- package/build/components/Disclosure/index.d.ts +34 -0
- package/build/components/Disclosure/index.js +64 -0
- package/build/components/Disclosure/index.js.map +1 -0
- package/build/components/Disclosure/style.css +1 -0
- package/build/components/Divider/index.cjs +2 -0
- package/build/components/Divider/index.cjs.map +1 -0
- package/build/components/Divider/index.d.cts +10 -0
- package/build/components/Divider/index.d.ts +10 -0
- package/build/components/Divider/index.js +24 -0
- package/build/components/Divider/index.js.map +1 -0
- package/build/components/Divider/style.css +1 -0
- package/build/components/Drawer/index.cjs +2 -0
- package/build/components/Drawer/index.cjs.map +1 -0
- package/build/components/Drawer/index.d.cts +29 -0
- package/build/components/Drawer/index.d.ts +29 -0
- package/build/components/Drawer/index.js +91 -0
- package/build/components/Drawer/index.js.map +1 -0
- package/build/components/Drawer/style.css +1 -0
- package/build/components/EmptyState/index.cjs +2 -0
- package/build/components/EmptyState/index.cjs.map +1 -0
- package/build/components/EmptyState/index.d.cts +19 -0
- package/build/components/EmptyState/index.d.ts +19 -0
- package/build/components/EmptyState/index.js +35 -0
- package/build/components/EmptyState/index.js.map +1 -0
- package/build/components/EmptyState/style.css +1 -0
- package/build/components/Field/index.cjs +2 -0
- package/build/components/Field/index.cjs.map +1 -0
- package/build/components/Field/index.d.cts +37 -0
- package/build/components/Field/index.d.ts +37 -0
- package/build/components/Field/index.js +54 -0
- package/build/components/Field/index.js.map +1 -0
- package/build/components/Field/style.css +1 -0
- package/build/components/FileUpload/index.cjs +2 -0
- package/build/components/FileUpload/index.cjs.map +1 -0
- package/build/components/FileUpload/index.d.cts +42 -0
- package/build/components/FileUpload/index.d.ts +42 -0
- package/build/components/FileUpload/index.js +145 -0
- package/build/components/FileUpload/index.js.map +1 -0
- package/build/components/FileUpload/style.css +1 -0
- package/build/components/FilterBar/index.cjs +2 -0
- package/build/components/FilterBar/index.cjs.map +1 -0
- package/build/components/FilterBar/index.d.cts +28 -0
- package/build/components/FilterBar/index.d.ts +28 -0
- package/build/components/FilterBar/index.js +35 -0
- package/build/components/FilterBar/index.js.map +1 -0
- package/build/components/FilterBar/style.css +1 -0
- package/build/components/IconButton/index.cjs +2 -0
- package/build/components/IconButton/index.cjs.map +1 -0
- package/build/components/IconButton/index.d.cts +26 -0
- package/build/components/IconButton/index.d.ts +26 -0
- package/build/components/IconButton/index.js +61 -0
- package/build/components/IconButton/index.js.map +1 -0
- package/build/components/IconButton/style.css +1 -0
- package/build/components/Input/index.cjs +2 -0
- package/build/components/Input/index.cjs.map +1 -0
- package/build/components/Input/index.d.cts +15 -0
- package/build/components/Input/index.d.ts +15 -0
- package/build/components/Input/index.js +52 -0
- package/build/components/Input/index.js.map +1 -0
- package/build/components/Input/style.css +1 -0
- package/build/components/Kbd/index.cjs +2 -0
- package/build/components/Kbd/index.cjs.map +1 -0
- package/build/components/Kbd/index.d.cts +12 -0
- package/build/components/Kbd/index.d.ts +12 -0
- package/build/components/Kbd/index.js +13 -0
- package/build/components/Kbd/index.js.map +1 -0
- package/build/components/Kbd/style.css +1 -0
- package/build/components/Link/index.cjs +2 -0
- package/build/components/Link/index.cjs.map +1 -0
- package/build/components/Link/index.d.cts +5 -0
- package/build/components/Link/index.d.ts +5 -0
- package/build/components/Link/index.js +11 -0
- package/build/components/Link/index.js.map +1 -0
- package/build/components/Menu/index.cjs +2 -0
- package/build/components/Menu/index.cjs.map +1 -0
- package/build/components/Menu/index.d.cts +46 -0
- package/build/components/Menu/index.d.ts +46 -0
- package/build/components/Menu/index.js +241 -0
- package/build/components/Menu/index.js.map +1 -0
- package/build/components/Menu/style.css +1 -0
- package/build/components/Modal/index.cjs +2 -0
- package/build/components/Modal/index.cjs.map +1 -0
- package/build/components/Modal/index.d.cts +35 -0
- package/build/components/Modal/index.d.ts +35 -0
- package/build/components/Modal/index.js +95 -0
- package/build/components/Modal/index.js.map +1 -0
- package/build/components/Modal/style.css +1 -0
- package/build/components/MoneyInput/index.cjs +2 -0
- package/build/components/MoneyInput/index.cjs.map +1 -0
- package/build/components/MoneyInput/index.d.cts +17 -0
- package/build/components/MoneyInput/index.d.ts +17 -0
- package/build/components/MoneyInput/index.js +22 -0
- package/build/components/MoneyInput/index.js.map +1 -0
- package/build/components/PageHeader/index.cjs +2 -0
- package/build/components/PageHeader/index.cjs.map +1 -0
- package/build/components/PageHeader/index.d.cts +24 -0
- package/build/components/PageHeader/index.d.ts +24 -0
- package/build/components/PageHeader/index.js +34 -0
- package/build/components/PageHeader/index.js.map +1 -0
- package/build/components/PageHeader/style.css +1 -0
- package/build/components/Pagination/index.cjs +2 -0
- package/build/components/Pagination/index.cjs.map +1 -0
- package/build/components/Pagination/index.d.cts +39 -0
- package/build/components/Pagination/index.d.ts +39 -0
- package/build/components/Pagination/index.js +128 -0
- package/build/components/Pagination/index.js.map +1 -0
- package/build/components/Pagination/style.css +1 -0
- package/build/components/Panel/index.cjs +2 -0
- package/build/components/Panel/index.cjs.map +1 -0
- package/build/components/Panel/index.d.cts +43 -0
- package/build/components/Panel/index.d.ts +43 -0
- package/build/components/Panel/index.js +55 -0
- package/build/components/Panel/index.js.map +1 -0
- package/build/components/Panel/style.css +1 -0
- package/build/components/PasswordInput/index.cjs +2 -0
- package/build/components/PasswordInput/index.cjs.map +1 -0
- package/build/components/PasswordInput/index.d.cts +14 -0
- package/build/components/PasswordInput/index.d.ts +14 -0
- package/build/components/PasswordInput/index.js +40 -0
- package/build/components/PasswordInput/index.js.map +1 -0
- package/build/components/PasswordInput/style.css +1 -0
- package/build/components/PercentInput/index.cjs +2 -0
- package/build/components/PercentInput/index.cjs.map +1 -0
- package/build/components/PercentInput/index.d.cts +10 -0
- package/build/components/PercentInput/index.d.ts +10 -0
- package/build/components/PercentInput/index.js +14 -0
- package/build/components/PercentInput/index.js.map +1 -0
- package/build/components/Popover/index.cjs +2 -0
- package/build/components/Popover/index.cjs.map +1 -0
- package/build/components/Popover/index.d.cts +26 -0
- package/build/components/Popover/index.d.ts +26 -0
- package/build/components/Popover/index.js +106 -0
- package/build/components/Popover/index.js.map +1 -0
- package/build/components/Popover/style.css +1 -0
- package/build/components/Price/index.cjs +2 -0
- package/build/components/Price/index.cjs.map +1 -0
- package/build/components/Price/index.d.cts +22 -0
- package/build/components/Price/index.d.ts +22 -0
- package/build/components/Price/index.js +46 -0
- package/build/components/Price/index.js.map +1 -0
- package/build/components/Price/style.css +1 -0
- package/build/components/Progress/index.cjs +2 -0
- package/build/components/Progress/index.cjs.map +1 -0
- package/build/components/Progress/index.d.cts +59 -0
- package/build/components/Progress/index.d.ts +59 -0
- package/build/components/Progress/index.js +124 -0
- package/build/components/Progress/index.js.map +1 -0
- package/build/components/Progress/style.css +1 -0
- package/build/components/PromptDialog/index.cjs +2 -0
- package/build/components/PromptDialog/index.cjs.map +1 -0
- package/build/components/PromptDialog/index.d.cts +36 -0
- package/build/components/PromptDialog/index.d.ts +36 -0
- package/build/components/PromptDialog/index.js +119 -0
- package/build/components/PromptDialog/index.js.map +1 -0
- package/build/components/PromptDialog/style.css +1 -0
- package/build/components/QuantityInput/index.cjs +2 -0
- package/build/components/QuantityInput/index.cjs.map +1 -0
- package/build/components/QuantityInput/index.d.cts +17 -0
- package/build/components/QuantityInput/index.d.ts +17 -0
- package/build/components/QuantityInput/index.js +23 -0
- package/build/components/QuantityInput/index.js.map +1 -0
- package/build/components/QuantityStepper/index.cjs +2 -0
- package/build/components/QuantityStepper/index.cjs.map +1 -0
- package/build/components/QuantityStepper/index.d.cts +37 -0
- package/build/components/QuantityStepper/index.d.ts +37 -0
- package/build/components/QuantityStepper/index.js +118 -0
- package/build/components/QuantityStepper/index.js.map +1 -0
- package/build/components/QuantityStepper/style.css +1 -0
- package/build/components/Radio/index.cjs +2 -0
- package/build/components/Radio/index.cjs.map +1 -0
- package/build/components/Radio/index.d.cts +18 -0
- package/build/components/Radio/index.d.ts +18 -0
- package/build/components/Radio/index.js +53 -0
- package/build/components/Radio/index.js.map +1 -0
- package/build/components/Radio/style.css +1 -0
- package/build/components/RadioCard/index.cjs +2 -0
- package/build/components/RadioCard/index.cjs.map +1 -0
- package/build/components/RadioCard/index.d.cts +16 -0
- package/build/components/RadioCard/index.d.ts +16 -0
- package/build/components/RadioCard/index.js +48 -0
- package/build/components/RadioCard/index.js.map +1 -0
- package/build/components/RadioCard/style.css +1 -0
- package/build/components/RangeSlider/index.cjs +2 -0
- package/build/components/RangeSlider/index.cjs.map +1 -0
- package/build/components/RangeSlider/index.d.cts +45 -0
- package/build/components/RangeSlider/index.d.ts +45 -0
- package/build/components/RangeSlider/index.js +121 -0
- package/build/components/RangeSlider/index.js.map +1 -0
- package/build/components/RangeSlider/style.css +1 -0
- package/build/components/RateInput/index.cjs +2 -0
- package/build/components/RateInput/index.cjs.map +1 -0
- package/build/components/RateInput/index.d.cts +9 -0
- package/build/components/RateInput/index.d.ts +9 -0
- package/build/components/RateInput/index.js +18 -0
- package/build/components/RateInput/index.js.map +1 -0
- package/build/components/Rating/index.cjs +2 -0
- package/build/components/Rating/index.cjs.map +1 -0
- package/build/components/Rating/index.d.cts +16 -0
- package/build/components/Rating/index.d.ts +16 -0
- package/build/components/Rating/index.js +29 -0
- package/build/components/Rating/index.js.map +1 -0
- package/build/components/Rating/style.css +1 -0
- package/build/components/RatingInput/index.cjs +2 -0
- package/build/components/RatingInput/index.cjs.map +1 -0
- package/build/components/RatingInput/index.d.cts +34 -0
- package/build/components/RatingInput/index.d.ts +34 -0
- package/build/components/RatingInput/index.js +89 -0
- package/build/components/RatingInput/index.js.map +1 -0
- package/build/components/RatingInput/style.css +1 -0
- package/build/components/ScaledInput/index.cjs +2 -0
- package/build/components/ScaledInput/index.cjs.map +1 -0
- package/build/components/ScaledInput/index.d.cts +77 -0
- package/build/components/ScaledInput/index.d.ts +77 -0
- package/build/components/ScaledInput/index.js +77 -0
- package/build/components/ScaledInput/index.js.map +1 -0
- package/build/components/ScaledInput/style.css +1 -0
- package/build/components/ScrollArea/index.cjs +2 -0
- package/build/components/ScrollArea/index.cjs.map +1 -0
- package/build/components/ScrollArea/index.d.cts +23 -0
- package/build/components/ScrollArea/index.d.ts +23 -0
- package/build/components/ScrollArea/index.js +65 -0
- package/build/components/ScrollArea/index.js.map +1 -0
- package/build/components/ScrollArea/style.css +1 -0
- package/build/components/SectionHeader/index.cjs +2 -0
- package/build/components/SectionHeader/index.cjs.map +1 -0
- package/build/components/SectionHeader/index.d.cts +17 -0
- package/build/components/SectionHeader/index.d.ts +17 -0
- package/build/components/SectionHeader/index.js +25 -0
- package/build/components/SectionHeader/index.js.map +1 -0
- package/build/components/SectionHeader/style.css +1 -0
- package/build/components/SegmentedControl/index.cjs +2 -0
- package/build/components/SegmentedControl/index.cjs.map +1 -0
- package/build/components/SegmentedControl/index.d.cts +39 -0
- package/build/components/SegmentedControl/index.d.ts +39 -0
- package/build/components/SegmentedControl/index.js +84 -0
- package/build/components/SegmentedControl/index.js.map +1 -0
- package/build/components/SegmentedControl/style.css +1 -0
- package/build/components/Select/index.cjs +2 -0
- package/build/components/Select/index.cjs.map +1 -0
- package/build/components/Select/index.d.cts +52 -0
- package/build/components/Select/index.d.ts +52 -0
- package/build/components/Select/index.js +206 -0
- package/build/components/Select/index.js.map +1 -0
- package/build/components/Select/style.css +1 -0
- package/build/components/Skeleton/index.cjs +2 -0
- package/build/components/Skeleton/index.cjs.map +1 -0
- package/build/components/Skeleton/index.d.cts +25 -0
- package/build/components/Skeleton/index.d.ts +25 -0
- package/build/components/Skeleton/index.js +50 -0
- package/build/components/Skeleton/index.js.map +1 -0
- package/build/components/Skeleton/style.css +1 -0
- package/build/components/Spinner/index.cjs +2 -0
- package/build/components/Spinner/index.cjs.map +1 -0
- package/build/components/Spinner/index.d.cts +16 -0
- package/build/components/Spinner/index.d.ts +16 -0
- package/build/components/Spinner/index.js +15 -0
- package/build/components/Spinner/index.js.map +1 -0
- package/build/components/Spinner/style.css +1 -0
- package/build/components/Stat/index.cjs +2 -0
- package/build/components/Stat/index.cjs.map +1 -0
- package/build/components/Stat/index.d.cts +34 -0
- package/build/components/Stat/index.d.ts +34 -0
- package/build/components/Stat/index.js +72 -0
- package/build/components/Stat/index.js.map +1 -0
- package/build/components/Stat/style.css +1 -0
- package/build/components/StatusDot/index.cjs +2 -0
- package/build/components/StatusDot/index.cjs.map +1 -0
- package/build/components/StatusDot/index.d.cts +23 -0
- package/build/components/StatusDot/index.d.ts +23 -0
- package/build/components/StatusDot/index.js +23 -0
- package/build/components/StatusDot/index.js.map +1 -0
- package/build/components/StatusDot/style.css +1 -0
- package/build/components/Steps/index.cjs +2 -0
- package/build/components/Steps/index.cjs.map +1 -0
- package/build/components/Steps/index.d.cts +23 -0
- package/build/components/Steps/index.d.ts +23 -0
- package/build/components/Steps/index.js +69 -0
- package/build/components/Steps/index.js.map +1 -0
- package/build/components/Steps/style.css +1 -0
- package/build/components/SummaryCard/index.cjs +2 -0
- package/build/components/SummaryCard/index.cjs.map +1 -0
- package/build/components/SummaryCard/index.d.cts +24 -0
- package/build/components/SummaryCard/index.d.ts +24 -0
- package/build/components/SummaryCard/index.js +33 -0
- package/build/components/SummaryCard/index.js.map +1 -0
- package/build/components/SummaryCard/style.css +1 -0
- package/build/components/Switch/index.cjs +2 -0
- package/build/components/Switch/index.cjs.map +1 -0
- package/build/components/Switch/index.d.cts +21 -0
- package/build/components/Switch/index.d.ts +21 -0
- package/build/components/Switch/index.js +60 -0
- package/build/components/Switch/index.js.map +1 -0
- package/build/components/Switch/style.css +1 -0
- package/build/components/Table/index.cjs +2 -0
- package/build/components/Table/index.cjs.map +1 -0
- package/build/components/Table/index.d.cts +28 -0
- package/build/components/Table/index.d.ts +28 -0
- package/build/components/Table/index.js +58 -0
- package/build/components/Table/index.js.map +1 -0
- package/build/components/Table/style.css +1 -0
- package/build/components/TableCheckbox/index.cjs +2 -0
- package/build/components/TableCheckbox/index.cjs.map +1 -0
- package/build/components/TableCheckbox/index.d.cts +15 -0
- package/build/components/TableCheckbox/index.d.ts +15 -0
- package/build/components/TableCheckbox/index.js +31 -0
- package/build/components/TableCheckbox/index.js.map +1 -0
- package/build/components/TableCheckbox/style.css +1 -0
- package/build/components/Tabs/index.cjs +2 -0
- package/build/components/Tabs/index.cjs.map +1 -0
- package/build/components/Tabs/index.d.cts +27 -0
- package/build/components/Tabs/index.d.ts +27 -0
- package/build/components/Tabs/index.js +102 -0
- package/build/components/Tabs/index.js.map +1 -0
- package/build/components/Tabs/style.css +1 -0
- package/build/components/TagInput/index.cjs +2 -0
- package/build/components/TagInput/index.cjs.map +1 -0
- package/build/components/TagInput/index.d.cts +43 -0
- package/build/components/TagInput/index.d.ts +43 -0
- package/build/components/TagInput/index.js +134 -0
- package/build/components/TagInput/index.js.map +1 -0
- package/build/components/TagInput/style.css +1 -0
- package/build/components/TextLink/index.cjs +2 -0
- package/build/components/TextLink/index.cjs.map +1 -0
- package/build/components/TextLink/index.d.cts +16 -0
- package/build/components/TextLink/index.d.ts +16 -0
- package/build/components/TextLink/index.js +32 -0
- package/build/components/TextLink/index.js.map +1 -0
- package/build/components/TextLink/style.css +1 -0
- package/build/components/Textarea/index.cjs +2 -0
- package/build/components/Textarea/index.cjs.map +1 -0
- package/build/components/Textarea/index.d.cts +20 -0
- package/build/components/Textarea/index.d.ts +20 -0
- package/build/components/Textarea/index.js +68 -0
- package/build/components/Textarea/index.js.map +1 -0
- package/build/components/Textarea/style.css +1 -0
- package/build/components/Tile/index.cjs +2 -0
- package/build/components/Tile/index.cjs.map +1 -0
- package/build/components/Tile/index.d.cts +19 -0
- package/build/components/Tile/index.d.ts +19 -0
- package/build/components/Tile/index.js +24 -0
- package/build/components/Tile/index.js.map +1 -0
- package/build/components/Tile/style.css +1 -0
- package/build/components/Timeline/index.cjs +2 -0
- package/build/components/Timeline/index.cjs.map +1 -0
- package/build/components/Timeline/index.d.cts +24 -0
- package/build/components/Timeline/index.d.ts +24 -0
- package/build/components/Timeline/index.js +56 -0
- package/build/components/Timeline/index.js.map +1 -0
- package/build/components/Timeline/style.css +1 -0
- package/build/components/Toast/index.cjs +2 -0
- package/build/components/Toast/index.cjs.map +1 -0
- package/build/components/Toast/index.d.cts +63 -0
- package/build/components/Toast/index.d.ts +63 -0
- package/build/components/Toast/index.js +159 -0
- package/build/components/Toast/index.js.map +1 -0
- package/build/components/Toast/style.css +1 -0
- package/build/components/ToastPortal/index.cjs +2 -0
- package/build/components/ToastPortal/index.cjs.map +1 -0
- package/build/components/ToastPortal/index.d.cts +10 -0
- package/build/components/ToastPortal/index.d.ts +10 -0
- package/build/components/ToastPortal/index.js +15 -0
- package/build/components/ToastPortal/index.js.map +1 -0
- package/build/components/Tooltip/index.cjs +2 -0
- package/build/components/Tooltip/index.cjs.map +1 -0
- package/build/components/Tooltip/index.d.cts +23 -0
- package/build/components/Tooltip/index.d.ts +23 -0
- package/build/components/Tooltip/index.js +116 -0
- package/build/components/Tooltip/index.js.map +1 -0
- package/build/components/Tooltip/style.css +1 -0
- package/build/constants/breakpoint.constants.cjs +2 -0
- package/build/constants/breakpoint.constants.cjs.map +1 -0
- package/build/constants/breakpoint.constants.d.cts +15 -0
- package/build/constants/breakpoint.constants.d.ts +15 -0
- package/build/constants/breakpoint.constants.js +12 -0
- package/build/constants/breakpoint.constants.js.map +1 -0
- package/build/constants/combobox.constants.cjs +2 -0
- package/build/constants/combobox.constants.cjs.map +1 -0
- package/build/constants/combobox.constants.d.cts +11 -0
- package/build/constants/combobox.constants.d.ts +11 -0
- package/build/constants/combobox.constants.js +7 -0
- package/build/constants/combobox.constants.js.map +1 -0
- package/build/constants/scale.constants.cjs +2 -0
- package/build/constants/scale.constants.cjs.map +1 -0
- package/build/constants/scale.constants.d.cts +11 -0
- package/build/constants/scale.constants.d.ts +11 -0
- package/build/constants/scale.constants.js +8 -0
- package/build/constants/scale.constants.js.map +1 -0
- package/build/constants/scroll.constants.cjs +2 -0
- package/build/constants/scroll.constants.cjs.map +1 -0
- package/build/constants/scroll.constants.d.cts +7 -0
- package/build/constants/scroll.constants.d.ts +7 -0
- package/build/constants/scroll.constants.js +5 -0
- package/build/constants/scroll.constants.js.map +1 -0
- package/build/enums/ui-size.enum.cjs +2 -0
- package/build/enums/ui-size.enum.cjs.map +1 -0
- package/build/enums/ui-size.enum.d.cts +12 -0
- package/build/enums/ui-size.enum.d.ts +12 -0
- package/build/enums/ui-size.enum.js +5 -0
- package/build/enums/ui-size.enum.js.map +1 -0
- package/build/enums/ui-variant.enum.cjs +2 -0
- package/build/enums/ui-variant.enum.cjs.map +1 -0
- package/build/enums/ui-variant.enum.d.cts +20 -0
- package/build/enums/ui-variant.enum.d.ts +20 -0
- package/build/enums/ui-variant.enum.js +5 -0
- package/build/enums/ui-variant.enum.js.map +1 -0
- package/build/helpers/aria.helper.cjs +2 -0
- package/build/helpers/aria.helper.cjs.map +1 -0
- package/build/helpers/aria.helper.d.cts +7 -0
- package/build/helpers/aria.helper.d.ts +7 -0
- package/build/helpers/aria.helper.js +5 -0
- package/build/helpers/aria.helper.js.map +1 -0
- package/build/helpers/class-name.helper.cjs +2 -0
- package/build/helpers/class-name.helper.cjs.map +1 -0
- package/build/helpers/class-name.helper.d.cts +3 -0
- package/build/helpers/class-name.helper.d.ts +3 -0
- package/build/helpers/class-name.helper.js +10 -0
- package/build/helpers/class-name.helper.js.map +1 -0
- package/build/helpers/component.helper.cjs +2 -0
- package/build/helpers/component.helper.cjs.map +1 -0
- package/build/helpers/component.helper.d.cts +13 -0
- package/build/helpers/component.helper.d.ts +13 -0
- package/build/helpers/component.helper.js +5 -0
- package/build/helpers/component.helper.js.map +1 -0
- package/build/helpers/focus.helper.cjs +2 -0
- package/build/helpers/focus.helper.cjs.map +1 -0
- package/build/helpers/focus.helper.d.cts +90 -0
- package/build/helpers/focus.helper.d.ts +90 -0
- package/build/helpers/focus.helper.js +83 -0
- package/build/helpers/focus.helper.js.map +1 -0
- package/build/helpers/label.helper.cjs +2 -0
- package/build/helpers/label.helper.cjs.map +1 -0
- package/build/helpers/label.helper.d.cts +11 -0
- package/build/helpers/label.helper.d.ts +11 -0
- package/build/helpers/label.helper.js +11 -0
- package/build/helpers/label.helper.js.map +1 -0
- package/build/helpers/portal.helper.cjs +2 -0
- package/build/helpers/portal.helper.cjs.map +1 -0
- package/build/helpers/portal.helper.d.cts +28 -0
- package/build/helpers/portal.helper.d.ts +28 -0
- package/build/helpers/portal.helper.js +36 -0
- package/build/helpers/portal.helper.js.map +1 -0
- package/build/helpers/ref.helper.cjs +2 -0
- package/build/helpers/ref.helper.cjs.map +1 -0
- package/build/helpers/ref.helper.d.cts +3 -0
- package/build/helpers/ref.helper.d.ts +3 -0
- package/build/helpers/ref.helper.js +7 -0
- package/build/helpers/ref.helper.js.map +1 -0
- package/build/helpers/scaled-number.helper.cjs +2 -0
- package/build/helpers/scaled-number.helper.cjs.map +1 -0
- package/build/helpers/scaled-number.helper.d.cts +55 -0
- package/build/helpers/scaled-number.helper.d.ts +55 -0
- package/build/helpers/scaled-number.helper.js +34 -0
- package/build/helpers/scaled-number.helper.js.map +1 -0
- package/build/helpers/scroll.helper.cjs +2 -0
- package/build/helpers/scroll.helper.cjs.map +1 -0
- package/build/helpers/scroll.helper.d.cts +8 -0
- package/build/helpers/scroll.helper.d.ts +8 -0
- package/build/helpers/scroll.helper.js +11 -0
- package/build/helpers/scroll.helper.js.map +1 -0
- package/build/helpers/text.helper.cjs +2 -0
- package/build/helpers/text.helper.cjs.map +1 -0
- package/build/helpers/text.helper.d.cts +5 -0
- package/build/helpers/text.helper.d.ts +5 -0
- package/build/helpers/text.helper.js +6 -0
- package/build/helpers/text.helper.js.map +1 -0
- package/build/helpers/theme.helper.cjs +2 -0
- package/build/helpers/theme.helper.cjs.map +1 -0
- package/build/helpers/theme.helper.d.cts +18 -0
- package/build/helpers/theme.helper.d.ts +18 -0
- package/build/helpers/theme.helper.js +37 -0
- package/build/helpers/theme.helper.js.map +1 -0
- package/build/hooks/useAnnounce.cjs +2 -0
- package/build/hooks/useAnnounce.cjs.map +1 -0
- package/build/hooks/useAnnounce.d.cts +4 -0
- package/build/hooks/useAnnounce.d.ts +4 -0
- package/build/hooks/useAnnounce.js +23 -0
- package/build/hooks/useAnnounce.js.map +1 -0
- package/build/hooks/useAsyncSearch.cjs +2 -0
- package/build/hooks/useAsyncSearch.cjs.map +1 -0
- package/build/hooks/useAsyncSearch.d.cts +11 -0
- package/build/hooks/useAsyncSearch.d.ts +11 -0
- package/build/hooks/useAsyncSearch.js +17 -0
- package/build/hooks/useAsyncSearch.js.map +1 -0
- package/build/hooks/useCopyFeedback.cjs +2 -0
- package/build/hooks/useCopyFeedback.cjs.map +1 -0
- package/build/hooks/useCopyFeedback.d.cts +10 -0
- package/build/hooks/useCopyFeedback.d.ts +10 -0
- package/build/hooks/useCopyFeedback.js +25 -0
- package/build/hooks/useCopyFeedback.js.map +1 -0
- package/build/hooks/useDismissOnEscape.cjs +2 -0
- package/build/hooks/useDismissOnEscape.cjs.map +1 -0
- package/build/hooks/useDismissOnEscape.d.cts +16 -0
- package/build/hooks/useDismissOnEscape.d.ts +16 -0
- package/build/hooks/useDismissOnEscape.js +18 -0
- package/build/hooks/useDismissOnEscape.js.map +1 -0
- package/build/hooks/useListboxNavigation.cjs +2 -0
- package/build/hooks/useListboxNavigation.cjs.map +1 -0
- package/build/hooks/useListboxNavigation.d.cts +7 -0
- package/build/hooks/useListboxNavigation.d.ts +7 -0
- package/build/hooks/useListboxNavigation.js +53 -0
- package/build/hooks/useListboxNavigation.js.map +1 -0
- package/build/hooks/usePortalSurface.cjs +2 -0
- package/build/hooks/usePortalSurface.cjs.map +1 -0
- package/build/hooks/usePortalSurface.d.cts +25 -0
- package/build/hooks/usePortalSurface.d.ts +25 -0
- package/build/hooks/usePortalSurface.js +19 -0
- package/build/hooks/usePortalSurface.js.map +1 -0
- package/build/hooks/usePositioning.cjs +2 -0
- package/build/hooks/usePositioning.cjs.map +1 -0
- package/build/hooks/usePositioning.d.cts +13 -0
- package/build/hooks/usePositioning.d.ts +13 -0
- package/build/hooks/usePositioning.js +74 -0
- package/build/hooks/usePositioning.js.map +1 -0
- package/build/hooks/useScrollLock.cjs +2 -0
- package/build/hooks/useScrollLock.cjs.map +1 -0
- package/build/hooks/useScrollLock.d.cts +2 -0
- package/build/hooks/useScrollLock.d.ts +2 -0
- package/build/hooks/useScrollLock.js +34 -0
- package/build/hooks/useScrollLock.js.map +1 -0
- package/build/hooks/useSheetViewport.cjs +2 -0
- package/build/hooks/useSheetViewport.cjs.map +1 -0
- package/build/hooks/useSheetViewport.d.cts +6 -0
- package/build/hooks/useSheetViewport.d.ts +6 -0
- package/build/hooks/useSheetViewport.js +29 -0
- package/build/hooks/useSheetViewport.js.map +1 -0
- package/build/hooks/useStickToBottom.cjs +2 -0
- package/build/hooks/useStickToBottom.cjs.map +1 -0
- package/build/hooks/useStickToBottom.d.cts +12 -0
- package/build/hooks/useStickToBottom.d.ts +12 -0
- package/build/hooks/useStickToBottom.js +39 -0
- package/build/hooks/useStickToBottom.js.map +1 -0
- package/build/hooks/useUiTheme.cjs +2 -0
- package/build/hooks/useUiTheme.cjs.map +1 -0
- package/build/hooks/useUiTheme.d.cts +10 -0
- package/build/hooks/useUiTheme.d.ts +10 -0
- package/build/hooks/useUiTheme.js +42 -0
- package/build/hooks/useUiTheme.js.map +1 -0
- package/build/hooks/useUiTokens.cjs +2 -0
- package/build/hooks/useUiTokens.cjs.map +1 -0
- package/build/hooks/useUiTokens.d.cts +11 -0
- package/build/hooks/useUiTokens.d.ts +11 -0
- package/build/hooks/useUiTokens.js +36 -0
- package/build/hooks/useUiTokens.js.map +1 -0
- package/build/hooks/useVirtualList.cjs +2 -0
- package/build/hooks/useVirtualList.cjs.map +1 -0
- package/build/hooks/useVirtualList.d.cts +13 -0
- package/build/hooks/useVirtualList.d.ts +13 -0
- package/build/hooks/useVirtualList.js +41 -0
- package/build/hooks/useVirtualList.js.map +1 -0
- package/build/index.cjs +2 -0
- package/build/index.cjs.map +1 -0
- package/build/index.d.cts +98 -0
- package/build/index.d.ts +98 -0
- package/build/index.js +209 -0
- package/build/index.js.map +1 -0
- package/build/scss/_index.scss +7 -0
- package/build/scss/_mixins.scss +861 -0
- package/build/scss/_variables.scss +245 -0
- package/build/styles/base.d.cts +0 -0
- package/build/styles/base.d.ts +0 -0
- package/build/styles.css +135 -0
- package/build/theme/UiProvider.cjs +2 -0
- package/build/theme/UiProvider.cjs.map +1 -0
- package/build/theme/UiProvider.d.cts +23 -0
- package/build/theme/UiProvider.d.ts +23 -0
- package/build/theme/UiProvider.js +12 -0
- package/build/theme/UiProvider.js.map +1 -0
- package/build/theme/UiThemeScript.cjs +2 -0
- package/build/theme/UiThemeScript.cjs.map +1 -0
- package/build/theme/UiThemeScript.d.cts +22 -0
- package/build/theme/UiThemeScript.d.ts +22 -0
- package/build/theme/UiThemeScript.js +8 -0
- package/build/theme/UiThemeScript.js.map +1 -0
- package/build/theme/context.cjs +2 -0
- package/build/theme/context.cjs.map +1 -0
- package/build/theme/context.d.cts +5 -0
- package/build/theme/context.d.ts +5 -0
- package/build/theme/context.js +8 -0
- package/build/theme/context.js.map +1 -0
- package/build/types/calendar/Calendar/EventBlock.d.cts +29 -0
- package/build/types/calendar/Calendar/EventBlock.d.ts +29 -0
- package/build/types/calendar/Calendar/MonthGrid.d.cts +28 -0
- package/build/types/calendar/Calendar/MonthGrid.d.ts +28 -0
- package/build/types/calendar/Calendar/TimeGrid.d.cts +37 -0
- package/build/types/calendar/Calendar/TimeGrid.d.ts +37 -0
- package/build/types/calendar/Calendar/index.d.cts +72 -0
- package/build/types/calendar/Calendar/index.d.ts +72 -0
- package/build/types/calendar/core/layout.d.cts +43 -0
- package/build/types/calendar/core/layout.d.ts +43 -0
- package/build/types/calendar/core/moves.d.cts +37 -0
- package/build/types/calendar/core/moves.d.ts +37 -0
- package/build/types/calendar/core/time.d.cts +19 -0
- package/build/types/calendar/core/time.d.ts +19 -0
- package/build/types/calendar/core/types.d.cts +75 -0
- package/build/types/calendar/core/types.d.ts +75 -0
- package/build/types/calendar/core/useCalendarDrag.d.cts +32 -0
- package/build/types/calendar/core/useCalendarDrag.d.ts +32 -0
- package/build/types/calendar/index.d.cts +13 -0
- package/build/types/calendar/index.d.ts +13 -0
- package/build/types/charts/AreaChart/index.d.cts +14 -0
- package/build/types/charts/AreaChart/index.d.ts +14 -0
- package/build/types/charts/BarChart/index.d.cts +16 -0
- package/build/types/charts/BarChart/index.d.ts +16 -0
- package/build/types/charts/BoxPlot/index.d.cts +43 -0
- package/build/types/charts/BoxPlot/index.d.ts +43 -0
- package/build/types/charts/ComposedChart/index.d.cts +16 -0
- package/build/types/charts/ComposedChart/index.d.ts +16 -0
- package/build/types/charts/Heatmap/index.d.cts +30 -0
- package/build/types/charts/Heatmap/index.d.ts +30 -0
- package/build/types/charts/Histogram/index.d.cts +29 -0
- package/build/types/charts/Histogram/index.d.ts +29 -0
- package/build/types/charts/LineChart/index.d.cts +14 -0
- package/build/types/charts/LineChart/index.d.ts +14 -0
- package/build/types/charts/PieChart/index.d.cts +36 -0
- package/build/types/charts/PieChart/index.d.ts +36 -0
- package/build/types/charts/RadarChart/index.d.cts +40 -0
- package/build/types/charts/RadarChart/index.d.ts +40 -0
- package/build/types/charts/ScatterPlot/index.d.cts +41 -0
- package/build/types/charts/ScatterPlot/index.d.ts +41 -0
- package/build/types/charts/core/CartesianChart.d.cts +43 -0
- package/build/types/charts/core/CartesianChart.d.ts +43 -0
- package/build/types/charts/core/ChartFrame.d.cts +55 -0
- package/build/types/charts/core/ChartFrame.d.ts +55 -0
- package/build/types/charts/core/axes.d.cts +37 -0
- package/build/types/charts/core/axes.d.ts +37 -0
- package/build/types/charts/core/cartesian.d.cts +80 -0
- package/build/types/charts/core/cartesian.d.ts +80 -0
- package/build/types/charts/core/format.d.cts +19 -0
- package/build/types/charts/core/format.d.ts +19 -0
- package/build/types/charts/core/margins.d.cts +9 -0
- package/build/types/charts/core/margins.d.ts +9 -0
- package/build/types/charts/core/palette.d.cts +11 -0
- package/build/types/charts/core/palette.d.ts +11 -0
- package/build/types/charts/core/path.d.cts +24 -0
- package/build/types/charts/core/path.d.ts +24 -0
- package/build/types/charts/core/scale.d.cts +40 -0
- package/build/types/charts/core/scale.d.ts +40 -0
- package/build/types/charts/core/series.d.cts +11 -0
- package/build/types/charts/core/series.d.ts +11 -0
- package/build/types/charts/core/spatial.d.cts +12 -0
- package/build/types/charts/core/spatial.d.ts +12 -0
- package/build/types/charts/core/stats.d.cts +34 -0
- package/build/types/charts/core/stats.d.ts +34 -0
- package/build/types/charts/core/types.d.cts +31 -0
- package/build/types/charts/core/types.d.ts +31 -0
- package/build/types/charts/core/useChartWidth.d.cts +7 -0
- package/build/types/charts/core/useChartWidth.d.ts +7 -0
- package/build/types/charts/index.d.cts +21 -0
- package/build/types/charts/index.d.ts +21 -0
- package/build/types/chat/ActionList/index.d.cts +46 -0
- package/build/types/chat/ActionList/index.d.ts +46 -0
- package/build/types/chat/AppBar/index.d.cts +21 -0
- package/build/types/chat/AppBar/index.d.ts +21 -0
- package/build/types/chat/ChatMessage/index.d.cts +24 -0
- package/build/types/chat/ChatMessage/index.d.ts +24 -0
- package/build/types/chat/ChatThread/index.d.cts +24 -0
- package/build/types/chat/ChatThread/index.d.ts +24 -0
- package/build/types/chat/Citation/index.d.cts +15 -0
- package/build/types/chat/Citation/index.d.ts +15 -0
- package/build/types/chat/CodeBlock/format.d.cts +7 -0
- package/build/types/chat/CodeBlock/format.d.ts +7 -0
- package/build/types/chat/CodeBlock/grammars.d.cts +44 -0
- package/build/types/chat/CodeBlock/grammars.d.ts +44 -0
- package/build/types/chat/CodeBlock/highlight.d.cts +22 -0
- package/build/types/chat/CodeBlock/highlight.d.ts +22 -0
- package/build/types/chat/CodeBlock/index.d.cts +33 -0
- package/build/types/chat/CodeBlock/index.d.ts +33 -0
- package/build/types/chat/DescriptionList/index.d.cts +16 -0
- package/build/types/chat/DescriptionList/index.d.ts +16 -0
- package/build/types/chat/Legend/index.d.cts +21 -0
- package/build/types/chat/Legend/index.d.ts +21 -0
- package/build/types/chat/MessageActions/index.d.cts +21 -0
- package/build/types/chat/MessageActions/index.d.ts +21 -0
- package/build/types/chat/PromptInput/index.d.cts +47 -0
- package/build/types/chat/PromptInput/index.d.ts +47 -0
- package/build/types/chat/PromptSuggestions/index.d.cts +25 -0
- package/build/types/chat/PromptSuggestions/index.d.ts +25 -0
- package/build/types/chat/Prose/index.d.cts +15 -0
- package/build/types/chat/Prose/index.d.ts +15 -0
- package/build/types/chat/ReasoningBlock/index.d.cts +24 -0
- package/build/types/chat/ReasoningBlock/index.d.ts +24 -0
- package/build/types/chat/ReasoningText/index.d.cts +14 -0
- package/build/types/chat/ReasoningText/index.d.ts +14 -0
- package/build/types/chat/SegmentBar/index.d.cts +46 -0
- package/build/types/chat/SegmentBar/index.d.ts +46 -0
- package/build/types/chat/SourceList/index.d.cts +25 -0
- package/build/types/chat/SourceList/index.d.ts +25 -0
- package/build/types/chat/TerminalOutput/index.d.cts +25 -0
- package/build/types/chat/TerminalOutput/index.d.ts +25 -0
- package/build/types/chat/ToolCall/index.d.cts +41 -0
- package/build/types/chat/ToolCall/index.d.ts +41 -0
- package/build/types/chat/index.d.cts +26 -0
- package/build/types/chat/index.d.ts +26 -0
- package/build/types/combobox.type.d.cts +65 -0
- package/build/types/combobox.type.d.ts +65 -0
- package/build/types/common-element-props.type.d.cts +8 -0
- package/build/types/common-element-props.type.d.ts +8 -0
- package/build/types/helpers/class-name.helper.d.cts +3 -0
- package/build/types/helpers/class-name.helper.d.ts +3 -0
- package/build/types/helpers/component.helper.d.cts +13 -0
- package/build/types/helpers/component.helper.d.ts +13 -0
- package/build/types/helpers/label.helper.d.cts +12 -0
- package/build/types/helpers/label.helper.d.ts +12 -0
- package/build/types/hook.type.d.cts +36 -0
- package/build/types/hook.type.d.ts +36 -0
- package/build/types/link.type.d.cts +14 -0
- package/build/types/link.type.d.ts +14 -0
- package/build/types/positioning.type.d.cts +38 -0
- package/build/types/positioning.type.d.ts +38 -0
- package/build/types/theme.type.d.cts +197 -0
- package/build/types/theme.type.d.ts +197 -0
- package/build/types/types/common-element-props.type.d.cts +8 -0
- package/build/types/types/common-element-props.type.d.ts +8 -0
- package/build/types/types/link.type.d.cts +14 -0
- package/build/types/types/link.type.d.ts +14 -0
- package/build/types/types/theme.type.d.cts +197 -0
- package/build/types/types/theme.type.d.ts +197 -0
- package/package.json +905 -4
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("react"),u=require("../helpers/focus.helper.cjs"),l=(e,t,{isTransient:r=!1}={})=>{d.useEffect(()=>{if(!e)return;const{token:s,pop:c}=u.pushModal({isTransient:r}),n=o=>{o.key==="Escape"&&u.isTopModal(s)&&(o.preventDefault(),t())};return document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n),c()}},[e,t,r])};exports.default=l;
|
|
2
|
+
//# sourceMappingURL=useDismissOnEscape.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDismissOnEscape.cjs","sources":["../../src/hooks/useDismissOnEscape.ts"],"sourcesContent":["'use client';\n\nimport { useEffect } from 'react';\n\nimport { isTopModal, pushModal, type SurfaceOptions } from '../helpers/focus.helper';\n\n/**\n * `Escape` ile kapanma — dinleyici BELGE düzeyinde.\n * ⚠ YÜZEY YIĞINA KATILIR ve tuşu YALNIZCA EN ÜSTTEKİ tüketir.\n * ⚠ Tüketilen tuş `preventDefault` ile İŞARETLENİR: sayfa düzeyindeki dinleyici yüzeyi kapatan tuşu\n * kendi eylemine saymaz (bkz. `hasOpenSurface`).\n * ⚠ Kipsel yüzeyler (`Modal`, `Drawer`, `BottomSheet`) bu kancayı KULLANMAZ: onlar yerel `<dialog>`\n * üzerinden `cancel` olayını işler.\n * ⚠ Klavyeyi sahiplenmeyen yüzey (`Toast`, `Tooltip`) `isTransient` verir: `Escape` sırasına girer,\n * `hasOpenSurface()` onu saymaz ve ⌘K ile uygulama kısayolları açık kalır.\n * @param isActive Yüzey açık mı.\n * @param onDismiss Kapatma.\n * @param options Yığın kaydının türü.\n */\nconst useDismissOnEscape = (\n isActive: boolean,\n onDismiss: () => void,\n { isTransient = false }: SurfaceOptions = {},\n): void => {\n useEffect(() => {\n if (!isActive) return;\n\n const { token, pop } = pushModal({ isTransient });\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key !== 'Escape') return;\n /* Yığının en üstünde değilsek tuş bizim değil. */\n if (!isTopModal(token)) return;\n /*\n * Yüzey bu tuş vuruşunda kapanır ve gerçek tarayıcıda React onu sonraki dinleyiciler koşmadan\n * yığından düşürür: onlara kalan tek kanıt bu işaret.\n */\n event.preventDefault();\n onDismiss();\n };\n\n document.addEventListener('keydown', handleKeyDown);\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n pop();\n };\n }, [isActive, onDismiss, isTransient]);\n};\n\nexport default useDismissOnEscape;\n"],"names":["useDismissOnEscape","isActive","onDismiss","isTransient","useEffect","token","pop","pushModal","handleKeyDown","event","isTopModal"],"mappings":"2LAkBMA,EAAqB,CACzBC,EACAC,EACA,CAAE,YAAAC,EAAc,EAAA,EAA0B,KACjC,CACTC,EAAAA,UAAU,IAAM,CACd,GAAI,CAACH,EAAU,OAEf,KAAM,CAAE,MAAAI,EAAO,IAAAC,CAAA,EAAQC,EAAAA,UAAU,CAAE,YAAAJ,EAAa,EAE1CK,EAAiBC,GAAyB,CAC1CA,EAAM,MAAQ,UAEbC,EAAAA,WAAWL,CAAK,IAKrBI,EAAM,eAAA,EACNP,EAAA,EACF,EAEA,gBAAS,iBAAiB,UAAWM,CAAa,EAC3C,IAAM,CACX,SAAS,oBAAoB,UAAWA,CAAa,EACrDF,EAAA,CACF,CACF,EAAG,CAACL,EAAUC,EAAWC,CAAW,CAAC,CACvC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SurfaceOptions } from '../helpers/focus.helper.cjs';
|
|
2
|
+
/**
|
|
3
|
+
* `Escape` ile kapanma — dinleyici BELGE düzeyinde.
|
|
4
|
+
* ⚠ YÜZEY YIĞINA KATILIR ve tuşu YALNIZCA EN ÜSTTEKİ tüketir.
|
|
5
|
+
* ⚠ Tüketilen tuş `preventDefault` ile İŞARETLENİR: sayfa düzeyindeki dinleyici yüzeyi kapatan tuşu
|
|
6
|
+
* kendi eylemine saymaz (bkz. `hasOpenSurface`).
|
|
7
|
+
* ⚠ Kipsel yüzeyler (`Modal`, `Drawer`, `BottomSheet`) bu kancayı KULLANMAZ: onlar yerel `<dialog>`
|
|
8
|
+
* üzerinden `cancel` olayını işler.
|
|
9
|
+
* ⚠ Klavyeyi sahiplenmeyen yüzey (`Toast`, `Tooltip`) `isTransient` verir: `Escape` sırasına girer,
|
|
10
|
+
* `hasOpenSurface()` onu saymaz ve ⌘K ile uygulama kısayolları açık kalır.
|
|
11
|
+
* @param isActive Yüzey açık mı.
|
|
12
|
+
* @param onDismiss Kapatma.
|
|
13
|
+
* @param options Yığın kaydının türü.
|
|
14
|
+
*/
|
|
15
|
+
declare const useDismissOnEscape: (isActive: boolean, onDismiss: () => void, { isTransient }?: SurfaceOptions) => void;
|
|
16
|
+
export default useDismissOnEscape;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SurfaceOptions } from '../helpers/focus.helper.js';
|
|
2
|
+
/**
|
|
3
|
+
* `Escape` ile kapanma — dinleyici BELGE düzeyinde.
|
|
4
|
+
* ⚠ YÜZEY YIĞINA KATILIR ve tuşu YALNIZCA EN ÜSTTEKİ tüketir.
|
|
5
|
+
* ⚠ Tüketilen tuş `preventDefault` ile İŞARETLENİR: sayfa düzeyindeki dinleyici yüzeyi kapatan tuşu
|
|
6
|
+
* kendi eylemine saymaz (bkz. `hasOpenSurface`).
|
|
7
|
+
* ⚠ Kipsel yüzeyler (`Modal`, `Drawer`, `BottomSheet`) bu kancayı KULLANMAZ: onlar yerel `<dialog>`
|
|
8
|
+
* üzerinden `cancel` olayını işler.
|
|
9
|
+
* ⚠ Klavyeyi sahiplenmeyen yüzey (`Toast`, `Tooltip`) `isTransient` verir: `Escape` sırasına girer,
|
|
10
|
+
* `hasOpenSurface()` onu saymaz ve ⌘K ile uygulama kısayolları açık kalır.
|
|
11
|
+
* @param isActive Yüzey açık mı.
|
|
12
|
+
* @param onDismiss Kapatma.
|
|
13
|
+
* @param options Yığın kaydının türü.
|
|
14
|
+
*/
|
|
15
|
+
declare const useDismissOnEscape: (isActive: boolean, onDismiss: () => void, { isTransient }?: SurfaceOptions) => void;
|
|
16
|
+
export default useDismissOnEscape;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect as d } from "react";
|
|
3
|
+
import { pushModal as f, isTopModal as p } from "../helpers/focus.helper.js";
|
|
4
|
+
const l = (e, t, { isTransient: o = !1 } = {}) => {
|
|
5
|
+
d(() => {
|
|
6
|
+
if (!e) return;
|
|
7
|
+
const { token: u, pop: s } = f({ isTransient: o }), n = (r) => {
|
|
8
|
+
r.key === "Escape" && p(u) && (r.preventDefault(), t());
|
|
9
|
+
};
|
|
10
|
+
return document.addEventListener("keydown", n), () => {
|
|
11
|
+
document.removeEventListener("keydown", n), s();
|
|
12
|
+
};
|
|
13
|
+
}, [e, t, o]);
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
l as default
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=useDismissOnEscape.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDismissOnEscape.js","sources":["../../src/hooks/useDismissOnEscape.ts"],"sourcesContent":["'use client';\n\nimport { useEffect } from 'react';\n\nimport { isTopModal, pushModal, type SurfaceOptions } from '../helpers/focus.helper';\n\n/**\n * `Escape` ile kapanma — dinleyici BELGE düzeyinde.\n * ⚠ YÜZEY YIĞINA KATILIR ve tuşu YALNIZCA EN ÜSTTEKİ tüketir.\n * ⚠ Tüketilen tuş `preventDefault` ile İŞARETLENİR: sayfa düzeyindeki dinleyici yüzeyi kapatan tuşu\n * kendi eylemine saymaz (bkz. `hasOpenSurface`).\n * ⚠ Kipsel yüzeyler (`Modal`, `Drawer`, `BottomSheet`) bu kancayı KULLANMAZ: onlar yerel `<dialog>`\n * üzerinden `cancel` olayını işler.\n * ⚠ Klavyeyi sahiplenmeyen yüzey (`Toast`, `Tooltip`) `isTransient` verir: `Escape` sırasına girer,\n * `hasOpenSurface()` onu saymaz ve ⌘K ile uygulama kısayolları açık kalır.\n * @param isActive Yüzey açık mı.\n * @param onDismiss Kapatma.\n * @param options Yığın kaydının türü.\n */\nconst useDismissOnEscape = (\n isActive: boolean,\n onDismiss: () => void,\n { isTransient = false }: SurfaceOptions = {},\n): void => {\n useEffect(() => {\n if (!isActive) return;\n\n const { token, pop } = pushModal({ isTransient });\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key !== 'Escape') return;\n /* Yığının en üstünde değilsek tuş bizim değil. */\n if (!isTopModal(token)) return;\n /*\n * Yüzey bu tuş vuruşunda kapanır ve gerçek tarayıcıda React onu sonraki dinleyiciler koşmadan\n * yığından düşürür: onlara kalan tek kanıt bu işaret.\n */\n event.preventDefault();\n onDismiss();\n };\n\n document.addEventListener('keydown', handleKeyDown);\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n pop();\n };\n }, [isActive, onDismiss, isTransient]);\n};\n\nexport default useDismissOnEscape;\n"],"names":["useDismissOnEscape","isActive","onDismiss","isTransient","useEffect","token","pop","pushModal","handleKeyDown","event","isTopModal"],"mappings":";;;AAkBA,MAAMA,IAAqB,CACzBC,GACAC,GACA,EAAE,aAAAC,IAAc,GAAA,IAA0B,OACjC;AACT,EAAAC,EAAU,MAAM;AACd,QAAI,CAACH,EAAU;AAEf,UAAM,EAAE,OAAAI,GAAO,KAAAC,EAAA,IAAQC,EAAU,EAAE,aAAAJ,GAAa,GAE1CK,IAAgB,CAACC,MAAyB;AAC9C,MAAIA,EAAM,QAAQ,YAEbC,EAAWL,CAAK,MAKrBI,EAAM,eAAA,GACNP,EAAA;AAAA,IACF;AAEA,oBAAS,iBAAiB,WAAWM,CAAa,GAC3C,MAAM;AACX,eAAS,oBAAoB,WAAWA,CAAa,GACrDF,EAAA;AAAA,IACF;AAAA,EACF,GAAG,CAACL,GAAUC,GAAWC,CAAW,CAAC;AACvC;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react"),p=require("../helpers/scroll.helper.cjs"),D=({count:a,isOpen:f,initialIndex:c=0,onSelect:b,onClose:u},{hasSpaceSelect:i=!1}={})=>{const[t,r]=s.useState(c),k=s.useRef(null);s.useEffect(()=>{f&&r(c)},[f,c]),s.useEffect(()=>{r(e=>e>=a?Math.max(0,a-1):e)},[a]),s.useEffect(()=>{var e;f&&p.scrollIntoViewIfPossible((e=k.current)==null?void 0:e.querySelector(`[data-index="${t}"]`),{block:"nearest"})},[t,f,a]);const d=s.useCallback(e=>{const o=a-1;switch(e.key){case"ArrowDown":e.preventDefault(),r(l=>l>=o?0:l+1);break;case"ArrowUp":e.preventDefault(),r(l=>l<=0?o:l-1);break;case"Home":e.preventDefault(),r(0);break;case"End":e.preventDefault(),r(o);break;case" ":case"Enter":{if(e.key===" "&&!i)break;e.preventDefault(),a>0&&b(t);break}case"Escape":e.preventDefault(),e.stopPropagation(),u();break;case"Tab":u();break}},[t,a,i,u,b]);return{activeIndex:t,setActiveIndex:r,listRef:k,handleKeyDown:d}};exports.default=D;
|
|
2
|
+
//# sourceMappingURL=useListboxNavigation.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useListboxNavigation.cjs","sources":["../../src/hooks/useListboxNavigation.ts"],"sourcesContent":["'use client';\n\nimport { type KeyboardEvent, useCallback, useEffect, useRef, useState } from 'react';\n\nimport { scrollIntoViewIfPossible } from '../helpers/scroll.helper';\nimport type { ListboxNavigation, ListboxNavigationOptions } from '@/types/hook.type';\n\n/*\n * Govde `types/hook.type.ts`e tasindi (kardesleri `VirtualRange`, `AnnouncePoliteness`,\n * `ListboxNavigationOptions` zaten oradaydi)\n */\nexport type { ListboxNavigation } from '@/types/hook.type';\n\n/** LISTBOX KLAVYE GEZİNMESİ — `Select` ve `Combobox`ın ortak modeli. */\nconst useListboxNavigation = <T extends HTMLElement = HTMLElement>(\n { count, isOpen, initialIndex = 0, onSelect, onClose }: ListboxNavigationOptions,\n { hasSpaceSelect = false } = {},\n): ListboxNavigation<T> => {\n const [activeIndex, setActiveIndex] = useState(initialIndex);\n const listRef = useRef<T | null>(null);\n\n /*\n * Panel her acildiginda etkin secenek SECILI olandan baslar; kullanici listeyi bastan taramak\n * zorunda kalmaz.\n */\n useEffect(() => {\n if (isOpen) setActiveIndex(initialIndex);\n }, [isOpen, initialIndex]);\n\n /*\n * Liste SUZULDUGUNDE etkin dizin listenin disinda kalabiliyor: uc secenek gorunurken\n * `activeIndex` 7'de kaldiginda `Enter` hicbir sey secmiyordu.\n */\n useEffect(() => {\n setActiveIndex(current => (current >= count ? Math.max(0, count - 1) : current));\n }, [count]);\n\n /* Etkin secenek gorunur alanin disina cikmamali. */\n useEffect(() => {\n if (!isOpen) return;\n scrollIntoViewIfPossible(listRef.current?.querySelector(`[data-index=\"${activeIndex}\"]`), {\n block: 'nearest',\n });\n }, [activeIndex, isOpen, count]);\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLElement>) => {\n const lastIndex = count - 1;\n\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n setActiveIndex(current => (current >= lastIndex ? 0 : current + 1));\n break;\n\n case 'ArrowUp':\n event.preventDefault();\n setActiveIndex(current => (current <= 0 ? lastIndex : current - 1));\n break;\n\n case 'Home':\n event.preventDefault();\n setActiveIndex(0);\n break;\n\n case 'End':\n event.preventDefault();\n setActiveIndex(lastIndex);\n break;\n\n case ' ':\n case 'Enter': {\n /*\n * Arama kutusunda BOSLUK bir KARAKTER: onu secime cevirmek \"fren balatasi\" yazmayi\n * imkansiz kiliyordu. `Enter` her iki kipte de secer.\n */\n if (event.key === ' ' && !hasSpaceSelect) break;\n\n event.preventDefault();\n if (count > 0) onSelect(activeIndex);\n break;\n }\n\n case 'Escape':\n event.preventDefault();\n /*\n * React 17+ dinleyiciyi KOK KAPSAYICIYA bagliyor, yani sentetik olayda propagasyonu\n * durdurmak yerel olayin `document`e ulasmasini da engeller.\n * ⚠ `stopPropagation` ZORUNLU.\n */\n event.stopPropagation();\n onClose();\n break;\n\n case 'Tab':\n /* Kapatir ama varsayilan gezinme SURER. */\n onClose();\n break;\n\n default:\n break;\n }\n },\n [activeIndex, count, hasSpaceSelect, onClose, onSelect],\n );\n\n return { activeIndex, setActiveIndex, listRef, handleKeyDown };\n};\n\nexport default useListboxNavigation;\n"],"names":["useListboxNavigation","count","isOpen","initialIndex","onSelect","onClose","hasSpaceSelect","activeIndex","setActiveIndex","use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,EAASG,CAAW,EACnC,KACF,CAEA,IAAK,SACHW,EAAM,eAAA,EAMNA,EAAM,gBAAA,EACNb,EAAA,EACA,MAEF,IAAK,MAEHA,EAAA,EACA,KAGA,CAEN,EACA,CAACE,EAAaN,EAAOK,EAAgBD,EAASD,CAAQ,CAAA,EAGxD,MAAO,CAAE,YAAAG,EAAa,eAAAC,EAAgB,QAAAE,EAAS,cAAAM,CAAA,CACjD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ListboxNavigation, ListboxNavigationOptions } from '../types/hook.type.cjs';
|
|
2
|
+
export type { ListboxNavigation } from '../types/hook.type.cjs';
|
|
3
|
+
/** LISTBOX KLAVYE GEZİNMESİ — `Select` ve `Combobox`ın ortak modeli. */
|
|
4
|
+
declare const useListboxNavigation: <T extends HTMLElement = HTMLElement>({ count, isOpen, initialIndex, onSelect, onClose }: ListboxNavigationOptions, { hasSpaceSelect }?: {
|
|
5
|
+
hasSpaceSelect?: boolean | undefined;
|
|
6
|
+
}) => ListboxNavigation<T>;
|
|
7
|
+
export default useListboxNavigation;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ListboxNavigation, ListboxNavigationOptions } from '../types/hook.type.js';
|
|
2
|
+
export type { ListboxNavigation } from '../types/hook.type.js';
|
|
3
|
+
/** LISTBOX KLAVYE GEZİNMESİ — `Select` ve `Combobox`ın ortak modeli. */
|
|
4
|
+
declare const useListboxNavigation: <T extends HTMLElement = HTMLElement>({ count, isOpen, initialIndex, onSelect, onClose }: ListboxNavigationOptions, { hasSpaceSelect }?: {
|
|
5
|
+
hasSpaceSelect?: boolean | undefined;
|
|
6
|
+
}) => ListboxNavigation<T>;
|
|
7
|
+
export default useListboxNavigation;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useState as D, useRef as d, useEffect as c, useCallback as m } from "react";
|
|
3
|
+
import { scrollIntoViewIfPossible as w } from "../helpers/scroll.helper.js";
|
|
4
|
+
const E = ({ count: a, isOpen: f, initialIndex: l = 0, onSelect: k, onClose: o }, { hasSpaceSelect: i = !1 } = {}) => {
|
|
5
|
+
const [s, r] = D(l), p = d(null);
|
|
6
|
+
c(() => {
|
|
7
|
+
f && r(l);
|
|
8
|
+
}, [f, l]), c(() => {
|
|
9
|
+
r((e) => e >= a ? Math.max(0, a - 1) : e);
|
|
10
|
+
}, [a]), c(() => {
|
|
11
|
+
var e;
|
|
12
|
+
f && w((e = p.current) == null ? void 0 : e.querySelector(`[data-index="${s}"]`), {
|
|
13
|
+
block: "nearest"
|
|
14
|
+
});
|
|
15
|
+
}, [s, f, a]);
|
|
16
|
+
const u = m(
|
|
17
|
+
(e) => {
|
|
18
|
+
const b = a - 1;
|
|
19
|
+
switch (e.key) {
|
|
20
|
+
case "ArrowDown":
|
|
21
|
+
e.preventDefault(), r((t) => t >= b ? 0 : t + 1);
|
|
22
|
+
break;
|
|
23
|
+
case "ArrowUp":
|
|
24
|
+
e.preventDefault(), r((t) => t <= 0 ? b : t - 1);
|
|
25
|
+
break;
|
|
26
|
+
case "Home":
|
|
27
|
+
e.preventDefault(), r(0);
|
|
28
|
+
break;
|
|
29
|
+
case "End":
|
|
30
|
+
e.preventDefault(), r(b);
|
|
31
|
+
break;
|
|
32
|
+
case " ":
|
|
33
|
+
case "Enter": {
|
|
34
|
+
if (e.key === " " && !i) break;
|
|
35
|
+
e.preventDefault(), a > 0 && k(s);
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
case "Escape":
|
|
39
|
+
e.preventDefault(), e.stopPropagation(), o();
|
|
40
|
+
break;
|
|
41
|
+
case "Tab":
|
|
42
|
+
o();
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
[s, a, i, o, k]
|
|
47
|
+
);
|
|
48
|
+
return { activeIndex: s, setActiveIndex: r, listRef: p, handleKeyDown: u };
|
|
49
|
+
};
|
|
50
|
+
export {
|
|
51
|
+
E as default
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=useListboxNavigation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useListboxNavigation.js","sources":["../../src/hooks/useListboxNavigation.ts"],"sourcesContent":["'use client';\n\nimport { type KeyboardEvent, useCallback, useEffect, useRef, useState } from 'react';\n\nimport { scrollIntoViewIfPossible } from '../helpers/scroll.helper';\nimport type { ListboxNavigation, ListboxNavigationOptions } from '@/types/hook.type';\n\n/*\n * Govde `types/hook.type.ts`e tasindi (kardesleri `VirtualRange`, `AnnouncePoliteness`,\n * `ListboxNavigationOptions` zaten oradaydi)\n */\nexport type { ListboxNavigation } from '@/types/hook.type';\n\n/** LISTBOX KLAVYE GEZİNMESİ — `Select` ve `Combobox`ın ortak modeli. */\nconst useListboxNavigation = <T extends HTMLElement = HTMLElement>(\n { count, isOpen, initialIndex = 0, onSelect, onClose }: ListboxNavigationOptions,\n { hasSpaceSelect = false } = {},\n): ListboxNavigation<T> => {\n const [activeIndex, setActiveIndex] = useState(initialIndex);\n const listRef = useRef<T | null>(null);\n\n /*\n * Panel her acildiginda etkin secenek SECILI olandan baslar; kullanici listeyi bastan taramak\n * zorunda kalmaz.\n */\n useEffect(() => {\n if (isOpen) setActiveIndex(initialIndex);\n }, [isOpen, initialIndex]);\n\n /*\n * Liste SUZULDUGUNDE etkin dizin listenin disinda kalabiliyor: uc secenek gorunurken\n * `activeIndex` 7'de kaldiginda `Enter` hicbir sey secmiyordu.\n */\n useEffect(() => {\n setActiveIndex(current => (current >= count ? Math.max(0, count - 1) : current));\n }, [count]);\n\n /* Etkin secenek gorunur alanin disina cikmamali. */\n useEffect(() => {\n if (!isOpen) return;\n scrollIntoViewIfPossible(listRef.current?.querySelector(`[data-index=\"${activeIndex}\"]`), {\n block: 'nearest',\n });\n }, [activeIndex, isOpen, count]);\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLElement>) => {\n const lastIndex = count - 1;\n\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n setActiveIndex(current => (current >= lastIndex ? 0 : current + 1));\n break;\n\n case 'ArrowUp':\n event.preventDefault();\n setActiveIndex(current => (current <= 0 ? lastIndex : current - 1));\n break;\n\n case 'Home':\n event.preventDefault();\n setActiveIndex(0);\n break;\n\n case 'End':\n event.preventDefault();\n setActiveIndex(lastIndex);\n break;\n\n case ' ':\n case 'Enter': {\n /*\n * Arama kutusunda BOSLUK bir KARAKTER: onu secime cevirmek \"fren balatasi\" yazmayi\n * imkansiz kiliyordu. `Enter` her iki kipte de secer.\n */\n if (event.key === ' ' && !hasSpaceSelect) break;\n\n event.preventDefault();\n if (count > 0) onSelect(activeIndex);\n break;\n }\n\n case 'Escape':\n event.preventDefault();\n /*\n * React 17+ dinleyiciyi KOK KAPSAYICIYA bagliyor, yani sentetik olayda propagasyonu\n * durdurmak yerel olayin `document`e ulasmasini da engeller.\n * ⚠ `stopPropagation` ZORUNLU.\n */\n event.stopPropagation();\n onClose();\n break;\n\n case 'Tab':\n /* Kapatir ama varsayilan gezinme SURER. */\n onClose();\n break;\n\n default:\n break;\n }\n },\n [activeIndex, count, hasSpaceSelect, onClose, onSelect],\n );\n\n return { activeIndex, setActiveIndex, listRef, handleKeyDown };\n};\n\nexport default useListboxNavigation;\n"],"names":["useListboxNavigation","count","isOpen","initialIndex","onSelect","onClose","hasSpaceSelect","activeIndex","setActiveIndex","useState","listRef","useRef","useEffect","current","scrollIntoViewIfPossible","_a","handleKeyDown","useCallback","event","lastIndex"],"mappings":";;;AAaA,MAAMA,IAAuB,CAC3B,EAAE,OAAAC,GAAO,QAAAC,GAAQ,cAAAC,IAAe,GAAG,UAAAC,GAAU,SAAAC,EAAA,GAC7C,EAAE,gBAAAC,IAAiB,GAAA,IAAU,CAAA,MACJ;AACzB,QAAM,CAACC,GAAaC,CAAc,IAAIC,EAASN,CAAY,GACrDO,IAAUC,EAAiB,IAAI;AAMrC,EAAAC,EAAU,MAAM;AACd,IAAIV,OAAuBC,CAAY;AAAA,EACzC,GAA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AAa,gBAAAC,GAAgB,SAAAE,GAAS,eAAAM,EAAA;AACjD;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react"),s=require("@handijitcom/utils"),o=require("../helpers/portal.helper.cjs"),c={},a={},i=(t,u,n)=>{const e=t&&s.isClient()?o.resolvePortalTarget(u.current):null,r=(e==null?void 0:e.needsTopLayer)??!1;return l.useEffect(()=>{if(!(!t||!r))return o.showTopLayer(n.current)},[t,r,n]),{container:(e==null?void 0:e.container)??null,attributes:r?{popover:"manual"}:c,style:r?o.POPOVER_RESET:a}};exports.default=i;
|
|
2
|
+
//# sourceMappingURL=usePortalSurface.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePortalSurface.cjs","sources":["../../src/hooks/usePortalSurface.ts"],"sourcesContent":["'use client';\n\nimport { useEffect } from 'react';\n\nimport { isClient } from '@handijitcom/utils';\n\nimport { POPOVER_RESET, resolvePortalTarget, showTopLayer } from '../helpers/portal.helper';\n\n/** Portallanan yüzeye yayılacak nitelik + stil parçaları. */\nexport type PortalSurface = {\n /** `null` iken yüzey ÇİZİLMEZ: hedef yalnızca açıkken ve istemcide çözülür. */\n container: HTMLElement | null;\n /** Üst katman gerekiyorsa `popover=\"manual\"`; gerekmiyorsa boş. */\n attributes: { popover?: 'manual' };\n /** UA'nın `inset: 0` + `margin: auto` çiftini geri alan sıfırlama. */\n style: typeof POPOVER_RESET | Record<string, never>;\n};\n\nconst NO_ATTRIBUTES: { popover?: 'manual' } = {};\nconst NO_STYLE: Record<string, never> = {};\n\n/**\n * ANKRAJLI YÜZEYİN PORTAL SÖZLEŞMESİ — `Menu`, `Popover`, `Tooltip`, `Combobox` ve `Select` için\n * TEK kaynak.\n * ⚠ `position: fixed` TEK BAŞINA \"viewport'a göre konumlan\" demek DEĞİL. `none` olmayan bir\n * `transform`/`translate`/`scale`/`rotate`, bir…\n * ⚠ Bu kancanın varlık sebebi DRY.\n */\nconst usePortalSurface = (\n isOpen: boolean,\n anchorRef: { current: HTMLElement | null },\n surfaceRef: { current: HTMLElement | null },\n): PortalSurface => {\n /*\n * Hedef HER RENDER'DA degil, yalnizca acikken cozulur. `closest` ucuzdur ama tetikleyicinin DOM\n * konumu acilistan sonra degismedigi icin tekrar…\n */\n const target = isOpen && isClient() ? resolvePortalTarget(anchorRef.current) : null;\n const needsTopLayer = target?.needsTopLayer ?? false;\n\n /*\n * ⚠ `popover` niteligi TEK BASINA yetmez: eleman `showPopover()` cagrilana kadar `display: none`\n * kalir.\n */\n useEffect(() => {\n if (!isOpen || !needsTopLayer) return;\n return showTopLayer(surfaceRef.current);\n }, [isOpen, needsTopLayer, surfaceRef]);\n\n return {\n container: target?.container ?? null,\n attributes: needsTopLayer ? { popover: 'manual' } : NO_ATTRIBUTES,\n style: needsTopLayer ? POPOVER_RESET : NO_STYLE,\n };\n};\n\nexport default usePortalSurface;\n"],"names":["NO_ATTRIBUTES","NO_STYLE","usePortalSurface","isOpen","anchorRef","surfaceRef","target","isClient","resolvePortalTarget","needsTopLayer","useEffect","showTopLayer","POPOVER_RESET"],"mappings":"4NAiBMA,EAAwC,CAAA,EACxCC,EAAkC,CAAA,EASlCC,EAAmB,CACvBC,EACAC,EACAC,IACkB,CAKlB,MAAMC,EAASH,GAAUI,EAAAA,SAAA,EAAaC,EAAAA,oBAAoBJ,EAAU,OAAO,EAAI,KACzEK,GAAgBH,GAAA,YAAAA,EAAQ,gBAAiB,GAM/CI,OAAAA,EAAAA,UAAU,IAAM,CACd,GAAI,GAACP,GAAU,CAACM,GAChB,OAAOE,EAAAA,aAAaN,EAAW,OAAO,CACxC,EAAG,CAACF,EAAQM,EAAeJ,CAAU,CAAC,EAE/B,CACL,WAAWC,GAAA,YAAAA,EAAQ,YAAa,KAChC,WAAYG,EAAgB,CAAE,QAAS,UAAaT,EACpD,MAAOS,EAAgBG,gBAAgBX,CAAA,CAE3C"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { POPOVER_RESET } from '../helpers/portal.helper.cjs';
|
|
2
|
+
/** Portallanan yüzeye yayılacak nitelik + stil parçaları. */
|
|
3
|
+
export type PortalSurface = {
|
|
4
|
+
/** `null` iken yüzey ÇİZİLMEZ: hedef yalnızca açıkken ve istemcide çözülür. */
|
|
5
|
+
container: HTMLElement | null;
|
|
6
|
+
/** Üst katman gerekiyorsa `popover="manual"`; gerekmiyorsa boş. */
|
|
7
|
+
attributes: {
|
|
8
|
+
popover?: 'manual';
|
|
9
|
+
};
|
|
10
|
+
/** UA'nın `inset: 0` + `margin: auto` çiftini geri alan sıfırlama. */
|
|
11
|
+
style: typeof POPOVER_RESET | Record<string, never>;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* ANKRAJLI YÜZEYİN PORTAL SÖZLEŞMESİ — `Menu`, `Popover`, `Tooltip`, `Combobox` ve `Select` için
|
|
15
|
+
* TEK kaynak.
|
|
16
|
+
* ⚠ `position: fixed` TEK BAŞINA "viewport'a göre konumlan" demek DEĞİL. `none` olmayan bir
|
|
17
|
+
* `transform`/`translate`/`scale`/`rotate`, bir…
|
|
18
|
+
* ⚠ Bu kancanın varlık sebebi DRY.
|
|
19
|
+
*/
|
|
20
|
+
declare const usePortalSurface: (isOpen: boolean, anchorRef: {
|
|
21
|
+
current: HTMLElement | null;
|
|
22
|
+
}, surfaceRef: {
|
|
23
|
+
current: HTMLElement | null;
|
|
24
|
+
}) => PortalSurface;
|
|
25
|
+
export default usePortalSurface;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { POPOVER_RESET } from '../helpers/portal.helper.js';
|
|
2
|
+
/** Portallanan yüzeye yayılacak nitelik + stil parçaları. */
|
|
3
|
+
export type PortalSurface = {
|
|
4
|
+
/** `null` iken yüzey ÇİZİLMEZ: hedef yalnızca açıkken ve istemcide çözülür. */
|
|
5
|
+
container: HTMLElement | null;
|
|
6
|
+
/** Üst katman gerekiyorsa `popover="manual"`; gerekmiyorsa boş. */
|
|
7
|
+
attributes: {
|
|
8
|
+
popover?: 'manual';
|
|
9
|
+
};
|
|
10
|
+
/** UA'nın `inset: 0` + `margin: auto` çiftini geri alan sıfırlama. */
|
|
11
|
+
style: typeof POPOVER_RESET | Record<string, never>;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* ANKRAJLI YÜZEYİN PORTAL SÖZLEŞMESİ — `Menu`, `Popover`, `Tooltip`, `Combobox` ve `Select` için
|
|
15
|
+
* TEK kaynak.
|
|
16
|
+
* ⚠ `position: fixed` TEK BAŞINA "viewport'a göre konumlan" demek DEĞİL. `none` olmayan bir
|
|
17
|
+
* `transform`/`translate`/`scale`/`rotate`, bir…
|
|
18
|
+
* ⚠ Bu kancanın varlık sebebi DRY.
|
|
19
|
+
*/
|
|
20
|
+
declare const usePortalSurface: (isOpen: boolean, anchorRef: {
|
|
21
|
+
current: HTMLElement | null;
|
|
22
|
+
}, surfaceRef: {
|
|
23
|
+
current: HTMLElement | null;
|
|
24
|
+
}) => PortalSurface;
|
|
25
|
+
export default usePortalSurface;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect as s } from "react";
|
|
3
|
+
import { isClient as l } from "@handijitcom/utils";
|
|
4
|
+
import { resolvePortalTarget as u, showTopLayer as a, POPOVER_RESET as c } from "../helpers/portal.helper.js";
|
|
5
|
+
const T = {}, i = {}, E = (o, n, t) => {
|
|
6
|
+
const r = o && l() ? u(n.current) : null, e = (r == null ? void 0 : r.needsTopLayer) ?? !1;
|
|
7
|
+
return s(() => {
|
|
8
|
+
if (!(!o || !e))
|
|
9
|
+
return a(t.current);
|
|
10
|
+
}, [o, e, t]), {
|
|
11
|
+
container: (r == null ? void 0 : r.container) ?? null,
|
|
12
|
+
attributes: e ? { popover: "manual" } : T,
|
|
13
|
+
style: e ? c : i
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
E as default
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=usePortalSurface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePortalSurface.js","sources":["../../src/hooks/usePortalSurface.ts"],"sourcesContent":["'use client';\n\nimport { useEffect } from 'react';\n\nimport { isClient } from '@handijitcom/utils';\n\nimport { POPOVER_RESET, resolvePortalTarget, showTopLayer } from '../helpers/portal.helper';\n\n/** Portallanan yüzeye yayılacak nitelik + stil parçaları. */\nexport type PortalSurface = {\n /** `null` iken yüzey ÇİZİLMEZ: hedef yalnızca açıkken ve istemcide çözülür. */\n container: HTMLElement | null;\n /** Üst katman gerekiyorsa `popover=\"manual\"`; gerekmiyorsa boş. */\n attributes: { popover?: 'manual' };\n /** UA'nın `inset: 0` + `margin: auto` çiftini geri alan sıfırlama. */\n style: typeof POPOVER_RESET | Record<string, never>;\n};\n\nconst NO_ATTRIBUTES: { popover?: 'manual' } = {};\nconst NO_STYLE: Record<string, never> = {};\n\n/**\n * ANKRAJLI YÜZEYİN PORTAL SÖZLEŞMESİ — `Menu`, `Popover`, `Tooltip`, `Combobox` ve `Select` için\n * TEK kaynak.\n * ⚠ `position: fixed` TEK BAŞINA \"viewport'a göre konumlan\" demek DEĞİL. `none` olmayan bir\n * `transform`/`translate`/`scale`/`rotate`, bir…\n * ⚠ Bu kancanın varlık sebebi DRY.\n */\nconst usePortalSurface = (\n isOpen: boolean,\n anchorRef: { current: HTMLElement | null },\n surfaceRef: { current: HTMLElement | null },\n): PortalSurface => {\n /*\n * Hedef HER RENDER'DA degil, yalnizca acikken cozulur. `closest` ucuzdur ama tetikleyicinin DOM\n * konumu acilistan sonra degismedigi icin tekrar…\n */\n const target = isOpen && isClient() ? resolvePortalTarget(anchorRef.current) : null;\n const needsTopLayer = target?.needsTopLayer ?? false;\n\n /*\n * ⚠ `popover` niteligi TEK BASINA yetmez: eleman `showPopover()` cagrilana kadar `display: none`\n * kalir.\n */\n useEffect(() => {\n if (!isOpen || !needsTopLayer) return;\n return showTopLayer(surfaceRef.current);\n }, [isOpen, needsTopLayer, surfaceRef]);\n\n return {\n container: target?.container ?? null,\n attributes: needsTopLayer ? { popover: 'manual' } : NO_ATTRIBUTES,\n style: needsTopLayer ? POPOVER_RESET : NO_STYLE,\n };\n};\n\nexport default usePortalSurface;\n"],"names":["NO_ATTRIBUTES","NO_STYLE","usePortalSurface","isOpen","anchorRef","surfaceRef","target","isClient","resolvePortalTarget","needsTopLayer","useEffect","showTopLayer","POPOVER_RESET"],"mappings":";;;;AAiBA,MAAMA,IAAwC,CAAA,GACxCC,IAAkC,CAAA,GASlCC,IAAmB,CACvBC,GACAC,GACAC,MACkB;AAKlB,QAAMC,IAASH,KAAUI,EAAA,IAAaC,EAAoBJ,EAAU,OAAO,IAAI,MACzEK,KAAgBH,KAAA,gBAAAA,EAAQ,kBAAiB;AAM/C,SAAAI,EAAU,MAAM;AACd,QAAI,GAACP,KAAU,CAACM;AAChB,aAAOE,EAAaN,EAAW,OAAO;AAAA,EACxC,GAAG,CAACF,GAAQM,GAAeJ,CAAU,CAAC,GAE/B;AAAA,IACL,YAAWC,KAAA,gBAAAA,EAAQ,cAAa;AAAA,IAChC,YAAYG,IAAgB,EAAE,SAAS,aAAaT;AAAA,IACpD,OAAOS,IAAgBG,IAAgBX;AAAA,EAAA;AAE3C;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const m=require("react"),y=require("@handijitcom/utils"),E={top:"bottom",bottom:"top",left:"right",right:"left"},S=(t,o,e)=>e<o?o:Math.min(Math.max(t,o),e),b=(t,o,e,s,n)=>{const r=e==="top"||e==="bottom",v={top:t.top-o.height-n,bottom:t.top+t.height+n,left:t.left-o.width-n,right:t.left+t.width+n}[e],a=r?t.left:t.top,f=r?t.width:t.height,u=r?o.width:o.height,w={start:a,center:a+f/2-u/2,end:a+f-u}[s];return r?{top:v,left:w}:{top:w,left:v}},z=(t,o,e,s,n)=>({top:t.top>=s,bottom:t.top+o.height<=n.height-s,left:t.left>=s,right:t.left+o.width<=n.width-s})[e],M=(t,o,{side:e="top",align:s="center",offset:n=8,padding:r=8,isOpen:v})=>{const[a,f]=m.useState({style:{position:"fixed",top:0,left:0},side:e,anchorWidth:0,isPositioned:!1}),u=m.useRef(0),w=m.useCallback(()=>{const l=t.current,p=o.current;if(!l||!p)return;const h=l.getBoundingClientRect(),i=p.getBoundingClientRect(),d={width:window.innerWidth,height:window.innerHeight},P=b(h,i,e,s,n),L=z(P,i,e,r,d)?e:z(b(h,i,E[e],s,n),i,E[e],r,d)?E[e]:e,g=b(h,i,L,s,n);f({style:{position:"fixed",top:Math.round(S(g.top,r,d.height-i.height-r)),left:Math.round(S(g.left,r,d.width-i.width-r))},side:L,anchorWidth:h.width,isPositioned:!0})},[t,o,e,s,n,r]),c=m.useCallback(()=>{u.current||(u.current=window.requestAnimationFrame(()=>{u.current=0,w()}))},[w]);return(y.isClient()?m.useLayoutEffect:m.useEffect)(()=>{var p,h;if(!v){f(i=>i.isPositioned?{...i,isPositioned:!1}:i);return}w(),window.addEventListener("resize",c),(p=window.visualViewport)==null||p.addEventListener("resize",c),(h=window.visualViewport)==null||h.addEventListener("scroll",c),document.addEventListener("scroll",c,!0);const l=typeof ResizeObserver>"u"?null:new ResizeObserver(c);return l&&o.current&&l.observe(o.current),l&&t.current instanceof Element&&l.observe(t.current),()=>{var i,d;window.removeEventListener("resize",c),(i=window.visualViewport)==null||i.removeEventListener("resize",c),(d=window.visualViewport)==null||d.removeEventListener("scroll",c),document.removeEventListener("scroll",c,!0),l==null||l.disconnect(),u.current&&(window.cancelAnimationFrame(u.current),u.current=0)}},[v,w,c,t,o]),a};exports.default=M;
|
|
2
|
+
//# sourceMappingURL=usePositioning.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePositioning.cjs","sources":["../../src/hooks/usePositioning.ts"],"sourcesContent":["'use client';\n\nimport { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';\n\nimport { isClient } from '@handijitcom/utils';\nimport {\n PositionAlign,\n PositionSide,\n PositioningOptions,\n PositioningRect,\n PositioningState,\n} from '@/types/positioning.type';\n\nconst OPPOSITE: Record<PositionSide, PositionSide> = {\n top: 'bottom',\n bottom: 'top',\n left: 'right',\n right: 'left',\n};\n\n/** Bir sayıyı [min, max] aralığına kırpar. */\n/**\n * Değeri aralığa sıkıştırır. Aralık geçersizse `min` kazanır: yüzey kenara yaslanır ve aşağı doğru\n * taşar.\n * ⚠ TERS ARALIK GÜVENLİ.\n */\nconst clamp = (value: number, min: number, max: number): number =>\n max < min ? min : Math.min(Math.max(value, min), max);\n\n/** Verilen kenarda yüzeyin sol-üst köşesi nereye düşer. */\nconst place = (\n anchor: PositioningRect,\n surface: { width: number; height: number },\n side: PositionSide,\n align: PositionAlign,\n offset: number,\n): { top: number; left: number } => {\n const isVertical = side === 'top' || side === 'bottom';\n\n /* Ana eksen: tetikleyicinin disinda, `offset` kadar uzakta. */\n const main = {\n top: anchor.top - surface.height - offset,\n bottom: anchor.top + anchor.height + offset,\n left: anchor.left - surface.width - offset,\n right: anchor.left + anchor.width + offset,\n }[side];\n\n /* Capraz eksen: hizalama. */\n const crossStart = isVertical ? anchor.left : anchor.top;\n const crossSize = isVertical ? anchor.width : anchor.height;\n const surfaceSize = isVertical ? surface.width : surface.height;\n\n const cross = {\n start: crossStart,\n center: crossStart + crossSize / 2 - surfaceSize / 2,\n end: crossStart + crossSize - surfaceSize,\n }[align];\n\n return isVertical ? { top: main, left: cross } : { top: cross, left: main };\n};\n\n/** Yüzey görünüm alanına sığıyor mu (yalnızca ana eksende). */\nconst fits = (\n position: { top: number; left: number },\n surface: { width: number; height: number },\n side: PositionSide,\n padding: number,\n viewport: { width: number; height: number },\n): boolean =>\n ({\n top: position.top >= padding,\n bottom: position.top + surface.height <= viewport.height - padding,\n left: position.left >= padding,\n right: position.left + surface.width <= viewport.width - padding,\n })[side];\n\n/**\n * ÇARPIŞMAYA DUYARLI KONUMLANDIRMA — `Tooltip`, `Popover`, `Menu` ve açılır listelerin ortak\n * temeli.\n */\nconst usePositioning = (\n /*\n * Capa yalniz OLCULUR: bir DOM ogesi (tetikleyici) ya da ogesi olmayan bir nokta (`ContextMenu`\n * imlec konumu — `{ getBoundingClientRect }`, 0×0 dikdortgen).\n */\n anchorRef: { current: { getBoundingClientRect: () => PositioningRect } | null },\n surfaceRef: { current: HTMLElement | null },\n { side = 'top', align = 'center', offset = 8, padding = 8, isOpen }: PositioningOptions,\n): PositioningState => {\n const [state, setState] = useState<PositioningState>({\n style: { position: 'fixed', top: 0, left: 0 },\n side,\n anchorWidth: 0,\n isPositioned: false,\n });\n\n /*\n * Olcum her karede yeniden planlanmasin: kaydirma sirasinda saniyede onlarca olay dusuyor ve her\n * biri bir yerlesim okumasi.\n */\n const frameRef = useRef(0);\n\n const measure = useCallback(() => {\n const anchor = anchorRef.current;\n const surface = surfaceRef.current;\n if (!anchor || !surface) return;\n\n const anchorRect = anchor.getBoundingClientRect();\n const surfaceRect = surface.getBoundingClientRect();\n const viewport = { width: window.innerWidth, height: window.innerHeight };\n\n /*\n * KENAR SECIMI: tercih edilen kenar sigmiyorsa KARSITI denenir; o da sigmiyorsa tercih edilene\n * donulur ve kirpma devreye girer.\n */\n const preferred = place(anchorRect, surfaceRect, side, align, offset);\n const resolvedSide = fits(preferred, surfaceRect, side, padding, viewport)\n ? side\n : fits(\n place(anchorRect, surfaceRect, OPPOSITE[side], align, offset),\n surfaceRect,\n OPPOSITE[side],\n padding,\n viewport,\n )\n ? OPPOSITE[side]\n : side;\n\n const placed = place(anchorRect, surfaceRect, resolvedSide, align, offset);\n\n /*\n * Capraz eksende KIRPMA: ekranin sag ucundaki bir tetikleyicinin balonu disari tasmak yerine\n * kenara yaslanir.\n */\n setState({\n style: {\n position: 'fixed',\n top: Math.round(clamp(placed.top, padding, viewport.height - surfaceRect.height - padding)),\n left: Math.round(clamp(placed.left, padding, viewport.width - surfaceRect.width - padding)),\n },\n side: resolvedSide,\n anchorWidth: anchorRect.width,\n isPositioned: true,\n });\n }, [anchorRef, surfaceRef, side, align, offset, padding]);\n\n const schedule = useCallback(() => {\n if (frameRef.current) return;\n frameRef.current = window.requestAnimationFrame(() => {\n frameRef.current = 0;\n measure();\n });\n }, [measure]);\n\n /*\n * `useLayoutEffect`: olcum BOYAMADAN once yapilmali. `useEffect` ile yuzey bir kare boyunca (0,\n * 0) noktasinda — ekranin sol ust kosesinde\n */\n const useIsomorphicLayoutEffect = isClient() ? useLayoutEffect : useEffect;\n\n useIsomorphicLayoutEffect(() => {\n if (!isOpen) {\n setState(current => (current.isPositioned ? { ...current, isPositioned: false } : current));\n return;\n }\n\n measure();\n\n window.addEventListener('resize', schedule);\n\n /* ⚠ `visualViewport` AYRICA dinlenir. */\n window.visualViewport?.addEventListener('resize', schedule);\n window.visualViewport?.addEventListener('scroll', schedule);\n /*\n * `capture: true` — kaydirma olayi BALONCUKLANMAZ; yakalama evresinde dinlemek, tetikleyicinin\n * kaydirilan HER atasini tek dinleyiciyle kapsar.\n */\n document.addEventListener('scroll', schedule, true);\n\n /*\n * Yuzeyin kendi olcusu degisebiliyor (icerik geldi, liste suzuldu) ve degistiginde konum yanlis\n * kalir.\n */\n const observer = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(schedule);\n if (observer && surfaceRef.current) observer.observe(surfaceRef.current);\n /* `observe` oge ister: nokta capasi `TypeError` firlatirdi (boyutu da hic degismez). */\n if (observer && anchorRef.current instanceof Element) observer.observe(anchorRef.current);\n\n return () => {\n window.removeEventListener('resize', schedule);\n window.visualViewport?.removeEventListener('resize', schedule);\n window.visualViewport?.removeEventListener('scroll', schedule);\n document.removeEventListener('scroll', schedule, true);\n observer?.disconnect();\n\n if (frameRef.current) {\n window.cancelAnimationFrame(frameRef.current);\n frameRef.current = 0;\n }\n };\n }, [isOpen, measure, schedule, anchorRef, surfaceRef]);\n\n return state;\n};\n\nexport default usePositioning;\n"],"names":["OPPOSITE","clamp","value","min","max","place","anchor","surface","side","align","offset","isVertical","main","crossStart","crossSize","surfaceSize","cross","fits","position","padding","viewport","usePositioning","anchorRef","surfaceRef","isOpen","state","setState","useState","frameRef","useRef","measure","useCallback","anchorRect","surfaceRect","preferred","resolvedSide","placed","schedule","isClient","useLayoutEffect","useEffect","current","_a","_b","observer"],"mappings":"kLAYMA,EAA+C,CACnD,IAAK,SACL,OAAQ,MACR,KAAM,QACN,MAAO,MACT,EAQMC,EAAQ,CAACC,EAAeC,EAAaC,IACzCA,EAAMD,EAAMA,EAAM,KAAK,IAAI,KAAK,IAAID,EAAOC,CAAG,EAAGC,CAAG,EAGhDC,EAAQ,CACZC,EACAC,EACAC,EACAC,EACAC,IACkC,CAClC,MAAMC,EAAaH,IAAS,OAASA,IAAS,SAGxCI,EAAO,CACX,IAAKN,EAAO,IAAMC,EAAQ,OAASG,EACnC,OAAQJ,EAAO,IAAMA,EAAO,OAASI,EACrC,KAAMJ,EAAO,KAAOC,EAAQ,MAAQG,EACpC,MAAOJ,EAAO,KAAOA,EAAO,MAAQI,CAAA,EACpCF,CAAI,EAGAK,EAAaF,EAAaL,EAAO,KAAOA,EAAO,IAC/CQ,EAAYH,EAAaL,EAAO,MAAQA,EAAO,OAC/CS,EAAcJ,EAAaJ,EAAQ,MAAQA,EAAQ,OAEnDS,EAAQ,CACZ,MAAOH,EACP,OAAQA,EAAaC,EAAY,EAAIC,EAAc,EACnD,IAAKF,EAAaC,EAAYC,CAAA,EAC9BN,CAAK,EAEP,OAAOE,EAAa,CAAE,IAAKC,EAAM,KAAMI,CAAA,EAAU,CAAE,IAAKA,EAAO,KAAMJ,CAAA,CACvE,EAGMK,EAAO,CACXC,EACAX,EACAC,EACAW,EACAC,KAEC,CACC,IAAKF,EAAS,KAAOC,EACrB,OAAQD,EAAS,IAAMX,EAAQ,QAAUa,EAAS,OAASD,EAC3D,KAAMD,E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,0 +1,13 @@
|
|
|
1
|
+
import { PositioningOptions, PositioningRect, PositioningState } from '../types/positioning.type.cjs';
|
|
2
|
+
/**
|
|
3
|
+
* ÇARPIŞMAYA DUYARLI KONUMLANDIRMA — `Tooltip`, `Popover`, `Menu` ve açılır listelerin ortak
|
|
4
|
+
* temeli.
|
|
5
|
+
*/
|
|
6
|
+
declare const usePositioning: (anchorRef: {
|
|
7
|
+
current: {
|
|
8
|
+
getBoundingClientRect: () => PositioningRect;
|
|
9
|
+
} | null;
|
|
10
|
+
}, surfaceRef: {
|
|
11
|
+
current: HTMLElement | null;
|
|
12
|
+
}, { side, align, offset, padding, isOpen }: PositioningOptions) => PositioningState;
|
|
13
|
+
export default usePositioning;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PositioningOptions, PositioningRect, PositioningState } from '../types/positioning.type.js';
|
|
2
|
+
/**
|
|
3
|
+
* ÇARPIŞMAYA DUYARLI KONUMLANDIRMA — `Tooltip`, `Popover`, `Menu` ve açılır listelerin ortak
|
|
4
|
+
* temeli.
|
|
5
|
+
*/
|
|
6
|
+
declare const usePositioning: (anchorRef: {
|
|
7
|
+
current: {
|
|
8
|
+
getBoundingClientRect: () => PositioningRect;
|
|
9
|
+
} | null;
|
|
10
|
+
}, surfaceRef: {
|
|
11
|
+
current: HTMLElement | null;
|
|
12
|
+
}, { side, align, offset, padding, isOpen }: PositioningOptions) => PositioningState;
|
|
13
|
+
export default usePositioning;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useState as y, useRef as V, useCallback as z, useLayoutEffect as C, useEffect as M } from "react";
|
|
3
|
+
import { isClient as x } from "@handijitcom/utils";
|
|
4
|
+
const E = {
|
|
5
|
+
top: "bottom",
|
|
6
|
+
bottom: "top",
|
|
7
|
+
left: "right",
|
|
8
|
+
right: "left"
|
|
9
|
+
}, g = (t, o, e) => e < o ? o : Math.min(Math.max(t, o), e), a = (t, o, e, s, n) => {
|
|
10
|
+
const r = e === "top" || e === "bottom", m = {
|
|
11
|
+
top: t.top - o.height - n,
|
|
12
|
+
bottom: t.top + t.height + n,
|
|
13
|
+
left: t.left - o.width - n,
|
|
14
|
+
right: t.left + t.width + n
|
|
15
|
+
}[e], v = r ? t.left : t.top, p = r ? t.width : t.height, u = r ? o.width : o.height, w = {
|
|
16
|
+
start: v,
|
|
17
|
+
center: v + p / 2 - u / 2,
|
|
18
|
+
end: v + p - u
|
|
19
|
+
}[s];
|
|
20
|
+
return r ? { top: m, left: w } : { top: w, left: m };
|
|
21
|
+
}, P = (t, o, e, s, n) => ({
|
|
22
|
+
top: t.top >= s,
|
|
23
|
+
bottom: t.top + o.height <= n.height - s,
|
|
24
|
+
left: t.left >= s,
|
|
25
|
+
right: t.left + o.width <= n.width - s
|
|
26
|
+
})[e], A = (t, o, { side: e = "top", align: s = "center", offset: n = 8, padding: r = 8, isOpen: m }) => {
|
|
27
|
+
const [v, p] = y({
|
|
28
|
+
style: { position: "fixed", top: 0, left: 0 },
|
|
29
|
+
side: e,
|
|
30
|
+
anchorWidth: 0,
|
|
31
|
+
isPositioned: !1
|
|
32
|
+
}), u = V(0), w = z(() => {
|
|
33
|
+
const l = t.current, f = o.current;
|
|
34
|
+
if (!l || !f) return;
|
|
35
|
+
const h = l.getBoundingClientRect(), i = f.getBoundingClientRect(), d = { width: window.innerWidth, height: window.innerHeight }, S = a(h, i, e, s, n), L = P(S, i, e, r, d) ? e : P(
|
|
36
|
+
a(h, i, E[e], s, n),
|
|
37
|
+
i,
|
|
38
|
+
E[e],
|
|
39
|
+
r,
|
|
40
|
+
d
|
|
41
|
+
) ? E[e] : e, b = a(h, i, L, s, n);
|
|
42
|
+
p({
|
|
43
|
+
style: {
|
|
44
|
+
position: "fixed",
|
|
45
|
+
top: Math.round(g(b.top, r, d.height - i.height - r)),
|
|
46
|
+
left: Math.round(g(b.left, r, d.width - i.width - r))
|
|
47
|
+
},
|
|
48
|
+
side: L,
|
|
49
|
+
anchorWidth: h.width,
|
|
50
|
+
isPositioned: !0
|
|
51
|
+
});
|
|
52
|
+
}, [t, o, e, s, n, r]), c = z(() => {
|
|
53
|
+
u.current || (u.current = window.requestAnimationFrame(() => {
|
|
54
|
+
u.current = 0, w();
|
|
55
|
+
}));
|
|
56
|
+
}, [w]);
|
|
57
|
+
return (x() ? C : M)(() => {
|
|
58
|
+
var f, h;
|
|
59
|
+
if (!m) {
|
|
60
|
+
p((i) => i.isPositioned ? { ...i, isPositioned: !1 } : i);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
w(), window.addEventListener("resize", c), (f = window.visualViewport) == null || f.addEventListener("resize", c), (h = window.visualViewport) == null || h.addEventListener("scroll", c), document.addEventListener("scroll", c, !0);
|
|
64
|
+
const l = typeof ResizeObserver > "u" ? null : new ResizeObserver(c);
|
|
65
|
+
return l && o.current && l.observe(o.current), l && t.current instanceof Element && l.observe(t.current), () => {
|
|
66
|
+
var i, d;
|
|
67
|
+
window.removeEventListener("resize", c), (i = window.visualViewport) == null || i.removeEventListener("resize", c), (d = window.visualViewport) == null || d.removeEventListener("scroll", c), document.removeEventListener("scroll", c, !0), l == null || l.disconnect(), u.current && (window.cancelAnimationFrame(u.current), u.current = 0);
|
|
68
|
+
};
|
|
69
|
+
}, [m, w, c, t, o]), v;
|
|
70
|
+
};
|
|
71
|
+
export {
|
|
72
|
+
A as default
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=usePositioning.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePositioning.js","sources":["../../src/hooks/usePositioning.ts"],"sourcesContent":["'use client';\n\nimport { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';\n\nimport { isClient } from '@handijitcom/utils';\nimport {\n PositionAlign,\n PositionSide,\n PositioningOptions,\n PositioningRect,\n PositioningState,\n} from '@/types/positioning.type';\n\nconst OPPOSITE: Record<PositionSide, PositionSide> = {\n top: 'bottom',\n bottom: 'top',\n left: 'right',\n right: 'left',\n};\n\n/** Bir sayıyı [min, max] aralığına kırpar. */\n/**\n * Değeri aralığa sıkıştırır. Aralık geçersizse `min` kazanır: yüzey kenara yaslanır ve aşağı doğru\n * taşar.\n * ⚠ TERS ARALIK GÜVENLİ.\n */\nconst clamp = (value: number, min: number, max: number): number =>\n max < min ? min : Math.min(Math.max(value, min), max);\n\n/** Verilen kenarda yüzeyin sol-üst köşesi nereye düşer. */\nconst place = (\n anchor: PositioningRect,\n surface: { width: number; height: number },\n side: PositionSide,\n align: PositionAlign,\n offset: number,\n): { top: number; left: number } => {\n const isVertical = side === 'top' || side === 'bottom';\n\n /* Ana eksen: tetikleyicinin disinda, `offset` kadar uzakta. */\n const main = {\n top: anchor.top - surface.height - offset,\n bottom: anchor.top + anchor.height + offset,\n left: anchor.left - surface.width - offset,\n right: anchor.left + anchor.width + offset,\n }[side];\n\n /* Capraz eksen: hizalama. */\n const crossStart = isVertical ? anchor.left : anchor.top;\n const crossSize = isVertical ? anchor.width : anchor.height;\n const surfaceSize = isVertical ? surface.width : surface.height;\n\n const cross = {\n start: crossStart,\n center: crossStart + crossSize / 2 - surfaceSize / 2,\n end: crossStart + crossSize - surfaceSize,\n }[align];\n\n return isVertical ? { top: main, left: cross } : { top: cross, left: main };\n};\n\n/** Yüzey görünüm alanına sığıyor mu (yalnızca ana eksende). */\nconst fits = (\n position: { top: number; left: number },\n surface: { width: number; height: number },\n side: PositionSide,\n padding: number,\n viewport: { width: number; height: number },\n): boolean =>\n ({\n top: position.top >= padding,\n bottom: position.top + surface.height <= viewport.height - padding,\n left: position.left >= padding,\n right: position.left + surface.width <= viewport.width - padding,\n })[side];\n\n/**\n * ÇARPIŞMAYA DUYARLI KONUMLANDIRMA — `Tooltip`, `Popover`, `Menu` ve açılır listelerin ortak\n * temeli.\n */\nconst usePositioning = (\n /*\n * Capa yalniz OLCULUR: bir DOM ogesi (tetikleyici) ya da ogesi olmayan bir nokta (`ContextMenu`\n * imlec konumu — `{ getBoundingClientRect }`, 0×0 dikdortgen).\n */\n anchorRef: { current: { getBoundingClientRect: () => PositioningRect } | null },\n surfaceRef: { current: HTMLElement | null },\n { side = 'top', align = 'center', offset = 8, padding = 8, isOpen }: PositioningOptions,\n): PositioningState => {\n const [state, setState] = useState<PositioningState>({\n style: { position: 'fixed', top: 0, left: 0 },\n side,\n anchorWidth: 0,\n isPositioned: false,\n });\n\n /*\n * Olcum her karede yeniden planlanmasin: kaydirma sirasinda saniyede onlarca olay dusuyor ve her\n * biri bir yerlesim okumasi.\n */\n const frameRef = useRef(0);\n\n const measure = useCallback(() => {\n const anchor = anchorRef.current;\n const surface = surfaceRef.current;\n if (!anchor || !surface) return;\n\n const anchorRect = anchor.getBoundingClientRect();\n const surfaceRect = surface.getBoundingClientRect();\n const viewport = { width: window.innerWidth, height: window.innerHeight };\n\n /*\n * KENAR SECIMI: tercih edilen kenar sigmiyorsa KARSITI denenir; o da sigmiyorsa tercih edilene\n * donulur ve kirpma devreye girer.\n */\n const preferred = place(anchorRect, surfaceRect, side, align, offset);\n const resolvedSide = fits(preferred, surfaceRect, side, padding, viewport)\n ? side\n : fits(\n place(anchorRect, surfaceRect, OPPOSITE[side], align, offset),\n surfaceRect,\n OPPOSITE[side],\n padding,\n viewport,\n )\n ? OPPOSITE[side]\n : side;\n\n const placed = place(anchorRect, surfaceRect, resolvedSide, align, offset);\n\n /*\n * Capraz eksende KIRPMA: ekranin sag ucundaki bir tetikleyicinin balonu disari tasmak yerine\n * kenara yaslanir.\n */\n setState({\n style: {\n position: 'fixed',\n top: Math.round(clamp(placed.top, padding, viewport.height - surfaceRect.height - padding)),\n left: Math.round(clamp(placed.left, padding, viewport.width - surfaceRect.width - padding)),\n },\n side: resolvedSide,\n anchorWidth: anchorRect.width,\n isPositioned: true,\n });\n }, [anchorRef, surfaceRef, side, align, offset, padding]);\n\n const schedule = useCallback(() => {\n if (frameRef.current) return;\n frameRef.current = window.requestAnimationFrame(() => {\n frameRef.current = 0;\n measure();\n });\n }, [measure]);\n\n /*\n * `useLayoutEffect`: olcum BOYAMADAN once yapilmali. `useEffect` ile yuzey bir kare boyunca (0,\n * 0) noktasinda — ekranin sol ust kosesinde\n */\n const useIsomorphicLayoutEffect = isClient() ? useLayoutEffect : useEffect;\n\n useIsomorphicLayoutEffect(() => {\n if (!isOpen) {\n setState(current => (current.isPositioned ? { ...current, isPositioned: false } : current));\n return;\n }\n\n measure();\n\n window.addEventListener('resize', schedule);\n\n /* ⚠ `visualViewport` AYRICA dinlenir. */\n window.visualViewport?.addEventListener('resize', schedule);\n window.visualViewport?.addEventListener('scroll', schedule);\n /*\n * `capture: true` — kaydirma olayi BALONCUKLANMAZ; yakalama evresinde dinlemek, tetikleyicinin\n * kaydirilan HER atasini tek dinleyiciyle kapsar.\n */\n document.addEventListener('scroll', schedule, true);\n\n /*\n * Yuzeyin kendi olcusu degisebiliyor (icerik geldi, liste suzuldu) ve degistiginde konum yanlis\n * kalir.\n */\n const observer = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(schedule);\n if (observer && surfaceRef.current) observer.observe(surfaceRef.current);\n /* `observe` oge ister: nokta capasi `TypeError` firlatirdi (boyutu da hic degismez). */\n if (observer && anchorRef.current instanceof Element) observer.observe(anchorRef.current);\n\n return () => {\n window.removeEventListener('resize', schedule);\n window.visualViewport?.removeEventListener('resize', schedule);\n window.visualViewport?.removeEventListener('scroll', schedule);\n document.removeEventListener('scroll', schedule, true);\n observer?.disconnect();\n\n if (frameRef.current) {\n window.cancelAnimationFrame(frameRef.current);\n frameRef.current = 0;\n }\n };\n }, [isOpen, measure, schedule, anchorRef, surfaceRef]);\n\n return state;\n};\n\nexport default usePositioning;\n"],"names":["OPPOSITE","clamp","value","min","max","place","anchor","surface","side","align","offset","isVertical","main","crossStart","crossSize","surfaceSize","cross","fits","position","padding","viewport","usePositioning","anchorRef","surfaceRef","isOpen","state","setState","useState","frameRef","useRef","measure","useCallback","anchorRect","surfaceRect","preferred","resolvedSide","placed","schedule","isClient","useLayoutEffect","useEffect","current","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0,0 +1,2 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("react");let o=0,e=null;const r=()=>{if(typeof navigator>"u")return!1;const t=navigator.userAgent;return/iP(hone|ad|od)/.test(t)?!0:/Macintosh/.test(t)&&navigator.maxTouchPoints>1},d=()=>{if(o+=1,o>1)return;const{body:t,style:l}={body:document.body,style:document.documentElement.style},n=window.scrollY;e={overflow:t.style.overflow,position:t.style.position,top:t.style.top,width:t.style.width,paddingRight:t.style.paddingRight,scrollY:n};const s=window.innerWidth-document.documentElement.clientWidth;s>0&&(t.style.paddingRight=`${s}px`),l.setProperty("scrollbar-gutter","stable"),t.style.overflow="hidden",r()&&(t.style.position="fixed",t.style.top=`${-n}px`,t.style.width="100%")},u=()=>{if(o=Math.max(0,o-1),o>0||!e)return;const{body:t}=document,{scrollY:l}=e;t.style.overflow=e.overflow,t.style.position=e.position,t.style.top=e.top,t.style.width=e.width,t.style.paddingRight=e.paddingRight,document.documentElement.style.removeProperty("scrollbar-gutter"),e=null,window.scrollTo(0,l)},c=(t=!0)=>{i.useEffect(()=>{if(t)return d(),u},[t])};exports.default=c;
|
|
2
|
+
//# sourceMappingURL=useScrollLock.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useScrollLock.cjs","sources":["../../src/hooks/useScrollLock.ts"],"sourcesContent":["'use client';\n\nimport { useEffect } from 'react';\n\n/**\n * SAYFA KAYDIRMA KİLİDİ — sayaçlı, tek yerde.\n * @param isLocked Kilit bu örnek için etkin mi.\n */\n\n/* Kac tane acik panel var. */\nlet lockCount = 0;\n\n/** Kilit yazılmadan önceki hâl — SON kapanışta buradan geri yüklenir. */\nlet previous: {\n overflow: string;\n position: string;\n top: string;\n width: string;\n paddingRight: string;\n scrollY: number;\n} | null = null;\n\n/**\n * iOS Safari mi? `userAgent` üzerinden Apple dokunmatik cihazı testi hem kaldırılmamış hem daha\n * dar: iPadOS 13+ masaüstü UA'sı gönderdiği için…\n * ⚠ `navigator.platform` KULLANILMAZ — spesifikasyondan KALDIRILDI ve tarayıcılar onu\n * dondurulmuş/uydurma değerlerle döndürüyor.\n */\nconst isIOS = (): boolean => {\n if (typeof navigator === 'undefined') return false;\n\n const ua = navigator.userAgent;\n if (/iP(hone|ad|od)/.test(ua)) return true;\n\n /* iPadOS 13+ kendini masaüstü Safari gibi tanıtıyor. */\n return /Macintosh/.test(ua) && navigator.maxTouchPoints > 1;\n};\n\nconst lock = (): void => {\n lockCount += 1;\n if (lockCount > 1) return;\n\n const { body, style: rootStyle } = { body: document.body, style: document.documentElement.style };\n const scrollY = window.scrollY;\n\n previous = {\n overflow: body.style.overflow,\n position: body.style.position,\n top: body.style.top,\n width: body.style.width,\n paddingRight: body.style.paddingRight,\n scrollY,\n };\n\n /* Cubugun genisligi: `scrollbar-gutter` desteklenmiyorsa dolgu olarak yazilir. */\n const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;\n if (scrollbarWidth > 0) body.style.paddingRight = `${scrollbarWidth}px`;\n\n rootStyle.setProperty('scrollbar-gutter', 'stable');\n body.style.overflow = 'hidden';\n\n if (isIOS()) {\n body.style.position = 'fixed';\n body.style.top = `${-scrollY}px`;\n body.style.width = '100%';\n }\n};\n\nconst unlock = (): void => {\n lockCount = Math.max(0, lockCount - 1);\n if (lockCount > 0 || !previous) return;\n\n const { body } = document;\n const { scrollY } = previous;\n\n body.style.overflow = previous.overflow;\n body.style.position = previous.position;\n body.style.top = previous.top;\n body.style.width = previous.width;\n body.style.paddingRight = previous.paddingRight;\n document.documentElement.style.removeProperty('scrollbar-gutter');\n\n previous = null;\n\n /*\n * Govde sabitlenmisken kaydirma konumu sifirlaniyor; geri yazilmazsa kullanici pencereyi\n * kapattiginda sayfanin en basina duser.\n */\n window.scrollTo(0, scrollY);\n};\n\nconst useScrollLock = (isLocked = true): void => {\n useEffect(() => {\n if (!isLocked) return;\n\n lock();\n return unlock;\n }, [isLocked]);\n};\n\nexport default useScrollLock;\n"],"names":["lockCount","previous","isIOS","ua","lock","body","rootStyle","scrollY","scrollbarWidth","unlock","useScrollLock","isLocked","useEffect"],"mappings":"kJASA,IAAIA,EAAY,EAGZC,EAOO,KAQX,MAAMC,EAAQ,IAAe,CAC3B,GAAI,OAAO,UAAc,IAAa,MAAO,GAE7C,MAAMC,EAAK,UAAU,UACrB,MAAI,iBAAiB,KAAKA,CAAE,EAAU,GAG/B,YAAY,KAAKA,CAAE,GAAK,UAAU,eAAiB,CAC5D,EAEMC,EAAO,IAAY,CAEvB,GADAJ,GAAa,EACTA,EAAY,EAAG,OAEnB,KAAM,CAAE,KAAAK,EAAM,MAAOC,CAAA,EAAc,CAAE,KAAM,SAAS,KAAM,MAAO,SAAS,gBAAgB,KAAA,EACpFC,EAAU,OAAO,QAEvBN,EAAW,CACT,SAAUI,EAAK,MAAM,SACrB,SAAUA,EAAK,MAAM,SACrB,IAAKA,EAAK,MAAM,IAChB,MAAOA,EAAK,MAAM,MAClB,aAAcA,EAAK,MAAM,aACzB,QAAAE,CAAA,EAIF,MAAMC,EAAiB,OAAO,WAAa,SAAS,gBAAgB,YAChEA,EAAiB,IAAGH,EAAK,MAAM,aAAe,GAAGG,CAAc,MAEnEF,EAAU,YAAY,mBAAoB,QAAQ,EAClDD,EAAK,MAAM,SAAW,SAElBH,MACFG,EAAK,MAAM,SAAW,QACtBA,EAAK,MAAM,IAAM,GAAG,CAACE,CAAO,KAC5BF,EAAK,MAAM,MAAQ,OAEvB,EAEMI,EAAS,IAAY,CAEzB,GADAT,EAAY,KAAK,IAAI,EAAGA,EAAY,CAAC,EACjCA,EAAY,GAAK,CAACC,EAAU,OAEhC,KAAM,CAAE,KAAAI,GAAS,SACX,CAAE,QAAAE,GAAYN,EAEpBI,EAAK,MAAM,SAAWJ,EAAS,SAC/BI,EAAK,MAAM,SAAWJ,EAAS,SAC/BI,EAAK,MAAM,IAAMJ,EAAS,IAC1BI,EAAK,MAAM,MAAQJ,EAAS,MAC5BI,EAAK,MAAM,aAAeJ,EAAS,aACnC,SAAS,gBAAgB,MAAM,eAAe,kBAAkB,EAEhEA,EAAW,KAMX,OAAO,SAAS,EAAGM,CAAO,CAC5B,EAEMG,EAAgB,CAACC,EAAW,KAAe,CAC/CC,EAAAA,UAAU,IAAM,CACd,GAAKD,EAEL,OAAAP,EAAA,EACOK,CACT,EAAG,CAACE,CAAQ,CAAC,CACf"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect as i } from "react";
|
|
3
|
+
let e = 0, o = null;
|
|
4
|
+
const r = () => {
|
|
5
|
+
if (typeof navigator > "u") return !1;
|
|
6
|
+
const t = navigator.userAgent;
|
|
7
|
+
return /iP(hone|ad|od)/.test(t) ? !0 : /Macintosh/.test(t) && navigator.maxTouchPoints > 1;
|
|
8
|
+
}, d = () => {
|
|
9
|
+
if (e += 1, e > 1) return;
|
|
10
|
+
const { body: t, style: n } = { body: document.body, style: document.documentElement.style }, l = window.scrollY;
|
|
11
|
+
o = {
|
|
12
|
+
overflow: t.style.overflow,
|
|
13
|
+
position: t.style.position,
|
|
14
|
+
top: t.style.top,
|
|
15
|
+
width: t.style.width,
|
|
16
|
+
paddingRight: t.style.paddingRight,
|
|
17
|
+
scrollY: l
|
|
18
|
+
};
|
|
19
|
+
const s = window.innerWidth - document.documentElement.clientWidth;
|
|
20
|
+
s > 0 && (t.style.paddingRight = `${s}px`), n.setProperty("scrollbar-gutter", "stable"), t.style.overflow = "hidden", r() && (t.style.position = "fixed", t.style.top = `${-l}px`, t.style.width = "100%");
|
|
21
|
+
}, c = () => {
|
|
22
|
+
if (e = Math.max(0, e - 1), e > 0 || !o) return;
|
|
23
|
+
const { body: t } = document, { scrollY: n } = o;
|
|
24
|
+
t.style.overflow = o.overflow, t.style.position = o.position, t.style.top = o.top, t.style.width = o.width, t.style.paddingRight = o.paddingRight, document.documentElement.style.removeProperty("scrollbar-gutter"), o = null, window.scrollTo(0, n);
|
|
25
|
+
}, y = (t = !0) => {
|
|
26
|
+
i(() => {
|
|
27
|
+
if (t)
|
|
28
|
+
return d(), c;
|
|
29
|
+
}, [t]);
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
y as default
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=useScrollLock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useScrollLock.js","sources":["../../src/hooks/useScrollLock.ts"],"sourcesContent":["'use client';\n\nimport { useEffect } from 'react';\n\n/**\n * SAYFA KAYDIRMA KİLİDİ — sayaçlı, tek yerde.\n * @param isLocked Kilit bu örnek için etkin mi.\n */\n\n/* Kac tane acik panel var. */\nlet lockCount = 0;\n\n/** Kilit yazılmadan önceki hâl — SON kapanışta buradan geri yüklenir. */\nlet previous: {\n overflow: string;\n position: string;\n top: string;\n width: string;\n paddingRight: string;\n scrollY: number;\n} | null = null;\n\n/**\n * iOS Safari mi? `userAgent` üzerinden Apple dokunmatik cihazı testi hem kaldırılmamış hem daha\n * dar: iPadOS 13+ masaüstü UA'sı gönderdiği için…\n * ⚠ `navigator.platform` KULLANILMAZ — spesifikasyondan KALDIRILDI ve tarayıcılar onu\n * dondurulmuş/uydurma değerlerle döndürüyor.\n */\nconst isIOS = (): boolean => {\n if (typeof navigator === 'undefined') return false;\n\n const ua = navigator.userAgent;\n if (/iP(hone|ad|od)/.test(ua)) return true;\n\n /* iPadOS 13+ kendini masaüstü Safari gibi tanıtıyor. */\n return /Macintosh/.test(ua) && navigator.maxTouchPoints > 1;\n};\n\nconst lock = (): void => {\n lockCount += 1;\n if (lockCount > 1) return;\n\n const { body, style: rootStyle } = { body: document.body, style: document.documentElement.style };\n const scrollY = window.scrollY;\n\n previous = {\n overflow: body.style.overflow,\n position: body.style.position,\n top: body.style.top,\n width: body.style.width,\n paddingRight: body.style.paddingRight,\n scrollY,\n };\n\n /* Cubugun genisligi: `scrollbar-gutter` desteklenmiyorsa dolgu olarak yazilir. */\n const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;\n if (scrollbarWidth > 0) body.style.paddingRight = `${scrollbarWidth}px`;\n\n rootStyle.setProperty('scrollbar-gutter', 'stable');\n body.style.overflow = 'hidden';\n\n if (isIOS()) {\n body.style.position = 'fixed';\n body.style.top = `${-scrollY}px`;\n body.style.width = '100%';\n }\n};\n\nconst unlock = (): void => {\n lockCount = Math.max(0, lockCount - 1);\n if (lockCount > 0 || !previous) return;\n\n const { body } = document;\n const { scrollY } = previous;\n\n body.style.overflow = previous.overflow;\n body.style.position = previous.position;\n body.style.top = previous.top;\n body.style.width = previous.width;\n body.style.paddingRight = previous.paddingRight;\n document.documentElement.style.removeProperty('scrollbar-gutter');\n\n previous = null;\n\n /*\n * Govde sabitlenmisken kaydirma konumu sifirlaniyor; geri yazilmazsa kullanici pencereyi\n * kapattiginda sayfanin en basina duser.\n */\n window.scrollTo(0, scrollY);\n};\n\nconst useScrollLock = (isLocked = true): void => {\n useEffect(() => {\n if (!isLocked) return;\n\n lock();\n return unlock;\n }, [isLocked]);\n};\n\nexport default useScrollLock;\n"],"names":["lockCount","previous","isIOS","ua","lock","body","rootStyle","scrollY","scrollbarWidth","unlock","useScrollLock","isLocked","useEffect"],"mappings":";;AASA,IAAIA,IAAY,GAGZC,IAOO;AAQX,MAAMC,IAAQ,MAAe;AAC3B,MAAI,OAAO,YAAc,IAAa,QAAO;AAE7C,QAAMC,IAAK,UAAU;AACrB,SAAI,iBAAiB,KAAKA,CAAE,IAAU,KAG/B,YAAY,KAAKA,CAAE,KAAK,UAAU,iBAAiB;AAC5D,GAEMC,IAAO,MAAY;AAEvB,MADAJ,KAAa,GACTA,IAAY,EAAG;AAEnB,QAAM,EAAE,MAAAK,GAAM,OAAOC,EAAA,IAAc,EAAE,MAAM,SAAS,MAAM,OAAO,SAAS,gBAAgB,MAAA,GACpFC,IAAU,OAAO;AAEvB,EAAAN,IAAW;AAAA,IACT,UAAUI,EAAK,MAAM;AAAA,IACrB,UAAUA,EAAK,MAAM;AAAA,IACrB,KAAKA,EAAK,MAAM;AAAA,IAChB,OAAOA,EAAK,MAAM;AAAA,IAClB,cAAcA,EAAK,MAAM;AAAA,IACzB,SAAAE;AAAA,EAAA;AAIF,QAAMC,IAAiB,OAAO,aAAa,SAAS,gBAAgB;AACpE,EAAIA,IAAiB,MAAGH,EAAK,MAAM,eAAe,GAAGG,CAAc,OAEnEF,EAAU,YAAY,oBAAoB,QAAQ,GAClDD,EAAK,MAAM,WAAW,UAElBH,QACFG,EAAK,MAAM,WAAW,SACtBA,EAAK,MAAM,MAAM,GAAG,CAACE,CAAO,MAC5BF,EAAK,MAAM,QAAQ;AAEvB,GAEMI,IAAS,MAAY;AAEzB,MADAT,IAAY,KAAK,IAAI,GAAGA,IAAY,CAAC,GACjCA,IAAY,KAAK,CAACC,EAAU;AAEhC,QAAM,EAAE,MAAAI,MAAS,UACX,EAAE,SAAAE,MAAYN;AAEpB,EAAAI,EAAK,MAAM,WAAWJ,EAAS,UAC/BI,EAAK,MAAM,WAAWJ,EAAS,UAC/BI,EAAK,MAAM,MAAMJ,EAAS,KAC1BI,EAAK,MAAM,QAAQJ,EAAS,OAC5BI,EAAK,MAAM,eAAeJ,EAAS,cACnC,SAAS,gBAAgB,MAAM,eAAe,kBAAkB,GAEhEA,IAAW,MAMX,OAAO,SAAS,GAAGM,CAAO;AAC5B,GAEMG,IAAgB,CAACC,IAAW,OAAe;AAC/C,EAAAC,EAAU,MAAM;AACd,QAAKD;AAEL,aAAAP,EAAA,GACOK;AAAA,EACT,GAAG,CAACE,CAAQ,CAAC;AACf;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react"),u="--ui-sheet-height",c="--ui-sheet-inset-bottom";let o=0,r=0;const l=240,d=()=>{const e=window.visualViewport;if(!e||e.height<l)return;const t=window.innerHeight-e.height-e.offsetTop,i=document.documentElement;i.style.setProperty(c,`${Math.max(0,Math.round(t))}px`),i.style.setProperty(u,`${Math.round(e.height)}px`)},n=()=>{r||(r=window.requestAnimationFrame(()=>{r=0,d()}))},s=()=>{r&&(window.cancelAnimationFrame(r),r=0)},m=(e=!0)=>{a.useEffect(()=>{if(!e)return;const t=window.visualViewport;if(t)return o+=1,o===1&&(t.addEventListener("resize",n),t.addEventListener("scroll",n),window.addEventListener("orientationchange",n)),s(),d(),()=>{o-=1,!(o>0)&&(t.removeEventListener("resize",n),t.removeEventListener("scroll",n),window.removeEventListener("orientationchange",n),s(),document.documentElement.style.removeProperty(c),document.documentElement.style.removeProperty(u))}},[e])};exports.default=m;
|
|
2
|
+
//# sourceMappingURL=useSheetViewport.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSheetViewport.cjs","sources":["../../src/hooks/useSheetViewport.ts"],"sourcesContent":["'use client';\n\nimport { useEffect } from 'react';\n\n/** Panelin kaplayabilecegi en fazla yukseklik — GORUNEN alanin yuksekligi. */\nconst HEIGHT_VAR = '--ui-sheet-height';\n\n/** Panelin dibinin, yerlesim gorunum alaninin dibinden ne kadar yukarida duracagi. */\nconst INSET_VAR = '--ui-sheet-inset-bottom';\n\n/* Tek olcum, tek dinleyici. */\nlet openCount = 0;\nlet frame = 0;\n\n/** Gorsel gorunum alanini olcup CSS degiskenlerine yazar. */\n/** MAKUL EN KÜÇÜK GÖRÜNÜM ALANI. */\nconst MIN_VIEWPORT_HEIGHT = 240;\n\nconst measure = () => {\n const viewport = window.visualViewport;\n if (!viewport) return;\n\n /* ABSURT OLCUM YAZILMAZ. */\n if (viewport.height < MIN_VIEWPORT_HEIGHT) return;\n\n const covered = window.innerHeight - viewport.height - viewport.offsetTop;\n const root = document.documentElement;\n\n root.style.setProperty(INSET_VAR, `${Math.max(0, Math.round(covered))}px`);\n root.style.setProperty(HEIGHT_VAR, `${Math.round(viewport.height)}px`);\n};\n\n/**\n * Kare başına bir ölçüm: klavye açılırken `resize` ve `scroll` ard arda düşüyor ve her ölçüm bir\n * yerleşim okuması.\n */\nconst schedule = () => {\n if (frame) return;\n frame = window.requestAnimationFrame(() => {\n frame = 0;\n measure();\n });\n};\n\n/** Bekleyen kareyi iptal eder ve bayrağı serbest bırakır. */\nconst cancelScheduled = () => {\n if (!frame) return;\n window.cancelAnimationFrame(frame);\n frame = 0;\n};\n\n/**\n * Alt sayfayi gorunen alana yaslar.\n * @param isActive Panel acik mi.\n */\nconst useSheetViewport = (isActive = true) => {\n useEffect(() => {\n if (!isActive) return;\n\n const viewport = window.visualViewport;\n if (!viewport) return;\n\n openCount += 1;\n\n if (openCount === 1) {\n viewport.addEventListener('resize', schedule);\n viewport.addEventListener('scroll', schedule);\n window.addEventListener('orientationchange', schedule);\n }\n\n /* Bekleyen kare IPTAL edilir ve olcum SENKRON yapilir. */\n cancelScheduled();\n measure();\n\n return () => {\n openCount -= 1;\n if (openCount > 0) return;\n\n viewport.removeEventListener('resize', schedule);\n viewport.removeEventListener('scroll', schedule);\n window.removeEventListener('orientationchange', schedule);\n\n cancelScheduled();\n\n /*\n * Degiskenler SILINIR, sifirlanmaz: yedek deger CSS'te (`var(…, 0px)` / `var(…, 100dvh)`) ve\n * panel kapaliyken dogru olan o.\n */\n document.documentElement.style.removeProperty(INSET_VAR);\n document.documentElement.style.removeProperty(HEIGHT_VAR);\n };\n }, [isActive]);\n};\n\nexport default useSheetViewport;\n"],"names":["HEIGHT_VAR","INSET_VAR","openCount","frame","MIN_VIEWPORT_HEIGHT","measure","viewport","covered","root","schedule","cancelScheduled","useSheetViewport","isActive","useEffect"],"mappings":"kJAIMA,EAAa,oBAGbC,EAAY,0BAGlB,IAAIC,EAAY,EACZC,EAAQ,EAIZ,MAAMC,EAAsB,IAEtBC,EAAU,IAAM,CACpB,MAAMC,EAAW,OAAO,eAIxB,GAHI,CAACA,GAGDA,EAAS,OAASF,EAAqB,OAE3C,MAAMG,EAAU,OAAO,YAAcD,EAAS,OAASA,EAAS,UAC1DE,EAAO,SAAS,gBAEtBA,EAAK,MAAM,YAAYP,EAAW,GAAG,KAAK,IAAI,EAAG,KAAK,MAAMM,CAAO,CAAC,CAAC,IAAI,EACzEC,EAAK,MAAM,YAAYR,EAAY,GAAG,KAAK,MAAMM,EAAS,MAAM,CAAC,IAAI,CACvE,EAMMG,EAAW,IAAM,CACjBN,IACJA,EAAQ,OAAO,sBAAsB,IAAM,CACzCA,EAAQ,EACRE,EAAA,CACF,CAAC,EACH,EAGMK,EAAkB,IAAM,CACvBP,IACL,OAAO,qBAAqBA,CAAK,EACjCA,EAAQ,EACV,EAMMQ,EAAmB,CAACC,EAAW,KAAS,CAC5CC,EAAAA,UAAU,IAAM,CACd,GAAI,CAACD,EAAU,OAEf,MAAMN,EAAW,OAAO,eACxB,GAAKA,EAEL,OAAAJ,GAAa,EAETA,IAAc,IAChBI,EAAS,iBAAiB,SAAUG,CAAQ,EAC5CH,EAAS,iBAAiB,SAAUG,CAAQ,EAC5C,OAAO,iBAAiB,oBAAqBA,CAAQ,GAIvDC,EAAA,EACAL,EAAA,EAEO,IAAM,CACXH,GAAa,EACT,EAAAA,EAAY,KAEhBI,EAAS,oBAAoB,SAAUG,CAAQ,EAC/CH,EAAS,oBAAoB,SAAUG,CAAQ,EAC/C,OAAO,oBAAoB,oBAAqBA,CAAQ,EAExDC,EAAA,EAMA,SAAS,gBAAgB,MAAM,eAAeT,CAAS,EACvD,SAAS,gBAAgB,MAAM,eAAeD,CAAU,EAC1D,CACF,EAAG,CAACY,CAAQ,CAAC,CACf"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect as m } from "react";
|
|
3
|
+
const u = "--ui-sheet-height", c = "--ui-sheet-inset-bottom";
|
|
4
|
+
let r = 0, o = 0;
|
|
5
|
+
const a = 240, d = () => {
|
|
6
|
+
const e = window.visualViewport;
|
|
7
|
+
if (!e || e.height < a) return;
|
|
8
|
+
const t = window.innerHeight - e.height - e.offsetTop, i = document.documentElement;
|
|
9
|
+
i.style.setProperty(c, `${Math.max(0, Math.round(t))}px`), i.style.setProperty(u, `${Math.round(e.height)}px`);
|
|
10
|
+
}, n = () => {
|
|
11
|
+
o || (o = window.requestAnimationFrame(() => {
|
|
12
|
+
o = 0, d();
|
|
13
|
+
}));
|
|
14
|
+
}, s = () => {
|
|
15
|
+
o && (window.cancelAnimationFrame(o), o = 0);
|
|
16
|
+
}, h = (e = !0) => {
|
|
17
|
+
m(() => {
|
|
18
|
+
if (!e) return;
|
|
19
|
+
const t = window.visualViewport;
|
|
20
|
+
if (t)
|
|
21
|
+
return r += 1, r === 1 && (t.addEventListener("resize", n), t.addEventListener("scroll", n), window.addEventListener("orientationchange", n)), s(), d(), () => {
|
|
22
|
+
r -= 1, !(r > 0) && (t.removeEventListener("resize", n), t.removeEventListener("scroll", n), window.removeEventListener("orientationchange", n), s(), document.documentElement.style.removeProperty(c), document.documentElement.style.removeProperty(u));
|
|
23
|
+
};
|
|
24
|
+
}, [e]);
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
h as default
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=useSheetViewport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSheetViewport.js","sources":["../../src/hooks/useSheetViewport.ts"],"sourcesContent":["'use client';\n\nimport { useEffect } from 'react';\n\n/** Panelin kaplayabilecegi en fazla yukseklik — GORUNEN alanin yuksekligi. */\nconst HEIGHT_VAR = '--ui-sheet-height';\n\n/** Panelin dibinin, yerlesim gorunum alaninin dibinden ne kadar yukarida duracagi. */\nconst INSET_VAR = '--ui-sheet-inset-bottom';\n\n/* Tek olcum, tek dinleyici. */\nlet openCount = 0;\nlet frame = 0;\n\n/** Gorsel gorunum alanini olcup CSS degiskenlerine yazar. */\n/** MAKUL EN KÜÇÜK GÖRÜNÜM ALANI. */\nconst MIN_VIEWPORT_HEIGHT = 240;\n\nconst measure = () => {\n const viewport = window.visualViewport;\n if (!viewport) return;\n\n /* ABSURT OLCUM YAZILMAZ. */\n if (viewport.height < MIN_VIEWPORT_HEIGHT) return;\n\n const covered = window.innerHeight - viewport.height - viewport.offsetTop;\n const root = document.documentElement;\n\n root.style.setProperty(INSET_VAR, `${Math.max(0, Math.round(covered))}px`);\n root.style.setProperty(HEIGHT_VAR, `${Math.round(viewport.height)}px`);\n};\n\n/**\n * Kare başına bir ölçüm: klavye açılırken `resize` ve `scroll` ard arda düşüyor ve her ölçüm bir\n * yerleşim okuması.\n */\nconst schedule = () => {\n if (frame) return;\n frame = window.requestAnimationFrame(() => {\n frame = 0;\n measure();\n });\n};\n\n/** Bekleyen kareyi iptal eder ve bayrağı serbest bırakır. */\nconst cancelScheduled = () => {\n if (!frame) return;\n window.cancelAnimationFrame(frame);\n frame = 0;\n};\n\n/**\n * Alt sayfayi gorunen alana yaslar.\n * @param isActive Panel acik mi.\n */\nconst useSheetViewport = (isActive = true) => {\n useEffect(() => {\n if (!isActive) return;\n\n const viewport = window.visualViewport;\n if (!viewport) return;\n\n openCount += 1;\n\n if (openCount === 1) {\n viewport.addEventListener('resize', schedule);\n viewport.addEventListener('scroll', schedule);\n window.addEventListener('orientationchange', schedule);\n }\n\n /* Bekleyen kare IPTAL edilir ve olcum SENKRON yapilir. */\n cancelScheduled();\n measure();\n\n return () => {\n openCount -= 1;\n if (openCount > 0) return;\n\n viewport.removeEventListener('resize', schedule);\n viewport.removeEventListener('scroll', schedule);\n window.removeEventListener('orientationchange', schedule);\n\n cancelScheduled();\n\n /*\n * Degiskenler SILINIR, sifirlanmaz: yedek deger CSS'te (`var(…, 0px)` / `var(…, 100dvh)`) ve\n * panel kapaliyken dogru olan o.\n */\n document.documentElement.style.removeProperty(INSET_VAR);\n document.documentElement.style.removeProperty(HEIGHT_VAR);\n };\n }, [isActive]);\n};\n\nexport default useSheetViewport;\n"],"names":["HEIGHT_VAR","INSET_VAR","openCount","frame","MIN_VIEWPORT_HEIGHT","measure","viewport","covered","root","sch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