prime-ui-kit 0.13.1 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -20
- package/dist/chunks/{chunk-XNOJEX55.js → chunk-2IKH55MI.js} +1 -1
- package/dist/chunks/{chunk-JV2KB5JZ.js → chunk-THFZIHKU.js} +3761 -3041
- package/dist/chunks/{chunk-PK2GC77E.js → chunk-XJAVS6FH.js} +213 -188
- package/dist/color-picker.js +2 -2
- package/dist/components/banner/Banner.d.ts +5 -2
- package/dist/components/chart-frame/ChartFrame.d.ts +19 -6
- package/dist/components/chat/Chat.d.ts +2 -2
- package/dist/components/chat/ChatPinned.d.ts +2 -2
- package/dist/components/chat/MessageList.d.ts +1 -1
- package/dist/components/chat/chatContext.d.ts +1 -1
- package/dist/components/dnd/Dnd.d.ts +1 -1
- package/dist/components/field-list/FieldList.d.ts +90 -0
- package/dist/components/index.d.ts +3 -1
- package/dist/components/input/Input.d.ts +2 -2
- package/dist/components/kanban/Kanban.d.ts +6 -3
- package/dist/components/login-form/LoginForm.d.ts +5 -1
- package/dist/components/page-content/PageContent.d.ts +55 -4
- package/dist/components/sparkline/Sparkline.d.ts +64 -15
- package/dist/components/sparkline/geometry.d.ts +26 -0
- package/dist/components/tooltip/Tooltip.d.ts +5 -2
- package/dist/hooks/usePosition.d.ts +15 -4
- package/dist/index.css +1 -1
- package/dist/index.js +4 -2
- package/dist/internal/ChartTooltip.d.ts +26 -0
- package/dist/internal/FieldAction.d.ts +6 -7
- package/dist/internal/fieldCell.d.ts +21 -0
- package/dist/internal/messageList.d.ts +2 -2
- package/dist/internal/palette.d.ts +7 -0
- package/dist/internal/swatch.d.ts +6 -2
- package/dist/layout/app-header/AppHeader.d.ts +9 -28
- package/dist/layout/index.d.ts +1 -1
- package/dist/skill/SKILL.md +32 -20
- package/dist/skill/anti-slop.md +77 -4
- package/dist/skill/api-contract.md +2 -2
- package/dist/skill/cheatsheet.md +33 -7
- package/dist/skill/checklist.md +28 -6
- package/dist/skill/choosing.md +17 -14
- package/dist/skill/components.md +9 -15
- package/dist/skill/composition.md +301 -61
- package/dist/skill/foundations.md +9 -7
- package/dist/skill/layouts.md +70 -37
- package/dist/skill/reference/components/avatar/COMPONENT.md +4 -4
- package/dist/skill/reference/components/avatar/examples/presence.tsx +1 -1
- package/dist/skill/reference/components/avatar/examples/states.tsx +5 -5
- package/dist/skill/reference/components/badge/examples/applied-filters.tsx +13 -19
- package/dist/skill/reference/components/badge/examples/examples.module.css +1 -8
- package/dist/skill/reference/components/badge/examples/server-tags.tsx +2 -6
- package/dist/skill/reference/components/banner/COMPONENT.md +6 -6
- package/dist/skill/reference/components/banner/examples/dismissible.tsx +22 -11
- package/dist/skill/reference/components/banner/examples/examples.module.css +4 -8
- package/dist/skill/reference/components/banner/examples/narrow.tsx +1 -1
- package/dist/skill/reference/components/banner/examples/page-strip.tsx +16 -22
- package/dist/skill/reference/components/breadcrumb/COMPONENT.md +5 -4
- package/dist/skill/reference/components/breadcrumb/examples/ellipsis.tsx +2 -2
- package/dist/skill/reference/components/breadcrumb/examples/overflow.tsx +1 -1
- package/dist/skill/reference/components/button-group/COMPONENT.md +2 -2
- package/dist/skill/reference/components/button-group/examples/in-form.tsx +22 -2
- package/dist/skill/reference/components/button-group/examples/states.tsx +10 -1
- package/dist/skill/reference/components/card/COMPONENT.md +7 -5
- package/dist/skill/reference/components/card/examples/examples.module.css +0 -28
- package/dist/skill/reference/components/card/examples/kpi-media.tsx +13 -11
- package/dist/skill/reference/components/card/examples/narrow.tsx +1 -1
- package/dist/skill/reference/components/card/examples/panel-chart.tsx +45 -22
- package/dist/skill/reference/components/card/examples/screen.module.css +14 -0
- package/dist/skill/reference/components/card/examples/screen.tsx +362 -0
- package/dist/skill/reference/components/card/examples/variants.tsx +15 -1
- package/dist/skill/reference/components/chart-frame/COMPONENT.md +12 -8
- package/dist/skill/reference/components/chart-frame/examples/fill-height.tsx +119 -0
- package/dist/skill/reference/components/chart-frame/examples/states.tsx +3 -1
- package/dist/skill/reference/components/chart-frame/examples/tooltip.tsx +20 -24
- package/dist/skill/reference/components/chat/COMPONENT.md +6 -4
- package/dist/skill/reference/components/chat/examples/group-chat.tsx +15 -2
- package/dist/skill/reference/components/chat/examples/reactions.tsx +121 -0
- package/dist/skill/reference/components/chat/examples/screen.module.css +9 -0
- package/dist/skill/{patterns/chat.tsx → reference/components/chat/examples/screen.tsx} +187 -350
- package/dist/skill/reference/components/chat/examples/search.tsx +1 -1
- package/dist/skill/reference/components/chat-list/COMPONENT.md +2 -1
- package/dist/skill/reference/components/chat-list/examples/links.tsx +72 -0
- package/dist/skill/reference/components/checkbox/COMPONENT.md +1 -1
- package/dist/skill/reference/components/checkbox/examples/examples.module.css +5 -1
- package/dist/skill/reference/components/checkbox/examples/indicator.tsx +37 -9
- package/dist/skill/reference/components/checkbox/examples/states.tsx +6 -1
- package/dist/skill/reference/components/color-field/COMPONENT.md +1 -1
- package/dist/skill/reference/components/color-picker/COMPONENT.md +6 -5
- package/dist/skill/reference/components/color-picker/examples/controlled-open.tsx +37 -0
- package/dist/skill/reference/components/color-picker/examples/presets.tsx +2 -2
- package/dist/skill/reference/components/color-picker/examples/states.tsx +23 -14
- package/dist/skill/reference/components/color-swatches/COMPONENT.md +1 -0
- package/dist/skill/reference/components/composer/COMPONENT.md +2 -1
- package/dist/skill/reference/components/composer/examples/attach-menu.tsx +78 -0
- package/dist/skill/reference/components/composer/examples/attachments.tsx +2 -2
- package/dist/skill/reference/components/crossfade/COMPONENT.md +1 -0
- package/dist/skill/{patterns/screen-states.module.css → reference/components/crossfade/examples/screen.module.css} +3 -17
- package/dist/skill/reference/components/crossfade/examples/screen.tsx +197 -0
- package/dist/skill/reference/components/data-table/COMPONENT.md +3 -2
- package/dist/skill/reference/components/data-table/examples/detail-panel.tsx +36 -37
- package/dist/skill/reference/components/data-table/examples/examples.module.css +0 -12
- package/dist/skill/reference/components/data-table/examples/numeric.tsx +36 -4
- package/dist/skill/reference/components/data-table/examples/overview.tsx +1 -0
- package/dist/skill/reference/components/data-table/examples/row-open.tsx +7 -36
- package/dist/skill/{patterns/list-page.module.css → reference/components/data-table/examples/screen.module.css} +1 -7
- package/dist/skill/{patterns/list-page.tsx → reference/components/data-table/examples/screen.tsx} +84 -64
- package/dist/skill/reference/components/datepicker/COMPONENT.md +6 -4
- package/dist/skill/reference/components/datepicker/examples/examples.module.css +2 -6
- package/dist/skill/reference/components/datepicker/examples/in-form.tsx +47 -55
- package/dist/skill/reference/components/datepicker/examples/locale.tsx +35 -0
- package/dist/skill/reference/components/datepicker/examples/range-presets.tsx +11 -2
- package/dist/skill/reference/components/datepicker/examples/states.tsx +9 -1
- package/dist/skill/reference/components/description-list/COMPONENT.md +1 -0
- package/dist/skill/{patterns/detail-page.module.css → reference/components/description-list/examples/screen.module.css} +2 -12
- package/dist/skill/reference/components/description-list/examples/screen.tsx +214 -0
- package/dist/skill/reference/components/description-list/examples/structure.tsx +1 -1
- package/dist/skill/reference/components/digit-input/COMPONENT.md +3 -1
- package/dist/skill/reference/components/digit-input/examples/states.tsx +3 -1
- package/dist/skill/reference/components/digit-input/examples/without-focus-ring.tsx +13 -0
- package/dist/skill/reference/components/divider/examples/with-icon.tsx +2 -2
- package/dist/skill/reference/components/dnd/COMPONENT.md +7 -5
- package/dist/skill/reference/components/dnd/examples/drop-zones.tsx +82 -49
- package/dist/skill/reference/components/dnd/examples/examples.module.css +50 -0
- package/dist/skill/reference/components/dnd/examples/states.tsx +54 -0
- package/dist/skill/reference/components/dnd/examples/table.tsx +113 -0
- package/dist/skill/reference/components/drawer/COMPONENT.md +1 -0
- package/dist/skill/reference/components/drawer/examples/dismiss.tsx +5 -3
- package/dist/skill/reference/components/drawer/examples/examples.module.css +0 -13
- package/dist/skill/reference/components/drawer/examples/header-actions.tsx +5 -9
- package/dist/skill/reference/components/drawer/examples/overview.tsx +6 -18
- package/dist/skill/reference/components/drawer/examples/screen.tsx +298 -0
- package/dist/skill/reference/components/dropdown/examples/examples.module.css +1 -5
- package/dist/skill/reference/components/empty-page/COMPONENT.md +1 -1
- package/dist/skill/reference/components/empty-page/examples/region-error.tsx +8 -2
- package/dist/skill/reference/components/example-frame/COMPONENT.md +3 -2
- package/dist/skill/reference/components/example-frame/examples/initial-view.tsx +44 -0
- package/dist/skill/reference/components/field-list/COMPONENT.md +165 -0
- package/dist/skill/reference/components/field-list/examples/base-row.tsx +76 -0
- package/dist/skill/reference/components/field-list/examples/controlled.tsx +72 -0
- package/dist/skill/reference/components/field-list/examples/errors.tsx +88 -0
- package/dist/skill/reference/components/field-list/examples/examples.module.css +34 -0
- package/dist/skill/reference/components/field-list/examples/limits.tsx +55 -0
- package/dist/skill/reference/components/field-list/examples/locked.tsx +139 -0
- package/dist/skill/reference/components/field-list/examples/narrow.tsx +68 -0
- package/dist/skill/reference/components/field-list/examples/overview.tsx +66 -0
- package/dist/skill/reference/components/field-list/examples/reorder.tsx +42 -0
- package/dist/skill/reference/components/field-list/examples/screen.module.css +18 -0
- package/dist/skill/reference/components/field-list/examples/screen.tsx +316 -0
- package/dist/skill/reference/components/field-list/examples/sizes.tsx +42 -0
- package/dist/skill/reference/components/field-list/examples/states.tsx +51 -0
- package/dist/skill/reference/components/file-upload/COMPONENT.md +7 -6
- package/dist/skill/reference/components/file-upload/examples/custom-body.tsx +2 -1
- package/dist/skill/reference/components/file-upload/examples/examples.module.css +1 -7
- package/dist/skill/reference/components/file-upload/examples/file-cards.tsx +10 -1
- package/dist/skill/reference/components/file-upload/examples/gallery.tsx +2 -2
- package/dist/skill/reference/components/file-upload/examples/in-form.tsx +4 -9
- package/dist/skill/reference/components/file-upload/examples/overview.tsx +5 -1
- package/dist/skill/reference/components/file-upload/examples/row-parts.tsx +24 -1
- package/dist/skill/{patterns/media-library.module.css → reference/components/file-upload/examples/screen.module.css} +2 -23
- package/dist/skill/reference/components/file-upload/examples/screen.tsx +646 -0
- package/dist/skill/reference/components/file-upload/examples/states.tsx +6 -2
- package/dist/skill/reference/components/file-upload/examples/validation.tsx +11 -2
- package/dist/skill/reference/components/file-upload/examples/variants.tsx +3 -20
- package/dist/skill/reference/components/gantt/COMPONENT.md +2 -1
- package/dist/skill/reference/components/gantt/examples/screen.module.css +14 -0
- package/dist/skill/{patterns/schedule.tsx → reference/components/gantt/examples/screen.tsx} +174 -170
- package/dist/skill/reference/components/gantt/examples/states.tsx +6 -2
- package/dist/skill/reference/components/input/COMPONENT.md +2 -2
- package/dist/skill/reference/components/input/examples/examples.module.css +2 -13
- package/dist/skill/reference/components/input/examples/in-form.tsx +1 -9
- package/dist/skill/reference/components/input/examples/password-strength.tsx +34 -8
- package/dist/skill/reference/components/input/examples/states.tsx +6 -1
- package/dist/skill/reference/components/kanban/COMPONENT.md +16 -11
- package/dist/skill/reference/components/kanban/examples/columns.tsx +8 -5
- package/dist/skill/reference/components/kanban/examples/limits.tsx +2 -1
- package/dist/skill/reference/components/kanban/examples/screen.module.css +17 -0
- package/dist/skill/{patterns/kanban-board.tsx → reference/components/kanban/examples/screen.tsx} +132 -172
- package/dist/skill/reference/components/kanban/examples/states.tsx +17 -6
- package/dist/skill/reference/components/kanban/examples/variants.tsx +16 -8
- package/dist/skill/reference/components/list/COMPONENT.md +1 -1
- package/dist/skill/reference/components/login-form/COMPONENT.md +6 -5
- package/dist/skill/reference/components/login-form/examples/examples.module.css +2 -21
- package/dist/skill/reference/components/login-form/examples/forgot-password.tsx +28 -32
- package/dist/skill/reference/components/login-form/examples/narrow.tsx +1 -1
- package/dist/skill/reference/components/login-form/examples/overview.tsx +45 -47
- package/dist/skill/reference/components/login-form/examples/register.tsx +64 -68
- package/dist/skill/reference/components/login-form/examples/reset-password.tsx +50 -47
- package/dist/skill/reference/components/login-form/examples/sizes.tsx +4 -6
- package/dist/skill/reference/components/login-form/examples/states.tsx +53 -57
- package/dist/skill/reference/components/login-form/examples/structure.tsx +18 -22
- package/dist/skill/reference/components/login-form/examples/verification-code.tsx +41 -45
- package/dist/skill/reference/components/media-viewer/COMPONENT.md +3 -3
- package/dist/skill/reference/components/media-viewer/examples/dismiss.tsx +5 -1
- package/dist/skill/reference/components/message/COMPONENT.md +6 -5
- package/dist/skill/reference/components/message/examples/file.tsx +5 -1
- package/dist/skill/reference/components/message/examples/media-open.tsx +48 -0
- package/dist/skill/reference/components/message/examples/status.tsx +21 -3
- package/dist/skill/reference/components/message/examples/text-formatting.tsx +7 -1
- package/dist/skill/reference/components/modal/COMPONENT.md +2 -1
- package/dist/skill/reference/components/modal/examples/custom-container.tsx +20 -20
- package/dist/skill/reference/components/modal/examples/dismiss.tsx +5 -3
- package/dist/skill/reference/components/modal/examples/enter-key.tsx +116 -0
- package/dist/skill/reference/components/modal/examples/examples.module.css +7 -13
- package/dist/skill/reference/components/modal/examples/structure.tsx +5 -2
- package/dist/skill/reference/components/native-select/COMPONENT.md +1 -1
- package/dist/skill/reference/components/native-select/examples/states.tsx +5 -1
- package/dist/skill/reference/components/notification/COMPONENT.md +2 -1
- package/dist/skill/reference/components/notification/examples/dismiss.tsx +2 -2
- package/dist/skill/reference/components/page-content/COMPONENT.md +71 -14
- package/dist/skill/reference/components/page-content/examples/grid.tsx +107 -0
- package/dist/skill/reference/components/page-content/examples/list-detail.tsx +0 -3
- package/dist/skill/reference/components/page-content/examples/overview.tsx +2 -2
- package/dist/skill/{patterns/settings-page.module.css → reference/components/page-content/examples/screen.module.css} +1 -21
- package/dist/skill/{patterns/settings-page.tsx → reference/components/page-content/examples/screen.tsx} +61 -82
- package/dist/skill/reference/components/page-content/examples/sections.tsx +81 -0
- package/dist/skill/reference/components/page-content/examples/variants.tsx +4 -11
- package/dist/skill/reference/components/page-toolbar/COMPONENT.md +18 -16
- package/dist/skill/reference/components/page-toolbar/examples/narrow.tsx +6 -3
- package/dist/skill/reference/components/pagination/examples/controlled.tsx +29 -29
- package/dist/skill/reference/components/pagination/examples/examples.module.css +0 -2
- package/dist/skill/reference/components/progress-bar/COMPONENT.md +1 -1
- package/dist/skill/reference/components/progress-bar/examples/segments.tsx +2 -2
- package/dist/skill/reference/components/progress-circle/COMPONENT.md +1 -1
- package/dist/skill/reference/components/progress-circle/examples/segments.tsx +8 -3
- package/dist/skill/reference/components/radio/COMPONENT.md +1 -0
- package/dist/skill/reference/components/radio/examples/examples.module.css +14 -0
- package/dist/skill/reference/components/radio/examples/in-form.tsx +45 -0
- package/dist/skill/reference/components/scroll-container/COMPONENT.md +1 -0
- package/dist/skill/reference/components/scroll-container/examples/auto-scroll.tsx +3 -3
- package/dist/skill/reference/components/scroll-container/examples/chat.tsx +3 -3
- package/dist/skill/reference/components/scroll-container/examples/edges.tsx +6 -3
- package/dist/skill/reference/components/scroll-container/examples/examples.module.css +4 -17
- package/dist/skill/reference/components/scroll-container/examples/load-more.tsx +51 -0
- package/dist/skill/reference/components/scroll-container/examples/lock.tsx +3 -5
- package/dist/skill/reference/components/scroll-container/examples/overscroll.tsx +3 -3
- package/dist/skill/reference/components/scroll-container/examples/overview.tsx +3 -3
- package/dist/skill/reference/components/scroll-container/examples/scrollbar.tsx +13 -7
- package/dist/skill/reference/components/scroll-container/examples/variants.tsx +13 -7
- package/dist/skill/reference/components/segmented-control/COMPONENT.md +3 -2
- package/dist/skill/reference/components/segmented-control/examples/in-form.tsx +5 -1
- package/dist/skill/reference/components/segmented-control/examples/states.tsx +10 -1
- package/dist/skill/reference/components/select/COMPONENT.md +5 -3
- package/dist/skill/reference/components/select/examples/examples.module.css +2 -7
- package/dist/skill/reference/components/select/examples/icon-only.tsx +38 -0
- package/dist/skill/reference/components/select/examples/states.tsx +13 -1
- package/dist/skill/reference/components/sheet/COMPONENT.md +2 -0
- package/dist/skill/reference/components/sheet/examples/guard.tsx +72 -0
- package/dist/skill/reference/components/sheet/examples/header-actions.tsx +56 -0
- package/dist/skill/reference/components/slider/COMPONENT.md +2 -1
- package/dist/skill/reference/components/slider/examples/examples.module.css +8 -0
- package/dist/skill/reference/components/slider/examples/in-form.tsx +47 -0
- package/dist/skill/reference/components/slider/examples/states.tsx +4 -1
- package/dist/skill/reference/components/smart-filter/COMPONENT.md +1 -1
- package/dist/skill/reference/components/smart-filter/examples/controlled.tsx +3 -3
- package/dist/skill/reference/components/smart-filter/examples/ranges.tsx +44 -10
- package/dist/skill/reference/components/sparkline/COMPONENT.md +83 -30
- package/dist/skill/reference/components/sparkline/examples/compact.tsx +1 -1
- package/dist/skill/reference/components/sparkline/examples/curve.tsx +28 -0
- package/dist/skill/reference/components/sparkline/examples/gaps.tsx +33 -0
- package/dist/skill/reference/components/sparkline/examples/overview.tsx +11 -2
- package/dist/skill/reference/components/sparkline/examples/period.tsx +7 -2
- package/dist/skill/reference/components/sparkline/examples/reference.tsx +38 -0
- package/dist/skill/reference/components/sparkline/examples/variants.tsx +2 -2
- package/dist/skill/reference/components/tabs/COMPONENT.md +1 -1
- package/dist/skill/reference/components/tabs/examples/examples.module.css +0 -6
- package/dist/skill/reference/components/tabs/examples/in-drawer.tsx +11 -13
- package/dist/skill/reference/components/tabs/examples/sizes.tsx +1 -1
- package/dist/skill/reference/components/tag-select/COMPONENT.md +1 -1
- package/dist/skill/reference/components/tag-select/examples/states.tsx +8 -1
- package/dist/skill/reference/components/textarea/COMPONENT.md +1 -1
- package/dist/skill/reference/components/textarea/examples/examples.module.css +0 -6
- package/dist/skill/reference/components/textarea/examples/in-form.tsx +1 -9
- package/dist/skill/reference/components/textarea/examples/states.tsx +2 -1
- package/dist/skill/reference/components/thumbnail/COMPONENT.md +2 -1
- package/dist/skill/reference/components/thumbnail/examples/examples.module.css +1 -1
- package/dist/skill/reference/components/thumbnail/examples/fit.tsx +24 -0
- package/dist/skill/reference/components/thumbnail/examples/video.tsx +20 -1
- package/dist/skill/reference/components/timeline/COMPONENT.md +1 -1
- package/dist/skill/reference/components/timeline/examples/examples.module.css +0 -8
- package/dist/skill/reference/components/timeline/examples/links.tsx +55 -14
- package/dist/skill/reference/components/timeline/examples/narrow.tsx +2 -2
- package/dist/skill/reference/components/timeline/examples/sizes.tsx +3 -3
- package/dist/skill/reference/components/timeline/examples/variants.tsx +4 -4
- package/dist/skill/reference/components/tooltip/COMPONENT.md +7 -5
- package/dist/skill/reference/components/tooltip/examples/placement.tsx +2 -1
- package/dist/skill/reference/components/tooltip/examples/toolbar.tsx +2 -2
- package/dist/skill/reference/components/typography/examples/weights.tsx +3 -0
- package/dist/skill/reference/components/video-note/COMPONENT.md +3 -3
- package/dist/skill/reference/components/video-note/examples/controlled.tsx +19 -2
- package/dist/skill/reference/components/video-note/examples/in-message.tsx +5 -2
- package/dist/skill/reference/components/visually-hidden/COMPONENT.md +2 -1
- package/dist/skill/reference/components/visually-hidden/examples/assertive.tsx +39 -0
- package/dist/skill/reference/components/voice-player/COMPONENT.md +3 -3
- package/dist/skill/reference/components/voice-player/examples/call-recording.tsx +19 -9
- package/dist/skill/reference/components/voice-player/examples/controlled.tsx +20 -3
- package/dist/skill/reference/layout/app-header/COMPONENT.md +46 -63
- package/dist/skill/reference/layout/app-header/examples/breadcrumbs.tsx +10 -9
- package/dist/skill/reference/layout/app-header/examples/examples.module.css +1 -1
- package/dist/skill/reference/layout/app-header/examples/in-app-shell.tsx +2 -3
- package/dist/skill/reference/layout/app-header/examples/narrow.tsx +4 -5
- package/dist/skill/reference/layout/app-header/examples/overview.tsx +8 -10
- package/dist/skill/reference/layout/app-header/examples/page-title.tsx +3 -10
- package/dist/skill/reference/layout/app-shell/COMPONENT.md +5 -4
- package/dist/skill/reference/layout/app-shell/examples/footer.tsx +2 -2
- package/dist/skill/reference/layout/app-shell/examples/overview.tsx +17 -32
- package/dist/skill/{patterns/app-shell.module.css → reference/layout/app-shell/examples/screen.module.css} +1 -8
- package/dist/skill/reference/layout/app-shell/examples/screen.tsx +262 -0
- package/dist/skill/reference/layout/app-shell/examples/template.tsx +31 -11
- package/dist/skill/reference/layout/bottom-nav/examples/floating-action.tsx +2 -2
- package/dist/skill/reference/layout/bottom-nav/examples/floating.tsx +2 -2
- package/dist/skill/reference/layout/bottom-nav/examples/in-app-shell.tsx +2 -2
- package/dist/skill/reference/layout/sidebar/COMPONENT.md +7 -4
- package/dist/skill/reference/layout/sidebar/examples/account.tsx +2 -2
- package/dist/skill/reference/layout/sidebar/examples/collapsible-groups.tsx +12 -4
- package/dist/skill/reference/layout/sidebar/examples/custom-part.tsx +53 -0
- package/dist/skill/reference/layout/sidebar/examples/examples.module.css +5 -0
- package/dist/skill/reference/layout/sidebar/examples/narrow.tsx +53 -0
- package/dist/skill/reference/layout/sidebar/examples/persist.tsx +57 -0
- package/dist/skill/reference/layout/sidebar/examples/router.tsx +14 -2
- package/dist/skill/reference/layout/sidebar/examples/structure.tsx +7 -2
- package/dist/skill/responsive.md +7 -5
- package/dist/skill/ux.md +145 -0
- package/dist/tokens/semantic.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/avatar/COMPONENT.md +4 -4
- package/src/components/avatar/examples/presence.tsx +1 -1
- package/src/components/avatar/examples/states.tsx +5 -5
- package/src/components/badge/examples/applied-filters.tsx +13 -19
- package/src/components/badge/examples/examples.module.css +1 -8
- package/src/components/badge/examples/server-tags.tsx +2 -6
- package/src/components/banner/COMPONENT.md +6 -6
- package/src/components/banner/examples/dismissible.tsx +22 -11
- package/src/components/banner/examples/examples.module.css +4 -8
- package/src/components/banner/examples/narrow.tsx +1 -1
- package/src/components/banner/examples/page-strip.tsx +16 -22
- package/src/components/breadcrumb/COMPONENT.md +5 -4
- package/src/components/breadcrumb/examples/ellipsis.tsx +2 -2
- package/src/components/breadcrumb/examples/overflow.tsx +1 -1
- package/src/components/button-group/COMPONENT.md +2 -2
- package/src/components/button-group/examples/in-form.tsx +22 -2
- package/src/components/button-group/examples/states.tsx +10 -1
- package/src/components/card/COMPONENT.md +7 -5
- package/src/components/card/examples/examples.module.css +0 -28
- package/src/components/card/examples/kpi-media.tsx +13 -11
- package/src/components/card/examples/narrow.tsx +1 -1
- package/src/components/card/examples/panel-chart.tsx +45 -22
- package/src/components/card/examples/screen.module.css +14 -0
- package/src/components/card/examples/screen.tsx +362 -0
- package/src/components/card/examples/variants.tsx +15 -1
- package/src/components/chart-frame/COMPONENT.md +12 -8
- package/src/components/chart-frame/examples/fill-height.tsx +119 -0
- package/src/components/chart-frame/examples/states.tsx +3 -1
- package/src/components/chart-frame/examples/tooltip.tsx +20 -24
- package/src/components/chat/COMPONENT.md +6 -4
- package/src/components/chat/examples/group-chat.tsx +15 -2
- package/src/components/chat/examples/reactions.tsx +121 -0
- package/src/components/chat/examples/screen.module.css +9 -0
- package/src/components/chat/examples/screen.tsx +718 -0
- package/src/components/chat/examples/search.tsx +1 -1
- package/src/components/chat-list/COMPONENT.md +2 -1
- package/src/components/chat-list/examples/links.tsx +72 -0
- package/src/components/checkbox/COMPONENT.md +1 -1
- package/src/components/checkbox/examples/examples.module.css +5 -1
- package/src/components/checkbox/examples/indicator.tsx +37 -9
- package/src/components/checkbox/examples/states.tsx +6 -1
- package/src/components/color-field/COMPONENT.md +1 -1
- package/src/components/color-picker/COMPONENT.md +6 -5
- package/src/components/color-picker/examples/controlled-open.tsx +37 -0
- package/src/components/color-picker/examples/presets.tsx +2 -2
- package/src/components/color-picker/examples/states.tsx +23 -14
- package/src/components/color-swatches/COMPONENT.md +1 -0
- package/src/components/composer/COMPONENT.md +2 -1
- package/src/components/composer/examples/attach-menu.tsx +78 -0
- package/src/components/composer/examples/attachments.tsx +2 -2
- package/src/components/crossfade/COMPONENT.md +1 -0
- package/src/components/crossfade/examples/screen.module.css +40 -0
- package/src/components/crossfade/examples/screen.tsx +197 -0
- package/src/components/data-table/COMPONENT.md +3 -2
- package/src/components/data-table/examples/detail-panel.tsx +36 -37
- package/src/components/data-table/examples/examples.module.css +0 -12
- package/src/components/data-table/examples/numeric.tsx +36 -4
- package/src/components/data-table/examples/overview.tsx +1 -0
- package/src/components/data-table/examples/row-open.tsx +7 -36
- package/src/components/data-table/examples/screen.module.css +13 -0
- package/src/components/data-table/examples/screen.tsx +354 -0
- package/src/components/datepicker/COMPONENT.md +6 -4
- package/src/components/datepicker/examples/examples.module.css +2 -6
- package/src/components/datepicker/examples/in-form.tsx +47 -55
- package/src/components/datepicker/examples/locale.tsx +35 -0
- package/src/components/datepicker/examples/range-presets.tsx +11 -2
- package/src/components/datepicker/examples/states.tsx +9 -1
- package/src/components/description-list/COMPONENT.md +1 -0
- package/src/components/description-list/examples/screen.module.css +64 -0
- package/src/components/description-list/examples/screen.tsx +214 -0
- package/src/components/description-list/examples/structure.tsx +1 -1
- package/src/components/digit-input/COMPONENT.md +3 -1
- package/src/components/digit-input/examples/states.tsx +3 -1
- package/src/components/digit-input/examples/without-focus-ring.tsx +13 -0
- package/src/components/divider/examples/with-icon.tsx +2 -2
- package/src/components/dnd/COMPONENT.md +7 -5
- package/src/components/dnd/examples/drop-zones.tsx +82 -49
- package/src/components/dnd/examples/examples.module.css +50 -0
- package/src/components/dnd/examples/states.tsx +54 -0
- package/src/components/dnd/examples/table.tsx +113 -0
- package/src/components/drawer/COMPONENT.md +1 -0
- package/src/components/drawer/examples/dismiss.tsx +5 -3
- package/src/components/drawer/examples/examples.module.css +0 -13
- package/src/components/drawer/examples/header-actions.tsx +5 -9
- package/src/components/drawer/examples/overview.tsx +6 -18
- package/src/components/drawer/examples/screen.module.css +14 -0
- package/src/components/drawer/examples/screen.tsx +298 -0
- package/src/components/dropdown/examples/examples.module.css +1 -5
- package/src/components/empty-page/COMPONENT.md +1 -1
- package/src/components/empty-page/examples/region-error.tsx +8 -2
- package/src/components/example-frame/COMPONENT.md +3 -2
- package/src/components/example-frame/examples/initial-view.tsx +44 -0
- package/src/components/field-list/COMPONENT.md +165 -0
- package/src/components/field-list/examples/base-row.tsx +76 -0
- package/src/components/field-list/examples/controlled.tsx +72 -0
- package/src/components/field-list/examples/errors.tsx +88 -0
- package/src/components/field-list/examples/examples.module.css +34 -0
- package/src/components/field-list/examples/limits.tsx +55 -0
- package/src/components/field-list/examples/locked.tsx +139 -0
- package/src/components/field-list/examples/narrow.tsx +68 -0
- package/src/components/field-list/examples/overview.tsx +66 -0
- package/src/components/field-list/examples/reorder.tsx +42 -0
- package/src/components/field-list/examples/screen.module.css +18 -0
- package/src/components/field-list/examples/screen.tsx +316 -0
- package/src/components/field-list/examples/sizes.tsx +42 -0
- package/src/components/field-list/examples/states.tsx +51 -0
- package/src/components/file-upload/COMPONENT.md +7 -6
- package/src/components/file-upload/examples/custom-body.tsx +2 -1
- package/src/components/file-upload/examples/examples.module.css +1 -7
- package/src/components/file-upload/examples/file-cards.tsx +10 -1
- package/src/components/file-upload/examples/gallery.tsx +2 -2
- package/src/components/file-upload/examples/in-form.tsx +4 -9
- package/src/components/file-upload/examples/overview.tsx +5 -1
- package/src/components/file-upload/examples/row-parts.tsx +24 -1
- package/src/components/file-upload/examples/screen.module.css +45 -0
- package/src/components/file-upload/examples/screen.tsx +646 -0
- package/src/components/file-upload/examples/states.tsx +6 -2
- package/src/components/file-upload/examples/validation.tsx +11 -2
- package/src/components/file-upload/examples/variants.tsx +3 -20
- package/src/components/gantt/COMPONENT.md +2 -1
- package/src/components/gantt/examples/screen.module.css +14 -0
- package/src/components/gantt/examples/screen.tsx +726 -0
- package/src/components/gantt/examples/states.tsx +6 -2
- package/src/components/input/COMPONENT.md +2 -2
- package/src/components/input/examples/examples.module.css +2 -13
- package/src/components/input/examples/in-form.tsx +1 -9
- package/src/components/input/examples/password-strength.tsx +34 -8
- package/src/components/input/examples/states.tsx +6 -1
- package/src/components/kanban/COMPONENT.md +16 -11
- package/src/components/kanban/examples/columns.tsx +8 -5
- package/src/components/kanban/examples/limits.tsx +2 -1
- package/src/components/kanban/examples/screen.module.css +17 -0
- package/src/components/kanban/examples/screen.tsx +572 -0
- package/src/components/kanban/examples/states.tsx +17 -6
- package/src/components/kanban/examples/variants.tsx +16 -8
- package/src/components/list/COMPONENT.md +1 -1
- package/src/components/login-form/COMPONENT.md +6 -5
- package/src/components/login-form/examples/examples.module.css +2 -21
- package/src/components/login-form/examples/forgot-password.tsx +28 -32
- package/src/components/login-form/examples/narrow.tsx +1 -1
- package/src/components/login-form/examples/overview.tsx +45 -47
- package/src/components/login-form/examples/register.tsx +64 -68
- package/src/components/login-form/examples/reset-password.tsx +50 -47
- package/src/components/login-form/examples/sizes.tsx +4 -6
- package/src/components/login-form/examples/states.tsx +53 -57
- package/src/components/login-form/examples/structure.tsx +18 -22
- package/src/components/login-form/examples/verification-code.tsx +41 -45
- package/src/components/media-viewer/COMPONENT.md +3 -3
- package/src/components/media-viewer/examples/dismiss.tsx +5 -1
- package/src/components/message/COMPONENT.md +6 -5
- package/src/components/message/examples/file.tsx +5 -1
- package/src/components/message/examples/media-open.tsx +48 -0
- package/src/components/message/examples/status.tsx +21 -3
- package/src/components/message/examples/text-formatting.tsx +7 -1
- package/src/components/modal/COMPONENT.md +2 -1
- package/src/components/modal/examples/custom-container.tsx +20 -20
- package/src/components/modal/examples/dismiss.tsx +5 -3
- package/src/components/modal/examples/enter-key.tsx +116 -0
- package/src/components/modal/examples/examples.module.css +7 -13
- package/src/components/modal/examples/structure.tsx +5 -2
- package/src/components/native-select/COMPONENT.md +1 -1
- package/src/components/native-select/examples/states.tsx +5 -1
- package/src/components/notification/COMPONENT.md +2 -1
- package/src/components/notification/examples/dismiss.tsx +2 -2
- package/src/components/page-content/COMPONENT.md +71 -14
- package/src/components/page-content/examples/grid.tsx +107 -0
- package/src/components/page-content/examples/list-detail.tsx +0 -3
- package/src/components/page-content/examples/overview.tsx +2 -2
- package/src/components/page-content/examples/screen.module.css +27 -0
- package/src/components/page-content/examples/screen.tsx +196 -0
- package/src/components/page-content/examples/sections.tsx +81 -0
- package/src/components/page-content/examples/variants.tsx +4 -11
- package/src/components/page-toolbar/COMPONENT.md +18 -16
- package/src/components/page-toolbar/examples/narrow.tsx +6 -3
- package/src/components/pagination/examples/controlled.tsx +29 -29
- package/src/components/pagination/examples/examples.module.css +0 -2
- package/src/components/progress-bar/COMPONENT.md +1 -1
- package/src/components/progress-bar/examples/segments.tsx +2 -2
- package/src/components/progress-circle/COMPONENT.md +1 -1
- package/src/components/progress-circle/examples/segments.tsx +8 -3
- package/src/components/radio/COMPONENT.md +1 -0
- package/src/components/radio/examples/examples.module.css +14 -0
- package/src/components/radio/examples/in-form.tsx +45 -0
- package/src/components/scroll-container/COMPONENT.md +1 -0
- package/src/components/scroll-container/examples/auto-scroll.tsx +3 -3
- package/src/components/scroll-container/examples/chat.tsx +3 -3
- package/src/components/scroll-container/examples/edges.tsx +6 -3
- package/src/components/scroll-container/examples/examples.module.css +4 -17
- package/src/components/scroll-container/examples/load-more.tsx +51 -0
- package/src/components/scroll-container/examples/lock.tsx +3 -5
- package/src/components/scroll-container/examples/overscroll.tsx +3 -3
- package/src/components/scroll-container/examples/overview.tsx +3 -3
- package/src/components/scroll-container/examples/scrollbar.tsx +13 -7
- package/src/components/scroll-container/examples/variants.tsx +13 -7
- package/src/components/segmented-control/COMPONENT.md +3 -2
- package/src/components/segmented-control/examples/in-form.tsx +5 -1
- package/src/components/segmented-control/examples/states.tsx +10 -1
- package/src/components/select/COMPONENT.md +5 -3
- package/src/components/select/examples/examples.module.css +2 -7
- package/src/components/select/examples/icon-only.tsx +38 -0
- package/src/components/select/examples/states.tsx +13 -1
- package/src/components/sheet/COMPONENT.md +2 -0
- package/src/components/sheet/examples/guard.tsx +72 -0
- package/src/components/sheet/examples/header-actions.tsx +56 -0
- package/src/components/slider/COMPONENT.md +2 -1
- package/src/components/slider/examples/examples.module.css +8 -0
- package/src/components/slider/examples/in-form.tsx +47 -0
- package/src/components/slider/examples/states.tsx +4 -1
- package/src/components/smart-filter/COMPONENT.md +1 -1
- package/src/components/smart-filter/examples/controlled.tsx +3 -3
- package/src/components/smart-filter/examples/ranges.tsx +44 -10
- package/src/components/sparkline/COMPONENT.md +83 -30
- package/src/components/sparkline/examples/compact.tsx +1 -1
- package/src/components/sparkline/examples/curve.tsx +28 -0
- package/src/components/sparkline/examples/gaps.tsx +33 -0
- package/src/components/sparkline/examples/overview.tsx +11 -2
- package/src/components/sparkline/examples/period.tsx +7 -2
- package/src/components/sparkline/examples/reference.tsx +38 -0
- package/src/components/sparkline/examples/variants.tsx +2 -2
- package/src/components/tabs/COMPONENT.md +1 -1
- package/src/components/tabs/examples/examples.module.css +0 -6
- package/src/components/tabs/examples/in-drawer.tsx +11 -13
- package/src/components/tabs/examples/sizes.tsx +1 -1
- package/src/components/tag-select/COMPONENT.md +1 -1
- package/src/components/tag-select/examples/states.tsx +8 -1
- package/src/components/textarea/COMPONENT.md +1 -1
- package/src/components/textarea/examples/examples.module.css +0 -6
- package/src/components/textarea/examples/in-form.tsx +1 -9
- package/src/components/textarea/examples/states.tsx +2 -1
- package/src/components/thumbnail/COMPONENT.md +2 -1
- package/src/components/thumbnail/examples/examples.module.css +1 -1
- package/src/components/thumbnail/examples/fit.tsx +24 -0
- package/src/components/thumbnail/examples/video.tsx +20 -1
- package/src/components/timeline/COMPONENT.md +1 -1
- package/src/components/timeline/examples/examples.module.css +0 -8
- package/src/components/timeline/examples/links.tsx +55 -14
- package/src/components/timeline/examples/narrow.tsx +2 -2
- package/src/components/timeline/examples/sizes.tsx +3 -3
- package/src/components/timeline/examples/variants.tsx +4 -4
- package/src/components/tooltip/COMPONENT.md +7 -5
- package/src/components/tooltip/examples/placement.tsx +2 -1
- package/src/components/tooltip/examples/toolbar.tsx +2 -2
- package/src/components/typography/examples/weights.tsx +3 -0
- package/src/components/video-note/COMPONENT.md +3 -3
- package/src/components/video-note/examples/controlled.tsx +19 -2
- package/src/components/video-note/examples/in-message.tsx +5 -2
- package/src/components/visually-hidden/COMPONENT.md +2 -1
- package/src/components/visually-hidden/examples/assertive.tsx +39 -0
- package/src/components/voice-player/COMPONENT.md +3 -3
- package/src/components/voice-player/examples/call-recording.tsx +19 -9
- package/src/components/voice-player/examples/controlled.tsx +20 -3
- package/src/layout/app-header/COMPONENT.md +46 -63
- package/src/layout/app-header/examples/breadcrumbs.tsx +10 -9
- package/src/layout/app-header/examples/examples.module.css +1 -1
- package/src/layout/app-header/examples/in-app-shell.tsx +2 -3
- package/src/layout/app-header/examples/narrow.tsx +4 -5
- package/src/layout/app-header/examples/overview.tsx +8 -10
- package/src/layout/app-header/examples/page-title.tsx +3 -10
- package/src/layout/app-shell/COMPONENT.md +5 -4
- package/src/layout/app-shell/examples/footer.tsx +2 -2
- package/src/layout/app-shell/examples/overview.tsx +17 -32
- package/src/layout/app-shell/examples/screen.module.css +11 -0
- package/src/layout/app-shell/examples/screen.tsx +262 -0
- package/src/layout/app-shell/examples/template.tsx +31 -11
- package/src/layout/bottom-nav/examples/floating-action.tsx +2 -2
- package/src/layout/bottom-nav/examples/floating.tsx +2 -2
- package/src/layout/bottom-nav/examples/in-app-shell.tsx +2 -2
- package/src/layout/sidebar/COMPONENT.md +7 -4
- package/src/layout/sidebar/examples/account.tsx +2 -2
- package/src/layout/sidebar/examples/collapsible-groups.tsx +12 -4
- package/src/layout/sidebar/examples/custom-part.tsx +53 -0
- package/src/layout/sidebar/examples/examples.module.css +5 -0
- package/src/layout/sidebar/examples/narrow.tsx +53 -0
- package/src/layout/sidebar/examples/persist.tsx +57 -0
- package/src/layout/sidebar/examples/router.tsx +14 -2
- package/src/layout/sidebar/examples/structure.tsx +7 -2
- package/src/styles/theme-light.css +1 -0
- package/dist/skill/patterns/app-shell.tsx +0 -301
- package/dist/skill/patterns/chat.module.css +0 -8
- package/dist/skill/patterns/dashboard.module.css +0 -44
- package/dist/skill/patterns/dashboard.tsx +0 -326
- package/dist/skill/patterns/detail-page.tsx +0 -209
- package/dist/skill/patterns/form-drawer.tsx +0 -240
- package/dist/skill/patterns/kanban-board.module.css +0 -28
- package/dist/skill/patterns/media-library.tsx +0 -638
- package/dist/skill/patterns/schedule.module.css +0 -22
- package/dist/skill/patterns/screen-states.tsx +0 -186
- /package/dist/skill/{patterns/form-drawer.module.css → reference/components/drawer/examples/screen.module.css} +0 -0
|
@@ -567,16 +567,16 @@ function MorphText({ children: text, className }) {
|
|
|
567
567
|
React6.useLayoutEffect(() => {
|
|
568
568
|
if (!morph) return;
|
|
569
569
|
const root = rootRef.current;
|
|
570
|
-
const
|
|
570
|
+
const segment2 = segmentRef.current;
|
|
571
571
|
const sizer = sizerRef.current;
|
|
572
|
-
if (!root || !
|
|
572
|
+
if (!root || !segment2 || !sizer) return;
|
|
573
573
|
const target = sizer.getBoundingClientRect().width;
|
|
574
574
|
const still = root.getBoundingClientRect().width - target;
|
|
575
575
|
const from = Math.max(0, morph.width - still);
|
|
576
576
|
if (target !== from) {
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
577
|
+
segment2.style.width = `${from}px`;
|
|
578
|
+
segment2.getBoundingClientRect();
|
|
579
|
+
segment2.style.width = `${target}px`;
|
|
580
580
|
}
|
|
581
581
|
const changed = splitChange(morph.from, morph.to);
|
|
582
582
|
const longest = changed.in.length > changed.out.length ? changed.in : changed.out;
|
|
@@ -986,44 +986,6 @@ function Divider({
|
|
|
986
986
|
);
|
|
987
987
|
}
|
|
988
988
|
|
|
989
|
-
// src/internal/states.ts
|
|
990
|
-
var controlSizes = ["xs", "s", "m", "l", "xl"];
|
|
991
|
-
function stepDown(size, n = 1) {
|
|
992
|
-
return controlSizes[Math.max(0, controlSizes.indexOf(size) - n)] ?? "xs";
|
|
993
|
-
}
|
|
994
|
-
var variants = ["solid", "soft", "outline", "ghost"];
|
|
995
|
-
var tones = ["neutral", "accent", "success", "warning", "danger", "info"];
|
|
996
|
-
var paletteColors = [
|
|
997
|
-
"gray",
|
|
998
|
-
"blue",
|
|
999
|
-
"green",
|
|
1000
|
-
"orange",
|
|
1001
|
-
"red",
|
|
1002
|
-
"yellow",
|
|
1003
|
-
"purple",
|
|
1004
|
-
"sky",
|
|
1005
|
-
"pink",
|
|
1006
|
-
"teal"
|
|
1007
|
-
];
|
|
1008
|
-
var dataStates = [
|
|
1009
|
-
"open",
|
|
1010
|
-
"closed",
|
|
1011
|
-
"checked",
|
|
1012
|
-
"unchecked",
|
|
1013
|
-
"indeterminate",
|
|
1014
|
-
"active",
|
|
1015
|
-
"inactive"
|
|
1016
|
-
];
|
|
1017
|
-
var textTones = [
|
|
1018
|
-
"default",
|
|
1019
|
-
"secondary",
|
|
1020
|
-
"muted",
|
|
1021
|
-
"accent",
|
|
1022
|
-
"success",
|
|
1023
|
-
"warning",
|
|
1024
|
-
"danger"
|
|
1025
|
-
];
|
|
1026
|
-
|
|
1027
989
|
// src/icons/registry.ts
|
|
1028
990
|
var iconRegistry = {
|
|
1029
991
|
"nav.chevronDown": ChevronDown,
|
|
@@ -1272,6 +1234,9 @@ function readCssLengthPx(name, fallbackPx) {
|
|
|
1272
1234
|
function getViewportPadPx() {
|
|
1273
1235
|
return readCssLengthPx("--prime-space-2", FALLBACK_VIEWPORT_PAD_PX);
|
|
1274
1236
|
}
|
|
1237
|
+
function pointRect(x, y) {
|
|
1238
|
+
return { left: x, right: x, top: y, bottom: y, width: 0, height: 0 };
|
|
1239
|
+
}
|
|
1275
1240
|
var clamp = (value, min, max) => Math.max(min, Math.min(value, Math.max(min, max)));
|
|
1276
1241
|
function computeFloatingPosition(anchor, contentW, contentH, vw, vh, opts) {
|
|
1277
1242
|
const { align, offset, flip, matchAnchorWidth, arrowInset: arrowInset2, boundary } = opts;
|
|
@@ -1346,13 +1311,16 @@ function usePosition(enabled, anchorRef, layerRef, {
|
|
|
1346
1311
|
align = DEFAULT_ALIGN,
|
|
1347
1312
|
matchAnchorWidth = false,
|
|
1348
1313
|
offsetToken = "--prime-panel-offset",
|
|
1349
|
-
arrowInset: arrowInset2
|
|
1314
|
+
arrowInset: arrowInset2,
|
|
1315
|
+
anchorPoint = null
|
|
1350
1316
|
} = {}) {
|
|
1351
1317
|
const [attached, setAttached] = React12.useState(false);
|
|
1352
1318
|
const [resolvedSide, setResolvedSide] = React12.useState(preferredSide);
|
|
1353
1319
|
const resolveAnchorRect = useAnchorRectResolver();
|
|
1354
1320
|
const resolveBoundary = useFloatingBoundaryResolver();
|
|
1355
1321
|
const metricsRef = React12.useRef(null);
|
|
1322
|
+
const pointRef = React12.useRef(anchorPoint);
|
|
1323
|
+
pointRef.current = anchorPoint;
|
|
1356
1324
|
const update = React12.useCallback(
|
|
1357
1325
|
(remeasure) => {
|
|
1358
1326
|
const anchor = anchorRef.current;
|
|
@@ -1367,7 +1335,8 @@ function usePosition(enabled, anchorRef, layerRef, {
|
|
|
1367
1335
|
}
|
|
1368
1336
|
const { offset, pad, arrow } = metricsRef.current;
|
|
1369
1337
|
const rawRect = anchor.getBoundingClientRect();
|
|
1370
|
-
const
|
|
1338
|
+
const point = pointRef.current;
|
|
1339
|
+
const rect = point ? pointRect(rawRect.left + point.x, rawRect.top + point.y) : resolveAnchorRect ? resolveAnchorRect(anchor, rawRect) : rawRect;
|
|
1371
1340
|
const boundary = resolveBoundary?.(anchor) ?? void 0;
|
|
1372
1341
|
const compute = (width2, height2) => computeFloatingPosition(rect, width2, height2, window.innerWidth, window.innerHeight, {
|
|
1373
1342
|
side: preferredSide,
|
|
@@ -1432,6 +1401,11 @@ function usePosition(enabled, anchorRef, layerRef, {
|
|
|
1432
1401
|
React12.useLayoutEffect(() => {
|
|
1433
1402
|
if (active2) update(true);
|
|
1434
1403
|
}, [active2, update]);
|
|
1404
|
+
const pointX = anchorPoint?.x;
|
|
1405
|
+
const pointY = anchorPoint?.y;
|
|
1406
|
+
React12.useLayoutEffect(() => {
|
|
1407
|
+
if (active2 && pointX !== void 0 && pointY !== void 0) updateRef.current(false);
|
|
1408
|
+
}, [active2, pointX, pointY]);
|
|
1435
1409
|
React12.useLayoutEffect(() => {
|
|
1436
1410
|
if (!active2) return;
|
|
1437
1411
|
let frame2 = 0;
|
|
@@ -2075,6 +2049,44 @@ function ScrollContainer({
|
|
|
2075
2049
|
) });
|
|
2076
2050
|
}
|
|
2077
2051
|
|
|
2052
|
+
// src/internal/states.ts
|
|
2053
|
+
var controlSizes = ["xs", "s", "m", "l", "xl"];
|
|
2054
|
+
function stepDown(size, n = 1) {
|
|
2055
|
+
return controlSizes[Math.max(0, controlSizes.indexOf(size) - n)] ?? "xs";
|
|
2056
|
+
}
|
|
2057
|
+
var variants = ["solid", "soft", "outline", "ghost"];
|
|
2058
|
+
var tones = ["neutral", "accent", "success", "warning", "danger", "info"];
|
|
2059
|
+
var paletteColors = [
|
|
2060
|
+
"gray",
|
|
2061
|
+
"blue",
|
|
2062
|
+
"green",
|
|
2063
|
+
"orange",
|
|
2064
|
+
"red",
|
|
2065
|
+
"yellow",
|
|
2066
|
+
"purple",
|
|
2067
|
+
"sky",
|
|
2068
|
+
"pink",
|
|
2069
|
+
"teal"
|
|
2070
|
+
];
|
|
2071
|
+
var dataStates = [
|
|
2072
|
+
"open",
|
|
2073
|
+
"closed",
|
|
2074
|
+
"checked",
|
|
2075
|
+
"unchecked",
|
|
2076
|
+
"indeterminate",
|
|
2077
|
+
"active",
|
|
2078
|
+
"inactive"
|
|
2079
|
+
];
|
|
2080
|
+
var textTones = [
|
|
2081
|
+
"default",
|
|
2082
|
+
"secondary",
|
|
2083
|
+
"muted",
|
|
2084
|
+
"accent",
|
|
2085
|
+
"success",
|
|
2086
|
+
"warning",
|
|
2087
|
+
"danger"
|
|
2088
|
+
];
|
|
2089
|
+
|
|
2078
2090
|
// src/components/badge/Badge.tsx
|
|
2079
2091
|
import * as React20 from "react";
|
|
2080
2092
|
|
|
@@ -3930,8 +3942,8 @@ function resolveValue(value, max) {
|
|
|
3930
3942
|
percent: Math.round(clamped / top * 100)
|
|
3931
3943
|
};
|
|
3932
3944
|
}
|
|
3933
|
-
function segmentFill(
|
|
3934
|
-
return
|
|
3945
|
+
function segmentFill(segment2) {
|
|
3946
|
+
return segment2.color ? { tone: void 0, color: segment2.color } : { tone: segment2.tone ?? "accent", color: void 0 };
|
|
3935
3947
|
}
|
|
3936
3948
|
function resolveRows(input, scale, max) {
|
|
3937
3949
|
const segments = input.map((s) => ({ ...s, value: nonNegative(s.value) }));
|
|
@@ -3941,10 +3953,10 @@ function resolveRows(input, scale, max) {
|
|
|
3941
3953
|
const first = segments[0]?.value ?? 0;
|
|
3942
3954
|
const lengthBase = scale === "max" ? largest : scale === "first" ? first : sum;
|
|
3943
3955
|
const shareBase = scale === "first" ? first : sum;
|
|
3944
|
-
return segments.map((
|
|
3945
|
-
segment,
|
|
3946
|
-
ratio: lengthBase > 0 ? Math.min(1,
|
|
3947
|
-
percent: shareBase > 0 ? Math.round(
|
|
3956
|
+
return segments.map((segment2) => ({
|
|
3957
|
+
segment: segment2,
|
|
3958
|
+
ratio: lengthBase > 0 ? Math.min(1, segment2.value / lengthBase) : 0,
|
|
3959
|
+
percent: shareBase > 0 ? Math.round(segment2.value / shareBase * 100) : 0
|
|
3948
3960
|
}));
|
|
3949
3961
|
}
|
|
3950
3962
|
var NUMBER = new Intl.NumberFormat("ru-RU");
|
|
@@ -3989,9 +4001,9 @@ function ProgressLegend({
|
|
|
3989
4001
|
className
|
|
3990
4002
|
}) {
|
|
3991
4003
|
if (segments.length === 0) return null;
|
|
3992
|
-
return /* @__PURE__ */ jsx23("ul", { id, className: cx(ProgressLegend_default.legend, className), "data-size": size, children: segments.map((
|
|
3993
|
-
const { tone, color } = segmentFill(
|
|
3994
|
-
const share = scale > 0 ? Math.round(
|
|
4004
|
+
return /* @__PURE__ */ jsx23("ul", { id, className: cx(ProgressLegend_default.legend, className), "data-size": size, children: segments.map((segment2, index) => {
|
|
4005
|
+
const { tone, color } = segmentFill(segment2);
|
|
4006
|
+
const share = scale > 0 ? Math.round(segment2.value / scale * 100) : 0;
|
|
3995
4007
|
return (
|
|
3996
4008
|
// biome-ignore lint/suspicious/noArrayIndexKey: parts in source order, like the bar
|
|
3997
4009
|
/* @__PURE__ */ jsxs11("li", { className: ProgressLegend_default.item, children: [
|
|
@@ -4003,8 +4015,8 @@ function ProgressLegend({
|
|
|
4003
4015
|
...toDataAttributes({ tone, color })
|
|
4004
4016
|
}
|
|
4005
4017
|
),
|
|
4006
|
-
/* @__PURE__ */ jsx23("span", { className: ProgressLegend_default.name, children:
|
|
4007
|
-
/* @__PURE__ */ jsx23("span", { className: ProgressLegend_default.value, children: formatValue(
|
|
4018
|
+
/* @__PURE__ */ jsx23("span", { className: ProgressLegend_default.name, children: segment2.label }),
|
|
4019
|
+
/* @__PURE__ */ jsx23("span", { className: ProgressLegend_default.value, children: formatValue(segment2.value) }),
|
|
4008
4020
|
/* @__PURE__ */ jsxs11("span", { className: ProgressLegend_default.share, children: [
|
|
4009
4021
|
share,
|
|
4010
4022
|
"%"
|
|
@@ -4126,12 +4138,12 @@ function ProgressBar(props) {
|
|
|
4126
4138
|
/* @__PURE__ */ jsx24(ProgressLegendSkeleton, { rows: 1, size, className: ProgressBar_default.rowSkeletonText }),
|
|
4127
4139
|
barSkeleton
|
|
4128
4140
|
] }, i)
|
|
4129
|
-
)) }, "loading") : /* @__PURE__ */ jsx24("ol", { className: cx(ProgressBar_default.rows, swapClass), ...nameProps, children: rows.map(({ segment, ratio, percent: share }, i) => (
|
|
4141
|
+
)) }, "loading") : /* @__PURE__ */ jsx24("ol", { className: cx(ProgressBar_default.rows, swapClass), ...nameProps, children: rows.map(({ segment: segment2, ratio, percent: share }, i) => (
|
|
4130
4142
|
// biome-ignore lint/suspicious/noArrayIndexKey: rows in source order
|
|
4131
4143
|
/* @__PURE__ */ jsxs12("li", { className: ProgressBar_default.row, children: [
|
|
4132
4144
|
/* @__PURE__ */ jsxs12("div", { className: ProgressBar_default.rowHeader, children: [
|
|
4133
|
-
/* @__PURE__ */ jsx24("span", { className: ProgressBar_default.rowLabel, children:
|
|
4134
|
-
/* @__PURE__ */ jsx24("span", { className: ProgressBar_default.rowValue, children: formatValue(
|
|
4145
|
+
/* @__PURE__ */ jsx24("span", { className: ProgressBar_default.rowLabel, children: segment2.label }),
|
|
4146
|
+
/* @__PURE__ */ jsx24("span", { className: ProgressBar_default.rowValue, children: formatValue(segment2.value) }),
|
|
4135
4147
|
/* @__PURE__ */ jsxs12("span", { className: ProgressBar_default.rowShare, children: [
|
|
4136
4148
|
share,
|
|
4137
4149
|
"%"
|
|
@@ -4142,7 +4154,7 @@ function ProgressBar(props) {
|
|
|
4142
4154
|
{
|
|
4143
4155
|
className: cx(palette_default.hue, ProgressBar_default.fill),
|
|
4144
4156
|
style: { "--pb-ratio": ratio },
|
|
4145
|
-
...toDataAttributes(segmentFill(
|
|
4157
|
+
...toDataAttributes(segmentFill(segment2))
|
|
4146
4158
|
}
|
|
4147
4159
|
) })
|
|
4148
4160
|
] }, i)
|
|
@@ -4252,7 +4264,7 @@ function getPasswordStrength(value) {
|
|
|
4252
4264
|
}
|
|
4253
4265
|
|
|
4254
4266
|
// src/components/input/Input.tsx
|
|
4255
|
-
import * as
|
|
4267
|
+
import * as React42 from "react";
|
|
4256
4268
|
|
|
4257
4269
|
// src/internal/FieldAction.tsx
|
|
4258
4270
|
import * as React38 from "react";
|
|
@@ -4266,7 +4278,7 @@ var FieldAction_default = {
|
|
|
4266
4278
|
// src/internal/FieldAction.tsx
|
|
4267
4279
|
import { Fragment as Fragment5, jsx as jsx25, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
4268
4280
|
var fieldActionClass = cx(FieldAction_default.action, touchTargetBlockClass);
|
|
4269
|
-
function
|
|
4281
|
+
function segment({
|
|
4270
4282
|
label,
|
|
4271
4283
|
asChild = false,
|
|
4272
4284
|
className,
|
|
@@ -4282,17 +4294,15 @@ function FieldActionButton({
|
|
|
4282
4294
|
"aria-label": label,
|
|
4283
4295
|
"data-field-action": ""
|
|
4284
4296
|
};
|
|
4297
|
+
return asChild ? /* @__PURE__ */ jsx25(Slot, { ...shared, ref, "aria-disabled": disabled || void 0, children }) : /* @__PURE__ */ jsx25("button", { ...shared, ref, type, disabled, children });
|
|
4298
|
+
}
|
|
4299
|
+
function FieldActionSegment(props) {
|
|
4300
|
+
return segment(props);
|
|
4301
|
+
}
|
|
4302
|
+
function FieldActionButton(props) {
|
|
4285
4303
|
return /* @__PURE__ */ jsxs13(Tooltip.Root, { children: [
|
|
4286
|
-
/* @__PURE__ */ jsx25(Tooltip.Trigger, { children:
|
|
4287
|
-
|
|
4288
|
-
{
|
|
4289
|
-
...shared,
|
|
4290
|
-
ref,
|
|
4291
|
-
"aria-disabled": disabled || void 0,
|
|
4292
|
-
children
|
|
4293
|
-
}
|
|
4294
|
-
) : /* @__PURE__ */ jsx25("button", { ...shared, ref, type, disabled, children }) }),
|
|
4295
|
-
/* @__PURE__ */ jsx25(Tooltip.Content, { children: label })
|
|
4304
|
+
/* @__PURE__ */ jsx25(Tooltip.Trigger, { children: segment(props) }),
|
|
4305
|
+
/* @__PURE__ */ jsx25(Tooltip.Content, { children: props.label })
|
|
4296
4306
|
] });
|
|
4297
4307
|
}
|
|
4298
4308
|
var COPY_FEEDBACK_MS = 1600;
|
|
@@ -4456,7 +4466,14 @@ function FieldCommitStatus({
|
|
|
4456
4466
|
}
|
|
4457
4467
|
|
|
4458
4468
|
// src/internal/FieldFrame.tsx
|
|
4469
|
+
import * as React41 from "react";
|
|
4470
|
+
|
|
4471
|
+
// src/internal/fieldCell.ts
|
|
4459
4472
|
import * as React40 from "react";
|
|
4473
|
+
var FieldCellContext = React40.createContext(null);
|
|
4474
|
+
function useFieldCell() {
|
|
4475
|
+
return React40.useContext(FieldCellContext);
|
|
4476
|
+
}
|
|
4460
4477
|
|
|
4461
4478
|
// src/internal/formatLabel.ts
|
|
4462
4479
|
function formatLabel(template, values) {
|
|
@@ -4470,6 +4487,8 @@ function formatLabel(template, values) {
|
|
|
4470
4487
|
var FieldFrame_default = {
|
|
4471
4488
|
root: "FieldFrame_root",
|
|
4472
4489
|
label: "FieldFrame_label",
|
|
4490
|
+
cellLabel: "FieldFrame_cellLabel",
|
|
4491
|
+
"prime-field-list": "FieldFrame_prime-field-list",
|
|
4473
4492
|
labelRow: "FieldFrame_labelRow",
|
|
4474
4493
|
labelEnd: "FieldFrame_labelEnd",
|
|
4475
4494
|
body: "FieldFrame_body",
|
|
@@ -4494,7 +4513,8 @@ function useFieldFrame(explicitId, {
|
|
|
4494
4513
|
error,
|
|
4495
4514
|
invalid
|
|
4496
4515
|
}, ariaDescribedBy) {
|
|
4497
|
-
const generated =
|
|
4516
|
+
const generated = React41.useId();
|
|
4517
|
+
const cell = useFieldCell();
|
|
4498
4518
|
const controlId = explicitId ?? generated;
|
|
4499
4519
|
const labelId = `${controlId}-label`;
|
|
4500
4520
|
const hintId = `${controlId}-hint`;
|
|
@@ -4508,7 +4528,8 @@ function useFieldFrame(explicitId, {
|
|
|
4508
4528
|
hintId,
|
|
4509
4529
|
errorId,
|
|
4510
4530
|
describedBy,
|
|
4511
|
-
|
|
4531
|
+
// In a FieldList cell the frame renders the column heading as the label when there is none.
|
|
4532
|
+
labelledBy: hasContent(label) || cell ? labelId : void 0,
|
|
4512
4533
|
showHint,
|
|
4513
4534
|
showError,
|
|
4514
4535
|
invalid: Boolean(invalid) || showError
|
|
@@ -4516,9 +4537,9 @@ function useFieldFrame(explicitId, {
|
|
|
4516
4537
|
}
|
|
4517
4538
|
function useErrorShake(invalid, error) {
|
|
4518
4539
|
const key = !invalid ? null : typeof error === "string" || typeof error === "number" ? String(error) : "invalid";
|
|
4519
|
-
const previous =
|
|
4520
|
-
const [count, setCount] =
|
|
4521
|
-
|
|
4540
|
+
const previous = React41.useRef(key);
|
|
4541
|
+
const [count, setCount] = React41.useState(0);
|
|
4542
|
+
React41.useEffect(() => {
|
|
4522
4543
|
if (key !== null && key !== previous.current) setCount((n) => n + 1);
|
|
4523
4544
|
previous.current = key;
|
|
4524
4545
|
}, [key]);
|
|
@@ -4526,7 +4547,7 @@ function useErrorShake(invalid, error) {
|
|
|
4526
4547
|
return count % 2 ? "odd" : "even";
|
|
4527
4548
|
}
|
|
4528
4549
|
function useLeavingError(showError, error) {
|
|
4529
|
-
const last =
|
|
4550
|
+
const last = React41.useRef(error);
|
|
4530
4551
|
if (showError) last.current = error;
|
|
4531
4552
|
const presence = usePresence(showError, { exitDuration: "fast" });
|
|
4532
4553
|
if (showError || !presence.mounted) return null;
|
|
@@ -4555,7 +4576,9 @@ function FieldFrame({
|
|
|
4555
4576
|
const leaving = useLeavingError(showError, error);
|
|
4556
4577
|
const showSupport = showError || showHint || leaving != null || counter != null || reserveSupportRow;
|
|
4557
4578
|
const shake = useErrorShake(ids.invalid, error);
|
|
4558
|
-
const
|
|
4579
|
+
const cell = useFieldCell();
|
|
4580
|
+
const shownLabel = hasContent(label) ? label : cell?.label;
|
|
4581
|
+
const labelNode = hasContent(shownLabel) ? /* @__PURE__ */ jsx27(
|
|
4559
4582
|
Label.Root,
|
|
4560
4583
|
{
|
|
4561
4584
|
id: ids.labelId,
|
|
@@ -4565,8 +4588,12 @@ function FieldFrame({
|
|
|
4565
4588
|
optional,
|
|
4566
4589
|
disabled,
|
|
4567
4590
|
labels: { optional: optionalLabel },
|
|
4568
|
-
className:
|
|
4569
|
-
|
|
4591
|
+
className: cx(
|
|
4592
|
+
FieldFrame_default.label,
|
|
4593
|
+
cell && visuallyHiddenClass,
|
|
4594
|
+
cell?.hidden === "wide" && FieldFrame_default.cellLabel
|
|
4595
|
+
),
|
|
4596
|
+
children: shownLabel
|
|
4570
4597
|
}
|
|
4571
4598
|
) : null;
|
|
4572
4599
|
return /* @__PURE__ */ jsxs15(
|
|
@@ -4578,6 +4605,7 @@ function FieldFrame({
|
|
|
4578
4605
|
size,
|
|
4579
4606
|
invalid: ids.invalid || void 0,
|
|
4580
4607
|
disabled: disabled || void 0,
|
|
4608
|
+
group: group || void 0,
|
|
4581
4609
|
shake
|
|
4582
4610
|
}),
|
|
4583
4611
|
children: [
|
|
@@ -4701,17 +4729,17 @@ function InputRoot({
|
|
|
4701
4729
|
className,
|
|
4702
4730
|
...rest
|
|
4703
4731
|
}) {
|
|
4704
|
-
const [strengthValue, setStrengthValue] =
|
|
4732
|
+
const [strengthValue, setStrengthValue] = React42.useState("");
|
|
4705
4733
|
const size = useControlSize(sizeProp);
|
|
4706
4734
|
const ids = useFieldFrame(id, { label, hint, error, invalid });
|
|
4707
|
-
const labels =
|
|
4735
|
+
const labels = React42.useMemo(() => ({ ...INPUT_LABELS, ...labelsProp }), [labelsProp]);
|
|
4708
4736
|
const { invalid: isInvalid, controlId: inputId, describedBy } = ids;
|
|
4709
|
-
const inputRef =
|
|
4737
|
+
const inputRef = React42.useRef(null);
|
|
4710
4738
|
const commit = useFieldCommit(inputRef, onCommit);
|
|
4711
4739
|
const hasCommit = onCommit !== void 0;
|
|
4712
|
-
const [revealed, setRevealed] =
|
|
4713
|
-
const selectionRef =
|
|
4714
|
-
const contextValue =
|
|
4740
|
+
const [revealed, setRevealed] = React42.useState(false);
|
|
4741
|
+
const selectionRef = React42.useRef(null);
|
|
4742
|
+
const contextValue = React42.useMemo(
|
|
4715
4743
|
() => ({
|
|
4716
4744
|
size,
|
|
4717
4745
|
invalid: isInvalid,
|
|
@@ -4839,7 +4867,7 @@ function InputField({
|
|
|
4839
4867
|
} = useInputContext();
|
|
4840
4868
|
const setRefs = useMergedRefs(inputRef, ref);
|
|
4841
4869
|
const disabled = useInheritedDisabled(disabledProp);
|
|
4842
|
-
|
|
4870
|
+
React42.useLayoutEffect(() => {
|
|
4843
4871
|
const selection = selectionRef.current;
|
|
4844
4872
|
const input = inputRef.current;
|
|
4845
4873
|
if (!selection || !input) return;
|
|
@@ -4847,7 +4875,7 @@ function InputField({
|
|
|
4847
4875
|
input.setSelectionRange(selection[0], selection[1]);
|
|
4848
4876
|
}, [revealed, selectionRef, inputRef]);
|
|
4849
4877
|
const controlled = rest.value;
|
|
4850
|
-
|
|
4878
|
+
React42.useEffect(() => {
|
|
4851
4879
|
if (!reportValue) return;
|
|
4852
4880
|
if (controlled !== void 0) reportValue(String(controlled));
|
|
4853
4881
|
else if (inputRef.current) reportValue(inputRef.current.value);
|
|
@@ -4910,17 +4938,14 @@ function InputInlineAffix({ side, children, className, ...rest }) {
|
|
|
4910
4938
|
);
|
|
4911
4939
|
}
|
|
4912
4940
|
InputInlineAffix.displayName = "Input.InlineAffix";
|
|
4913
|
-
function InputClearButton({
|
|
4941
|
+
function InputClearButton({ onClick: onClick2, ref, ...rest }) {
|
|
4914
4942
|
const { inputId, inputRef, labels } = useInputContext();
|
|
4915
4943
|
return /* @__PURE__ */ jsx28(
|
|
4916
|
-
|
|
4944
|
+
FieldActionSegment,
|
|
4917
4945
|
{
|
|
4918
4946
|
...rest,
|
|
4919
4947
|
ref,
|
|
4920
|
-
|
|
4921
|
-
className: cx(fieldActionClass, className),
|
|
4922
|
-
"data-field-action": "",
|
|
4923
|
-
"aria-label": labels.clear,
|
|
4948
|
+
label: labels.clear,
|
|
4924
4949
|
"aria-controls": inputId,
|
|
4925
4950
|
onClick: (event) => {
|
|
4926
4951
|
onClick2?.(event);
|
|
@@ -4947,23 +4972,14 @@ function InputCopyButton({ value, ...rest }) {
|
|
|
4947
4972
|
);
|
|
4948
4973
|
}
|
|
4949
4974
|
InputCopyButton.displayName = "Input.CopyButton";
|
|
4950
|
-
function InputRevealButton({
|
|
4951
|
-
className,
|
|
4952
|
-
onClick: onClick2,
|
|
4953
|
-
onMouseDown,
|
|
4954
|
-
ref,
|
|
4955
|
-
...rest
|
|
4956
|
-
}) {
|
|
4975
|
+
function InputRevealButton({ onClick: onClick2, onMouseDown, ref, ...rest }) {
|
|
4957
4976
|
const { inputId, inputRef, labels, revealed, setRevealed, selectionRef } = useInputContext();
|
|
4958
4977
|
return /* @__PURE__ */ jsx28(
|
|
4959
|
-
|
|
4978
|
+
FieldActionSegment,
|
|
4960
4979
|
{
|
|
4961
4980
|
...rest,
|
|
4962
4981
|
ref,
|
|
4963
|
-
|
|
4964
|
-
className: cx(fieldActionClass, className),
|
|
4965
|
-
"data-field-action": "",
|
|
4966
|
-
"aria-label": labels.reveal,
|
|
4982
|
+
label: labels.reveal,
|
|
4967
4983
|
"aria-pressed": revealed,
|
|
4968
4984
|
"aria-controls": inputId,
|
|
4969
4985
|
onMouseDown: (event) => {
|
|
@@ -5006,7 +5022,7 @@ var Input = {
|
|
|
5006
5022
|
};
|
|
5007
5023
|
|
|
5008
5024
|
// src/components/checkbox/Checkbox.tsx
|
|
5009
|
-
import * as
|
|
5025
|
+
import * as React43 from "react";
|
|
5010
5026
|
|
|
5011
5027
|
// src/internal/CheckMark.module.css
|
|
5012
5028
|
var CheckMark_default = {
|
|
@@ -5145,9 +5161,9 @@ function CheckboxRoot({
|
|
|
5145
5161
|
defaultValue: defaultChecked,
|
|
5146
5162
|
onChange: onCheckedChange
|
|
5147
5163
|
});
|
|
5148
|
-
const internalRef =
|
|
5164
|
+
const internalRef = React43.useRef(null);
|
|
5149
5165
|
const mergedRef = useMergedRefs(internalRef, ref);
|
|
5150
|
-
|
|
5166
|
+
React43.useEffect(() => {
|
|
5151
5167
|
if (internalRef.current) internalRef.current.indeterminate = indeterminate;
|
|
5152
5168
|
}, [indeterminate]);
|
|
5153
5169
|
return /* @__PURE__ */ jsx31(
|
|
@@ -5244,7 +5260,7 @@ var Checkbox = {
|
|
|
5244
5260
|
};
|
|
5245
5261
|
|
|
5246
5262
|
// src/components/thumbnail/Thumbnail.tsx
|
|
5247
|
-
import * as
|
|
5263
|
+
import * as React45 from "react";
|
|
5248
5264
|
|
|
5249
5265
|
// src/internal/formatClock.ts
|
|
5250
5266
|
function formatClock(seconds) {
|
|
@@ -5273,7 +5289,7 @@ function firstFrame(src) {
|
|
|
5273
5289
|
}
|
|
5274
5290
|
|
|
5275
5291
|
// src/internal/mediaSession.ts
|
|
5276
|
-
import * as
|
|
5292
|
+
import * as React44 from "react";
|
|
5277
5293
|
var active = null;
|
|
5278
5294
|
var audible = (media) => !media.muted && media.volume > 0;
|
|
5279
5295
|
function claimPlayback(media) {
|
|
@@ -5285,7 +5301,7 @@ function releasePlayback(media) {
|
|
|
5285
5301
|
if (active === media) active = null;
|
|
5286
5302
|
}
|
|
5287
5303
|
function useMediaSession(ref) {
|
|
5288
|
-
|
|
5304
|
+
React44.useEffect(() => {
|
|
5289
5305
|
const media = ref.current;
|
|
5290
5306
|
if (!media) return;
|
|
5291
5307
|
const claim = () => claimPlayback(media);
|
|
@@ -5415,22 +5431,22 @@ function ThumbnailVideoInner({
|
|
|
5415
5431
|
...rest
|
|
5416
5432
|
}) {
|
|
5417
5433
|
const report = slot2.useReportStatus();
|
|
5418
|
-
const mute =
|
|
5434
|
+
const mute = React45.useCallback(
|
|
5419
5435
|
(node) => {
|
|
5420
5436
|
if (node) node.muted = autoPlay && !controls;
|
|
5421
5437
|
},
|
|
5422
5438
|
[autoPlay, controls]
|
|
5423
5439
|
);
|
|
5424
|
-
const sessionRef =
|
|
5440
|
+
const sessionRef = React45.useRef(null);
|
|
5425
5441
|
useMediaSession(sessionRef);
|
|
5426
5442
|
const videoRef = useMergedRefs(mute, sessionRef, ref);
|
|
5427
5443
|
const media = useImageStatus(report, {
|
|
5428
5444
|
onLoad: onLoadedData,
|
|
5429
5445
|
onError
|
|
5430
5446
|
});
|
|
5431
|
-
const [duration, setDuration] =
|
|
5432
|
-
const [playing, setPlaying] =
|
|
5433
|
-
const [still] =
|
|
5447
|
+
const [duration, setDuration] = React45.useState(null);
|
|
5448
|
+
const [playing, setPlaying] = React45.useState(false);
|
|
5449
|
+
const [still] = React45.useState(prefersReducedMotion);
|
|
5434
5450
|
const loops = autoPlay && !still && !controls;
|
|
5435
5451
|
return /* @__PURE__ */ jsxs20(Fragment9, { children: [
|
|
5436
5452
|
/* @__PURE__ */ jsx33(
|
|
@@ -5481,7 +5497,7 @@ var Thumbnail = {
|
|
|
5481
5497
|
};
|
|
5482
5498
|
|
|
5483
5499
|
// src/internal/swatch.tsx
|
|
5484
|
-
import * as
|
|
5500
|
+
import * as React46 from "react";
|
|
5485
5501
|
|
|
5486
5502
|
// src/internal/swatch.module.css
|
|
5487
5503
|
var swatch_default = {
|
|
@@ -5514,10 +5530,10 @@ var COLOR_PRESETS = [
|
|
|
5514
5530
|
{ value: "#be185d", label: "\u0422\u0451\u043C\u043D\u043E-\u0440\u043E\u0437\u043E\u0432\u044B\u0439" }
|
|
5515
5531
|
];
|
|
5516
5532
|
function useSwatchOptions(presets, allowEmpty, emptyLabel) {
|
|
5517
|
-
return
|
|
5533
|
+
return React46.useMemo(
|
|
5518
5534
|
() => [
|
|
5519
5535
|
...presets.map((preset) => ({ ...preset, contrast: markContrast(preset.value) })),
|
|
5520
|
-
...allowEmpty ? [{ value: null, label: emptyLabel, contrast: "
|
|
5536
|
+
...allowEmpty ? [{ value: null, label: emptyLabel, contrast: "surface" }] : []
|
|
5521
5537
|
],
|
|
5522
5538
|
[presets, allowEmpty, emptyLabel]
|
|
5523
5539
|
);
|
|
@@ -5579,7 +5595,7 @@ function markContrast(value) {
|
|
|
5579
5595
|
}
|
|
5580
5596
|
|
|
5581
5597
|
// src/components/color-swatches/ColorSwatches.tsx
|
|
5582
|
-
import * as
|
|
5598
|
+
import * as React47 from "react";
|
|
5583
5599
|
|
|
5584
5600
|
// src/internal/rovingFocus.ts
|
|
5585
5601
|
var PREV = {
|
|
@@ -5646,8 +5662,8 @@ function balancedColumns(count, width, cell, gap) {
|
|
|
5646
5662
|
return Math.ceil(count / rows);
|
|
5647
5663
|
}
|
|
5648
5664
|
function useBalancedColumns(gridRef, count) {
|
|
5649
|
-
const [columns, setColumns] =
|
|
5650
|
-
|
|
5665
|
+
const [columns, setColumns] = React47.useState();
|
|
5666
|
+
React47.useLayoutEffect(() => {
|
|
5651
5667
|
const grid = gridRef.current;
|
|
5652
5668
|
if (!grid || typeof ResizeObserver === "undefined") return;
|
|
5653
5669
|
const measure = () => {
|
|
@@ -5698,8 +5714,8 @@ function ColorSwatches({
|
|
|
5698
5714
|
const options = useSwatchOptions(presets, allowEmpty, labels.empty);
|
|
5699
5715
|
const selectedIndex = options.findIndex((option) => sameColor(option.value, value));
|
|
5700
5716
|
const focusIndex = Math.max(0, selectedIndex);
|
|
5701
|
-
const itemRefs =
|
|
5702
|
-
const gridRef =
|
|
5717
|
+
const itemRefs = React47.useRef([]);
|
|
5718
|
+
const gridRef = React47.useRef(null);
|
|
5703
5719
|
const columns = useBalancedColumns(gridRef, options.length);
|
|
5704
5720
|
const labelledBy = ariaLabelledBy ?? ids.labelledBy;
|
|
5705
5721
|
const onKeyDown2 = (event) => {
|
|
@@ -5791,10 +5807,10 @@ function ColorSwatches({
|
|
|
5791
5807
|
}
|
|
5792
5808
|
|
|
5793
5809
|
// src/components/select/Select.tsx
|
|
5794
|
-
import * as
|
|
5810
|
+
import * as React52 from "react";
|
|
5795
5811
|
|
|
5796
5812
|
// src/internal/listbox.ts
|
|
5797
|
-
import * as
|
|
5813
|
+
import * as React48 from "react";
|
|
5798
5814
|
var optionDomId = (listboxId, value) => `${listboxId}-opt-${value.replace(/\s+/g, "_")}`;
|
|
5799
5815
|
function enabledOptions(container) {
|
|
5800
5816
|
if (!container) return [];
|
|
@@ -5819,11 +5835,11 @@ function createStore(initial) {
|
|
|
5819
5835
|
};
|
|
5820
5836
|
}
|
|
5821
5837
|
function useCreateStore(initial) {
|
|
5822
|
-
return
|
|
5838
|
+
return React48.useState(() => createStore(initial))[0];
|
|
5823
5839
|
}
|
|
5824
5840
|
function useStoreSlice(store, select) {
|
|
5825
5841
|
const read = () => select(store.get());
|
|
5826
|
-
return
|
|
5842
|
+
return React48.useSyncExternalStore(store.subscribe, read, read);
|
|
5827
5843
|
}
|
|
5828
5844
|
function handleListboxKeyDown(event, { items, highlight, onSelect }) {
|
|
5829
5845
|
if (items.length === 0) return;
|
|
@@ -5845,10 +5861,10 @@ function handleListboxKeyDown(event, { items, highlight, onSelect }) {
|
|
|
5845
5861
|
}
|
|
5846
5862
|
var TYPEAHEAD_RESET_MS = 500;
|
|
5847
5863
|
function useTypeahead() {
|
|
5848
|
-
const state =
|
|
5849
|
-
|
|
5850
|
-
const isTyping =
|
|
5851
|
-
const find =
|
|
5864
|
+
const state = React48.useRef({ buffer: "", timer: 0 });
|
|
5865
|
+
React48.useEffect(() => () => window.clearTimeout(state.current.timer), []);
|
|
5866
|
+
const isTyping = React48.useCallback(() => state.current.buffer !== "", []);
|
|
5867
|
+
const find = React48.useCallback(
|
|
5852
5868
|
(key, items, highlighted) => {
|
|
5853
5869
|
const s = state.current;
|
|
5854
5870
|
window.clearTimeout(s.timer);
|
|
@@ -5870,19 +5886,19 @@ function useTypeahead() {
|
|
|
5870
5886
|
}
|
|
5871
5887
|
var LOAD_MORE_ROOT_MARGIN = "0px 0px 48px 0px";
|
|
5872
5888
|
function useLoadMore({ enabled, onLoadMore, scrollRef, rearm }) {
|
|
5873
|
-
const sentinelRef =
|
|
5874
|
-
const handlerRef =
|
|
5889
|
+
const sentinelRef = React48.useRef(null);
|
|
5890
|
+
const handlerRef = React48.useRef(onLoadMore);
|
|
5875
5891
|
handlerRef.current = onLoadMore;
|
|
5876
|
-
const askedRef =
|
|
5877
|
-
|
|
5892
|
+
const askedRef = React48.useRef(false);
|
|
5893
|
+
React48.useLayoutEffect(() => {
|
|
5878
5894
|
askedRef.current = false;
|
|
5879
5895
|
}, [enabled, rearm]);
|
|
5880
|
-
const request =
|
|
5896
|
+
const request = React48.useCallback(() => {
|
|
5881
5897
|
if (!enabled || askedRef.current) return;
|
|
5882
5898
|
askedRef.current = true;
|
|
5883
5899
|
void handlerRef.current?.();
|
|
5884
5900
|
}, [enabled]);
|
|
5885
|
-
|
|
5901
|
+
React48.useEffect(() => {
|
|
5886
5902
|
const root = scrollRef.current;
|
|
5887
5903
|
const target = sentinelRef.current;
|
|
5888
5904
|
if (!enabled || !root || !target || typeof IntersectionObserver === "undefined") return;
|
|
@@ -5899,7 +5915,7 @@ function useLoadMore({ enabled, onLoadMore, scrollRef, rearm }) {
|
|
|
5899
5915
|
}
|
|
5900
5916
|
|
|
5901
5917
|
// src/internal/MenuGroup.tsx
|
|
5902
|
-
import * as
|
|
5918
|
+
import * as React49 from "react";
|
|
5903
5919
|
|
|
5904
5920
|
// src/internal/menu.module.css
|
|
5905
5921
|
var menu_default = {
|
|
@@ -5921,7 +5937,7 @@ var menu_default = {
|
|
|
5921
5937
|
// src/internal/MenuGroup.tsx
|
|
5922
5938
|
import { jsx as jsx36, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
5923
5939
|
function MenuGroup({ label, className, children, ...rest }) {
|
|
5924
|
-
const labelId =
|
|
5940
|
+
const labelId = React49.useId();
|
|
5925
5941
|
return (
|
|
5926
5942
|
// biome-ignore lint/a11y/useSemanticElements: role="group" inside a menu / listbox; <fieldset> is not allowed there
|
|
5927
5943
|
/* @__PURE__ */ jsxs23(
|
|
@@ -5964,10 +5980,10 @@ var Select_default = {
|
|
|
5964
5980
|
};
|
|
5965
5981
|
|
|
5966
5982
|
// src/components/select/SelectItem.tsx
|
|
5967
|
-
import * as
|
|
5983
|
+
import * as React51 from "react";
|
|
5968
5984
|
|
|
5969
5985
|
// src/internal/HighlightMatch.tsx
|
|
5970
|
-
import * as
|
|
5986
|
+
import * as React50 from "react";
|
|
5971
5987
|
|
|
5972
5988
|
// src/internal/HighlightMatch.module.css
|
|
5973
5989
|
var HighlightMatch_default = {
|
|
@@ -6011,7 +6027,7 @@ function HighlightMatch({
|
|
|
6011
6027
|
}
|
|
6012
6028
|
function highlightChildren(children, query) {
|
|
6013
6029
|
if (!query.trim()) return children;
|
|
6014
|
-
return
|
|
6030
|
+
return React50.Children.map(
|
|
6015
6031
|
children,
|
|
6016
6032
|
(child) => typeof child === "string" || typeof child === "number" ? /* @__PURE__ */ jsx37(HighlightMatch, { text: String(child), query }) : child
|
|
6017
6033
|
);
|
|
@@ -6053,7 +6069,7 @@ function textOf(node) {
|
|
|
6053
6069
|
if (node == null || typeof node === "boolean") return "";
|
|
6054
6070
|
if (typeof node === "string" || typeof node === "number") return String(node);
|
|
6055
6071
|
if (Array.isArray(node)) return node.map(textOf).join("");
|
|
6056
|
-
if (
|
|
6072
|
+
if (React51.isValidElement(node))
|
|
6057
6073
|
return textOf(node.props.children);
|
|
6058
6074
|
return "";
|
|
6059
6075
|
}
|
|
@@ -6061,9 +6077,9 @@ function SelectItemIcon({ className, ...rest }) {
|
|
|
6061
6077
|
return /* @__PURE__ */ jsx38("span", { "aria-hidden": "true", className: cx(menu_default.itemIcon, className), ...rest });
|
|
6062
6078
|
}
|
|
6063
6079
|
SelectItemIcon.displayName = "Select.ItemIcon";
|
|
6064
|
-
var OptionQueryContext =
|
|
6080
|
+
var OptionQueryContext = React51.createContext("");
|
|
6065
6081
|
function SelectItemText({ children, className, ...rest }) {
|
|
6066
|
-
const query =
|
|
6082
|
+
const query = React51.useContext(OptionQueryContext);
|
|
6067
6083
|
return /* @__PURE__ */ jsx38("span", { ...rest, className: cx(Select_default.itemTitle, className), children: highlightChildren(children, query) });
|
|
6068
6084
|
}
|
|
6069
6085
|
SelectItemText.displayName = "Select.ItemText";
|
|
@@ -6072,7 +6088,7 @@ function SelectItemDescription({
|
|
|
6072
6088
|
className,
|
|
6073
6089
|
...rest
|
|
6074
6090
|
}) {
|
|
6075
|
-
const query =
|
|
6091
|
+
const query = React51.useContext(OptionQueryContext);
|
|
6076
6092
|
return /* @__PURE__ */ jsx38("span", { ...rest, className: cx(Select_default.itemDescription, className), children: highlightChildren(children, query) });
|
|
6077
6093
|
}
|
|
6078
6094
|
SelectItemDescription.displayName = "Select.ItemDescription";
|
|
@@ -6090,11 +6106,11 @@ function splitItemChildren(children) {
|
|
|
6090
6106
|
description: ""
|
|
6091
6107
|
};
|
|
6092
6108
|
let plain = "";
|
|
6093
|
-
for (const child of
|
|
6094
|
-
if (!
|
|
6109
|
+
for (const child of React51.Children.toArray(children)) {
|
|
6110
|
+
if (!React51.isValidElement(child)) {
|
|
6095
6111
|
plain += textOf(child);
|
|
6096
6112
|
parts.body.push(child);
|
|
6097
|
-
} else if (child.type ===
|
|
6113
|
+
} else if (child.type === React51.Fragment) {
|
|
6098
6114
|
const inner = splitItemChildren(child.props.children);
|
|
6099
6115
|
parts.leading.push(...inner.leading);
|
|
6100
6116
|
parts.body.push(...inner.body);
|
|
@@ -6124,7 +6140,7 @@ function splitItemChildren(children) {
|
|
|
6124
6140
|
}
|
|
6125
6141
|
function sizeMedia(leading, size) {
|
|
6126
6142
|
return leading.map(
|
|
6127
|
-
(node) =>
|
|
6143
|
+
(node) => React51.isValidElement(node) && (node.type === Thumbnail.Root || node.type === Avatar.Root) ? React51.cloneElement(node, {
|
|
6128
6144
|
size: node.props.size ?? MEDIA_SIZE[size],
|
|
6129
6145
|
className: cx(Select_default.media, node.props.className),
|
|
6130
6146
|
"aria-hidden": true
|
|
@@ -6146,7 +6162,7 @@ function SelectItem({
|
|
|
6146
6162
|
const haystack = normalize(`${resolvedLabel} ${parts.description} ${keywords ?? ""}`);
|
|
6147
6163
|
const isSelected = selected.includes(value);
|
|
6148
6164
|
const isHighlighted = useStoreSlice(highlight, (current) => current === value);
|
|
6149
|
-
|
|
6165
|
+
React51.useLayoutEffect(
|
|
6150
6166
|
() => registry.register(value, resolvedLabel, haystack),
|
|
6151
6167
|
[registry, value, resolvedLabel, haystack]
|
|
6152
6168
|
);
|
|
@@ -6203,7 +6219,7 @@ function SelectAction({
|
|
|
6203
6219
|
...rest
|
|
6204
6220
|
}) {
|
|
6205
6221
|
const { highlight, listboxId, setOpen, size } = useSelectContext();
|
|
6206
|
-
const value = `${ACTION_PREFIX}${
|
|
6222
|
+
const value = `${ACTION_PREFIX}${React51.useId()}`;
|
|
6207
6223
|
const isHighlighted = useStoreSlice(highlight, (current) => current === value);
|
|
6208
6224
|
const parts = splitItemChildren(children);
|
|
6209
6225
|
return (
|
|
@@ -6295,7 +6311,7 @@ function SelectRoot(props) {
|
|
|
6295
6311
|
} = props;
|
|
6296
6312
|
const multiple = props.multiple === true;
|
|
6297
6313
|
const disabled = useInheritedDisabled(disabledProp);
|
|
6298
|
-
const labels =
|
|
6314
|
+
const labels = React52.useMemo(() => ({ ...SELECT_LABELS, ...labelsProp }), [labelsProp]);
|
|
6299
6315
|
const ids = useFieldFrame(id, { hint, error, invalid });
|
|
6300
6316
|
const [stored, setStored] = useControllableState({
|
|
6301
6317
|
value: props.value,
|
|
@@ -6304,7 +6320,7 @@ function SelectRoot(props) {
|
|
|
6304
6320
|
const changes = usePendingChanges(stored, takeNext);
|
|
6305
6321
|
const value = changes.shown;
|
|
6306
6322
|
const saving = changes.pending.length > 0;
|
|
6307
|
-
const [announcement, setAnnouncement] =
|
|
6323
|
+
const [announcement, setAnnouncement] = React52.useState("");
|
|
6308
6324
|
const onValueChange = props.onValueChange;
|
|
6309
6325
|
const commit = (next) => {
|
|
6310
6326
|
if (saving || Object.is(next, value)) return;
|
|
@@ -6319,9 +6335,9 @@ function SelectRoot(props) {
|
|
|
6319
6335
|
onReject: () => setAnnouncement(labels.changeFailed)
|
|
6320
6336
|
});
|
|
6321
6337
|
};
|
|
6322
|
-
const commitRef =
|
|
6338
|
+
const commitRef = React52.useRef(commit);
|
|
6323
6339
|
commitRef.current = commit;
|
|
6324
|
-
const selected =
|
|
6340
|
+
const selected = React52.useMemo(
|
|
6325
6341
|
() => Array.isArray(value) ? value : value ? [value] : [],
|
|
6326
6342
|
[value]
|
|
6327
6343
|
);
|
|
@@ -6331,19 +6347,19 @@ function SelectRoot(props) {
|
|
|
6331
6347
|
onChange: onOpenChange
|
|
6332
6348
|
});
|
|
6333
6349
|
const highlight = useCreateStore(void 0);
|
|
6334
|
-
const [registry] =
|
|
6350
|
+
const [registry] = React52.useState(createItemRegistry);
|
|
6335
6351
|
const [query, setQuery] = useControllableState({
|
|
6336
6352
|
value: search,
|
|
6337
6353
|
defaultValue: defaultSearch,
|
|
6338
6354
|
onChange: onSearchChange
|
|
6339
6355
|
});
|
|
6340
|
-
const triggerRef =
|
|
6341
|
-
const wasOpenRef =
|
|
6342
|
-
|
|
6356
|
+
const triggerRef = React52.useRef(null);
|
|
6357
|
+
const wasOpenRef = React52.useRef(isOpen);
|
|
6358
|
+
React52.useEffect(() => {
|
|
6343
6359
|
if (wasOpenRef.current && !isOpen) setQuery("");
|
|
6344
6360
|
wasOpenRef.current = isOpen;
|
|
6345
6361
|
}, [isOpen, setQuery]);
|
|
6346
|
-
const pick =
|
|
6362
|
+
const pick = React52.useCallback(
|
|
6347
6363
|
(optionValue) => {
|
|
6348
6364
|
if (multiple) {
|
|
6349
6365
|
const list = Array.isArray(value) ? value : [];
|
|
@@ -6357,8 +6373,8 @@ function SelectRoot(props) {
|
|
|
6357
6373
|
},
|
|
6358
6374
|
[multiple, value, setOpen]
|
|
6359
6375
|
);
|
|
6360
|
-
const clear =
|
|
6361
|
-
const context =
|
|
6376
|
+
const clear = React52.useCallback(() => commitRef.current(multiple ? [] : ""), [multiple]);
|
|
6377
|
+
const context = React52.useMemo(
|
|
6362
6378
|
() => ({
|
|
6363
6379
|
size,
|
|
6364
6380
|
invalid: ids.invalid,
|
|
@@ -6475,6 +6491,8 @@ function SelectTrigger({
|
|
|
6475
6491
|
labels
|
|
6476
6492
|
} = useSelectContext();
|
|
6477
6493
|
const mergedRef = useMergedRefs(triggerRef, ref);
|
|
6494
|
+
const parts = React52.Children.toArray(children);
|
|
6495
|
+
const iconOnly = parts.some((node) => React52.isValidElement(node) && node.type === SelectTriggerIcon) && !parts.some((node) => React52.isValidElement(node) && node.type === SelectValue);
|
|
6478
6496
|
const busy = loading || saving;
|
|
6479
6497
|
const showClear = clearable && selected.length > 0 && !disabled && !busy;
|
|
6480
6498
|
return /* @__PURE__ */ jsxs26(
|
|
@@ -6515,17 +6533,22 @@ function SelectTrigger({
|
|
|
6515
6533
|
invalid: invalid || void 0,
|
|
6516
6534
|
loading: busy || void 0,
|
|
6517
6535
|
disabled: disabled || void 0,
|
|
6518
|
-
"focus-ring": focusRing ? void 0 : false
|
|
6536
|
+
"focus-ring": focusRing ? void 0 : false,
|
|
6537
|
+
"icon-only": iconOnly || void 0
|
|
6519
6538
|
}),
|
|
6520
6539
|
children: [
|
|
6521
|
-
/* @__PURE__ */
|
|
6540
|
+
/* @__PURE__ */ jsxs26("span", { className: Select_default.triggerMain, children: [
|
|
6541
|
+
children,
|
|
6542
|
+
iconOnly ? /* @__PURE__ */ jsx39(SelectValue, { className: visuallyHiddenClass }) : null
|
|
6543
|
+
] }),
|
|
6522
6544
|
showClear ? (
|
|
6523
6545
|
// A segment, not a button: interactive content inside a <button> is invalid. The keyboard
|
|
6524
|
-
// clears with Delete / Backspace on the trigger.
|
|
6546
|
+
// clears with Delete / Backspace on the trigger. A touch target in height, like the clear
|
|
6547
|
+
// segment of a field (`FieldAction`).
|
|
6525
6548
|
/* @__PURE__ */ jsx39(
|
|
6526
6549
|
"span",
|
|
6527
6550
|
{
|
|
6528
|
-
className: Select_default.clear,
|
|
6551
|
+
className: cx(Select_default.clear, touchTargetBlockClass),
|
|
6529
6552
|
"aria-hidden": "true",
|
|
6530
6553
|
title: labels.clear,
|
|
6531
6554
|
"data-select-clear": "",
|
|
@@ -6621,11 +6644,11 @@ function SelectContent({ searchable = false, className, children, ...rest }) {
|
|
|
6621
6644
|
labels,
|
|
6622
6645
|
registry
|
|
6623
6646
|
} = useSelectContext();
|
|
6624
|
-
const listboxRef =
|
|
6647
|
+
const listboxRef = React52.useRef(null);
|
|
6625
6648
|
const items = [];
|
|
6626
6649
|
const actions = [];
|
|
6627
|
-
for (const child of
|
|
6628
|
-
(
|
|
6650
|
+
for (const child of React52.Children.toArray(children)) {
|
|
6651
|
+
(React52.isValidElement(child) && child.type === SelectAction ? actions : items).push(child);
|
|
6629
6652
|
}
|
|
6630
6653
|
const actionsId = `${listboxId}-actions`;
|
|
6631
6654
|
const floating = useFloatingLayer({
|
|
@@ -6650,12 +6673,12 @@ function SelectContent({ searchable = false, className, children, ...rest }) {
|
|
|
6650
6673
|
scrollRef: listboxRef,
|
|
6651
6674
|
rearm: version
|
|
6652
6675
|
});
|
|
6653
|
-
|
|
6676
|
+
React52.useEffect(() => {
|
|
6654
6677
|
if (highlighted === void 0) return;
|
|
6655
6678
|
if (enabledOptions(listboxRef.current).at(-1)?.dataset.value === highlighted) requestMore();
|
|
6656
6679
|
}, [highlighted, requestMore]);
|
|
6657
6680
|
const panelRef = floating.contentRef;
|
|
6658
|
-
|
|
6681
|
+
React52.useEffect(() => {
|
|
6659
6682
|
const panel = panelRef.current;
|
|
6660
6683
|
if (isOpen && swapped && panel && !panel.contains(document.activeElement)) focusInto(panel);
|
|
6661
6684
|
}, [region, swapped, isOpen, panelRef]);
|
|
@@ -6778,10 +6801,10 @@ function HighlightOnOpen({
|
|
|
6778
6801
|
highlight
|
|
6779
6802
|
}) {
|
|
6780
6803
|
const { isOpen, query, selected, registry } = useSelectContext();
|
|
6781
|
-
const selectedRef =
|
|
6804
|
+
const selectedRef = React52.useRef(selected);
|
|
6782
6805
|
selectedRef.current = selected;
|
|
6783
6806
|
const version = useStoreSlice(registry.version, (value) => value);
|
|
6784
|
-
|
|
6807
|
+
React52.useLayoutEffect(() => {
|
|
6785
6808
|
if (!isOpen) return;
|
|
6786
6809
|
const options = enabledOptions(listboxRef.current);
|
|
6787
6810
|
const first = options.find((item) => selectedRef.current.includes(item.dataset.value ?? ""));
|
|
@@ -6789,10 +6812,10 @@ function HighlightOnOpen({
|
|
|
6789
6812
|
first?.scrollIntoView?.({ block: "nearest" });
|
|
6790
6813
|
return () => highlight.set(void 0);
|
|
6791
6814
|
}, [isOpen, listboxRef, highlight]);
|
|
6792
|
-
|
|
6815
|
+
React52.useLayoutEffect(() => {
|
|
6793
6816
|
if (query !== "") highlight.set(enabledOptions(panelRef.current)[0]?.dataset.value);
|
|
6794
6817
|
}, [query, panelRef, highlight]);
|
|
6795
|
-
|
|
6818
|
+
React52.useLayoutEffect(() => {
|
|
6796
6819
|
if (query === "") return;
|
|
6797
6820
|
const options = enabledOptions(listboxRef.current);
|
|
6798
6821
|
if (!options.some((item) => item.dataset.value === highlight.get())) {
|
|
@@ -6855,15 +6878,6 @@ export {
|
|
|
6855
6878
|
Spinner,
|
|
6856
6879
|
Button,
|
|
6857
6880
|
Divider,
|
|
6858
|
-
controlSizes,
|
|
6859
|
-
stepDown,
|
|
6860
|
-
variants,
|
|
6861
|
-
tones,
|
|
6862
|
-
paletteColors,
|
|
6863
|
-
dataStates,
|
|
6864
|
-
textTones,
|
|
6865
|
-
useBadgeTier,
|
|
6866
|
-
chipTier_default,
|
|
6867
6881
|
Icon,
|
|
6868
6882
|
createIcon,
|
|
6869
6883
|
AnchorRectProvider,
|
|
@@ -6875,8 +6889,17 @@ export {
|
|
|
6875
6889
|
useEdgeOverflow,
|
|
6876
6890
|
useScrollRegion,
|
|
6877
6891
|
ScrollContainer,
|
|
6892
|
+
chipTier_default,
|
|
6878
6893
|
leaveInPlace,
|
|
6879
6894
|
RollingNumber,
|
|
6895
|
+
controlSizes,
|
|
6896
|
+
stepDown,
|
|
6897
|
+
variants,
|
|
6898
|
+
tones,
|
|
6899
|
+
paletteColors,
|
|
6900
|
+
dataStates,
|
|
6901
|
+
textTones,
|
|
6902
|
+
useBadgeTier,
|
|
6880
6903
|
Badge,
|
|
6881
6904
|
createComponentContext,
|
|
6882
6905
|
Avatar,
|
|
@@ -6909,6 +6932,8 @@ export {
|
|
|
6909
6932
|
enterMotion_default,
|
|
6910
6933
|
Hint,
|
|
6911
6934
|
Label,
|
|
6935
|
+
FieldCellContext,
|
|
6936
|
+
useFieldCell,
|
|
6912
6937
|
formatLabel,
|
|
6913
6938
|
useFieldFrame,
|
|
6914
6939
|
FieldFrame,
|