@lt-ui/uikit 0.0.0-stage → 0.0.2
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/_internal/base-button/base-button.d.ts +9 -0
- package/_internal/base-button/base-button.js +47 -0
- package/_internal/base-button/index.d.ts +2 -0
- package/_internal/base-button/index.js +1 -0
- package/_internal/base-button/styles.module.css +69 -0
- package/_internal/base-button/types.d.ts +42 -0
- package/_internal/base-button/types.js +1 -0
- package/_internal/collapse-box/collapse-box.d.ts +60 -0
- package/_internal/collapse-box/collapse-box.js +30 -0
- package/_internal/collapse-box/index.d.ts +2 -0
- package/_internal/collapse-box/index.js +1 -0
- package/_internal/collapse-box/styles.module.css +30 -0
- package/_internal/compat/context-provider.d.ts +17 -0
- package/_internal/compat/context-provider.js +13 -0
- package/_internal/compat/index.d.ts +4 -0
- package/_internal/compat/index.js +4 -0
- package/_internal/compat/react-version.d.ts +5 -0
- package/_internal/compat/react-version.js +6 -0
- package/_internal/compat/use-form-pending.d.ts +5 -0
- package/_internal/compat/use-form-pending.js +8 -0
- package/_internal/compat/with-ref.d.ts +10 -0
- package/_internal/compat/with-ref.js +22 -0
- package/_internal/context-selector/context-selector.d.ts +27 -0
- package/_internal/context-selector/context-selector.js +71 -0
- package/_internal/context-selector/index.d.ts +2 -0
- package/_internal/context-selector/index.js +1 -0
- package/_internal/date/date-format.d.ts +24 -0
- package/_internal/date/date-format.js +122 -0
- package/_internal/date/date-locale.d.ts +21 -0
- package/_internal/date/date-locale.js +60 -0
- package/_internal/date/date-utils.d.ts +44 -0
- package/_internal/date/date-utils.js +75 -0
- package/_internal/date/index.d.ts +3 -0
- package/_internal/date/index.js +3 -0
- package/_internal/empty-function.d.ts +1 -0
- package/_internal/empty-function.js +4 -0
- package/_internal/field/_motion.css +0 -0
- package/_internal/field/field-caption.d.ts +12 -0
- package/_internal/field/field-caption.js +5 -0
- package/_internal/field/field-clear-button.d.ts +16 -0
- package/_internal/field/field-clear-button.js +14 -0
- package/_internal/field/field-frame.d.ts +34 -0
- package/_internal/field/field-frame.js +36 -0
- package/_internal/field/field.module.css +353 -0
- package/_internal/field/index.d.ts +7 -0
- package/_internal/field/index.js +7 -0
- package/_internal/field/props.d.ts +81 -0
- package/_internal/field/props.js +1 -0
- package/_internal/field/types.d.ts +54 -0
- package/_internal/field/types.js +1 -0
- package/_internal/field/use-field-state.d.ts +38 -0
- package/_internal/field/use-field-state.js +46 -0
- package/_internal/floating/compute-position.d.ts +11 -0
- package/_internal/floating/compute-position.js +112 -0
- package/_internal/floating/index.d.ts +4 -0
- package/_internal/floating/index.js +2 -0
- package/_internal/floating/origin.d.ts +6 -0
- package/_internal/floating/origin.js +18 -0
- package/_internal/floating/types.d.ts +52 -0
- package/_internal/floating/types.js +1 -0
- package/_internal/floating/use-floating.d.ts +35 -0
- package/_internal/floating/use-floating.js +149 -0
- package/_internal/focus-trap/focus-trap.d.ts +25 -0
- package/_internal/focus-trap/focus-trap.js +111 -0
- package/_internal/focus-trap/index.d.ts +3 -0
- package/_internal/focus-trap/index.js +3 -0
- package/_internal/focus-trap/scroll-lock.d.ts +2 -0
- package/_internal/focus-trap/scroll-lock.js +32 -0
- package/_internal/focus-trap/tabbable.d.ts +2 -0
- package/_internal/focus-trap/tabbable.js +25 -0
- package/_internal/hooks/focus-when-ready.d.ts +6 -0
- package/_internal/hooks/focus-when-ready.js +21 -0
- package/_internal/hooks/index.d.ts +15 -0
- package/_internal/hooks/index.js +15 -0
- package/_internal/hooks/restore-focus.d.ts +6 -0
- package/_internal/hooks/restore-focus.js +11 -0
- package/_internal/hooks/use-arrow-navigation.d.ts +14 -0
- package/_internal/hooks/use-arrow-navigation.js +35 -0
- package/_internal/hooks/use-chips-nav.d.ts +22 -0
- package/_internal/hooks/use-chips-nav.js +100 -0
- package/_internal/hooks/use-collapse-motion.d.ts +30 -0
- package/_internal/hooks/use-collapse-motion.js +102 -0
- package/_internal/hooks/use-controllable-state.d.ts +13 -0
- package/_internal/hooks/use-controllable-state.js +28 -0
- package/_internal/hooks/use-effect-once.d.ts +2 -0
- package/_internal/hooks/use-effect-once.js +4 -0
- package/_internal/hooks/use-focus-on-context.d.ts +2 -0
- package/_internal/hooks/use-focus-on-context.js +4 -0
- package/_internal/hooks/use-focus-on-ignore.d.ts +8 -0
- package/_internal/hooks/use-focus-on-ignore.js +19 -0
- package/_internal/hooks/use-focused-state.d.ts +5 -0
- package/_internal/hooks/use-focused-state.js +8 -0
- package/_internal/hooks/use-popover-tab-flow.d.ts +18 -0
- package/_internal/hooks/use-popover-tab-flow.js +55 -0
- package/_internal/hooks/use-resize-observer.d.ts +2 -0
- package/_internal/hooks/use-resize-observer.js +24 -0
- package/_internal/hooks/use-return-focus.d.ts +15 -0
- package/_internal/hooks/use-return-focus.js +25 -0
- package/_internal/hooks/use-scroll-edges.d.ts +6 -0
- package/_internal/hooks/use-scroll-edges.js +28 -0
- package/_internal/hooks/use-synced-animation.d.ts +12 -0
- package/_internal/hooks/use-synced-animation.js +28 -0
- package/_internal/layer/index.d.ts +2 -0
- package/_internal/layer/index.js +2 -0
- package/_internal/layer/layer-manager.d.ts +47 -0
- package/_internal/layer/layer-manager.js +93 -0
- package/_internal/layer/use-layer.d.ts +13 -0
- package/_internal/layer/use-layer.js +30 -0
- package/_internal/picker/index.d.ts +5 -0
- package/_internal/picker/index.js +5 -0
- package/_internal/picker/picker-field.d.ts +77 -0
- package/_internal/picker/picker-field.js +23 -0
- package/_internal/picker/picker-field.module.css +28 -0
- package/_internal/picker/picker-sheet-search.d.ts +9 -0
- package/_internal/picker/picker-sheet-search.js +11 -0
- package/_internal/picker/picker-sheet.d.ts +30 -0
- package/_internal/picker/picker-sheet.js +14 -0
- package/_internal/picker/picker-sheet.module.css +11 -0
- package/_internal/picker/use-date-input.d.ts +27 -0
- package/_internal/picker/use-date-input.js +74 -0
- package/_internal/picker/use-picker-presentation.d.ts +25 -0
- package/_internal/picker/use-picker-presentation.js +30 -0
- package/_internal/transition/css-transition.d.ts +22 -0
- package/_internal/transition/css-transition.js +67 -0
- package/_internal/transition/index.d.ts +3 -0
- package/_internal/transition/index.js +3 -0
- package/_internal/transition/transition-group-context.d.ts +4 -0
- package/_internal/transition/transition-group-context.js +4 -0
- package/_internal/transition/transition-group.d.ts +20 -0
- package/_internal/transition/transition-group.js +126 -0
- package/_internal/transition/transition.d.ts +40 -0
- package/_internal/transition/transition.js +125 -0
- package/accordion/accordion-item.d.ts +289 -0
- package/accordion/accordion-item.js +16 -0
- package/accordion/accordion.d.ts +301 -0
- package/accordion/accordion.js +16 -0
- package/accordion/constants.d.ts +2 -0
- package/accordion/constants.js +2 -0
- package/accordion/context.d.ts +17 -0
- package/accordion/context.js +3 -0
- package/accordion/hooks/use-accordion-item-view-model.d.ts +45 -0
- package/accordion/hooks/use-accordion-item-view-model.js +223 -0
- package/accordion/hooks/use-accordion-view-model.d.ts +25 -0
- package/accordion/hooks/use-accordion-view-model.js +121 -0
- package/accordion/index.d.ts +3 -0
- package/accordion/index.js +2 -0
- package/accordion/store.d.ts +22 -0
- package/accordion/store.js +42 -0
- package/accordion/styles.module.css +182 -0
- package/accordion/types.d.ts +196 -0
- package/accordion/types.js +1 -0
- package/accordion/utils.d.ts +29 -0
- package/accordion/utils.js +111 -0
- package/accordion/views/accordion-item-view.d.ts +6 -0
- package/accordion/views/accordion-item-view.js +22 -0
- package/accordion/views/accordion-view.d.ts +7 -0
- package/accordion/views/accordion-view.js +18 -0
- package/adaptive/adaptive.d.ts +20 -0
- package/adaptive/adaptive.js +14 -0
- package/adaptive/adaptive.module.css +189 -0
- package/adaptive/index.d.ts +2 -0
- package/adaptive/index.js +1 -0
- package/adaptive/types.d.ts +35 -0
- package/adaptive/types.js +1 -0
- package/alert/alert-actions.d.ts +6 -0
- package/alert/alert-actions.js +22 -0
- package/alert/alert-content.d.ts +6 -0
- package/alert/alert-content.js +15 -0
- package/alert/alert-icon.d.ts +4 -0
- package/alert/alert-icon.js +9 -0
- package/alert/alert.d.ts +11 -0
- package/alert/alert.js +41 -0
- package/alert/index.d.ts +2 -0
- package/alert/index.js +1 -0
- package/alert/styles/alert-variants.module.css +38 -0
- package/alert/styles/alert.module.css +51 -0
- package/alert/types.d.ts +69 -0
- package/alert/types.js +1 -0
- package/alert/use-alert.d.ts +8 -0
- package/alert/use-alert.js +14 -0
- package/avatar/avatar-group.d.ts +47 -0
- package/avatar/avatar-group.js +31 -0
- package/avatar/avatar-group.module.css +13 -0
- package/avatar/avatar-inner.d.ts +2 -0
- package/avatar/avatar-inner.js +24 -0
- package/avatar/avatar.d.ts +10 -0
- package/avatar/avatar.js +68 -0
- package/avatar/constants.d.ts +6 -0
- package/avatar/constants.js +5 -0
- package/avatar/index.d.ts +3 -0
- package/avatar/index.js +2 -0
- package/avatar/styles.module.css +292 -0
- package/avatar/types.d.ts +87 -0
- package/avatar/types.js +1 -0
- package/avatar/utils.d.ts +4 -0
- package/avatar/utils.js +10 -0
- package/badge/badge.d.ts +23 -0
- package/badge/badge.js +31 -0
- package/badge/index.d.ts +2 -0
- package/badge/index.js +2 -0
- package/badge/styles.module.css +114 -0
- package/badge/types.d.ts +58 -0
- package/badge/types.js +1 -0
- package/breadcrumbs/breadcrumbs-context.d.ts +7 -0
- package/breadcrumbs/breadcrumbs-context.js +6 -0
- package/breadcrumbs/breadcrumbs-item.d.ts +6 -0
- package/breadcrumbs/breadcrumbs-item.js +18 -0
- package/breadcrumbs/breadcrumbs-menu.d.ts +12 -0
- package/breadcrumbs/breadcrumbs-menu.js +12 -0
- package/breadcrumbs/breadcrumbs.d.ts +28 -0
- package/breadcrumbs/breadcrumbs.js +61 -0
- package/breadcrumbs/index.d.ts +3 -0
- package/breadcrumbs/index.js +2 -0
- package/breadcrumbs/styles.module.css +190 -0
- package/breadcrumbs/types.d.ts +81 -0
- package/breadcrumbs/types.js +1 -0
- package/breadcrumbs/use-breadcrumbs-fit.d.ts +21 -0
- package/breadcrumbs/use-breadcrumbs-fit.js +43 -0
- package/breadcrumbs/use-breadcrumbs.d.ts +21 -0
- package/breadcrumbs/use-breadcrumbs.js +41 -0
- package/button/button.d.ts +13 -0
- package/button/button.js +45 -0
- package/button/close-button.d.ts +14 -0
- package/button/close-button.js +17 -0
- package/button/index.d.ts +7 -0
- package/button/index.js +5 -0
- package/button/styles.module.css +288 -0
- package/button/types.d.ts +95 -0
- package/button/types.js +1 -0
- package/button/use-button.d.ts +22 -0
- package/button/use-button.js +35 -0
- package/calendar/availability.d.ts +14 -0
- package/calendar/availability.js +30 -0
- package/calendar/calendar-header.d.ts +20 -0
- package/calendar/calendar-header.js +40 -0
- package/calendar/calendar.d.ts +11 -0
- package/calendar/calendar.js +35 -0
- package/calendar/day-grid.d.ts +13 -0
- package/calendar/day-grid.js +21 -0
- package/calendar/index.d.ts +6 -0
- package/calendar/index.js +3 -0
- package/calendar/labels.d.ts +4 -0
- package/calendar/labels.js +12 -0
- package/calendar/picker-grid.d.ts +15 -0
- package/calendar/picker-grid.js +63 -0
- package/calendar/selection.d.ts +17 -0
- package/calendar/selection.js +50 -0
- package/calendar/styles.module.css +283 -0
- package/calendar/types.d.ts +169 -0
- package/calendar/types.js +1 -0
- package/calendar/use-calendar.d.ts +74 -0
- package/calendar/use-calendar.js +397 -0
- package/caption/caption.d.ts +16 -0
- package/caption/caption.js +27 -0
- package/caption/index.d.ts +2 -0
- package/caption/index.js +1 -0
- package/caption/styles.module.css +33 -0
- package/caption/types.d.ts +30 -0
- package/caption/types.js +1 -0
- package/card/card.d.ts +19 -0
- package/card/card.js +31 -0
- package/card/index.d.ts +2 -0
- package/card/index.js +1 -0
- package/card/styles.module.css +80 -0
- package/card/types.d.ts +49 -0
- package/card/types.js +1 -0
- package/card/use-card.d.ts +24 -0
- package/card/use-card.js +36 -0
- package/checkbox/checkbox.d.ts +10 -0
- package/checkbox/checkbox.js +54 -0
- package/checkbox/index.d.ts +2 -0
- package/checkbox/index.js +1 -0
- package/checkbox/styles/style.module.css +257 -0
- package/checkbox/types.d.ts +68 -0
- package/checkbox/types.js +1 -0
- package/chip/chip.d.ts +40 -0
- package/chip/chip.js +63 -0
- package/chip/index.d.ts +2 -0
- package/chip/index.js +1 -0
- package/chip/styles.module.css +65 -0
- package/chip/types.d.ts +45 -0
- package/chip/types.js +1 -0
- package/chip-group/chip-group-transition-context.d.ts +9 -0
- package/chip-group/chip-group-transition-context.js +8 -0
- package/chip-group/chip-group-transition-provider.d.ts +6 -0
- package/chip-group/chip-group-transition-provider.js +11 -0
- package/chip-group/chip-group.d.ts +4 -0
- package/chip-group/chip-group.js +33 -0
- package/chip-group/index.d.ts +2 -0
- package/chip-group/index.js +1 -0
- package/chip-group/styles.module.css +4 -0
- package/chip-group/types.d.ts +5 -0
- package/chip-group/types.js +1 -0
- package/cjs/_internal/base-button/base-button.js +86 -0
- package/cjs/_internal/base-button/index.js +17 -0
- package/cjs/_internal/base-button/styles.module.css +69 -0
- package/cjs/_internal/base-button/types.js +2 -0
- package/cjs/_internal/collapse-box/collapse-box.js +69 -0
- package/cjs/_internal/collapse-box/index.js +5 -0
- package/cjs/_internal/collapse-box/styles.module.css +30 -0
- package/cjs/_internal/compat/context-provider.js +17 -0
- package/cjs/_internal/compat/index.js +11 -0
- package/cjs/_internal/compat/react-version.js +9 -0
- package/cjs/_internal/compat/use-form-pending.js +45 -0
- package/cjs/_internal/compat/with-ref.js +26 -0
- package/cjs/_internal/context-selector/context-selector.js +75 -0
- package/cjs/_internal/context-selector/index.js +6 -0
- package/cjs/_internal/date/date-format.js +129 -0
- package/cjs/_internal/date/date-locale.js +71 -0
- package/cjs/_internal/date/date-utils.js +104 -0
- package/cjs/_internal/date/index.js +19 -0
- package/cjs/_internal/empty-function.js +8 -0
- package/cjs/_internal/field/_motion.css +0 -0
- package/cjs/_internal/field/field-caption.js +12 -0
- package/cjs/_internal/field/field-clear-button.js +17 -0
- package/cjs/_internal/field/field-frame.js +42 -0
- package/cjs/_internal/field/field.module.css +353 -0
- package/cjs/_internal/field/index.js +17 -0
- package/cjs/_internal/field/props.js +2 -0
- package/cjs/_internal/field/types.js +2 -0
- package/cjs/_internal/field/use-field-state.js +49 -0
- package/cjs/_internal/floating/compute-position.js +118 -0
- package/cjs/_internal/floating/index.js +9 -0
- package/cjs/_internal/floating/origin.js +21 -0
- package/cjs/_internal/floating/types.js +2 -0
- package/cjs/_internal/floating/use-floating.js +152 -0
- package/cjs/_internal/focus-trap/focus-trap.js +148 -0
- package/cjs/_internal/focus-trap/index.js +19 -0
- package/cjs/_internal/focus-trap/scroll-lock.js +35 -0
- package/cjs/_internal/focus-trap/tabbable.js +28 -0
- package/cjs/_internal/hooks/focus-when-ready.js +24 -0
- package/cjs/_internal/hooks/index.js +31 -0
- package/cjs/_internal/hooks/restore-focus.js +14 -0
- package/cjs/_internal/hooks/use-arrow-navigation.js +38 -0
- package/cjs/_internal/hooks/use-chips-nav.js +106 -0
- package/cjs/_internal/hooks/use-collapse-motion.js +108 -0
- package/cjs/_internal/hooks/use-controllable-state.js +31 -0
- package/cjs/_internal/hooks/use-effect-once.js +8 -0
- package/cjs/_internal/hooks/use-focus-on-context.js +8 -0
- package/cjs/_internal/hooks/use-focus-on-ignore.js +23 -0
- package/cjs/_internal/hooks/use-focused-state.js +11 -0
- package/cjs/_internal/hooks/use-popover-tab-flow.js +60 -0
- package/cjs/_internal/hooks/use-resize-observer.js +28 -0
- package/cjs/_internal/hooks/use-return-focus.js +28 -0
- package/cjs/_internal/hooks/use-scroll-edges.js +31 -0
- package/cjs/_internal/hooks/use-synced-animation.js +32 -0
- package/cjs/_internal/layer/index.js +18 -0
- package/cjs/_internal/layer/layer-manager.js +96 -0
- package/cjs/_internal/layer/use-layer.js +33 -0
- package/cjs/_internal/picker/index.js +21 -0
- package/cjs/_internal/picker/picker-field.js +29 -0
- package/cjs/_internal/picker/picker-field.module.css +28 -0
- package/cjs/_internal/picker/picker-sheet-search.js +17 -0
- package/cjs/_internal/picker/picker-sheet.js +20 -0
- package/cjs/_internal/picker/picker-sheet.module.css +11 -0
- package/cjs/_internal/picker/use-date-input.js +77 -0
- package/cjs/_internal/picker/use-picker-presentation.js +35 -0
- package/cjs/_internal/transition/css-transition.js +70 -0
- package/cjs/_internal/transition/index.js +19 -0
- package/cjs/_internal/transition/transition-group-context.js +7 -0
- package/cjs/_internal/transition/transition-group.js +162 -0
- package/cjs/_internal/transition/transition.js +129 -0
- package/cjs/accordion/accordion-item.js +22 -0
- package/cjs/accordion/accordion.js +22 -0
- package/cjs/accordion/constants.js +5 -0
- package/cjs/accordion/context.js +6 -0
- package/cjs/accordion/hooks/use-accordion-item-view-model.js +227 -0
- package/cjs/accordion/hooks/use-accordion-view-model.js +127 -0
- package/cjs/accordion/index.js +7 -0
- package/cjs/accordion/store.js +45 -0
- package/cjs/accordion/styles.module.css +182 -0
- package/cjs/accordion/types.js +2 -0
- package/cjs/accordion/utils.js +123 -0
- package/cjs/accordion/views/accordion-item-view.js +28 -0
- package/cjs/accordion/views/accordion-view.js +24 -0
- package/cjs/adaptive/adaptive.js +53 -0
- package/cjs/adaptive/adaptive.module.css +189 -0
- package/cjs/adaptive/index.js +17 -0
- package/cjs/adaptive/types.js +2 -0
- package/cjs/alert/alert-actions.js +29 -0
- package/cjs/alert/alert-content.js +22 -0
- package/cjs/alert/alert-icon.js +16 -0
- package/cjs/alert/alert.js +47 -0
- package/cjs/alert/index.js +17 -0
- package/cjs/alert/styles/alert-variants.module.css +38 -0
- package/cjs/alert/styles/alert.module.css +51 -0
- package/cjs/alert/types.js +2 -0
- package/cjs/alert/use-alert.js +17 -0
- package/cjs/avatar/avatar-group.js +37 -0
- package/cjs/avatar/avatar-group.module.css +13 -0
- package/cjs/avatar/avatar-inner.js +31 -0
- package/cjs/avatar/avatar.js +107 -0
- package/cjs/avatar/constants.js +8 -0
- package/cjs/avatar/index.js +18 -0
- package/cjs/avatar/styles.module.css +292 -0
- package/cjs/avatar/types.js +2 -0
- package/cjs/avatar/utils.js +16 -0
- package/cjs/badge/badge.js +37 -0
- package/cjs/badge/index.js +18 -0
- package/cjs/badge/styles.module.css +114 -0
- package/cjs/badge/types.js +2 -0
- package/cjs/breadcrumbs/breadcrumbs-context.js +10 -0
- package/cjs/breadcrumbs/breadcrumbs-item.js +24 -0
- package/cjs/breadcrumbs/breadcrumbs-menu.js +18 -0
- package/cjs/breadcrumbs/breadcrumbs.js +100 -0
- package/cjs/breadcrumbs/index.js +7 -0
- package/cjs/breadcrumbs/styles.module.css +190 -0
- package/cjs/breadcrumbs/types.js +2 -0
- package/cjs/breadcrumbs/use-breadcrumbs-fit.js +46 -0
- package/cjs/breadcrumbs/use-breadcrumbs.js +77 -0
- package/cjs/button/button.js +51 -0
- package/cjs/button/close-button.js +24 -0
- package/cjs/button/index.js +23 -0
- package/cjs/button/styles.module.css +288 -0
- package/cjs/button/types.js +2 -0
- package/cjs/button/use-button.js +41 -0
- package/cjs/calendar/availability.js +35 -0
- package/cjs/calendar/calendar-header.js +46 -0
- package/cjs/calendar/calendar.js +41 -0
- package/cjs/calendar/day-grid.js +27 -0
- package/cjs/calendar/index.js +11 -0
- package/cjs/calendar/labels.js +16 -0
- package/cjs/calendar/picker-grid.js +69 -0
- package/cjs/calendar/selection.js +59 -0
- package/cjs/calendar/styles.module.css +283 -0
- package/cjs/calendar/types.js +2 -0
- package/cjs/calendar/use-calendar.js +400 -0
- package/cjs/caption/caption.js +66 -0
- package/cjs/caption/index.js +17 -0
- package/cjs/caption/styles.module.css +33 -0
- package/cjs/caption/types.js +2 -0
- package/cjs/card/card.js +37 -0
- package/cjs/card/index.js +17 -0
- package/cjs/card/styles.module.css +80 -0
- package/cjs/card/types.js +2 -0
- package/cjs/card/use-card.js +39 -0
- package/cjs/checkbox/checkbox.js +60 -0
- package/cjs/checkbox/index.js +17 -0
- package/cjs/checkbox/styles/style.module.css +257 -0
- package/cjs/checkbox/types.js +2 -0
- package/cjs/chip/chip.js +102 -0
- package/cjs/chip/index.js +5 -0
- package/cjs/chip/styles.module.css +65 -0
- package/cjs/chip/types.js +2 -0
- package/cjs/chip-group/chip-group-transition-context.js +14 -0
- package/cjs/chip-group/chip-group-transition-provider.js +18 -0
- package/cjs/chip-group/chip-group.js +74 -0
- package/cjs/chip-group/index.js +5 -0
- package/cjs/chip-group/styles.module.css +4 -0
- package/cjs/chip-group/types.js +2 -0
- package/cjs/container/container.js +46 -0
- package/cjs/container/index.js +17 -0
- package/cjs/container/styles.module.css +85 -0
- package/cjs/container/types.js +2 -0
- package/cjs/css-baseline/css-baseline.js +11 -0
- package/cjs/css-baseline/index.js +17 -0
- package/cjs/css-baseline/styles.css +36 -0
- package/cjs/date-picker/date-picker-panel.js +42 -0
- package/cjs/date-picker/date-picker-sheet-footer.js +16 -0
- package/cjs/date-picker/date-picker.js +76 -0
- package/cjs/date-picker/index.js +8 -0
- package/cjs/date-picker/range-time-panels.js +26 -0
- package/cjs/date-picker/styles.module.css +125 -0
- package/cjs/date-picker/types.js +2 -0
- package/cjs/date-picker/use-date-picker.js +286 -0
- package/cjs/date-picker/use-sheet-time.js +18 -0
- package/cjs/divider/divider.js +58 -0
- package/cjs/divider/index.js +17 -0
- package/cjs/divider/styles.module.css +28 -0
- package/cjs/divider/types.js +2 -0
- package/cjs/drawer/content.js +59 -0
- package/cjs/drawer/context.js +14 -0
- package/cjs/drawer/drawer.js +132 -0
- package/cjs/drawer/footer.js +67 -0
- package/cjs/drawer/header.js +66 -0
- package/cjs/drawer/index.js +21 -0
- package/cjs/drawer/normalize-padding.js +23 -0
- package/cjs/drawer/sheet-drag-config.js +16 -0
- package/cjs/drawer/sheet-drag-utils.js +39 -0
- package/cjs/drawer/styles.module.css +266 -0
- package/cjs/drawer/types.js +2 -0
- package/cjs/drawer/use-scroll-state.js +34 -0
- package/cjs/drawer/use-sheet-drag.js +163 -0
- package/cjs/dropdown-menu/dropdown-menu-button.js +61 -0
- package/cjs/dropdown-menu/dropdown-menu-context.js +14 -0
- package/cjs/dropdown-menu/dropdown-menu-item.js +16 -0
- package/cjs/dropdown-menu/dropdown-menu.js +44 -0
- package/cjs/dropdown-menu/index.js +19 -0
- package/cjs/dropdown-menu/styles.module.css +46 -0
- package/cjs/dropdown-menu/types.js +2 -0
- package/cjs/dropdown-menu/use-dropdown-menu.js +203 -0
- package/cjs/file/components/file-background-progress.js +20 -0
- package/cjs/file/components/file-emblem.js +38 -0
- package/cjs/file/components/file-interactive-shell.js +15 -0
- package/cjs/file/components/file-name.js +20 -0
- package/cjs/file/components/file-status-meta.js +20 -0
- package/cjs/file/constants.js +21 -0
- package/cjs/file/file-extensions.js +116 -0
- package/cjs/file/file.js +26 -0
- package/cjs/file/hooks/use-file-view-model.js +123 -0
- package/cjs/file/icons/file-extension-glyph-icon.js +13 -0
- package/cjs/file/icons/file-extension-glyphs.js +20 -0
- package/cjs/file/icons/file-extension-icons.js +19 -0
- package/cjs/file/image-frame-size-class.js +17 -0
- package/cjs/file/index.js +25 -0
- package/cjs/file/presets/remove-preset.js +37 -0
- package/cjs/file/presets/retry-preset.js +25 -0
- package/cjs/file/styles.module.css +565 -0
- package/cjs/file/types.js +2 -0
- package/cjs/file/utils/file-name-parts.js +25 -0
- package/cjs/file/utils/format-size.js +39 -0
- package/cjs/file/utils/get-file-presentation.js +51 -0
- package/cjs/file/utils/resolve-file-icon.js +21 -0
- package/cjs/file/utils/resolve-file-slot.js +61 -0
- package/cjs/file/utils/split-file-name.js +15 -0
- package/cjs/file/views/file-default-view.js +28 -0
- package/cjs/file/views/file-image-view.js +23 -0
- package/cjs/file-upload/components/drop-overlay.js +36 -0
- package/cjs/file-upload/components/file-upload-button-trigger.js +17 -0
- package/cjs/file-upload/components/file-upload-hint-caption.js +15 -0
- package/cjs/file-upload/components/file-upload-icon-button.js +20 -0
- package/cjs/file-upload/components/image-loader-icons.js +15 -0
- package/cjs/file-upload/components/image-loader-trigger.js +20 -0
- package/cjs/file-upload/constants.js +44 -0
- package/cjs/file-upload/file-upload.js +22 -0
- package/cjs/file-upload/hooks/use-drag-overlay.js +113 -0
- package/cjs/file-upload/hooks/use-file-list.js +191 -0
- package/cjs/file-upload/hooks/use-file-upload-view-model.js +188 -0
- package/cjs/file-upload/hooks/use-object-url.js +31 -0
- package/cjs/file-upload/index.js +40 -0
- package/cjs/file-upload/styles.module.css +345 -0
- package/cjs/file-upload/types-dropzone.js +2 -0
- package/cjs/file-upload/types-file-actions.js +2 -0
- package/cjs/file-upload/types-labels.js +2 -0
- package/cjs/file-upload/types.js +21 -0
- package/cjs/file-upload/utils/accept.js +48 -0
- package/cjs/file-upload/utils/build-file-slots.js +19 -0
- package/cjs/file-upload/utils/compute-drop-border-vertical-dash-style.js +49 -0
- package/cjs/file-upload/utils/get-drop-zone-typography.js +15 -0
- package/cjs/file-upload/utils/get-file-upload-presentation.js +68 -0
- package/cjs/file-upload/utils/max-count.js +26 -0
- package/cjs/file-upload/utils/normalize.js +67 -0
- package/cjs/file-upload/utils/render-drop-zone-hint-content.js +33 -0
- package/cjs/file-upload/utils/resolve-display-error.js +18 -0
- package/cjs/file-upload/utils/resolve-hint-content.js +59 -0
- package/cjs/file-upload/utils/resolve-labels.js +37 -0
- package/cjs/file-upload/utils/resolve-preset.js +49 -0
- package/cjs/file-upload/utils/resolve-upload-file-error.js +12 -0
- package/cjs/file-upload/utils/resolve-upload-text.js +9 -0
- package/cjs/file-upload/utils/run-before-upload.js +29 -0
- package/cjs/file-upload/utils/run-sequentially.js +7 -0
- package/cjs/file-upload/utils/uid.js +7 -0
- package/cjs/file-upload/views/file-upload-dropzone-view.js +54 -0
- package/cjs/file-upload/views/file-upload-errors-view.js +13 -0
- package/cjs/file-upload/views/file-upload-footer-view.js +23 -0
- package/cjs/file-upload/views/file-upload-list-view.js +44 -0
- package/cjs/file-upload/views/file-upload-trigger-view.js +101 -0
- package/cjs/file-upload/views/file-upload-view.js +23 -0
- package/cjs/grid/grid.js +153 -0
- package/cjs/grid/index.js +21 -0
- package/cjs/grid/presets.js +6 -0
- package/cjs/grid/styles.module.css +56 -0
- package/cjs/grid/types.js +2 -0
- package/cjs/grid-item/grid-item.js +19 -0
- package/cjs/grid-item/index.js +17 -0
- package/cjs/grid-item/types.js +2 -0
- package/cjs/hint/buttons/action-button.js +26 -0
- package/cjs/hint/buttons/close-button.js +30 -0
- package/cjs/hint/buttons/extra-button.js +26 -0
- package/cjs/hint/hint-content.js +27 -0
- package/cjs/hint/hint-provider.js +14 -0
- package/cjs/hint/hint.js +90 -0
- package/cjs/hint/index.js +21 -0
- package/cjs/hint/styles/buttons.module.css +16 -0
- package/cjs/hint/styles/hint-content.module.css +33 -0
- package/cjs/hint/styles/hint.module.css +37 -0
- package/cjs/hint/types.js +2 -0
- package/cjs/hooks/index.js +37 -0
- package/cjs/hooks/media-query/create-media-query.js +22 -0
- package/cjs/hooks/media-query/index.js +18 -0
- package/cjs/hooks/media-query/observe-media-query.js +29 -0
- package/cjs/hooks/media-query/types.js +2 -0
- package/cjs/hooks/media-query/use-media-query-listener.js +39 -0
- package/cjs/hooks/media-query/use-media-query.js +28 -0
- package/cjs/hooks/use-actual-ref.js +14 -0
- package/cjs/hooks/use-breakpoint.js +56 -0
- package/cjs/hooks/use-click-outside.js +43 -0
- package/cjs/hooks/use-component-tokens.js +20 -0
- package/cjs/hooks/use-cssvar-from-width.js +35 -0
- package/cjs/hooks/use-effect-once.js +13 -0
- package/cjs/hooks/use-isomorphic-layout-effect.js +9 -0
- package/cjs/hooks/use-keyboard-callbacks.js +124 -0
- package/cjs/hooks/use-keyboard-navigation.js +66 -0
- package/cjs/hooks/use-list-navigation/index.js +15 -0
- package/cjs/hooks/use-list-navigation/input-modality.js +59 -0
- package/cjs/hooks/use-list-navigation/store.js +70 -0
- package/cjs/hooks/use-list-navigation/types.js +2 -0
- package/cjs/hooks/use-list-navigation/use-list-navigation-item.js +39 -0
- package/cjs/hooks/use-list-navigation/use-list-navigation.js +262 -0
- package/cjs/hooks/use-list-navigation/utils.js +52 -0
- package/cjs/hooks/use-load-more.js +74 -0
- package/cjs/hooks/use-mount.js +13 -0
- package/cjs/hooks/use-persistent-callback.js +18 -0
- package/cjs/hooks/use-platform.js +38 -0
- package/cjs/hooks/use-responsive-value.js +39 -0
- package/cjs/hooks/use-uniq-id.js +21 -0
- package/cjs/hooks/use-unmount.js +16 -0
- package/cjs/hooks/use-update-effect.js +27 -0
- package/cjs/hooks/use-viewport-exit.js +33 -0
- package/cjs/hooks/use-virtual-window.js +86 -0
- package/cjs/hooks/use-window-size.js +28 -0
- package/cjs/icon/icon.js +71 -0
- package/cjs/icon/index.js +17 -0
- package/cjs/icon/pack-utils.js +33 -0
- package/cjs/icon/styles.module.css +17 -0
- package/cjs/icons/arrow-icon.js +16 -0
- package/cjs/icons/back-icon.js +10 -0
- package/cjs/icons/calendar-icon.js +10 -0
- package/cjs/icons/check-icon.js +11 -0
- package/cjs/icons/clock-icon.js +11 -0
- package/cjs/icons/close-icon.js +10 -0
- package/cjs/icons/del-icon.js +10 -0
- package/cjs/icons/double-arrow-icon.js +15 -0
- package/cjs/icons/error-icon.js +10 -0
- package/cjs/icons/eye-icon.js +12 -0
- package/cjs/icons/index.js +31 -0
- package/cjs/icons/magnifying-glass-icon.js +10 -0
- package/cjs/icons/minus-icon.js +10 -0
- package/cjs/icons/plus-icon.js +10 -0
- package/cjs/icons/reset-icon.js +10 -0
- package/cjs/icons/shopping-icon.js +10 -0
- package/cjs/icons/stars/star-fill-icon.js +10 -0
- package/cjs/icons/stars/star-half-icon.js +10 -0
- package/cjs/icons/stars/start-outline-icon.js +10 -0
- package/cjs/icons/types.js +2 -0
- package/cjs/image/image-viewer.js +47 -0
- package/cjs/image/image.js +73 -0
- package/cjs/image/index.js +17 -0
- package/cjs/image/style.module.css +65 -0
- package/cjs/image/types.js +2 -0
- package/cjs/image/use-image.js +47 -0
- package/cjs/image/viewer.module.css +80 -0
- package/cjs/index.js +87 -0
- package/cjs/input/fields/password-toggle.js +14 -0
- package/cjs/input/fields/text-field.js +29 -0
- package/cjs/input/fields/use-text-field.js +79 -0
- package/cjs/input/index.js +17 -0
- package/cjs/input/input.js +24 -0
- package/cjs/input/types.js +2 -0
- package/cjs/label/index.js +18 -0
- package/cjs/label/label.js +82 -0
- package/cjs/label/styles.module.css +25 -0
- package/cjs/label/types.js +2 -0
- package/cjs/list/clear-all-button/clear-all-button.js +47 -0
- package/cjs/list/clear-all-button/index.js +17 -0
- package/cjs/list/constants.js +4 -0
- package/cjs/list/index.js +24 -0
- package/cjs/list/list-context.js +14 -0
- package/cjs/list/list-divider/index.js +17 -0
- package/cjs/list/list-divider/list-divider.js +49 -0
- package/cjs/list/list-divider/styles.module.css +7 -0
- package/cjs/list/list-divider/use-list-divider.js +15 -0
- package/cjs/list/list-item/index.js +5 -0
- package/cjs/list/list-item/list-icon.js +61 -0
- package/cjs/list/list-item/list-item-provider.js +21 -0
- package/cjs/list/list-item/list-item.js +32 -0
- package/cjs/list/list-item/styles.module.css +216 -0
- package/cjs/list/list-item/types.js +2 -0
- package/cjs/list/list-item/use-list-item.js +78 -0
- package/cjs/list/list-item/use-nested-list.js +17 -0
- package/cjs/list/list-section/index.js +17 -0
- package/cjs/list/list-section/list-section.js +67 -0
- package/cjs/list/list-section/styles.module.css +27 -0
- package/cjs/list/list.js +39 -0
- package/cjs/list/styles.module.css +24 -0
- package/cjs/list/types.js +2 -0
- package/cjs/list/use-list.js +73 -0
- package/cjs/loader/index.js +17 -0
- package/cjs/loader/loader.js +31 -0
- package/cjs/loader/loader.module.css +80 -0
- package/cjs/locale/create-translator.js +13 -0
- package/cjs/locale/en.js +109 -0
- package/cjs/locale/index.js +13 -0
- package/cjs/locale/locale-provider.js +23 -0
- package/cjs/locale/ru.js +109 -0
- package/cjs/locale/types.js +2 -0
- package/cjs/locale/use-locale.js +11 -0
- package/cjs/masked-input/constants.js +8 -0
- package/cjs/masked-input/hooks.js +179 -0
- package/cjs/masked-input/index.js +5 -0
- package/cjs/masked-input/mask-types.js +2 -0
- package/cjs/masked-input/masked-input.js +27 -0
- package/cjs/masked-input/types.js +2 -0
- package/cjs/masked-input/use-mask.js +168 -0
- package/cjs/masked-input/utils/get-autofill-selector.js +14 -0
- package/cjs/masked-input/utils/helpers.js +61 -0
- package/cjs/masked-input/utils/index.js +20 -0
- package/cjs/masked-input/utils/mask-utils.js +211 -0
- package/cjs/masked-input/utils/parse-mask.js +61 -0
- package/cjs/masked-input/utils/validate-props.js +15 -0
- package/cjs/modal/constants.js +5 -0
- package/cjs/modal/index.js +26 -0
- package/cjs/modal/modal-close-button.js +20 -0
- package/cjs/modal/modal-content.js +43 -0
- package/cjs/modal/modal-context.js +13 -0
- package/cjs/modal/modal-footer.js +57 -0
- package/cjs/modal/modal-header.js +57 -0
- package/cjs/modal/modal.js +63 -0
- package/cjs/modal/styles/_animations.css +124 -0
- package/cjs/modal/styles/_config.css +0 -0
- package/cjs/modal/styles/modal-content.module.css +30 -0
- package/cjs/modal/styles/modal-footer.module.css +31 -0
- package/cjs/modal/styles/modal-header.module.css +56 -0
- package/cjs/modal/styles/modal.module.css +284 -0
- package/cjs/modal/types.js +2 -0
- package/cjs/modal/use-modal-refs.js +16 -0
- package/cjs/modal/use-modal.js +52 -0
- package/cjs/modal/utils.js +17 -0
- package/cjs/navigation/context.js +24 -0
- package/cjs/navigation/index.js +25 -0
- package/cjs/navigation/navigation-compact.js +122 -0
- package/cjs/navigation/navigation-control.js +89 -0
- package/cjs/navigation/navigation-item-content.js +33 -0
- package/cjs/navigation/navigation-list.js +87 -0
- package/cjs/navigation/navigation-rail.js +31 -0
- package/cjs/navigation/navigation-row.js +86 -0
- package/cjs/navigation/navigation-tree.js +100 -0
- package/cjs/navigation/navigation-views.js +114 -0
- package/cjs/navigation/navigation.js +153 -0
- package/cjs/navigation/storage.js +28 -0
- package/cjs/navigation/styles/navigation.module.css +567 -0
- package/cjs/navigation/types.js +2 -0
- package/cjs/navigation/use-item-tooltip.js +22 -0
- package/cjs/navigation/use-navigation-types.js +2 -0
- package/cjs/navigation/use-navigation.js +141 -0
- package/cjs/navigation/use-overflow.js +41 -0
- package/cjs/navigation/utils.js +102 -0
- package/cjs/number-input/format-types.js +8 -0
- package/cjs/number-input/format-utils.js +166 -0
- package/cjs/number-input/hooks/index.js +5 -0
- package/cjs/number-input/hooks/use-numeric-format.js +139 -0
- package/cjs/number-input/index.js +5 -0
- package/cjs/number-input/number-input.js +26 -0
- package/cjs/number-input/types.js +2 -0
- package/cjs/number-input/use-number-input.js +405 -0
- package/cjs/number-input/utils.js +323 -0
- package/cjs/pagination/index.js +9 -0
- package/cjs/pagination/items.js +48 -0
- package/cjs/pagination/labels.js +17 -0
- package/cjs/pagination/pagination.js +65 -0
- package/cjs/pagination/styles.module.css +125 -0
- package/cjs/pagination/types.js +2 -0
- package/cjs/pagination/use-pagination.js +27 -0
- package/cjs/pin-input/index.js +5 -0
- package/cjs/pin-input/pin-input.js +33 -0
- package/cjs/pin-input/styles.module.css +68 -0
- package/cjs/pin-input/types.js +2 -0
- package/cjs/pin-input/use-pin-input.js +137 -0
- package/cjs/pin-input/utils.js +17 -0
- package/cjs/popover/index.js +10 -0
- package/cjs/popover/popover.js +43 -0
- package/cjs/popover/styles.module.css +76 -0
- package/cjs/popover/types.js +2 -0
- package/cjs/popover/use-popover.js +125 -0
- package/cjs/portal/index.js +11 -0
- package/cjs/portal/portal-provider.js +21 -0
- package/cjs/portal/portal.js +48 -0
- package/cjs/portal/resolve-container.js +14 -0
- package/cjs/portal/types.js +2 -0
- package/cjs/portal/use-portal.js +51 -0
- package/cjs/progress-bar/index.js +17 -0
- package/cjs/progress-bar/progress-bar.js +57 -0
- package/cjs/progress-bar/styles.module.css +147 -0
- package/cjs/progress-bar/types.js +2 -0
- package/cjs/quantity-input/index.js +17 -0
- package/cjs/quantity-input/quantity-input.js +123 -0
- package/cjs/quantity-input/styles.module.css +44 -0
- package/cjs/quantity-input/types.js +2 -0
- package/cjs/quantity-input/utils.js +25 -0
- package/cjs/radio/index.js +18 -0
- package/cjs/radio/radio.js +50 -0
- package/cjs/radio/styles.module.css +161 -0
- package/cjs/radio/types.js +2 -0
- package/cjs/radio-group/index.js +20 -0
- package/cjs/radio-group/radio-group-context.js +11 -0
- package/cjs/radio-group/radio-group.js +81 -0
- package/cjs/radio-group/styles.module.css +12 -0
- package/cjs/radio-group/use-radio-group.js +8 -0
- package/cjs/segmented-control/index.js +7 -0
- package/cjs/segmented-control/segmented-control-context.js +11 -0
- package/cjs/segmented-control/segmented-control-item.js +79 -0
- package/cjs/segmented-control/segmented-control.js +75 -0
- package/cjs/segmented-control/styles/_variables.css +0 -0
- package/cjs/segmented-control/styles/segmented-control-item.module.css +194 -0
- package/cjs/segmented-control/styles/segmented-control.module.css +31 -0
- package/cjs/segmented-control/types.js +2 -0
- package/cjs/segmented-control/use-segmented-control.js +33 -0
- package/cjs/select/class-names-context.js +7 -0
- package/cjs/select/components/render-grouped-options.js +48 -0
- package/cjs/select/components/select-field-multiselect-value.js +56 -0
- package/cjs/select/components/select-field-value.js +60 -0
- package/cjs/select/components/select-field.js +221 -0
- package/cjs/select/components/select-load-more-indicator.js +13 -0
- package/cjs/select/components/select-multiselect-panel.js +202 -0
- package/cjs/select/components/select-option-list.js +111 -0
- package/cjs/select/components/select-option-row.js +79 -0
- package/cjs/select/components/select-options-scroll-area.js +14 -0
- package/cjs/select/components/select-panel-status.js +23 -0
- package/cjs/select/components/select-single-panel.js +47 -0
- package/cjs/select/hooks/use-auto-scroll-to-bottom.js +26 -0
- package/cjs/select/hooks/use-chips-row-count.js +65 -0
- package/cjs/select/hooks/use-multiselect-collapsed-display.js +137 -0
- package/cjs/select/hooks/use-select-dismiss.js +82 -0
- package/cjs/select/hooks/use-select-input-bindings.js +46 -0
- package/cjs/select/hooks/use-select-keyboard.js +174 -0
- package/cjs/select/hooks/use-select-multiselect-panel-state.js +31 -0
- package/cjs/select/hooks/use-select-search.js +261 -0
- package/cjs/select/hooks/use-select-view-model.js +169 -0
- package/cjs/select/hooks/use-select-virtual.js +35 -0
- package/cjs/select/hooks/use-select.js +438 -0
- package/cjs/select/index.js +40 -0
- package/cjs/select/presets/autocomplete.js +22 -0
- package/cjs/select/presets/index.js +17 -0
- package/cjs/select/select.js +25 -0
- package/cjs/select/styles/select-field.module.css +147 -0
- package/cjs/select/styles/select.module.css +457 -0
- package/cjs/select/types-search.js +2 -0
- package/cjs/select/types.js +2 -0
- package/cjs/select/utils/custom-search-option.js +42 -0
- package/cjs/select/utils/filter-options.js +28 -0
- package/cjs/select/utils/get-display-value.js +19 -0
- package/cjs/select/utils/get-element-content-width.js +14 -0
- package/cjs/select/utils/get-multiselect-display-labels.js +10 -0
- package/cjs/select/utils/get-status-content.js +13 -0
- package/cjs/select/utils/is-select-panel-compact-content.js +7 -0
- package/cjs/select/utils/measure-multiselect-row-width.js +19 -0
- package/cjs/select/utils/measure-text-width.js +78 -0
- package/cjs/select/utils/multiselect-collapsed-display-shared.js +156 -0
- package/cjs/select/utils/normalize-options.js +10 -0
- package/cjs/select/utils/normalize-value.js +23 -0
- package/cjs/select/utils/resolve-loading-state.js +13 -0
- package/cjs/select/utils/resolve-multiselect-collapsed-display.js +45 -0
- package/cjs/select/utils/resolve-search-content.js +9 -0
- package/cjs/select/utils/retain-combobox-focus.js +21 -0
- package/cjs/select/utils/select-keyboard-navigation.js +17 -0
- package/cjs/select/utils/select-load-more-scroll.js +24 -0
- package/cjs/select/utils/select-option-id.js +7 -0
- package/cjs/select/views/select-listbox.js +21 -0
- package/cjs/select/views/select-search-listbox.js +29 -0
- package/cjs/select/views/select-view.js +70 -0
- package/cjs/select/views/styles.module.css +45 -0
- package/cjs/show-more/hooks/use-show-more-view-model.js +79 -0
- package/cjs/show-more/index.js +5 -0
- package/cjs/show-more/show-more.js +21 -0
- package/cjs/show-more/styles.module.css +20 -0
- package/cjs/show-more/types.js +2 -0
- package/cjs/show-more/views/show-more-view.js +15 -0
- package/cjs/skeleton/index.js +18 -0
- package/cjs/skeleton/skeleton.js +50 -0
- package/cjs/skeleton/styles.module.css +300 -0
- package/cjs/skeleton/types.js +2 -0
- package/cjs/skeleton/use-skeleton.js +23 -0
- package/cjs/snackbar/index.js +21 -0
- package/cjs/snackbar/snack-button.js +57 -0
- package/cjs/snackbar/snack-view.js +105 -0
- package/cjs/snackbar/snack.js +64 -0
- package/cjs/snackbar/snackbar-context.js +13 -0
- package/cjs/snackbar/snackbar-provider.js +88 -0
- package/cjs/snackbar/snackbar.js +81 -0
- package/cjs/snackbar/styles/snack.module.css +195 -0
- package/cjs/snackbar/styles/snackbar.module.css +66 -0
- package/cjs/snackbar/types.js +2 -0
- package/cjs/snackbar/use-snack-timer.js +31 -0
- package/cjs/snackbar/use-snack.js +86 -0
- package/cjs/stack/index.js +17 -0
- package/cjs/stack/stack.js +40 -0
- package/cjs/stack/styles.module.css +46 -0
- package/cjs/stack/types.js +2 -0
- package/cjs/status/index.js +17 -0
- package/cjs/status/status-icon.js +26 -0
- package/cjs/status/styles.module.css +18 -0
- package/cjs/status/types.js +2 -0
- package/cjs/stepper/index.js +20 -0
- package/cjs/stepper/stepper.js +47 -0
- package/cjs/stepper/styles.module.css +172 -0
- package/cjs/stepper/types.js +2 -0
- package/cjs/stepper/use-stepper.js +28 -0
- package/cjs/switch/index.js +18 -0
- package/cjs/switch/styles/base.module.css +134 -0
- package/cjs/switch/switch.js +78 -0
- package/cjs/switch/types.js +2 -0
- package/cjs/tabs/context.js +13 -0
- package/cjs/tabs/index.js +23 -0
- package/cjs/tabs/styles/tab-list.module.css +23 -0
- package/cjs/tabs/styles/tab-panel.module.css +3 -0
- package/cjs/tabs/styles/tab.module.css +210 -0
- package/cjs/tabs/tab-list.js +109 -0
- package/cjs/tabs/tab-panel.js +55 -0
- package/cjs/tabs/tab.js +79 -0
- package/cjs/tabs/tabs.js +33 -0
- package/cjs/tabs/types.js +2 -0
- package/cjs/tabs/use-tabs.js +62 -0
- package/cjs/textarea/get-max-length-message.js +9 -0
- package/cjs/textarea/index.js +5 -0
- package/cjs/textarea/styles.module.css +37 -0
- package/cjs/textarea/textarea.js +26 -0
- package/cjs/textarea/types.js +2 -0
- package/cjs/textarea/use-auto-height.js +109 -0
- package/cjs/textarea/use-resize-handle.js +47 -0
- package/cjs/textarea/use-textarea.js +111 -0
- package/cjs/theme-provider/index.js +46 -0
- package/cjs/theme-provider/styles.module.css +332 -0
- package/cjs/theme-provider/theme-context.js +39 -0
- package/cjs/theme-provider/theme-provider.js +48 -0
- package/cjs/theme-provider/theme-scope.js +85 -0
- package/cjs/theme-provider/types.js +2 -0
- package/cjs/theme-provider/use-system-theme.js +26 -0
- package/cjs/theme-provider/use-theme-provider.js +28 -0
- package/cjs/time-picker/index.js +16 -0
- package/cjs/time-picker/picker-types.js +2 -0
- package/cjs/time-picker/single-time-picker.js +44 -0
- package/cjs/time-picker/styles.module.css +124 -0
- package/cjs/time-picker/time-model.js +149 -0
- package/cjs/time-picker/time-panel.js +87 -0
- package/cjs/time-picker/time-picker.js +80 -0
- package/cjs/time-picker/time-range-picker.js +51 -0
- package/cjs/time-picker/types.js +2 -0
- package/cjs/time-picker/use-time-panel.js +25 -0
- package/cjs/time-picker/use-time-picker.js +120 -0
- package/cjs/time-picker/use-time-range-picker.js +134 -0
- package/cjs/tokens/index.js +18 -0
- package/cjs/tooltip/index.js +17 -0
- package/cjs/tooltip/styles.module.css +46 -0
- package/cjs/tooltip/tooltip.js +70 -0
- package/cjs/tooltip/types.js +2 -0
- package/cjs/tooltip/use-tooltip.js +41 -0
- package/cjs/tree/check.js +106 -0
- package/cjs/tree/class-names-context.js +9 -0
- package/cjs/tree/highlight.js +29 -0
- package/cjs/tree/index.js +20 -0
- package/cjs/tree/model.js +119 -0
- package/cjs/tree/move.js +109 -0
- package/cjs/tree/styles.module.css +290 -0
- package/cjs/tree/tree-branch.js +78 -0
- package/cjs/tree/tree-placeholder.js +16 -0
- package/cjs/tree/tree-row-content.js +32 -0
- package/cjs/tree/tree-row-renderer.js +60 -0
- package/cjs/tree/tree-row.js +98 -0
- package/cjs/tree/tree-select-panel.js +15 -0
- package/cjs/tree/tree-select-selection.js +34 -0
- package/cjs/tree/tree-select-types.js +2 -0
- package/cjs/tree/tree-select.js +207 -0
- package/cjs/tree/tree-select.module.css +35 -0
- package/cjs/tree/tree.js +99 -0
- package/cjs/tree/types-row.js +2 -0
- package/cjs/tree/types.js +2 -0
- package/cjs/tree/use-tree-activate.js +17 -0
- package/cjs/tree/use-tree-checks.js +27 -0
- package/cjs/tree/use-tree-expansion.js +74 -0
- package/cjs/tree/use-tree-keyboard.js +94 -0
- package/cjs/tree/use-tree-virtual.js +76 -0
- package/cjs/tree/use-tree.js +111 -0
- package/cjs/tree/virtual-rows.js +15 -0
- package/cjs/types/size.js +2 -0
- package/cjs/typography/index.js +17 -0
- package/cjs/typography/styles.module.css +304 -0
- package/cjs/typography/types.js +2 -0
- package/cjs/typography/typography.js +30 -0
- package/cjs/utils/call-child-as-function.js +5 -0
- package/cjs/utils/class-names.js +168 -0
- package/cjs/utils/compose-event-handlers.js +18 -0
- package/cjs/utils/container-props-override.js +56 -0
- package/cjs/utils/create-id.js +13 -0
- package/cjs/utils/data-attributes.js +29 -0
- package/cjs/utils/decode-uri.js +50 -0
- package/cjs/utils/empty-function.js +7 -0
- package/cjs/utils/get-react-element-ref.js +16 -0
- package/cjs/utils/imperative-change-input-value.js +19 -0
- package/cjs/utils/index.js +38 -0
- package/cjs/utils/input-caret.js +48 -0
- package/cjs/utils/invariant.js +15 -0
- package/cjs/utils/is-browser.js +5 -0
- package/cjs/utils/is-new-theme.js +10 -0
- package/cjs/utils/merge-refs.js +39 -0
- package/cjs/utils/overridable-component.js +2 -0
- package/cjs/utils/shallow-objects-equal.js +20 -0
- package/cjs/utils/style/index.js +20 -0
- package/cjs/utils/style/props/color.js +9 -0
- package/cjs/utils/style/props/dimension.js +13 -0
- package/cjs/utils/style/props/index.js +19 -0
- package/cjs/utils/style/props/passthrough.js +5 -0
- package/cjs/utils/style/props/types.js +2 -0
- package/cjs/utils/style/types.js +2 -0
- package/cjs/utils/style/use-style-props.js +10 -0
- package/cjs/utils/style/utils/convert-style-props.js +26 -0
- package/cjs/utils/style/utils/index.js +17 -0
- package/cjs/utils/use-class-names.js +99 -0
- package/cjs/utils/utils.js +2 -0
- package/cjs/visually-hidden/index.js +17 -0
- package/cjs/visually-hidden/styles.module.css +9 -0
- package/cjs/visually-hidden/visually-hidden.js +12 -0
- package/container/container.d.ts +2 -0
- package/container/container.js +7 -0
- package/container/index.d.ts +2 -0
- package/container/index.js +1 -0
- package/container/styles.module.css +85 -0
- package/container/types.d.ts +9 -0
- package/container/types.js +1 -0
- package/css-baseline/css-baseline.d.ts +3 -0
- package/css-baseline/css-baseline.js +4 -0
- package/css-baseline/index.d.ts +1 -0
- package/css-baseline/index.js +1 -0
- package/css-baseline/styles.css +36 -0
- package/date-picker/date-picker-panel.d.ts +13 -0
- package/date-picker/date-picker-panel.js +35 -0
- package/date-picker/date-picker-sheet-footer.d.ts +6 -0
- package/date-picker/date-picker-sheet-footer.js +12 -0
- package/date-picker/date-picker.d.ts +12 -0
- package/date-picker/date-picker.js +70 -0
- package/date-picker/index.d.ts +4 -0
- package/date-picker/index.js +2 -0
- package/date-picker/range-time-panels.d.ts +16 -0
- package/date-picker/range-time-panels.js +19 -0
- package/date-picker/styles.module.css +125 -0
- package/date-picker/types.d.ts +173 -0
- package/date-picker/types.js +1 -0
- package/date-picker/use-date-picker.d.ts +56 -0
- package/date-picker/use-date-picker.js +282 -0
- package/date-picker/use-sheet-time.d.ts +8 -0
- package/date-picker/use-sheet-time.js +14 -0
- package/divider/divider.d.ts +10 -0
- package/divider/divider.js +18 -0
- package/divider/index.d.ts +2 -0
- package/divider/index.js +1 -0
- package/divider/styles.module.css +28 -0
- package/divider/types.d.ts +17 -0
- package/divider/types.js +1 -0
- package/drawer/content.d.ts +8 -0
- package/drawer/content.js +20 -0
- package/drawer/context.d.ts +13 -0
- package/drawer/context.js +11 -0
- package/drawer/drawer.d.ts +27 -0
- package/drawer/drawer.js +93 -0
- package/drawer/footer.d.ts +6 -0
- package/drawer/footer.js +28 -0
- package/drawer/header.d.ts +11 -0
- package/drawer/header.js +27 -0
- package/drawer/index.d.ts +5 -0
- package/drawer/index.js +5 -0
- package/drawer/normalize-padding.d.ts +2 -0
- package/drawer/normalize-padding.js +20 -0
- package/drawer/sheet-drag-config.d.ts +12 -0
- package/drawer/sheet-drag-config.js +13 -0
- package/drawer/sheet-drag-utils.d.ts +16 -0
- package/drawer/sheet-drag-utils.js +35 -0
- package/drawer/styles.module.css +266 -0
- package/drawer/types.d.ts +102 -0
- package/drawer/types.js +1 -0
- package/drawer/use-scroll-state.d.ts +11 -0
- package/drawer/use-scroll-state.js +31 -0
- package/drawer/use-sheet-drag.d.ts +25 -0
- package/drawer/use-sheet-drag.js +160 -0
- package/dropdown-menu/dropdown-menu-button.d.ts +8 -0
- package/dropdown-menu/dropdown-menu-button.js +22 -0
- package/dropdown-menu/dropdown-menu-context.d.ts +6 -0
- package/dropdown-menu/dropdown-menu-context.js +10 -0
- package/dropdown-menu/dropdown-menu-item.d.ts +6 -0
- package/dropdown-menu/dropdown-menu-item.js +9 -0
- package/dropdown-menu/dropdown-menu.d.ts +13 -0
- package/dropdown-menu/dropdown-menu.js +37 -0
- package/dropdown-menu/index.d.ts +4 -0
- package/dropdown-menu/index.js +3 -0
- package/dropdown-menu/styles.module.css +46 -0
- package/dropdown-menu/types.d.ts +64 -0
- package/dropdown-menu/types.js +1 -0
- package/dropdown-menu/use-dropdown-menu.d.ts +178 -0
- package/dropdown-menu/use-dropdown-menu.js +166 -0
- package/file/components/file-background-progress.d.ts +8 -0
- package/file/components/file-background-progress.js +14 -0
- package/file/components/file-emblem.d.ts +14 -0
- package/file/components/file-emblem.js +32 -0
- package/file/components/file-interactive-shell.d.ts +15 -0
- package/file/components/file-interactive-shell.js +9 -0
- package/file/components/file-name.d.ts +13 -0
- package/file/components/file-name.js +14 -0
- package/file/components/file-status-meta.d.ts +14 -0
- package/file/components/file-status-meta.js +14 -0
- package/file/constants.d.ts +32 -0
- package/file/constants.js +17 -0
- package/file/file-extensions.d.ts +2 -0
- package/file/file-extensions.js +113 -0
- package/file/file.d.ts +6 -0
- package/file/file.js +19 -0
- package/file/hooks/use-file-view-model.d.ts +31 -0
- package/file/hooks/use-file-view-model.js +117 -0
- package/file/icons/file-extension-glyph-icon.d.ts +6 -0
- package/file/icons/file-extension-glyph-icon.js +7 -0
- package/file/icons/file-extension-glyphs.d.ts +18 -0
- package/file/icons/file-extension-glyphs.js +17 -0
- package/file/icons/file-extension-icons.d.ts +3 -0
- package/file/icons/file-extension-icons.js +12 -0
- package/file/image-frame-size-class.d.ts +3 -0
- package/file/image-frame-size-class.js +11 -0
- package/file/index.d.ts +6 -0
- package/file/index.js +4 -0
- package/file/presets/remove-preset.d.ts +10 -0
- package/file/presets/remove-preset.js +29 -0
- package/file/presets/retry-preset.d.ts +9 -0
- package/file/presets/retry-preset.js +18 -0
- package/file/styles.module.css +565 -0
- package/file/types.d.ts +62 -0
- package/file/types.js +1 -0
- package/file/utils/file-name-parts.d.ts +15 -0
- package/file/utils/file-name-parts.js +21 -0
- package/file/utils/format-size.d.ts +7 -0
- package/file/utils/format-size.js +35 -0
- package/file/utils/get-file-presentation.d.ts +33 -0
- package/file/utils/get-file-presentation.js +48 -0
- package/file/utils/resolve-file-icon.d.ts +5 -0
- package/file/utils/resolve-file-icon.js +17 -0
- package/file/utils/resolve-file-slot.d.ts +10 -0
- package/file/utils/resolve-file-slot.js +52 -0
- package/file/utils/split-file-name.d.ts +6 -0
- package/file/utils/split-file-name.js +12 -0
- package/file/views/file-default-view.d.ts +6 -0
- package/file/views/file-default-view.js +22 -0
- package/file/views/file-image-view.d.ts +6 -0
- package/file/views/file-image-view.js +17 -0
- package/file-upload/components/drop-overlay.d.ts +8 -0
- package/file-upload/components/drop-overlay.js +29 -0
- package/file-upload/components/file-upload-button-trigger.d.ts +9 -0
- package/file-upload/components/file-upload-button-trigger.js +11 -0
- package/file-upload/components/file-upload-hint-caption.d.ts +8 -0
- package/file-upload/components/file-upload-hint-caption.js +9 -0
- package/file-upload/components/file-upload-icon-button.d.ts +10 -0
- package/file-upload/components/file-upload-icon-button.js +14 -0
- package/file-upload/components/image-loader-icons.d.ts +7 -0
- package/file-upload/components/image-loader-icons.js +8 -0
- package/file-upload/components/image-loader-trigger.d.ts +12 -0
- package/file-upload/components/image-loader-trigger.js +14 -0
- package/file-upload/constants.d.ts +33 -0
- package/file-upload/constants.js +39 -0
- package/file-upload/file-upload.d.ts +10 -0
- package/file-upload/file-upload.js +16 -0
- package/file-upload/hooks/use-drag-overlay.d.ts +11 -0
- package/file-upload/hooks/use-drag-overlay.js +110 -0
- package/file-upload/hooks/use-file-list.d.ts +22 -0
- package/file-upload/hooks/use-file-list.js +188 -0
- package/file-upload/hooks/use-file-upload-view-model.d.ts +51 -0
- package/file-upload/hooks/use-file-upload-view-model.js +185 -0
- package/file-upload/hooks/use-object-url.d.ts +3 -0
- package/file-upload/hooks/use-object-url.js +27 -0
- package/file-upload/index.d.ts +16 -0
- package/file-upload/index.js +10 -0
- package/file-upload/styles.module.css +345 -0
- package/file-upload/types-dropzone.d.ts +18 -0
- package/file-upload/types-dropzone.js +1 -0
- package/file-upload/types-file-actions.d.ts +13 -0
- package/file-upload/types-file-actions.js +1 -0
- package/file-upload/types-labels.d.ts +44 -0
- package/file-upload/types-labels.js +1 -0
- package/file-upload/types.d.ts +155 -0
- package/file-upload/types.js +2 -0
- package/file-upload/utils/accept.d.ts +3 -0
- package/file-upload/utils/accept.js +44 -0
- package/file-upload/utils/build-file-slots.d.ts +16 -0
- package/file-upload/utils/build-file-slots.js +16 -0
- package/file-upload/utils/compute-drop-border-vertical-dash-style.d.ts +18 -0
- package/file-upload/utils/compute-drop-border-vertical-dash-style.js +41 -0
- package/file-upload/utils/get-drop-zone-typography.d.ts +12 -0
- package/file-upload/utils/get-drop-zone-typography.js +11 -0
- package/file-upload/utils/get-file-upload-presentation.d.ts +35 -0
- package/file-upload/utils/get-file-upload-presentation.js +65 -0
- package/file-upload/utils/max-count.d.ts +6 -0
- package/file-upload/utils/max-count.js +20 -0
- package/file-upload/utils/normalize.d.ts +3 -0
- package/file-upload/utils/normalize.js +63 -0
- package/file-upload/utils/render-drop-zone-hint-content.d.ts +6 -0
- package/file-upload/utils/render-drop-zone-hint-content.js +27 -0
- package/file-upload/utils/resolve-display-error.d.ts +6 -0
- package/file-upload/utils/resolve-display-error.js +15 -0
- package/file-upload/utils/resolve-hint-content.d.ts +12 -0
- package/file-upload/utils/resolve-hint-content.js +56 -0
- package/file-upload/utils/resolve-labels.d.ts +21 -0
- package/file-upload/utils/resolve-labels.js +34 -0
- package/file-upload/utils/resolve-preset.d.ts +14 -0
- package/file-upload/utils/resolve-preset.js +39 -0
- package/file-upload/utils/resolve-upload-file-error.d.ts +1 -0
- package/file-upload/utils/resolve-upload-file-error.js +9 -0
- package/file-upload/utils/resolve-upload-text.d.ts +2 -0
- package/file-upload/utils/resolve-upload-text.js +6 -0
- package/file-upload/utils/run-before-upload.d.ts +6 -0
- package/file-upload/utils/run-before-upload.js +25 -0
- package/file-upload/utils/run-sequentially.d.ts +2 -0
- package/file-upload/utils/run-sequentially.js +4 -0
- package/file-upload/utils/uid.d.ts +1 -0
- package/file-upload/utils/uid.js +4 -0
- package/file-upload/views/file-upload-dropzone-view.d.ts +6 -0
- package/file-upload/views/file-upload-dropzone-view.js +48 -0
- package/file-upload/views/file-upload-errors-view.d.ts +8 -0
- package/file-upload/views/file-upload-errors-view.js +7 -0
- package/file-upload/views/file-upload-footer-view.d.ts +6 -0
- package/file-upload/views/file-upload-footer-view.js +17 -0
- package/file-upload/views/file-upload-list-view.d.ts +8 -0
- package/file-upload/views/file-upload-list-view.js +38 -0
- package/file-upload/views/file-upload-trigger-view.d.ts +8 -0
- package/file-upload/views/file-upload-trigger-view.js +62 -0
- package/file-upload/views/file-upload-view.d.ts +6 -0
- package/file-upload/views/file-upload-view.js +17 -0
- package/grid/grid.d.ts +23 -0
- package/grid/grid.js +111 -0
- package/grid/index.d.ts +3 -0
- package/grid/index.js +2 -0
- package/grid/presets.d.ts +1 -0
- package/grid/presets.js +1 -0
- package/grid/styles.module.css +56 -0
- package/grid/types.d.ts +52 -0
- package/grid/types.js +1 -0
- package/grid-item/grid-item.d.ts +2 -0
- package/grid-item/grid-item.js +13 -0
- package/grid-item/index.d.ts +2 -0
- package/grid-item/index.js +1 -0
- package/grid-item/types.d.ts +13 -0
- package/grid-item/types.js +1 -0
- package/hint/buttons/action-button.d.ts +9 -0
- package/hint/buttons/action-button.js +19 -0
- package/hint/buttons/close-button.d.ts +10 -0
- package/hint/buttons/close-button.js +23 -0
- package/hint/buttons/extra-button.d.ts +9 -0
- package/hint/buttons/extra-button.js +19 -0
- package/hint/hint-content.d.ts +17 -0
- package/hint/hint-content.js +21 -0
- package/hint/hint-provider.d.ts +6 -0
- package/hint/hint-provider.js +10 -0
- package/hint/hint.d.ts +12 -0
- package/hint/hint.js +50 -0
- package/hint/index.d.ts +6 -0
- package/hint/index.js +5 -0
- package/hint/styles/buttons.module.css +16 -0
- package/hint/styles/hint-content.module.css +33 -0
- package/hint/styles/hint.module.css +37 -0
- package/hint/types.d.ts +103 -0
- package/hint/types.js +1 -0
- package/hooks/index.d.ts +21 -0
- package/hooks/index.js +21 -0
- package/hooks/media-query/create-media-query.d.ts +2 -0
- package/hooks/media-query/create-media-query.js +19 -0
- package/hooks/media-query/index.d.ts +3 -0
- package/hooks/media-query/index.js +2 -0
- package/hooks/media-query/observe-media-query.d.ts +5 -0
- package/hooks/media-query/observe-media-query.js +25 -0
- package/hooks/media-query/types.d.ts +8 -0
- package/hooks/media-query/types.js +1 -0
- package/hooks/media-query/use-media-query-listener.d.ts +8 -0
- package/hooks/media-query/use-media-query-listener.js +32 -0
- package/hooks/media-query/use-media-query.d.ts +10 -0
- package/hooks/media-query/use-media-query.js +24 -0
- package/hooks/use-actual-ref.d.ts +7 -0
- package/hooks/use-actual-ref.js +11 -0
- package/hooks/use-breakpoint.d.ts +13 -0
- package/hooks/use-breakpoint.js +50 -0
- package/hooks/use-click-outside.d.ts +5 -0
- package/hooks/use-click-outside.js +40 -0
- package/hooks/use-component-tokens.d.ts +12 -0
- package/hooks/use-component-tokens.js +17 -0
- package/hooks/use-cssvar-from-width.d.ts +3 -0
- package/hooks/use-cssvar-from-width.js +31 -0
- package/hooks/use-effect-once.d.ts +6 -0
- package/hooks/use-effect-once.js +10 -0
- package/hooks/use-isomorphic-layout-effect.d.ts +2 -0
- package/hooks/use-isomorphic-layout-effect.js +6 -0
- package/hooks/use-keyboard-callbacks.d.ts +15 -0
- package/hooks/use-keyboard-callbacks.js +121 -0
- package/hooks/use-keyboard-navigation.d.ts +14 -0
- package/hooks/use-keyboard-navigation.js +63 -0
- package/hooks/use-list-navigation/index.d.ts +8 -0
- package/hooks/use-list-navigation/index.js +4 -0
- package/hooks/use-list-navigation/input-modality.d.ts +8 -0
- package/hooks/use-list-navigation/input-modality.js +52 -0
- package/hooks/use-list-navigation/store.d.ts +31 -0
- package/hooks/use-list-navigation/store.js +67 -0
- package/hooks/use-list-navigation/types.d.ts +108 -0
- package/hooks/use-list-navigation/types.js +1 -0
- package/hooks/use-list-navigation/use-list-navigation-item.d.ts +12 -0
- package/hooks/use-list-navigation/use-list-navigation-item.js +36 -0
- package/hooks/use-list-navigation/use-list-navigation.d.ts +29 -0
- package/hooks/use-list-navigation/use-list-navigation.js +257 -0
- package/hooks/use-list-navigation/utils.d.ts +12 -0
- package/hooks/use-list-navigation/utils.js +47 -0
- package/hooks/use-load-more.d.ts +48 -0
- package/hooks/use-load-more.js +69 -0
- package/hooks/use-mount.d.ts +4 -0
- package/hooks/use-mount.js +10 -0
- package/hooks/use-persistent-callback.d.ts +5 -0
- package/hooks/use-persistent-callback.js +15 -0
- package/hooks/use-platform.d.ts +5 -0
- package/hooks/use-platform.js +34 -0
- package/hooks/use-responsive-value.d.ts +20 -0
- package/hooks/use-responsive-value.js +34 -0
- package/hooks/use-uniq-id.d.ts +12 -0
- package/hooks/use-uniq-id.js +16 -0
- package/hooks/use-unmount.d.ts +4 -0
- package/hooks/use-unmount.js +13 -0
- package/hooks/use-update-effect.d.ts +8 -0
- package/hooks/use-update-effect.js +23 -0
- package/hooks/use-viewport-exit.d.ts +6 -0
- package/hooks/use-viewport-exit.js +29 -0
- package/hooks/use-virtual-window.d.ts +44 -0
- package/hooks/use-virtual-window.js +83 -0
- package/hooks/use-window-size.d.ts +7 -0
- package/hooks/use-window-size.js +23 -0
- package/icon/icon.d.ts +118 -0
- package/icon/icon.js +32 -0
- package/icon/index.d.ts +1 -0
- package/icon/index.js +1 -0
- package/icon/pack-utils.d.ts +19 -0
- package/icon/pack-utils.js +24 -0
- package/icon/styles.module.css +17 -0
- package/icons/arrow-icon.d.ts +8 -0
- package/icons/arrow-icon.js +9 -0
- package/icons/back-icon.d.ts +2 -0
- package/icons/back-icon.js +3 -0
- package/icons/calendar-icon.d.ts +2 -0
- package/icons/calendar-icon.js +3 -0
- package/icons/check-icon.d.ts +2 -0
- package/icons/check-icon.js +5 -0
- package/icons/clock-icon.d.ts +2 -0
- package/icons/clock-icon.js +5 -0
- package/icons/close-icon.d.ts +2 -0
- package/icons/close-icon.js +3 -0
- package/icons/del-icon.d.ts +2 -0
- package/icons/del-icon.js +3 -0
- package/icons/double-arrow-icon.d.ts +6 -0
- package/icons/double-arrow-icon.js +8 -0
- package/icons/error-icon.d.ts +2 -0
- package/icons/error-icon.js +3 -0
- package/icons/eye-icon.d.ts +3 -0
- package/icons/eye-icon.js +4 -0
- package/icons/index.d.ts +15 -0
- package/icons/index.js +15 -0
- package/icons/magnifying-glass-icon.d.ts +2 -0
- package/icons/magnifying-glass-icon.js +3 -0
- package/icons/minus-icon.d.ts +2 -0
- package/icons/minus-icon.js +3 -0
- package/icons/plus-icon.d.ts +2 -0
- package/icons/plus-icon.js +3 -0
- package/icons/reset-icon.d.ts +2 -0
- package/icons/reset-icon.js +3 -0
- package/icons/shopping-icon.d.ts +2 -0
- package/icons/shopping-icon.js +3 -0
- package/icons/stars/star-fill-icon.d.ts +2 -0
- package/icons/stars/star-fill-icon.js +3 -0
- package/icons/stars/star-half-icon.d.ts +4 -0
- package/icons/stars/star-half-icon.js +3 -0
- package/icons/stars/start-outline-icon.d.ts +5 -0
- package/icons/stars/start-outline-icon.js +3 -0
- package/icons/types.d.ts +2 -0
- package/icons/types.js +1 -0
- package/image/image-viewer.d.ts +17 -0
- package/image/image-viewer.js +41 -0
- package/image/image.d.ts +27 -0
- package/image/image.js +67 -0
- package/image/index.d.ts +2 -0
- package/image/index.js +1 -0
- package/image/style.module.css +65 -0
- package/image/types.d.ts +88 -0
- package/image/types.js +1 -0
- package/image/use-image.d.ts +18 -0
- package/image/use-image.js +44 -0
- package/image/viewer.module.css +80 -0
- package/index.d.ts +67 -0
- package/index.js +64 -0
- package/input/fields/password-toggle.d.ts +10 -0
- package/input/fields/password-toggle.js +10 -0
- package/input/fields/text-field.d.ts +3 -0
- package/input/fields/text-field.js +23 -0
- package/input/fields/use-text-field.d.ts +676 -0
- package/input/fields/use-text-field.js +76 -0
- package/input/index.d.ts +2 -0
- package/input/index.js +1 -0
- package/input/input.d.ts +13 -0
- package/input/input.js +18 -0
- package/input/types.d.ts +30 -0
- package/input/types.js +1 -0
- package/label/index.d.ts +2 -0
- package/label/index.js +2 -0
- package/label/label.d.ts +19 -0
- package/label/label.js +43 -0
- package/label/styles.module.css +25 -0
- package/label/types.d.ts +45 -0
- package/label/types.js +1 -0
- package/list/clear-all-button/clear-all-button.d.ts +9 -0
- package/list/clear-all-button/clear-all-button.js +11 -0
- package/list/clear-all-button/index.d.ts +1 -0
- package/list/clear-all-button/index.js +1 -0
- package/list/constants.d.ts +1 -0
- package/list/constants.js +1 -0
- package/list/index.d.ts +6 -0
- package/list/index.js +4 -0
- package/list/list-context.d.ts +15 -0
- package/list/list-context.js +10 -0
- package/list/list-divider/index.d.ts +1 -0
- package/list/list-divider/index.js +1 -0
- package/list/list-divider/list-divider.d.ts +2 -0
- package/list/list-divider/list-divider.js +10 -0
- package/list/list-divider/styles.module.css +7 -0
- package/list/list-divider/use-list-divider.d.ts +3 -0
- package/list/list-divider/use-list-divider.js +12 -0
- package/list/list-item/index.d.ts +2 -0
- package/list/list-item/index.js +1 -0
- package/list/list-item/list-icon.d.ts +11 -0
- package/list/list-item/list-icon.js +22 -0
- package/list/list-item/list-item-provider.d.ts +13 -0
- package/list/list-item/list-item-provider.js +14 -0
- package/list/list-item/list-item.d.ts +5 -0
- package/list/list-item/list-item.js +26 -0
- package/list/list-item/styles.module.css +216 -0
- package/list/list-item/types.d.ts +100 -0
- package/list/list-item/types.js +1 -0
- package/list/list-item/use-list-item.d.ts +28 -0
- package/list/list-item/use-list-item.js +75 -0
- package/list/list-item/use-nested-list.d.ts +4 -0
- package/list/list-item/use-nested-list.js +14 -0
- package/list/list-section/index.d.ts +1 -0
- package/list/list-section/index.js +1 -0
- package/list/list-section/list-section.d.ts +32 -0
- package/list/list-section/list-section.js +28 -0
- package/list/list-section/styles.module.css +27 -0
- package/list/list.d.ts +20 -0
- package/list/list.js +33 -0
- package/list/styles.module.css +24 -0
- package/list/types.d.ts +73 -0
- package/list/types.js +1 -0
- package/list/use-list.d.ts +17 -0
- package/list/use-list.js +70 -0
- package/loader/index.d.ts +1 -0
- package/loader/index.js +1 -0
- package/loader/loader.d.ts +46 -0
- package/loader/loader.js +24 -0
- package/loader/loader.module.css +80 -0
- package/locale/create-translator.d.ts +8 -0
- package/locale/create-translator.js +10 -0
- package/locale/en.d.ts +2 -0
- package/locale/en.js +106 -0
- package/locale/index.d.ts +8 -0
- package/locale/index.js +5 -0
- package/locale/locale-provider.d.ts +30 -0
- package/locale/locale-provider.js +17 -0
- package/locale/ru.d.ts +2 -0
- package/locale/ru.js +106 -0
- package/locale/types.d.ts +183 -0
- package/locale/types.js +1 -0
- package/locale/use-locale.d.ts +9 -0
- package/locale/use-locale.js +8 -0
- package/masked-input/constants.d.ts +5 -0
- package/masked-input/constants.js +5 -0
- package/masked-input/hooks.d.ts +14 -0
- package/masked-input/hooks.js +172 -0
- package/masked-input/index.d.ts +3 -0
- package/masked-input/index.js +1 -0
- package/masked-input/mask-types.d.ts +27 -0
- package/masked-input/mask-types.js +1 -0
- package/masked-input/masked-input.d.ts +12 -0
- package/masked-input/masked-input.js +21 -0
- package/masked-input/types.d.ts +27 -0
- package/masked-input/types.js +1 -0
- package/masked-input/use-mask.d.ts +648 -0
- package/masked-input/use-mask.js +164 -0
- package/masked-input/utils/get-autofill-selector.d.ts +1 -0
- package/masked-input/utils/get-autofill-selector.js +11 -0
- package/masked-input/utils/helpers.d.ts +17 -0
- package/masked-input/utils/helpers.js +50 -0
- package/masked-input/utils/index.d.ts +4 -0
- package/masked-input/utils/index.js +4 -0
- package/masked-input/utils/mask-utils.d.ts +20 -0
- package/masked-input/utils/mask-utils.js +207 -0
- package/masked-input/utils/parse-mask.d.ts +2 -0
- package/masked-input/utils/parse-mask.js +57 -0
- package/masked-input/utils/validate-props.d.ts +3 -0
- package/masked-input/utils/validate-props.js +10 -0
- package/modal/constants.d.ts +2 -0
- package/modal/constants.js +2 -0
- package/modal/index.d.ts +5 -0
- package/modal/index.js +5 -0
- package/modal/modal-close-button.d.ts +3 -0
- package/modal/modal-close-button.js +13 -0
- package/modal/modal-content.d.ts +5 -0
- package/modal/modal-content.js +37 -0
- package/modal/modal-context.d.ts +18 -0
- package/modal/modal-context.js +10 -0
- package/modal/modal-footer.d.ts +8 -0
- package/modal/modal-footer.js +18 -0
- package/modal/modal-header.d.ts +8 -0
- package/modal/modal-header.js +18 -0
- package/modal/modal.d.ts +22 -0
- package/modal/modal.js +56 -0
- package/modal/styles/_animations.css +124 -0
- package/modal/styles/_config.css +0 -0
- package/modal/styles/modal-content.module.css +30 -0
- package/modal/styles/modal-footer.module.css +31 -0
- package/modal/styles/modal-header.module.css +56 -0
- package/modal/styles/modal.module.css +284 -0
- package/modal/types.d.ts +74 -0
- package/modal/types.js +1 -0
- package/modal/use-modal-refs.d.ts +5 -0
- package/modal/use-modal-refs.js +12 -0
- package/modal/use-modal.d.ts +22 -0
- package/modal/use-modal.js +49 -0
- package/modal/utils.d.ts +11 -0
- package/modal/utils.js +12 -0
- package/navigation/context.d.ts +72 -0
- package/navigation/context.js +19 -0
- package/navigation/index.d.ts +5 -0
- package/navigation/index.js +3 -0
- package/navigation/navigation-compact.d.ts +12 -0
- package/navigation/navigation-compact.js +83 -0
- package/navigation/navigation-control.d.ts +15 -0
- package/navigation/navigation-control.js +53 -0
- package/navigation/navigation-item-content.d.ts +25 -0
- package/navigation/navigation-item-content.js +26 -0
- package/navigation/navigation-list.d.ts +15 -0
- package/navigation/navigation-list.js +51 -0
- package/navigation/navigation-rail.d.ts +9 -0
- package/navigation/navigation-rail.js +25 -0
- package/navigation/navigation-row.d.ts +8 -0
- package/navigation/navigation-row.js +47 -0
- package/navigation/navigation-tree.d.ts +11 -0
- package/navigation/navigation-tree.js +61 -0
- package/navigation/navigation-views.d.ts +23 -0
- package/navigation/navigation-views.js +72 -0
- package/navigation/navigation.d.ts +45 -0
- package/navigation/navigation.js +114 -0
- package/navigation/storage.d.ts +2 -0
- package/navigation/storage.js +23 -0
- package/navigation/styles/navigation.module.css +567 -0
- package/navigation/types.d.ts +189 -0
- package/navigation/types.js +1 -0
- package/navigation/use-item-tooltip.d.ts +14 -0
- package/navigation/use-item-tooltip.js +17 -0
- package/navigation/use-navigation-types.d.ts +33 -0
- package/navigation/use-navigation-types.js +1 -0
- package/navigation/use-navigation.d.ts +8 -0
- package/navigation/use-navigation.js +138 -0
- package/navigation/use-overflow.d.ts +16 -0
- package/navigation/use-overflow.js +38 -0
- package/navigation/utils.d.ts +30 -0
- package/navigation/utils.js +90 -0
- package/number-input/format-types.d.ts +58 -0
- package/number-input/format-types.js +5 -0
- package/number-input/format-utils.d.ts +11 -0
- package/number-input/format-utils.js +160 -0
- package/number-input/hooks/index.d.ts +2 -0
- package/number-input/hooks/index.js +1 -0
- package/number-input/hooks/use-numeric-format.d.ts +15 -0
- package/number-input/hooks/use-numeric-format.js +133 -0
- package/number-input/index.d.ts +2 -0
- package/number-input/index.js +1 -0
- package/number-input/number-input.d.ts +11 -0
- package/number-input/number-input.js +20 -0
- package/number-input/types.d.ts +47 -0
- package/number-input/types.js +1 -0
- package/number-input/use-number-input.d.ts +664 -0
- package/number-input/use-number-input.js +402 -0
- package/number-input/utils.d.ts +63 -0
- package/number-input/utils.js +300 -0
- package/package.json +361 -4
- package/pagination/index.d.ts +6 -0
- package/pagination/index.js +3 -0
- package/pagination/items.d.ts +21 -0
- package/pagination/items.js +44 -0
- package/pagination/labels.d.ts +4 -0
- package/pagination/labels.js +13 -0
- package/pagination/pagination.d.ts +30 -0
- package/pagination/pagination.js +59 -0
- package/pagination/styles.module.css +125 -0
- package/pagination/types.d.ts +99 -0
- package/pagination/types.js +1 -0
- package/pagination/use-pagination.d.ts +13 -0
- package/pagination/use-pagination.js +24 -0
- package/pin-input/index.d.ts +2 -0
- package/pin-input/index.js +1 -0
- package/pin-input/pin-input.d.ts +26 -0
- package/pin-input/pin-input.js +27 -0
- package/pin-input/styles.module.css +68 -0
- package/pin-input/types.d.ts +83 -0
- package/pin-input/types.js +1 -0
- package/pin-input/use-pin-input.d.ts +23 -0
- package/pin-input/use-pin-input.js +134 -0
- package/pin-input/utils.d.ts +7 -0
- package/pin-input/utils.js +11 -0
- package/popover/index.d.ts +5 -0
- package/popover/index.js +3 -0
- package/popover/popover.d.ts +13 -0
- package/popover/popover.js +37 -0
- package/popover/styles.module.css +76 -0
- package/popover/types.d.ts +115 -0
- package/popover/types.js +1 -0
- package/popover/use-popover.d.ts +24 -0
- package/popover/use-popover.js +121 -0
- package/portal/index.d.ts +4 -0
- package/portal/index.js +3 -0
- package/portal/portal-provider.d.ts +13 -0
- package/portal/portal-provider.js +17 -0
- package/portal/portal.d.ts +34 -0
- package/portal/portal.js +42 -0
- package/portal/resolve-container.d.ts +3 -0
- package/portal/resolve-container.js +11 -0
- package/portal/types.d.ts +25 -0
- package/portal/types.js +1 -0
- package/portal/use-portal.d.ts +14 -0
- package/portal/use-portal.js +45 -0
- package/progress-bar/index.d.ts +2 -0
- package/progress-bar/index.js +1 -0
- package/progress-bar/progress-bar.d.ts +12 -0
- package/progress-bar/progress-bar.js +50 -0
- package/progress-bar/styles.module.css +147 -0
- package/progress-bar/types.d.ts +45 -0
- package/progress-bar/types.js +1 -0
- package/quantity-input/index.d.ts +2 -0
- package/quantity-input/index.js +1 -0
- package/quantity-input/quantity-input.d.ts +22 -0
- package/quantity-input/quantity-input.js +84 -0
- package/quantity-input/styles.module.css +44 -0
- package/quantity-input/types.d.ts +54 -0
- package/quantity-input/types.js +1 -0
- package/quantity-input/utils.d.ts +10 -0
- package/quantity-input/utils.js +16 -0
- package/radio/index.d.ts +2 -0
- package/radio/index.js +2 -0
- package/radio/radio.d.ts +9 -0
- package/radio/radio.js +44 -0
- package/radio/styles.module.css +161 -0
- package/radio/types.d.ts +40 -0
- package/radio/types.js +1 -0
- package/radio-group/index.d.ts +2 -0
- package/radio-group/index.js +2 -0
- package/radio-group/radio-group-context.d.ts +14 -0
- package/radio-group/radio-group-context.js +5 -0
- package/radio-group/radio-group.d.ts +57 -0
- package/radio-group/radio-group.js +41 -0
- package/radio-group/styles.module.css +12 -0
- package/radio-group/use-radio-group.d.ts +8 -0
- package/radio-group/use-radio-group.js +4 -0
- package/scss/_functions.scss +101 -0
- package/scss/_grid.scss +89 -0
- package/scss/_index.scss +6 -0
- package/scss/_interaction.scss +36 -0
- package/scss/_mixins.scss +62 -0
- package/scss/_tokens.generated.scss +578 -0
- package/scss/_tokens.scss +2 -0
- package/scss/_typography.scss +316 -0
- package/segmented-control/index.d.ts +3 -0
- package/segmented-control/index.js +2 -0
- package/segmented-control/segmented-control-context.d.ts +13 -0
- package/segmented-control/segmented-control-context.js +8 -0
- package/segmented-control/segmented-control-item.d.ts +3 -0
- package/segmented-control/segmented-control-item.js +39 -0
- package/segmented-control/segmented-control.d.ts +21 -0
- package/segmented-control/segmented-control.js +36 -0
- package/segmented-control/styles/_variables.css +0 -0
- package/segmented-control/styles/segmented-control-item.module.css +194 -0
- package/segmented-control/styles/segmented-control.module.css +31 -0
- package/segmented-control/types.d.ts +95 -0
- package/segmented-control/types.js +1 -0
- package/segmented-control/use-segmented-control.d.ts +9 -0
- package/segmented-control/use-segmented-control.js +30 -0
- package/select/class-names-context.d.ts +18 -0
- package/select/class-names-context.js +3 -0
- package/select/components/render-grouped-options.d.ts +18 -0
- package/select/components/render-grouped-options.js +41 -0
- package/select/components/select-field-multiselect-value.d.ts +23 -0
- package/select/components/select-field-multiselect-value.js +17 -0
- package/select/components/select-field-value.d.ts +38 -0
- package/select/components/select-field-value.js +54 -0
- package/select/components/select-field.d.ts +41 -0
- package/select/components/select-field.js +182 -0
- package/select/components/select-load-more-indicator.d.ts +6 -0
- package/select/components/select-load-more-indicator.js +7 -0
- package/select/components/select-multiselect-panel.d.ts +60 -0
- package/select/components/select-multiselect-panel.js +163 -0
- package/select/components/select-option-list.d.ts +23 -0
- package/select/components/select-option-list.js +72 -0
- package/select/components/select-option-row.d.ts +19 -0
- package/select/components/select-option-row.js +40 -0
- package/select/components/select-options-scroll-area.d.ts +13 -0
- package/select/components/select-options-scroll-area.js +8 -0
- package/select/components/select-panel-status.d.ts +11 -0
- package/select/components/select-panel-status.js +17 -0
- package/select/components/select-single-panel.d.ts +27 -0
- package/select/components/select-single-panel.js +41 -0
- package/select/hooks/use-auto-scroll-to-bottom.d.ts +7 -0
- package/select/hooks/use-auto-scroll-to-bottom.js +23 -0
- package/select/hooks/use-chips-row-count.d.ts +23 -0
- package/select/hooks/use-chips-row-count.js +61 -0
- package/select/hooks/use-multiselect-collapsed-display.d.ts +8 -0
- package/select/hooks/use-multiselect-collapsed-display.js +134 -0
- package/select/hooks/use-select-dismiss.d.ts +17 -0
- package/select/hooks/use-select-dismiss.js +79 -0
- package/select/hooks/use-select-input-bindings.d.ts +37 -0
- package/select/hooks/use-select-input-bindings.js +43 -0
- package/select/hooks/use-select-keyboard.d.ts +24 -0
- package/select/hooks/use-select-keyboard.js +171 -0
- package/select/hooks/use-select-multiselect-panel-state.d.ts +8 -0
- package/select/hooks/use-select-multiselect-panel-state.js +28 -0
- package/select/hooks/use-select-search.d.ts +9 -0
- package/select/hooks/use-select-search.js +258 -0
- package/select/hooks/use-select-view-model.d.ts +58 -0
- package/select/hooks/use-select-view-model.js +166 -0
- package/select/hooks/use-select-virtual.d.ts +28 -0
- package/select/hooks/use-select-virtual.js +31 -0
- package/select/hooks/use-select.d.ts +9 -0
- package/select/hooks/use-select.js +435 -0
- package/select/index.d.ts +20 -0
- package/select/index.js +12 -0
- package/select/presets/autocomplete.d.ts +12 -0
- package/select/presets/autocomplete.js +16 -0
- package/select/presets/index.d.ts +1 -0
- package/select/presets/index.js +1 -0
- package/select/select.d.ts +25 -0
- package/select/select.js +19 -0
- package/select/styles/select-field.module.css +147 -0
- package/select/styles/select.module.css +457 -0
- package/select/types-search.d.ts +151 -0
- package/select/types-search.js +1 -0
- package/select/types.d.ts +374 -0
- package/select/types.js +1 -0
- package/select/utils/custom-search-option.d.ts +15 -0
- package/select/utils/custom-search-option.js +37 -0
- package/select/utils/filter-options.d.ts +5 -0
- package/select/utils/filter-options.js +23 -0
- package/select/utils/get-display-value.d.ts +13 -0
- package/select/utils/get-display-value.js +16 -0
- package/select/utils/get-element-content-width.d.ts +1 -0
- package/select/utils/get-element-content-width.js +11 -0
- package/select/utils/get-multiselect-display-labels.d.ts +3 -0
- package/select/utils/get-multiselect-display-labels.js +7 -0
- package/select/utils/get-status-content.d.ts +11 -0
- package/select/utils/get-status-content.js +10 -0
- package/select/utils/is-select-panel-compact-content.d.ts +3 -0
- package/select/utils/is-select-panel-compact-content.js +4 -0
- package/select/utils/measure-multiselect-row-width.d.ts +10 -0
- package/select/utils/measure-multiselect-row-width.js +15 -0
- package/select/utils/measure-text-width.d.ts +9 -0
- package/select/utils/measure-text-width.js +72 -0
- package/select/utils/multiselect-collapsed-display-shared.d.ts +40 -0
- package/select/utils/multiselect-collapsed-display-shared.js +145 -0
- package/select/utils/normalize-options.d.ts +4 -0
- package/select/utils/normalize-options.js +7 -0
- package/select/utils/normalize-value.d.ts +5 -0
- package/select/utils/normalize-value.js +18 -0
- package/select/utils/resolve-loading-state.d.ts +9 -0
- package/select/utils/resolve-loading-state.js +10 -0
- package/select/utils/resolve-multiselect-collapsed-display.d.ts +6 -0
- package/select/utils/resolve-multiselect-collapsed-display.js +42 -0
- package/select/utils/resolve-search-content.d.ts +3 -0
- package/select/utils/resolve-search-content.js +6 -0
- package/select/utils/retain-combobox-focus.d.ts +4 -0
- package/select/utils/retain-combobox-focus.js +17 -0
- package/select/utils/select-keyboard-navigation.d.ts +3 -0
- package/select/utils/select-keyboard-navigation.js +14 -0
- package/select/utils/select-load-more-scroll.d.ts +16 -0
- package/select/utils/select-load-more-scroll.js +20 -0
- package/select/utils/select-option-id.d.ts +3 -0
- package/select/utils/select-option-id.js +4 -0
- package/select/views/select-listbox.d.ts +10 -0
- package/select/views/select-listbox.js +15 -0
- package/select/views/select-search-listbox.d.ts +3 -0
- package/select/views/select-search-listbox.js +23 -0
- package/select/views/select-view.d.ts +6 -0
- package/select/views/select-view.js +64 -0
- package/select/views/styles.module.css +45 -0
- package/show-more/hooks/use-show-more-view-model.d.ts +24 -0
- package/show-more/hooks/use-show-more-view-model.js +76 -0
- package/show-more/index.d.ts +2 -0
- package/show-more/index.js +1 -0
- package/show-more/show-more.d.ts +21 -0
- package/show-more/show-more.js +15 -0
- package/show-more/styles.module.css +20 -0
- package/show-more/types.d.ts +46 -0
- package/show-more/types.js +1 -0
- package/show-more/views/show-more-view.d.ts +6 -0
- package/show-more/views/show-more-view.js +9 -0
- package/skeleton/index.d.ts +2 -0
- package/skeleton/index.js +2 -0
- package/skeleton/skeleton.d.ts +13 -0
- package/skeleton/skeleton.js +44 -0
- package/skeleton/styles.module.css +300 -0
- package/skeleton/types.d.ts +85 -0
- package/skeleton/types.js +1 -0
- package/skeleton/use-skeleton.d.ts +7 -0
- package/skeleton/use-skeleton.js +20 -0
- package/snackbar/index.d.ts +6 -0
- package/snackbar/index.js +5 -0
- package/snackbar/snack-button.d.ts +10 -0
- package/snackbar/snack-button.js +19 -0
- package/snackbar/snack-view.d.ts +8 -0
- package/snackbar/snack-view.js +66 -0
- package/snackbar/snack.d.ts +14 -0
- package/snackbar/snack.js +25 -0
- package/snackbar/snackbar-context.d.ts +9 -0
- package/snackbar/snackbar-context.js +10 -0
- package/snackbar/snackbar-provider.d.ts +17 -0
- package/snackbar/snackbar-provider.js +49 -0
- package/snackbar/snackbar.d.ts +26 -0
- package/snackbar/snackbar.js +41 -0
- package/snackbar/styles/snack.module.css +195 -0
- package/snackbar/styles/snackbar.module.css +66 -0
- package/snackbar/types.d.ts +152 -0
- package/snackbar/types.js +1 -0
- package/snackbar/use-snack-timer.d.ts +5 -0
- package/snackbar/use-snack-timer.js +28 -0
- package/snackbar/use-snack.d.ts +326 -0
- package/snackbar/use-snack.js +82 -0
- package/stack/index.d.ts +1 -0
- package/stack/index.js +1 -0
- package/stack/stack.d.ts +16 -0
- package/stack/stack.js +34 -0
- package/stack/styles.module.css +46 -0
- package/stack/types.d.ts +34 -0
- package/stack/types.js +1 -0
- package/status/index.d.ts +2 -0
- package/status/index.js +1 -0
- package/status/status-icon.d.ts +18 -0
- package/status/status-icon.js +19 -0
- package/status/styles.module.css +18 -0
- package/status/types.d.ts +12 -0
- package/status/types.js +1 -0
- package/stepper/index.d.ts +3 -0
- package/stepper/index.js +2 -0
- package/stepper/stepper.d.ts +24 -0
- package/stepper/stepper.js +41 -0
- package/stepper/styles.module.css +172 -0
- package/stepper/types.d.ts +69 -0
- package/stepper/types.js +1 -0
- package/stepper/use-stepper.d.ts +11 -0
- package/stepper/use-stepper.js +25 -0
- package/switch/index.d.ts +2 -0
- package/switch/index.js +2 -0
- package/switch/styles/base.module.css +134 -0
- package/switch/switch.d.ts +14 -0
- package/switch/switch.js +39 -0
- package/switch/types.d.ts +60 -0
- package/switch/types.js +1 -0
- package/tabs/context.d.ts +21 -0
- package/tabs/context.js +9 -0
- package/tabs/index.d.ts +6 -0
- package/tabs/index.js +5 -0
- package/tabs/styles/tab-list.module.css +23 -0
- package/tabs/styles/tab-panel.module.css +3 -0
- package/tabs/styles/tab.module.css +210 -0
- package/tabs/tab-list.d.ts +14 -0
- package/tabs/tab-list.js +70 -0
- package/tabs/tab-panel.d.ts +8 -0
- package/tabs/tab-panel.js +16 -0
- package/tabs/tab.d.ts +10 -0
- package/tabs/tab.js +40 -0
- package/tabs/tabs.d.ts +18 -0
- package/tabs/tabs.js +26 -0
- package/tabs/types.d.ts +92 -0
- package/tabs/types.js +1 -0
- package/tabs/use-tabs.d.ts +7 -0
- package/tabs/use-tabs.js +59 -0
- package/textarea/get-max-length-message.d.ts +1 -0
- package/textarea/get-max-length-message.js +5 -0
- package/textarea/index.d.ts +2 -0
- package/textarea/index.js +1 -0
- package/textarea/styles.module.css +37 -0
- package/textarea/textarea.d.ts +9 -0
- package/textarea/textarea.js +20 -0
- package/textarea/types.d.ts +44 -0
- package/textarea/types.js +1 -0
- package/textarea/use-auto-height.d.ts +16 -0
- package/textarea/use-auto-height.js +106 -0
- package/textarea/use-resize-handle.d.ts +8 -0
- package/textarea/use-resize-handle.js +44 -0
- package/textarea/use-textarea.d.ts +1241 -0
- package/textarea/use-textarea.js +108 -0
- package/theme-provider/index.d.ts +9 -0
- package/theme-provider/index.js +5 -0
- package/theme-provider/styles.module.css +332 -0
- package/theme-provider/theme-context.d.ts +31 -0
- package/theme-provider/theme-context.js +33 -0
- package/theme-provider/theme-provider.d.ts +14 -0
- package/theme-provider/theme-provider.js +45 -0
- package/theme-provider/theme-scope.d.ts +33 -0
- package/theme-provider/theme-scope.js +45 -0
- package/theme-provider/types.d.ts +82 -0
- package/theme-provider/types.js +1 -0
- package/theme-provider/use-system-theme.d.ts +6 -0
- package/theme-provider/use-system-theme.js +23 -0
- package/theme-provider/use-theme-provider.d.ts +8 -0
- package/theme-provider/use-theme-provider.js +22 -0
- package/time-picker/index.d.ts +8 -0
- package/time-picker/index.js +6 -0
- package/time-picker/picker-types.d.ts +77 -0
- package/time-picker/picker-types.js +1 -0
- package/time-picker/single-time-picker.d.ts +3 -0
- package/time-picker/single-time-picker.js +37 -0
- package/time-picker/styles.module.css +124 -0
- package/time-picker/time-model.d.ts +34 -0
- package/time-picker/time-model.js +140 -0
- package/time-picker/time-panel.d.ts +20 -0
- package/time-picker/time-panel.js +81 -0
- package/time-picker/time-picker.d.ts +13 -0
- package/time-picker/time-picker.js +43 -0
- package/time-picker/time-range-picker.d.ts +3 -0
- package/time-picker/time-range-picker.js +44 -0
- package/time-picker/types.d.ts +158 -0
- package/time-picker/types.js +1 -0
- package/time-picker/use-time-panel.d.ts +12 -0
- package/time-picker/use-time-panel.js +22 -0
- package/time-picker/use-time-picker.d.ts +29 -0
- package/time-picker/use-time-picker.js +117 -0
- package/time-picker/use-time-range-picker.d.ts +36 -0
- package/time-picker/use-time-range-picker.js +131 -0
- package/tokens/index.d.ts +1 -0
- package/tokens/index.js +2 -0
- package/tooltip/index.d.ts +2 -0
- package/tooltip/index.js +1 -0
- package/tooltip/styles.module.css +46 -0
- package/tooltip/tooltip.d.ts +12 -0
- package/tooltip/tooltip.js +30 -0
- package/tooltip/types.d.ts +41 -0
- package/tooltip/types.js +1 -0
- package/tooltip/use-tooltip.d.ts +18 -0
- package/tooltip/use-tooltip.js +37 -0
- package/tree/check.d.ts +16 -0
- package/tree/check.js +99 -0
- package/tree/class-names-context.d.ts +3 -0
- package/tree/class-names-context.js +5 -0
- package/tree/highlight.d.ts +3 -0
- package/tree/highlight.js +23 -0
- package/tree/index.d.ts +11 -0
- package/tree/index.js +6 -0
- package/tree/model.d.ts +59 -0
- package/tree/model.js +110 -0
- package/tree/move.d.ts +42 -0
- package/tree/move.js +103 -0
- package/tree/styles.module.css +290 -0
- package/tree/tree-branch.d.ts +23 -0
- package/tree/tree-branch.js +41 -0
- package/tree/tree-placeholder.d.ts +11 -0
- package/tree/tree-placeholder.js +10 -0
- package/tree/tree-row-content.d.ts +27 -0
- package/tree/tree-row-content.js +25 -0
- package/tree/tree-row-renderer.d.ts +12 -0
- package/tree/tree-row-renderer.js +54 -0
- package/tree/tree-row.d.ts +30 -0
- package/tree/tree-row.js +92 -0
- package/tree/tree-select-panel.d.ts +22 -0
- package/tree/tree-select-panel.js +9 -0
- package/tree/tree-select-selection.d.ts +20 -0
- package/tree/tree-select-selection.js +28 -0
- package/tree/tree-select-types.d.ts +102 -0
- package/tree/tree-select-types.js +1 -0
- package/tree/tree-select.d.ts +32 -0
- package/tree/tree-select.js +201 -0
- package/tree/tree-select.module.css +35 -0
- package/tree/tree.d.ts +57 -0
- package/tree/tree.js +93 -0
- package/tree/types-row.d.ts +51 -0
- package/tree/types-row.js +1 -0
- package/tree/types.d.ts +192 -0
- package/tree/types.js +1 -0
- package/tree/use-tree-activate.d.ts +3 -0
- package/tree/use-tree-activate.js +14 -0
- package/tree/use-tree-checks.d.ts +17 -0
- package/tree/use-tree-checks.js +24 -0
- package/tree/use-tree-expansion.d.ts +17 -0
- package/tree/use-tree-expansion.js +71 -0
- package/tree/use-tree-keyboard.d.ts +17 -0
- package/tree/use-tree-keyboard.js +91 -0
- package/tree/use-tree-virtual.d.ts +33 -0
- package/tree/use-tree-virtual.js +72 -0
- package/tree/use-tree.d.ts +26 -0
- package/tree/use-tree.js +108 -0
- package/tree/virtual-rows.d.ts +11 -0
- package/tree/virtual-rows.js +9 -0
- package/types/size.d.ts +6 -0
- package/types/size.js +1 -0
- package/typography/index.d.ts +2 -0
- package/typography/index.js +1 -0
- package/typography/styles.module.css +304 -0
- package/typography/types.d.ts +61 -0
- package/typography/types.js +1 -0
- package/typography/typography.d.ts +21 -0
- package/typography/typography.js +24 -0
- package/utils/call-child-as-function.d.ts +1 -0
- package/utils/call-child-as-function.js +1 -0
- package/utils/class-names.d.ts +68 -0
- package/utils/class-names.js +164 -0
- package/utils/compose-event-handlers.d.ts +2 -0
- package/utils/compose-event-handlers.js +15 -0
- package/utils/container-props-override.d.ts +10 -0
- package/utils/container-props-override.js +19 -0
- package/utils/create-id.d.ts +5 -0
- package/utils/create-id.js +9 -0
- package/utils/data-attributes.d.ts +14 -0
- package/utils/data-attributes.js +23 -0
- package/utils/decode-uri.d.ts +23 -0
- package/utils/decode-uri.js +46 -0
- package/utils/empty-function.d.ts +2 -0
- package/utils/empty-function.js +4 -0
- package/utils/get-react-element-ref.d.ts +2 -0
- package/utils/get-react-element-ref.js +10 -0
- package/utils/imperative-change-input-value.d.ts +4 -0
- package/utils/imperative-change-input-value.js +15 -0
- package/utils/index.d.ts +20 -0
- package/utils/index.js +16 -0
- package/utils/input-caret.d.ts +4 -0
- package/utils/input-caret.js +42 -0
- package/utils/invariant.d.ts +5 -0
- package/utils/invariant.js +12 -0
- package/utils/is-browser.d.ts +1 -0
- package/utils/is-browser.js +1 -0
- package/utils/is-new-theme.d.ts +1 -0
- package/utils/is-new-theme.js +7 -0
- package/utils/merge-refs.d.ts +9 -0
- package/utils/merge-refs.js +36 -0
- package/utils/overridable-component.d.ts +47 -0
- package/utils/overridable-component.js +1 -0
- package/utils/shallow-objects-equal.d.ts +4 -0
- package/utils/shallow-objects-equal.js +16 -0
- package/utils/style/index.d.ts +3 -0
- package/utils/style/index.js +2 -0
- package/utils/style/props/color.d.ts +2 -0
- package/utils/style/props/color.js +6 -0
- package/utils/style/props/dimension.d.ts +2 -0
- package/utils/style/props/dimension.js +10 -0
- package/utils/style/props/index.d.ts +4 -0
- package/utils/style/props/index.js +3 -0
- package/utils/style/props/passthrough.d.ts +1 -0
- package/utils/style/props/passthrough.js +1 -0
- package/utils/style/props/types.d.ts +7 -0
- package/utils/style/props/types.js +1 -0
- package/utils/style/types.d.ts +6 -0
- package/utils/style/types.js +1 -0
- package/utils/style/use-style-props.d.ts +5 -0
- package/utils/style/use-style-props.js +7 -0
- package/utils/style/utils/convert-style-props.d.ts +4 -0
- package/utils/style/utils/convert-style-props.js +23 -0
- package/utils/style/utils/index.d.ts +1 -0
- package/utils/style/utils/index.js +1 -0
- package/utils/use-class-names.d.ts +37 -0
- package/utils/use-class-names.js +87 -0
- package/utils/utils.d.ts +9 -0
- package/utils/utils.js +1 -0
- package/visually-hidden/index.d.ts +1 -0
- package/visually-hidden/index.js +1 -0
- package/visually-hidden/styles.module.css +9 -0
- package/visually-hidden/visually-hidden.d.ts +6 -0
- package/visually-hidden/visually-hidden.js +6 -0
- package/README.md +0 -3
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ListNavigation } from './use-list-navigation';
|
|
2
|
+
import type { ListNavigationItemProps, ListNavigationReason, UseListNavigationItemOptions } from './types';
|
|
3
|
+
export type ListNavigationItem = {
|
|
4
|
+
/** Навесить на элемент навигации (кнопку, пункт списка) */
|
|
5
|
+
props: ListNavigationItemProps;
|
|
6
|
+
/** Элемент активен (подсвечен) */
|
|
7
|
+
active: boolean;
|
|
8
|
+
/** Почему активен: под курсором, с клавиатуры или через API */
|
|
9
|
+
reason: ListNavigationReason | null;
|
|
10
|
+
};
|
|
11
|
+
/** Регистрирует элемент и отдаёт пропсы. Без аргумента берёт ближайший `ListNavigationContext`. Ререндер только при смене своего состояния. */
|
|
12
|
+
export declare function useListNavigationItem({ id, disabled, hoverZoneRef, isHoverZoneTarget }: UseListNavigationItemOptions, navigation?: ListNavigation | null): ListNavigationItem;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useCallback, useContext, useRef, useSyncExternalStore } from 'react';
|
|
3
|
+
import { useIsomorphicLayoutEffect } from '../use-isomorphic-layout-effect';
|
|
4
|
+
import { ListNavigationContext } from './use-list-navigation';
|
|
5
|
+
const noopSubscribe = () => () => undefined;
|
|
6
|
+
/** Регистрирует элемент и отдаёт пропсы. Без аргумента берёт ближайший `ListNavigationContext`. Ререндер только при смене своего состояния. */
|
|
7
|
+
export function useListNavigationItem({ id, disabled = false, hoverZoneRef, isHoverZoneTarget }, navigation) {
|
|
8
|
+
var _a;
|
|
9
|
+
const contextValue = useContext(ListNavigationContext);
|
|
10
|
+
const resolved = navigation === undefined ? contextValue : ((_a = navigation === null || navigation === void 0 ? void 0 : navigation.context) !== null && _a !== void 0 ? _a : null);
|
|
11
|
+
const store = resolved === null || resolved === void 0 ? void 0 : resolved.store;
|
|
12
|
+
// Один объект на всё время жизни: store читает актуальные значения без перерегистрации
|
|
13
|
+
const recordRef = useRef({ element: null, disabled });
|
|
14
|
+
recordRef.current.disabled = disabled;
|
|
15
|
+
recordRef.current.hoverZoneRef = hoverZoneRef;
|
|
16
|
+
recordRef.current.isHoverZoneTarget = isHoverZoneTarget;
|
|
17
|
+
useIsomorphicLayoutEffect(() => store === null || store === void 0 ? void 0 : store.register(id, recordRef.current), [store, id]);
|
|
18
|
+
const ref = useCallback((element) => {
|
|
19
|
+
recordRef.current.element = element;
|
|
20
|
+
}, []);
|
|
21
|
+
const subscribe = store ? store.subscribe : noopSubscribe;
|
|
22
|
+
const getReason = () => { var _a; return ((store === null || store === void 0 ? void 0 : store.isActive(id)) ? ((_a = store.getActiveReason()) !== null && _a !== void 0 ? _a : 'api') : null); };
|
|
23
|
+
const getTabStop = () => (store ? store.getTabStopId() === id : false);
|
|
24
|
+
const reason = useSyncExternalStore(subscribe, getReason, getReason);
|
|
25
|
+
const active = reason !== null;
|
|
26
|
+
const isTabStop = useSyncExternalStore(subscribe, getTabStop, getTabStop);
|
|
27
|
+
if (!resolved)
|
|
28
|
+
return { props: { ref }, active: false, reason: null };
|
|
29
|
+
const { mode = 'focus', tabStop = 'single' } = resolved.optionsRef.current;
|
|
30
|
+
const props = { ref };
|
|
31
|
+
if (reason)
|
|
32
|
+
props['data-nav-active'] = reason;
|
|
33
|
+
if (mode === 'focus' && tabStop === 'single')
|
|
34
|
+
props.tabIndex = isTabStop ? 0 : -1;
|
|
35
|
+
return { props, active, reason };
|
|
36
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { NavigationStore } from './store';
|
|
2
|
+
import type { ListNavigationApi, ListNavigationControlProps, ListNavigationRootProps, UseListNavigationOptions } from './types';
|
|
3
|
+
export type ListNavigationContextValue = {
|
|
4
|
+
store: NavigationStore;
|
|
5
|
+
/** Актуальные опции (читаются в рендере элементов) */
|
|
6
|
+
optionsRef: {
|
|
7
|
+
current: UseListNavigationOptions;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export declare const ListNavigationContext: import("react").Context<ListNavigationContextValue | null>;
|
|
11
|
+
export type ListNavigation = {
|
|
12
|
+
api: ListNavigationApi;
|
|
13
|
+
/** Контейнер элементов: клавиатура (режим `focus`), наведение, фокус */
|
|
14
|
+
rootProps: ListNavigationRootProps;
|
|
15
|
+
/** Контрол, который держит фокус в режиме `virtual`. Для `aria-activedescendant` используйте `useListNavigationActiveId` */
|
|
16
|
+
getControlProps: () => ListNavigationControlProps;
|
|
17
|
+
/** Значение для `ListNavigationContext.Provider` — через него элементы находят навигацию */
|
|
18
|
+
context: ListNavigationContextValue;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Навигация по списку: клавиатура, наведение и API. Активен один элемент (`data-nav-active`).
|
|
22
|
+
* Клавиша гасит подсветку курсора, движение мыши возвращает её.
|
|
23
|
+
* Элементы — `useListNavigationItem`, порядок из документа, в том числе из порталов.
|
|
24
|
+
* Режимы `focus` и `virtual` (`aria-activedescendant`), сетка (`cols`), roving tabindex (`tabStop`).
|
|
25
|
+
* Свои клавиши — `onKeyDown(event, api)`.
|
|
26
|
+
*/
|
|
27
|
+
export declare function useListNavigation(options?: UseListNavigationOptions): ListNavigation;
|
|
28
|
+
/** Активный элемент в рендере (перерисовывает компонент при смене) — для `aria-activedescendant`, автоскролла */
|
|
29
|
+
export declare function useListNavigationActiveId(navigation: ListNavigation): string | null;
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { createContext, useCallback, useMemo, useRef, useState, useSyncExternalStore } from 'react';
|
|
3
|
+
import { useActualRef } from '../use-actual-ref';
|
|
4
|
+
import { useIsomorphicLayoutEffect } from '../use-isomorphic-layout-effect';
|
|
5
|
+
import { getInputModality, useInputModalityListener } from './input-modality';
|
|
6
|
+
import { createNavigationStore } from './store';
|
|
7
|
+
import { getNextEnabledIndex } from './utils';
|
|
8
|
+
export const ListNavigationContext = createContext(null);
|
|
9
|
+
function getKeyAction(key, options) {
|
|
10
|
+
const { orientation = 'vertical', cols, pageSize } = options;
|
|
11
|
+
if (key === 'Home')
|
|
12
|
+
return 'first';
|
|
13
|
+
if (key === 'End')
|
|
14
|
+
return 'last';
|
|
15
|
+
if (pageSize && key === 'PageDown')
|
|
16
|
+
return { step: pageSize };
|
|
17
|
+
if (pageSize && key === 'PageUp')
|
|
18
|
+
return { step: -pageSize };
|
|
19
|
+
if (cols) {
|
|
20
|
+
if (key === 'ArrowRight')
|
|
21
|
+
return { step: 1 };
|
|
22
|
+
if (key === 'ArrowLeft')
|
|
23
|
+
return { step: -1 };
|
|
24
|
+
if (key === 'ArrowDown')
|
|
25
|
+
return { step: cols };
|
|
26
|
+
if (key === 'ArrowUp')
|
|
27
|
+
return { step: -cols };
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
const vertical = orientation !== 'horizontal';
|
|
31
|
+
const horizontal = orientation !== 'vertical';
|
|
32
|
+
if ((vertical && key === 'ArrowDown') || (horizontal && key === 'ArrowRight'))
|
|
33
|
+
return { step: 1 };
|
|
34
|
+
if ((vertical && key === 'ArrowUp') || (horizontal && key === 'ArrowLeft'))
|
|
35
|
+
return { step: -1 };
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Навигация по списку: клавиатура, наведение и API. Активен один элемент (`data-nav-active`).
|
|
40
|
+
* Клавиша гасит подсветку курсора, движение мыши возвращает её.
|
|
41
|
+
* Элементы — `useListNavigationItem`, порядок из документа, в том числе из порталов.
|
|
42
|
+
* Режимы `focus` и `virtual` (`aria-activedescendant`), сетка (`cols`), roving tabindex (`tabStop`).
|
|
43
|
+
* Свои клавиши — `onKeyDown(event, api)`.
|
|
44
|
+
*/
|
|
45
|
+
export function useListNavigation(options = {}) {
|
|
46
|
+
var _a, _b;
|
|
47
|
+
const optionsRef = useActualRef(options);
|
|
48
|
+
const isControlled = options.activeId !== undefined;
|
|
49
|
+
const [store] = useState(() => { var _a, _b; return createNavigationStore((_b = (_a = options.activeId) !== null && _a !== void 0 ? _a : options.defaultActiveId) !== null && _b !== void 0 ? _b : null); });
|
|
50
|
+
// Контролируемое значение синхронизируем во время рендера (без второго прохода), подписчиков уведомляем после коммита
|
|
51
|
+
const pendingReasonRef = useRef(null);
|
|
52
|
+
const pendingNotifyRef = useRef(false);
|
|
53
|
+
if (isControlled && options.activeId !== store.getActiveId()) {
|
|
54
|
+
store.setActive((_a = options.activeId) !== null && _a !== void 0 ? _a : null, (_b = pendingReasonRef.current) !== null && _b !== void 0 ? _b : 'api', true);
|
|
55
|
+
pendingNotifyRef.current = true;
|
|
56
|
+
}
|
|
57
|
+
pendingReasonRef.current = null;
|
|
58
|
+
useIsomorphicLayoutEffect(() => {
|
|
59
|
+
var _a, _b;
|
|
60
|
+
if (pendingNotifyRef.current) {
|
|
61
|
+
pendingNotifyRef.current = false;
|
|
62
|
+
store.notify();
|
|
63
|
+
}
|
|
64
|
+
// roving tabindex: пока ничего не выбрано, в Tab-порядке первый доступный элемент
|
|
65
|
+
const { mode = 'focus', tabStop = 'single', skipDisabled = true } = optionsRef.current;
|
|
66
|
+
if (mode !== 'focus' || tabStop !== 'single')
|
|
67
|
+
return;
|
|
68
|
+
const tabStopId = store.getTabStopId();
|
|
69
|
+
if (tabStopId && ((_b = (_a = store.getRecord(tabStopId)) === null || _a === void 0 ? void 0 : _a.element) === null || _b === void 0 ? void 0 : _b.isConnected))
|
|
70
|
+
return;
|
|
71
|
+
const first = store.getOrderedIds().find(id => { var _a; return !skipDisabled || !((_a = store.getRecord(id)) === null || _a === void 0 ? void 0 : _a.disabled); });
|
|
72
|
+
store.setTabStopId(first !== null && first !== void 0 ? first : null);
|
|
73
|
+
});
|
|
74
|
+
const api = useMemo(() => {
|
|
75
|
+
const requestActive = (id, reason) => {
|
|
76
|
+
const { onActiveChange, activeId } = optionsRef.current;
|
|
77
|
+
const nextReason = id === null ? null : reason;
|
|
78
|
+
if (id === store.getActiveId() && nextReason === store.getActiveReason())
|
|
79
|
+
return;
|
|
80
|
+
onActiveChange === null || onActiveChange === void 0 ? void 0 : onActiveChange(id, nextReason);
|
|
81
|
+
if (activeId !== undefined) {
|
|
82
|
+
pendingReasonRef.current = reason;
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
store.setActive(id, reason);
|
|
86
|
+
};
|
|
87
|
+
const isEnabled = (ids) => (index) => { var _a; return optionsRef.current.skipDisabled === false || !((_a = store.getRecord(ids[index])) === null || _a === void 0 ? void 0 : _a.disabled); };
|
|
88
|
+
const getItemElement = (id) => { var _a, _b; return (_b = (_a = store.getRecord(id)) === null || _a === void 0 ? void 0 : _a.element) !== null && _b !== void 0 ? _b : null; };
|
|
89
|
+
const focus = (id, reason = 'api') => {
|
|
90
|
+
var _a;
|
|
91
|
+
const { mode = 'focus' } = optionsRef.current;
|
|
92
|
+
const element = getItemElement(id);
|
|
93
|
+
if (mode === 'focus')
|
|
94
|
+
element === null || element === void 0 ? void 0 : element.focus();
|
|
95
|
+
else if (reason === 'keyboard')
|
|
96
|
+
(_a = element === null || element === void 0 ? void 0 : element.scrollIntoView) === null || _a === void 0 ? void 0 : _a.call(element, { block: 'nearest' });
|
|
97
|
+
requestActive(id, reason);
|
|
98
|
+
};
|
|
99
|
+
/** Точка отсчёта: в режиме focus — элемент в фокусе, иначе — активный */
|
|
100
|
+
const getCurrentId = () => {
|
|
101
|
+
const { mode = 'focus' } = optionsRef.current;
|
|
102
|
+
if (mode === 'focus' && typeof document !== 'undefined') {
|
|
103
|
+
const focused = document.activeElement;
|
|
104
|
+
const focusedId = focused ? store.findIdByTarget(focused) : null;
|
|
105
|
+
if (focusedId && getItemElement(focusedId) === focused)
|
|
106
|
+
return focusedId;
|
|
107
|
+
}
|
|
108
|
+
return store.getActiveId();
|
|
109
|
+
};
|
|
110
|
+
const goToIndex = (ids, index, reason) => {
|
|
111
|
+
if (index !== -1)
|
|
112
|
+
focus(ids[index], reason);
|
|
113
|
+
};
|
|
114
|
+
return {
|
|
115
|
+
getActiveId: store.getActiveId,
|
|
116
|
+
getActiveReason: store.getActiveReason,
|
|
117
|
+
setActive: (id, reason = 'api') => requestActive(id, reason),
|
|
118
|
+
focus,
|
|
119
|
+
move: (step, reason = 'api') => {
|
|
120
|
+
var _a;
|
|
121
|
+
const ids = store.getOrderedIds();
|
|
122
|
+
const currentId = getCurrentId();
|
|
123
|
+
const current = currentId ? ids.indexOf(currentId) : -1;
|
|
124
|
+
const enabled = isEnabled(ids);
|
|
125
|
+
// Ничего не активно — начинаем с края списка в сторону шага
|
|
126
|
+
const index = current === -1
|
|
127
|
+
? getNextEnabledIndex(ids.length, step > 0 ? -1 : ids.length, Math.sign(step), false, enabled)
|
|
128
|
+
: getNextEnabledIndex(ids.length, current, step, (_a = optionsRef.current.loop) !== null && _a !== void 0 ? _a : true, enabled);
|
|
129
|
+
goToIndex(ids, index, reason);
|
|
130
|
+
},
|
|
131
|
+
first: (reason = 'api') => {
|
|
132
|
+
const ids = store.getOrderedIds();
|
|
133
|
+
goToIndex(ids, getNextEnabledIndex(ids.length, -1, 1, false, isEnabled(ids)), reason);
|
|
134
|
+
},
|
|
135
|
+
last: (reason = 'api') => {
|
|
136
|
+
const ids = store.getOrderedIds();
|
|
137
|
+
goToIndex(ids, getNextEnabledIndex(ids.length, ids.length, -1, false, isEnabled(ids)), reason);
|
|
138
|
+
},
|
|
139
|
+
getItemIds: store.getOrderedIds,
|
|
140
|
+
getItemElement,
|
|
141
|
+
};
|
|
142
|
+
}, [optionsRef, store]);
|
|
143
|
+
const handleKeyDown = useCallback((event, fromControl) => {
|
|
144
|
+
var _a, _b;
|
|
145
|
+
const current = optionsRef.current;
|
|
146
|
+
if (current.disabled || event.defaultPrevented)
|
|
147
|
+
return;
|
|
148
|
+
if ((_a = current.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(current, event, api)) {
|
|
149
|
+
event.preventDefault();
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
// В режиме focus управляем только с самих элементов (не из полей внутри панелей и не из вложенных групп)
|
|
153
|
+
if (((_b = current.mode) !== null && _b !== void 0 ? _b : 'focus') === 'focus' && !fromControl) {
|
|
154
|
+
const id = store.findIdByTarget(event.target);
|
|
155
|
+
if (!id || api.getItemElement(id) !== event.target)
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
const action = getKeyAction(event.key, current);
|
|
159
|
+
if (!action)
|
|
160
|
+
return;
|
|
161
|
+
event.preventDefault();
|
|
162
|
+
if (action === 'first')
|
|
163
|
+
api.first('keyboard');
|
|
164
|
+
else if (action === 'last')
|
|
165
|
+
api.last('keyboard');
|
|
166
|
+
else
|
|
167
|
+
api.move(action.step, 'keyboard');
|
|
168
|
+
}, [api, optionsRef, store]);
|
|
169
|
+
// Начали работать с клавиатуры — «мышиная» подсветка гаснет (в focus — переходит на элемент в фокусе)
|
|
170
|
+
const handleModality = useCallback((modality) => {
|
|
171
|
+
var _a;
|
|
172
|
+
if (modality !== 'keyboard' || store.getActiveReason() !== 'pointer')
|
|
173
|
+
return;
|
|
174
|
+
if (((_a = optionsRef.current.mode) !== null && _a !== void 0 ? _a : 'focus') === 'virtual') {
|
|
175
|
+
// В virtual стрелки продолжают от элемента под курсором
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
let focused = null;
|
|
179
|
+
if (typeof document !== 'undefined')
|
|
180
|
+
focused = document.activeElement;
|
|
181
|
+
const focusedId = focused ? store.findIdByTarget(focused) : null;
|
|
182
|
+
const isFocusedItem = !!focusedId && api.getItemElement(focusedId) === focused;
|
|
183
|
+
api.setActive(isFocusedItem ? focusedId : null, 'keyboard');
|
|
184
|
+
}, [api, optionsRef, store]);
|
|
185
|
+
useInputModalityListener(handleModality);
|
|
186
|
+
const rootProps = useMemo(() => ({
|
|
187
|
+
onKeyDown: event => handleKeyDown(event, false),
|
|
188
|
+
onFocus: (event) => {
|
|
189
|
+
var _a;
|
|
190
|
+
if (((_a = optionsRef.current.mode) !== null && _a !== void 0 ? _a : 'focus') !== 'focus')
|
|
191
|
+
return;
|
|
192
|
+
const target = event.target;
|
|
193
|
+
const id = store.findIdByTarget(target);
|
|
194
|
+
if (id && api.getItemElement(id) === target) {
|
|
195
|
+
// Фокус мышью не перебивает подсветку под курсором
|
|
196
|
+
if (getInputModality() === 'pointer' && store.getActiveReason() === 'pointer')
|
|
197
|
+
return;
|
|
198
|
+
api.setActive(id, 'keyboard');
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
// Фокус ушёл на другой элемент внутри (поле в панели, вложенная группа) — подсветка гаснет
|
|
202
|
+
if (store.getActiveReason() === 'keyboard')
|
|
203
|
+
api.setActive(null, 'keyboard');
|
|
204
|
+
},
|
|
205
|
+
onBlur: (event) => {
|
|
206
|
+
var _a;
|
|
207
|
+
if (((_a = optionsRef.current.mode) !== null && _a !== void 0 ? _a : 'focus') !== 'focus' || store.getActiveReason() !== 'keyboard')
|
|
208
|
+
return;
|
|
209
|
+
const next = event.relatedTarget;
|
|
210
|
+
const nextId = next ? store.findIdByTarget(next) : null;
|
|
211
|
+
if (!nextId || api.getItemElement(nextId) !== next)
|
|
212
|
+
api.setActive(null, 'keyboard');
|
|
213
|
+
},
|
|
214
|
+
onPointerMove: (event) => {
|
|
215
|
+
var _a;
|
|
216
|
+
const { highlightOnHover = true, skipDisabled = true, disabled } = optionsRef.current;
|
|
217
|
+
// У тача нет hover
|
|
218
|
+
if (!highlightOnHover || disabled || event.pointerType === 'touch')
|
|
219
|
+
return;
|
|
220
|
+
const id = store.findIdByTarget(event.target);
|
|
221
|
+
const available = id && (!skipDisabled || !((_a = store.getRecord(id)) === null || _a === void 0 ? void 0 : _a.disabled));
|
|
222
|
+
if (!available) {
|
|
223
|
+
if (store.getActiveReason() === 'pointer')
|
|
224
|
+
api.setActive(null, 'pointer');
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
api.setActive(id, 'pointer');
|
|
228
|
+
const { focusOnHover, mode = 'focus' } = optionsRef.current;
|
|
229
|
+
const element = api.getItemElement(id);
|
|
230
|
+
if (focusOnHover &&
|
|
231
|
+
mode === 'focus' &&
|
|
232
|
+
element &&
|
|
233
|
+
element !== event.currentTarget.ownerDocument.activeElement) {
|
|
234
|
+
element.focus({ preventScroll: true });
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
onPointerLeave: () => {
|
|
238
|
+
if (store.getActiveReason() === 'pointer')
|
|
239
|
+
api.setActive(null, 'pointer');
|
|
240
|
+
},
|
|
241
|
+
}), [api, handleKeyDown, optionsRef, store]);
|
|
242
|
+
const getControlProps = useCallback(() => {
|
|
243
|
+
var _a;
|
|
244
|
+
const activeId = store.getActiveId();
|
|
245
|
+
return {
|
|
246
|
+
onKeyDown: event => handleKeyDown(event, true),
|
|
247
|
+
'aria-activedescendant': (activeId && ((_a = api.getItemElement(activeId)) === null || _a === void 0 ? void 0 : _a.id)) || undefined,
|
|
248
|
+
};
|
|
249
|
+
}, [api, handleKeyDown, store]);
|
|
250
|
+
const context = useMemo(() => ({ store, optionsRef }), [optionsRef, store]);
|
|
251
|
+
return { api, rootProps, getControlProps, context };
|
|
252
|
+
}
|
|
253
|
+
/** Активный элемент в рендере (перерисовывает компонент при смене) — для `aria-activedescendant`, автоскролла */
|
|
254
|
+
export function useListNavigationActiveId(navigation) {
|
|
255
|
+
const { store } = navigation.context;
|
|
256
|
+
return useSyncExternalStore(store.subscribe, store.getActiveId, () => null);
|
|
257
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Следующий доступный индекс на `step` от `from`, либо -1. `from = -1` — первый, `from = count` — последний. `|step| > 1` без loop упирается в край. */
|
|
2
|
+
export declare function getNextEnabledIndex(count: number, from: number, step: number, loop: boolean, isEnabled: (index: number) => boolean): number;
|
|
3
|
+
export type AdjacentFocusableOptions = {
|
|
4
|
+
/** Искать назад по порядку документа */
|
|
5
|
+
backward?: boolean;
|
|
6
|
+
/** Пропустить элемент (по умолчанию — содержимое порталов `[data-lt-ui-portal]`) */
|
|
7
|
+
isSkipped?: (element: HTMLElement) => boolean;
|
|
8
|
+
};
|
|
9
|
+
/** Следующий фокусируемый элемент в раскладке: без порталов, скрытых и disabled. Tab из попапа уходит на соседнее поле. */
|
|
10
|
+
export declare function getAdjacentFocusable(from: HTMLElement, { backward, isSkipped }?: AdjacentFocusableOptions): HTMLElement | null;
|
|
11
|
+
/** Порядок элементов в документе (работает и для порталов) */
|
|
12
|
+
export declare function compareDocumentOrder(a: HTMLElement, b: HTMLElement): 0 | 1 | -1;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/** Следующий доступный индекс на `step` от `from`, либо -1. `from = -1` — первый, `from = count` — последний. `|step| > 1` без loop упирается в край. */
|
|
2
|
+
export function getNextEnabledIndex(count, from, step, loop, isEnabled) {
|
|
3
|
+
if (count === 0 || step === 0)
|
|
4
|
+
return -1;
|
|
5
|
+
const direction = step > 0 ? 1 : -1;
|
|
6
|
+
let index = from + step;
|
|
7
|
+
if (loop)
|
|
8
|
+
index = ((index % count) + count) % count;
|
|
9
|
+
else if (Math.abs(step) > 1)
|
|
10
|
+
index = Math.max(0, Math.min(count - 1, index));
|
|
11
|
+
for (let attempt = 0; attempt < count; attempt += 1) {
|
|
12
|
+
if (!loop && (index < 0 || index >= count))
|
|
13
|
+
return -1;
|
|
14
|
+
if (isEnabled(index))
|
|
15
|
+
return index;
|
|
16
|
+
index += direction;
|
|
17
|
+
if (loop)
|
|
18
|
+
index = (index + count) % count;
|
|
19
|
+
}
|
|
20
|
+
return -1;
|
|
21
|
+
}
|
|
22
|
+
const FOCUSABLE_SELECTOR = 'a[href], button, input, select, textarea, [tabindex]';
|
|
23
|
+
const isInPortal = (element) => !!element.closest('[data-lt-ui-portal]');
|
|
24
|
+
/** Следующий фокусируемый элемент в раскладке: без порталов, скрытых и disabled. Tab из попапа уходит на соседнее поле. */
|
|
25
|
+
export function getAdjacentFocusable(from, { backward = false, isSkipped = isInPortal } = {}) {
|
|
26
|
+
const nodes = Array.from(from.ownerDocument.querySelectorAll(FOCUSABLE_SELECTOR));
|
|
27
|
+
const start = nodes.indexOf(from);
|
|
28
|
+
if (start < 0)
|
|
29
|
+
return null;
|
|
30
|
+
const step = backward ? -1 : 1;
|
|
31
|
+
for (let index = start + step; index >= 0 && index < nodes.length; index += step) {
|
|
32
|
+
const node = nodes[index];
|
|
33
|
+
const unavailable = node.tabIndex < 0 ||
|
|
34
|
+
node.hasAttribute('disabled') ||
|
|
35
|
+
node.getAttribute('aria-disabled') === 'true' ||
|
|
36
|
+
!!node.closest('[hidden], [aria-hidden="true"], [inert]');
|
|
37
|
+
if (!unavailable && !isSkipped(node))
|
|
38
|
+
return node;
|
|
39
|
+
}
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
/** Порядок элементов в документе (работает и для порталов) */
|
|
43
|
+
export function compareDocumentOrder(a, b) {
|
|
44
|
+
if (a === b)
|
|
45
|
+
return 0;
|
|
46
|
+
return a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
|
|
47
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { UIEvent } from 'react';
|
|
2
|
+
/** Доля прокрутки, после которой подгружается следующая порция */
|
|
3
|
+
export declare const LOAD_MORE_THRESHOLD = 0.85;
|
|
4
|
+
/** Прокручен ли элемент до `threshold` своей высоты (доля от 0 до 1) */
|
|
5
|
+
export declare function isScrolledToEnd(element: Pick<HTMLElement, 'scrollHeight' | 'scrollTop' | 'clientHeight'>, threshold?: number): boolean;
|
|
6
|
+
export type UseLoadMoreOptions = {
|
|
7
|
+
/** Есть ли что подгружать. Когда данные кончились — `false` */
|
|
8
|
+
hasMore: boolean;
|
|
9
|
+
/** Следующая порция уже грузится: пока `true`, повторных вызовов нет */
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Загрузить следующую порцию. Можно вернуть `Promise`: до его завершения повторных вызовов не будет.
|
|
13
|
+
* Без `Promise` ориентиром служит `loading`.
|
|
14
|
+
*/
|
|
15
|
+
onLoadMore: () => void | Promise<unknown>;
|
|
16
|
+
/**
|
|
17
|
+
* Доля прокрутки, после которой грузим.
|
|
18
|
+
* @default 0.85
|
|
19
|
+
*/
|
|
20
|
+
threshold?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Если содержимое ещё короче контейнера и прокрутки нет, догружать, пока она не появится или данные не кончатся.
|
|
23
|
+
* @default true
|
|
24
|
+
*/
|
|
25
|
+
fillViewport?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Выключить подгрузку.
|
|
28
|
+
* @default true
|
|
29
|
+
*/
|
|
30
|
+
enabled?: boolean;
|
|
31
|
+
};
|
|
32
|
+
export type UseLoadMoreResult = {
|
|
33
|
+
/** Обработчик `onScroll` прокручиваемого контейнера */
|
|
34
|
+
onScroll: (event: UIEvent<HTMLElement>) => void;
|
|
35
|
+
/** `ref` прокручиваемого контейнера: нужен для `fillViewport` */
|
|
36
|
+
ref: (element: HTMLElement | null) => void;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Подгрузка порциями при прокрутке: общая логика для списков и таблиц (бесконечный скролл). Хук ничего не знает о данных:
|
|
40
|
+
* владелец отдаёт `hasMore`, `loading` и `onLoadMore`, а хук решает, когда вызвать колбэк — один раз за порцию,
|
|
41
|
+
* когда пользователь дошёл до конца или когда контента не хватает на экран.
|
|
42
|
+
*
|
|
43
|
+
* @example ```tsx
|
|
44
|
+
* const loadMore = useLoadMore({ hasMore, loading: isFetching, onLoadMore: fetchNextPage });
|
|
45
|
+
* <div ref={loadMore.ref} onScroll={loadMore.onScroll} style={{ overflow: 'auto', height: 400 }}>…</div>
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
export declare function useLoadMore({ hasMore, loading, onLoadMore, threshold, fillViewport, enabled, }: UseLoadMoreOptions): UseLoadMoreResult;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useCallback, useEffect, useRef } from 'react';
|
|
3
|
+
import { useIsomorphicLayoutEffect } from './use-isomorphic-layout-effect';
|
|
4
|
+
/** Доля прокрутки, после которой подгружается следующая порция */
|
|
5
|
+
export const LOAD_MORE_THRESHOLD = 0.85;
|
|
6
|
+
/** Прокручен ли элемент до `threshold` своей высоты (доля от 0 до 1) */
|
|
7
|
+
export function isScrolledToEnd(element, threshold = LOAD_MORE_THRESHOLD) {
|
|
8
|
+
if (element.scrollHeight <= 0)
|
|
9
|
+
return false;
|
|
10
|
+
return (element.scrollTop + element.clientHeight) / element.scrollHeight >= threshold;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Подгрузка порциями при прокрутке: общая логика для списков и таблиц (бесконечный скролл). Хук ничего не знает о данных:
|
|
14
|
+
* владелец отдаёт `hasMore`, `loading` и `onLoadMore`, а хук решает, когда вызвать колбэк — один раз за порцию,
|
|
15
|
+
* когда пользователь дошёл до конца или когда контента не хватает на экран.
|
|
16
|
+
*
|
|
17
|
+
* @example ```tsx
|
|
18
|
+
* const loadMore = useLoadMore({ hasMore, loading: isFetching, onLoadMore: fetchNextPage });
|
|
19
|
+
* <div ref={loadMore.ref} onScroll={loadMore.onScroll} style={{ overflow: 'auto', height: 400 }}>…</div>
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export function useLoadMore({ hasMore, loading = false, onLoadMore, threshold = LOAD_MORE_THRESHOLD, fillViewport = true, enabled = true, }) {
|
|
23
|
+
const elementRef = useRef(null);
|
|
24
|
+
const pending = useRef(false);
|
|
25
|
+
const promiseActive = useRef(false);
|
|
26
|
+
const latest = useRef({ hasMore, loading, onLoadMore, enabled });
|
|
27
|
+
latest.current = { hasMore, loading, onLoadMore, enabled };
|
|
28
|
+
// Номер отрисовки: порцию считаем «обработанной», только когда после вызова компонент перерисовался (владелец обновил
|
|
29
|
+
// данные). Иначе двойной запуск эффектов в Strict Mode сбросил бы флаг между двумя вызовами и порция грузилась бы дважды
|
|
30
|
+
const renders = useRef(0);
|
|
31
|
+
renders.current += 1;
|
|
32
|
+
const triggeredAt = useRef(-1);
|
|
33
|
+
const trigger = useCallback(() => {
|
|
34
|
+
const state = latest.current;
|
|
35
|
+
if (!state.enabled || !state.hasMore || state.loading || pending.current)
|
|
36
|
+
return;
|
|
37
|
+
pending.current = true;
|
|
38
|
+
triggeredAt.current = renders.current;
|
|
39
|
+
const result = state.onLoadMore();
|
|
40
|
+
if (result && typeof result.then === 'function') {
|
|
41
|
+
promiseActive.current = true;
|
|
42
|
+
const done = () => {
|
|
43
|
+
promiseActive.current = false;
|
|
44
|
+
pending.current = false;
|
|
45
|
+
};
|
|
46
|
+
result.then(done, done);
|
|
47
|
+
}
|
|
48
|
+
}, []);
|
|
49
|
+
// Без Promise повторный вызов разрешаем после того, как владелец перерисовал данные и снял `loading`
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
if (!loading && !promiseActive.current && renders.current > triggeredAt.current)
|
|
52
|
+
pending.current = false;
|
|
53
|
+
});
|
|
54
|
+
useIsomorphicLayoutEffect(() => {
|
|
55
|
+
const element = elementRef.current;
|
|
56
|
+
if (!fillViewport || !element)
|
|
57
|
+
return;
|
|
58
|
+
if (element.scrollHeight <= element.clientHeight + 1)
|
|
59
|
+
trigger();
|
|
60
|
+
});
|
|
61
|
+
const onScroll = useCallback((event) => {
|
|
62
|
+
if (isScrolledToEnd(event.currentTarget, threshold))
|
|
63
|
+
trigger();
|
|
64
|
+
}, [threshold, trigger]);
|
|
65
|
+
const ref = useCallback((element) => {
|
|
66
|
+
elementRef.current = element;
|
|
67
|
+
}, []);
|
|
68
|
+
return { onScroll, ref };
|
|
69
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useRef } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Создает стабильную ссылку на функцию.
|
|
5
|
+
* При ререндерах функция обновляется, ссылка нет.
|
|
6
|
+
*/
|
|
7
|
+
export function usePersistentCallback(cb) {
|
|
8
|
+
const callbackRef = useRef(cb);
|
|
9
|
+
callbackRef.current = cb;
|
|
10
|
+
// eslint-disable-next-line func-names
|
|
11
|
+
const persistentCbRef = useRef(function (...args) {
|
|
12
|
+
return callbackRef.current.apply(this, args);
|
|
13
|
+
});
|
|
14
|
+
return persistentCbRef.current;
|
|
15
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type Platform = 'ios' | 'android' | 'mac' | 'pc';
|
|
2
|
+
/** Настольный Mac. Телефон и планшет Apple — `ios`. */
|
|
3
|
+
export declare function isMac(): boolean;
|
|
4
|
+
/** `ios`, `android`, `mac` или `pc`. На сервере — `pc`, после гидратации фактическая платформа. */
|
|
5
|
+
export declare function usePlatform(): Platform;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useSyncExternalStore } from 'react';
|
|
3
|
+
import { emptyFunction } from '../_internal/empty-function';
|
|
4
|
+
const subscribe = () => emptyFunction;
|
|
5
|
+
/**
|
|
6
|
+
* `ios` — iPhone, iPad, iPod, в том числе iPad, который представляется Mac.
|
|
7
|
+
* `android` — по `userAgent`: в `platform` у него Linux.
|
|
8
|
+
* `mac` — настольный Mac. `pc` — всё остальное и сервер.
|
|
9
|
+
*/
|
|
10
|
+
function readPlatform() {
|
|
11
|
+
var _a, _b;
|
|
12
|
+
if (typeof navigator !== 'undefined') {
|
|
13
|
+
const ua = (_a = navigator.userAgent) !== null && _a !== void 0 ? _a : '';
|
|
14
|
+
const name = (_b = navigator.platform) !== null && _b !== void 0 ? _b : '';
|
|
15
|
+
const ios = /iPad|iPhone|iPod/.test(name) ||
|
|
16
|
+
/iPad|iPhone|iPod/.test(ua) ||
|
|
17
|
+
(/Mac/.test(name) && navigator.maxTouchPoints > 1);
|
|
18
|
+
if (ios)
|
|
19
|
+
return 'ios';
|
|
20
|
+
if (/android/i.test(ua))
|
|
21
|
+
return 'android';
|
|
22
|
+
if (/Mac/.test(name))
|
|
23
|
+
return 'mac';
|
|
24
|
+
}
|
|
25
|
+
return 'pc';
|
|
26
|
+
}
|
|
27
|
+
/** Настольный Mac. Телефон и планшет Apple — `ios`. */
|
|
28
|
+
export function isMac() {
|
|
29
|
+
return readPlatform() === 'mac';
|
|
30
|
+
}
|
|
31
|
+
/** `ios`, `android`, `mac` или `pc`. На сервере — `pc`, после гидратации фактическая платформа. */
|
|
32
|
+
export function usePlatform() {
|
|
33
|
+
return useSyncExternalStore(subscribe, readPlatform, () => 'pc');
|
|
34
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { BreakpointName } from './use-breakpoint';
|
|
2
|
+
/**
|
|
3
|
+
* Значение, которое может меняться по ширине окна: обычное значение или объект по ступеням
|
|
4
|
+
* `{ base: 'column', md: 'row' }`. `base` — для окон уже самой узкой ступени, дальше значение действует, пока
|
|
5
|
+
* его не заменит значение более широкой ступени (mobile-first, как у Chakra и Mantine).
|
|
6
|
+
*/
|
|
7
|
+
export type Responsive<T> = T | ({
|
|
8
|
+
base?: T;
|
|
9
|
+
} & Partial<Record<BreakpointName, T>>);
|
|
10
|
+
/** Значение для ступени: самая широкая ступень не шире текущей, иначе `base` */
|
|
11
|
+
export declare const resolveResponsive: <T>(value: Responsive<T>, current: BreakpointName | null) => T | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Значение для текущей ширины окна. На сервере и до гидратации — `base`.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* const columns = useResponsiveValue({ base: 1, sm: 2, lg: 4 });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function useResponsiveValue<T>(value: Responsive<T>): T | undefined;
|