prime-ui-kit 0.9.3 → 0.10.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 +9 -4
- package/THIRD_PARTY_NOTICES +76 -0
- package/dist/chunks/{chunk-6JTZOA5I.js → chunk-4TRNUP45.js} +534 -522
- package/dist/chunks/chunk-EJ2ZVQYL.js +5805 -0
- package/dist/chunks/chunk-GFKDZFQR.js +1208 -0
- package/dist/chunks/{chunk-OAE4IQX2.js → chunk-K4FACFQ2.js} +8 -6
- package/dist/chunks/{chunk-U5SR2LZR.js → chunk-T7CLQXGB.js} +4 -2
- package/dist/color-picker.js +3 -2
- package/dist/components/button/Button.d.ts +5 -2
- package/dist/icon-set.d.ts +501 -0
- package/dist/icons/Icon.d.ts +10 -18
- package/dist/icons/glyph.d.ts +40 -0
- package/dist/icons/glyphs/a-arrow-down.d.ts +2 -0
- package/dist/icons/glyphs/a-arrow-up.d.ts +2 -0
- package/dist/icons/glyphs/accessibility.d.ts +2 -0
- package/dist/icons/glyphs/activity.d.ts +2 -0
- package/dist/icons/glyphs/air-vent.d.ts +2 -0
- package/dist/icons/glyphs/airplay.d.ts +2 -0
- package/dist/icons/glyphs/alarm-clock-check.d.ts +2 -0
- package/dist/icons/glyphs/alarm-clock-minus.d.ts +2 -0
- package/dist/icons/glyphs/alarm-clock-plus.d.ts +2 -0
- package/dist/icons/glyphs/alarm-clock.d.ts +2 -0
- package/dist/icons/glyphs/alarm-smoke.d.ts +2 -0
- package/dist/icons/glyphs/align-horizontal-space-around.d.ts +2 -0
- package/dist/icons/glyphs/align-vertical-space-around.d.ts +2 -0
- package/dist/icons/glyphs/ambulance.d.ts +2 -0
- package/dist/icons/glyphs/angry.d.ts +2 -0
- package/dist/icons/glyphs/annoyed.d.ts +2 -0
- package/dist/icons/glyphs/archive.d.ts +2 -0
- package/dist/icons/glyphs/arrow-big-down-dash.d.ts +2 -0
- package/dist/icons/glyphs/arrow-big-down.d.ts +2 -0
- package/dist/icons/glyphs/arrow-big-left-dash.d.ts +2 -0
- package/dist/icons/glyphs/arrow-big-left.d.ts +2 -0
- package/dist/icons/glyphs/arrow-big-right-dash.d.ts +2 -0
- package/dist/icons/glyphs/arrow-big-right.d.ts +2 -0
- package/dist/icons/glyphs/arrow-big-up-dash.d.ts +2 -0
- package/dist/icons/glyphs/arrow-big-up.d.ts +2 -0
- package/dist/icons/glyphs/arrow-down-0-1.d.ts +2 -0
- package/dist/icons/glyphs/arrow-down-1-0.d.ts +2 -0
- package/dist/icons/glyphs/arrow-down-a-z.d.ts +2 -0
- package/dist/icons/glyphs/arrow-down-left.d.ts +2 -0
- package/dist/icons/glyphs/arrow-down-right.d.ts +2 -0
- package/dist/icons/glyphs/arrow-down-z-a.d.ts +2 -0
- package/dist/icons/glyphs/arrow-down.d.ts +2 -0
- package/dist/icons/glyphs/arrow-left.d.ts +2 -0
- package/dist/icons/glyphs/arrow-right.d.ts +2 -0
- package/dist/icons/glyphs/arrow-up-down.d.ts +2 -0
- package/dist/icons/glyphs/arrow-up-left.d.ts +2 -0
- package/dist/icons/glyphs/arrow-up-right.d.ts +2 -0
- package/dist/icons/glyphs/arrow-up.d.ts +2 -0
- package/dist/icons/glyphs/at-sign.d.ts +2 -0
- package/dist/icons/glyphs/atom.d.ts +2 -0
- package/dist/icons/glyphs/audio-lines.d.ts +2 -0
- package/dist/icons/glyphs/axe.d.ts +2 -0
- package/dist/icons/glyphs/badge-alert.d.ts +2 -0
- package/dist/icons/glyphs/badge-percent.d.ts +2 -0
- package/dist/icons/glyphs/ban.d.ts +2 -0
- package/dist/icons/glyphs/banana.d.ts +2 -0
- package/dist/icons/glyphs/battery-charging.d.ts +2 -0
- package/dist/icons/glyphs/battery-full.d.ts +2 -0
- package/dist/icons/glyphs/battery-low.d.ts +2 -0
- package/dist/icons/glyphs/battery-medium.d.ts +2 -0
- package/dist/icons/glyphs/battery-plus.d.ts +2 -0
- package/dist/icons/glyphs/battery-warning.d.ts +2 -0
- package/dist/icons/glyphs/battery.d.ts +2 -0
- package/dist/icons/glyphs/bell-electric.d.ts +2 -0
- package/dist/icons/glyphs/bell.d.ts +2 -0
- package/dist/icons/glyphs/biceps-flexed.d.ts +2 -0
- package/dist/icons/glyphs/binary.d.ts +2 -0
- package/dist/icons/glyphs/blocks.d.ts +2 -0
- package/dist/icons/glyphs/bluetooth-connected.d.ts +2 -0
- package/dist/icons/glyphs/bluetooth-off.d.ts +2 -0
- package/dist/icons/glyphs/bluetooth-searching.d.ts +2 -0
- package/dist/icons/glyphs/bluetooth.d.ts +2 -0
- package/dist/icons/glyphs/bold.d.ts +2 -0
- package/dist/icons/glyphs/bone.d.ts +2 -0
- package/dist/icons/glyphs/book-open.d.ts +2 -0
- package/dist/icons/glyphs/book-text.d.ts +2 -0
- package/dist/icons/glyphs/bookmark-check.d.ts +2 -0
- package/dist/icons/glyphs/bookmark-minus.d.ts +2 -0
- package/dist/icons/glyphs/bookmark-plus.d.ts +2 -0
- package/dist/icons/glyphs/bookmark-x.d.ts +2 -0
- package/dist/icons/glyphs/bookmark.d.ts +2 -0
- package/dist/icons/glyphs/bot-message-square.d.ts +2 -0
- package/dist/icons/glyphs/bot.d.ts +2 -0
- package/dist/icons/glyphs/box.d.ts +2 -0
- package/dist/icons/glyphs/boxes.d.ts +2 -0
- package/dist/icons/glyphs/brain.d.ts +2 -0
- package/dist/icons/glyphs/briefcase-business.d.ts +2 -0
- package/dist/icons/glyphs/calendar-check-2.d.ts +2 -0
- package/dist/icons/glyphs/calendar-check.d.ts +2 -0
- package/dist/icons/glyphs/calendar-cog.d.ts +2 -0
- package/dist/icons/glyphs/calendar-days.d.ts +2 -0
- package/dist/icons/glyphs/calendar.d.ts +2 -0
- package/dist/icons/glyphs/car.d.ts +2 -0
- package/dist/icons/glyphs/cast.d.ts +2 -0
- package/dist/icons/glyphs/cctv.d.ts +2 -0
- package/dist/icons/glyphs/chart-bar-decreasing.d.ts +2 -0
- package/dist/icons/glyphs/chart-bar-increasing.d.ts +2 -0
- package/dist/icons/glyphs/chart-column-decreasing.d.ts +2 -0
- package/dist/icons/glyphs/chart-column-increasing.d.ts +2 -0
- package/dist/icons/glyphs/chart-column.d.ts +2 -0
- package/dist/icons/glyphs/chart-line.d.ts +2 -0
- package/dist/icons/glyphs/chart-no-axes-column-decreasing.d.ts +2 -0
- package/dist/icons/glyphs/chart-no-axes-column-increasing.d.ts +2 -0
- package/dist/icons/glyphs/chart-pie.d.ts +2 -0
- package/dist/icons/glyphs/chart-scatter.d.ts +2 -0
- package/dist/icons/glyphs/chart-spline.d.ts +2 -0
- package/dist/icons/glyphs/check-check.d.ts +2 -0
- package/dist/icons/glyphs/check.d.ts +2 -0
- package/dist/icons/glyphs/chess-bishop.d.ts +2 -0
- package/dist/icons/glyphs/chess-king.d.ts +2 -0
- package/dist/icons/glyphs/chess-knight.d.ts +2 -0
- package/dist/icons/glyphs/chess-pawn.d.ts +2 -0
- package/dist/icons/glyphs/chevron-down.d.ts +2 -0
- package/dist/icons/glyphs/chevron-first.d.ts +2 -0
- package/dist/icons/glyphs/chevron-left.d.ts +2 -0
- package/dist/icons/glyphs/chevron-right.d.ts +2 -0
- package/dist/icons/glyphs/chevron-up.d.ts +2 -0
- package/dist/icons/glyphs/chevrons-down-up.d.ts +2 -0
- package/dist/icons/glyphs/chevrons-left-right.d.ts +2 -0
- package/dist/icons/glyphs/chevrons-left.d.ts +2 -0
- package/dist/icons/glyphs/chevrons-right-left.d.ts +2 -0
- package/dist/icons/glyphs/chevrons-up-down.d.ts +2 -0
- package/dist/icons/glyphs/chromium.d.ts +2 -0
- package/dist/icons/glyphs/cigarette-off.d.ts +2 -0
- package/dist/icons/glyphs/cigarette.d.ts +2 -0
- package/dist/icons/glyphs/circle-check.d.ts +2 -0
- package/dist/icons/glyphs/circle-chevron-down.d.ts +2 -0
- package/dist/icons/glyphs/circle-chevron-left.d.ts +2 -0
- package/dist/icons/glyphs/circle-chevron-right.d.ts +2 -0
- package/dist/icons/glyphs/circle-chevron-up.d.ts +2 -0
- package/dist/icons/glyphs/circle-dashed.d.ts +2 -0
- package/dist/icons/glyphs/circle-dollar-sign.d.ts +2 -0
- package/dist/icons/glyphs/circle-gauge.d.ts +2 -0
- package/dist/icons/glyphs/circle-question-mark.d.ts +2 -0
- package/dist/icons/glyphs/circle-x.d.ts +2 -0
- package/dist/icons/glyphs/circle.d.ts +2 -0
- package/dist/icons/glyphs/clapperboard.d.ts +2 -0
- package/dist/icons/glyphs/clipboard-check.d.ts +2 -0
- package/dist/icons/glyphs/clock.d.ts +2 -0
- package/dist/icons/glyphs/cloud-backup.d.ts +2 -0
- package/dist/icons/glyphs/cloud-cog.d.ts +2 -0
- package/dist/icons/glyphs/cloud-download.d.ts +2 -0
- package/dist/icons/glyphs/cloud-lightning.d.ts +2 -0
- package/dist/icons/glyphs/cloud-off.d.ts +2 -0
- package/dist/icons/glyphs/cloud-rain-wind.d.ts +2 -0
- package/dist/icons/glyphs/cloud-rain.d.ts +2 -0
- package/dist/icons/glyphs/cloud-snow.d.ts +2 -0
- package/dist/icons/glyphs/cloud-sun.d.ts +2 -0
- package/dist/icons/glyphs/cloud-sync.d.ts +2 -0
- package/dist/icons/glyphs/cloud-upload.d.ts +2 -0
- package/dist/icons/glyphs/code-xml.d.ts +2 -0
- package/dist/icons/glyphs/coffee.d.ts +2 -0
- package/dist/icons/glyphs/cog.d.ts +2 -0
- package/dist/icons/glyphs/compass.d.ts +2 -0
- package/dist/icons/glyphs/concierge-bell.d.ts +2 -0
- package/dist/icons/glyphs/construction.d.ts +2 -0
- package/dist/icons/glyphs/contrast.d.ts +2 -0
- package/dist/icons/glyphs/cooking-pot.d.ts +2 -0
- package/dist/icons/glyphs/copy.d.ts +2 -0
- package/dist/icons/glyphs/corner-down-left.d.ts +2 -0
- package/dist/icons/glyphs/corner-down-right.d.ts +2 -0
- package/dist/icons/glyphs/corner-left-down.d.ts +2 -0
- package/dist/icons/glyphs/corner-left-up.d.ts +2 -0
- package/dist/icons/glyphs/corner-right-down.d.ts +2 -0
- package/dist/icons/glyphs/corner-right-up.d.ts +2 -0
- package/dist/icons/glyphs/corner-up-left.d.ts +2 -0
- package/dist/icons/glyphs/corner-up-right.d.ts +2 -0
- package/dist/icons/glyphs/cpu.d.ts +2 -0
- package/dist/icons/glyphs/credit-card.d.ts +2 -0
- package/dist/icons/glyphs/cup-soda.d.ts +2 -0
- package/dist/icons/glyphs/database-backup.d.ts +2 -0
- package/dist/icons/glyphs/delete.d.ts +2 -0
- package/dist/icons/glyphs/disc-3.d.ts +2 -0
- package/dist/icons/glyphs/dollar-sign.d.ts +2 -0
- package/dist/icons/glyphs/download.d.ts +2 -0
- package/dist/icons/glyphs/dribbble.d.ts +2 -0
- package/dist/icons/glyphs/droplet.d.ts +2 -0
- package/dist/icons/glyphs/drum.d.ts +2 -0
- package/dist/icons/glyphs/earth.d.ts +2 -0
- package/dist/icons/glyphs/ellipsis.d.ts +2 -0
- package/dist/icons/glyphs/euro.d.ts +2 -0
- package/dist/icons/glyphs/ev-charger.d.ts +2 -0
- package/dist/icons/glyphs/expand.d.ts +2 -0
- package/dist/icons/glyphs/external-link.d.ts +2 -0
- package/dist/icons/glyphs/eye-off.d.ts +2 -0
- package/dist/icons/glyphs/eye.d.ts +2 -0
- package/dist/icons/glyphs/facebook.d.ts +2 -0
- package/dist/icons/glyphs/fan.d.ts +2 -0
- package/dist/icons/glyphs/feather.d.ts +2 -0
- package/dist/icons/glyphs/figma.d.ts +2 -0
- package/dist/icons/glyphs/file-chart-line.d.ts +2 -0
- package/dist/icons/glyphs/file-check-corner.d.ts +2 -0
- package/dist/icons/glyphs/file-check.d.ts +2 -0
- package/dist/icons/glyphs/file-cog.d.ts +2 -0
- package/dist/icons/glyphs/file-pen-line.d.ts +2 -0
- package/dist/icons/glyphs/file-stack.d.ts +2 -0
- package/dist/icons/glyphs/file-text.d.ts +2 -0
- package/dist/icons/glyphs/fingerprint-pattern.d.ts +2 -0
- package/dist/icons/glyphs/fish-symbol.d.ts +2 -0
- package/dist/icons/glyphs/flame.d.ts +2 -0
- package/dist/icons/glyphs/flask-conical.d.ts +2 -0
- package/dist/icons/glyphs/folder-archive.d.ts +2 -0
- package/dist/icons/glyphs/folder-check.d.ts +2 -0
- package/dist/icons/glyphs/folder-clock.d.ts +2 -0
- package/dist/icons/glyphs/folder-code.d.ts +2 -0
- package/dist/icons/glyphs/folder-cog.d.ts +2 -0
- package/dist/icons/glyphs/folder-dot.d.ts +2 -0
- package/dist/icons/glyphs/folder-down.d.ts +2 -0
- package/dist/icons/glyphs/folder-git-2.d.ts +2 -0
- package/dist/icons/glyphs/folder-git.d.ts +2 -0
- package/dist/icons/glyphs/folder-heart.d.ts +2 -0
- package/dist/icons/glyphs/folder-input.d.ts +2 -0
- package/dist/icons/glyphs/folder-kanban.d.ts +2 -0
- package/dist/icons/glyphs/folder-key.d.ts +2 -0
- package/dist/icons/glyphs/folder-lock.d.ts +2 -0
- package/dist/icons/glyphs/folder-minus.d.ts +2 -0
- package/dist/icons/glyphs/folder-open.d.ts +2 -0
- package/dist/icons/glyphs/folder-output.d.ts +2 -0
- package/dist/icons/glyphs/folder-plus.d.ts +2 -0
- package/dist/icons/glyphs/folder-root.d.ts +2 -0
- package/dist/icons/glyphs/folder-sync.d.ts +2 -0
- package/dist/icons/glyphs/folder-tree.d.ts +2 -0
- package/dist/icons/glyphs/folder-up.d.ts +2 -0
- package/dist/icons/glyphs/folder-x.d.ts +2 -0
- package/dist/icons/glyphs/folders.d.ts +2 -0
- package/dist/icons/glyphs/frame.d.ts +2 -0
- package/dist/icons/glyphs/frown.d.ts +2 -0
- package/dist/icons/glyphs/gallery-horizontal-end.d.ts +2 -0
- package/dist/icons/glyphs/gallery-thumbnails.d.ts +2 -0
- package/dist/icons/glyphs/gallery-vertical-end.d.ts +2 -0
- package/dist/icons/glyphs/gauge.d.ts +2 -0
- package/dist/icons/glyphs/gavel.d.ts +2 -0
- package/dist/icons/glyphs/georgian-lari.d.ts +2 -0
- package/dist/icons/glyphs/git-branch.d.ts +2 -0
- package/dist/icons/glyphs/git-commit-horizontal.d.ts +2 -0
- package/dist/icons/glyphs/git-commit-vertical.d.ts +2 -0
- package/dist/icons/glyphs/git-compare-arrows.d.ts +2 -0
- package/dist/icons/glyphs/git-compare.d.ts +2 -0
- package/dist/icons/glyphs/git-fork.d.ts +2 -0
- package/dist/icons/glyphs/git-graph.d.ts +2 -0
- package/dist/icons/glyphs/git-merge.d.ts +2 -0
- package/dist/icons/glyphs/git-pull-request-closed.d.ts +2 -0
- package/dist/icons/glyphs/git-pull-request-create.d.ts +2 -0
- package/dist/icons/glyphs/git-pull-request.d.ts +2 -0
- package/dist/icons/glyphs/github.d.ts +2 -0
- package/dist/icons/glyphs/gitlab.d.ts +2 -0
- package/dist/icons/glyphs/graduation-cap.d.ts +2 -0
- package/dist/icons/glyphs/grip-horizontal.d.ts +2 -0
- package/dist/icons/glyphs/grip-vertical.d.ts +2 -0
- package/dist/icons/glyphs/grip.d.ts +2 -0
- package/dist/icons/glyphs/hammer.d.ts +2 -0
- package/dist/icons/glyphs/hand-coins.d.ts +2 -0
- package/dist/icons/glyphs/hand-fist.d.ts +2 -0
- package/dist/icons/glyphs/hand-grab.d.ts +2 -0
- package/dist/icons/glyphs/hand-heart.d.ts +2 -0
- package/dist/icons/glyphs/hand-helping.d.ts +2 -0
- package/dist/icons/glyphs/hand-metal.d.ts +2 -0
- package/dist/icons/glyphs/hand.d.ts +2 -0
- package/dist/icons/glyphs/hard-drive-download.d.ts +2 -0
- package/dist/icons/glyphs/hard-drive-upload.d.ts +2 -0
- package/dist/icons/glyphs/hard-drive.d.ts +2 -0
- package/dist/icons/glyphs/hat-glasses.d.ts +2 -0
- package/dist/icons/glyphs/heart-handshake.d.ts +2 -0
- package/dist/icons/glyphs/heart-pulse.d.ts +2 -0
- package/dist/icons/glyphs/heart.d.ts +2 -0
- package/dist/icons/glyphs/history.d.ts +2 -0
- package/dist/icons/glyphs/hourglass.d.ts +2 -0
- package/dist/icons/glyphs/house.d.ts +2 -0
- package/dist/icons/glyphs/id-card.d.ts +2 -0
- package/dist/icons/glyphs/image.d.ts +2 -0
- package/dist/icons/glyphs/inbox.d.ts +2 -0
- package/dist/icons/glyphs/indian-rupee.d.ts +2 -0
- package/dist/icons/glyphs/info.d.ts +2 -0
- package/dist/icons/glyphs/instagram.d.ts +2 -0
- package/dist/icons/glyphs/italic.d.ts +2 -0
- package/dist/icons/glyphs/japanese-yen.d.ts +2 -0
- package/dist/icons/glyphs/key-round.d.ts +2 -0
- package/dist/icons/glyphs/key-square.d.ts +2 -0
- package/dist/icons/glyphs/key.d.ts +2 -0
- package/dist/icons/glyphs/keyboard.d.ts +2 -0
- package/dist/icons/glyphs/languages.d.ts +2 -0
- package/dist/icons/glyphs/laptop-minimal-check.d.ts +2 -0
- package/dist/icons/glyphs/laugh.d.ts +2 -0
- package/dist/icons/glyphs/layers.d.ts +2 -0
- package/dist/icons/glyphs/layout-dashboard.d.ts +2 -0
- package/dist/icons/glyphs/layout-grid.d.ts +2 -0
- package/dist/icons/glyphs/layout-panel-top.d.ts +2 -0
- package/dist/icons/glyphs/leaf.d.ts +2 -0
- package/dist/icons/glyphs/leafy-green.d.ts +2 -0
- package/dist/icons/glyphs/link-2.d.ts +2 -0
- package/dist/icons/glyphs/link.d.ts +2 -0
- package/dist/icons/glyphs/linkedin.d.ts +2 -0
- package/dist/icons/glyphs/list-filter.d.ts +2 -0
- package/dist/icons/glyphs/list-todo.d.ts +2 -0
- package/dist/icons/glyphs/list.d.ts +2 -0
- package/dist/icons/glyphs/loader-circle.d.ts +2 -0
- package/dist/icons/glyphs/loader-pinwheel.d.ts +2 -0
- package/dist/icons/glyphs/loader.d.ts +2 -0
- package/dist/icons/glyphs/lock-keyhole-open.d.ts +2 -0
- package/dist/icons/glyphs/lock-keyhole.d.ts +2 -0
- package/dist/icons/glyphs/lock-open.d.ts +2 -0
- package/dist/icons/glyphs/lock.d.ts +2 -0
- package/dist/icons/glyphs/log-in.d.ts +2 -0
- package/dist/icons/glyphs/log-out.d.ts +2 -0
- package/dist/icons/glyphs/mail-check.d.ts +2 -0
- package/dist/icons/glyphs/mail.d.ts +2 -0
- package/dist/icons/glyphs/mailbox.d.ts +2 -0
- package/dist/icons/glyphs/map-pin-check-inside.d.ts +2 -0
- package/dist/icons/glyphs/map-pin-check.d.ts +2 -0
- package/dist/icons/glyphs/map-pin-house.d.ts +2 -0
- package/dist/icons/glyphs/map-pin-minus-inside.d.ts +2 -0
- package/dist/icons/glyphs/map-pin-minus.d.ts +2 -0
- package/dist/icons/glyphs/map-pin-off.d.ts +2 -0
- package/dist/icons/glyphs/map-pin-plus-inside.d.ts +2 -0
- package/dist/icons/glyphs/map-pin-plus.d.ts +2 -0
- package/dist/icons/glyphs/map-pin-x-inside.d.ts +2 -0
- package/dist/icons/glyphs/map-pin.d.ts +2 -0
- package/dist/icons/glyphs/maximize-2.d.ts +2 -0
- package/dist/icons/glyphs/maximize.d.ts +2 -0
- package/dist/icons/glyphs/meh.d.ts +2 -0
- package/dist/icons/glyphs/menu.d.ts +2 -0
- package/dist/icons/glyphs/message-circle-check.d.ts +2 -0
- package/dist/icons/glyphs/message-circle-dashed.d.ts +2 -0
- package/dist/icons/glyphs/message-circle-more.d.ts +2 -0
- package/dist/icons/glyphs/message-circle-plus.d.ts +2 -0
- package/dist/icons/glyphs/message-circle-x.d.ts +2 -0
- package/dist/icons/glyphs/message-circle.d.ts +2 -0
- package/dist/icons/glyphs/message-square-check.d.ts +2 -0
- package/dist/icons/glyphs/message-square-dashed.d.ts +2 -0
- package/dist/icons/glyphs/message-square-more.d.ts +2 -0
- package/dist/icons/glyphs/message-square-plus.d.ts +2 -0
- package/dist/icons/glyphs/message-square-x.d.ts +2 -0
- package/dist/icons/glyphs/message-square.d.ts +2 -0
- package/dist/icons/glyphs/mic-off.d.ts +2 -0
- package/dist/icons/glyphs/mic.d.ts +2 -0
- package/dist/icons/glyphs/minimize.d.ts +2 -0
- package/dist/icons/glyphs/minus.d.ts +2 -0
- package/dist/icons/glyphs/monitor-check.d.ts +2 -0
- package/dist/icons/glyphs/monitor-cog.d.ts +2 -0
- package/dist/icons/glyphs/monitor.d.ts +2 -0
- package/dist/icons/glyphs/moon.d.ts +2 -0
- package/dist/icons/glyphs/mouse-pointer-click.d.ts +2 -0
- package/dist/icons/glyphs/nfc.d.ts +2 -0
- package/dist/icons/glyphs/package.d.ts +2 -0
- package/dist/icons/glyphs/palette.d.ts +2 -0
- package/dist/icons/glyphs/panel-left-close.d.ts +2 -0
- package/dist/icons/glyphs/panel-left-open.d.ts +2 -0
- package/dist/icons/glyphs/panel-right-open.d.ts +2 -0
- package/dist/icons/glyphs/paperclip.d.ts +2 -0
- package/dist/icons/glyphs/party-popper.d.ts +2 -0
- package/dist/icons/glyphs/pause.d.ts +2 -0
- package/dist/icons/glyphs/pen-tool.d.ts +2 -0
- package/dist/icons/glyphs/philippine-peso.d.ts +2 -0
- package/dist/icons/glyphs/phone-call.d.ts +2 -0
- package/dist/icons/glyphs/phone-forwarded.d.ts +2 -0
- package/dist/icons/glyphs/phone-incoming.d.ts +2 -0
- package/dist/icons/glyphs/phone-missed.d.ts +2 -0
- package/dist/icons/glyphs/phone-off.d.ts +2 -0
- package/dist/icons/glyphs/phone.d.ts +2 -0
- package/dist/icons/glyphs/pickaxe.d.ts +2 -0
- package/dist/icons/glyphs/pipette.d.ts +2 -0
- package/dist/icons/glyphs/plane-landing.d.ts +2 -0
- package/dist/icons/glyphs/plane-takeoff.d.ts +2 -0
- package/dist/icons/glyphs/plane.d.ts +2 -0
- package/dist/icons/glyphs/play.d.ts +2 -0
- package/dist/icons/glyphs/plug-zap.d.ts +2 -0
- package/dist/icons/glyphs/plus.d.ts +2 -0
- package/dist/icons/glyphs/pound-sterling.d.ts +2 -0
- package/dist/icons/glyphs/projector.d.ts +2 -0
- package/dist/icons/glyphs/rabbit.d.ts +2 -0
- package/dist/icons/glyphs/radio-tower.d.ts +2 -0
- package/dist/icons/glyphs/radio.d.ts +2 -0
- package/dist/icons/glyphs/receipt-cent.d.ts +2 -0
- package/dist/icons/glyphs/receipt-euro.d.ts +2 -0
- package/dist/icons/glyphs/receipt-indian-rupee.d.ts +2 -0
- package/dist/icons/glyphs/receipt-japanese-yen.d.ts +2 -0
- package/dist/icons/glyphs/receipt-pound-sterling.d.ts +2 -0
- package/dist/icons/glyphs/receipt-russian-ruble.d.ts +2 -0
- package/dist/icons/glyphs/receipt-swiss-franc.d.ts +2 -0
- package/dist/icons/glyphs/receipt-text.d.ts +2 -0
- package/dist/icons/glyphs/receipt-turkish-lira.d.ts +2 -0
- package/dist/icons/glyphs/receipt.d.ts +2 -0
- package/dist/icons/glyphs/redo-dot.d.ts +2 -0
- package/dist/icons/glyphs/redo.d.ts +2 -0
- package/dist/icons/glyphs/refresh-ccw-dot.d.ts +2 -0
- package/dist/icons/glyphs/refresh-ccw.d.ts +2 -0
- package/dist/icons/glyphs/refresh-cw-off.d.ts +2 -0
- package/dist/icons/glyphs/refresh-cw.d.ts +2 -0
- package/dist/icons/glyphs/rocket.d.ts +2 -0
- package/dist/icons/glyphs/rocking-chair.d.ts +2 -0
- package/dist/icons/glyphs/roller-coaster.d.ts +2 -0
- package/dist/icons/glyphs/rotate-ccw.d.ts +2 -0
- package/dist/icons/glyphs/rotate-cw.d.ts +2 -0
- package/dist/icons/glyphs/route.d.ts +2 -0
- package/dist/icons/glyphs/router.d.ts +2 -0
- package/dist/icons/glyphs/russian-ruble.d.ts +2 -0
- package/dist/icons/glyphs/satellite-dish.d.ts +2 -0
- package/dist/icons/glyphs/saudi-riyal.d.ts +2 -0
- package/dist/icons/glyphs/scan-face.d.ts +2 -0
- package/dist/icons/glyphs/scan-text.d.ts +2 -0
- package/dist/icons/glyphs/search.d.ts +2 -0
- package/dist/icons/glyphs/send.d.ts +2 -0
- package/dist/icons/glyphs/server-cog.d.ts +2 -0
- package/dist/icons/glyphs/server-crash.d.ts +2 -0
- package/dist/icons/glyphs/server.d.ts +2 -0
- package/dist/icons/glyphs/settings.d.ts +2 -0
- package/dist/icons/glyphs/shield-check.d.ts +2 -0
- package/dist/icons/glyphs/ship-wheel.d.ts +2 -0
- package/dist/icons/glyphs/ship.d.ts +2 -0
- package/dist/icons/glyphs/shopping-cart.d.ts +2 -0
- package/dist/icons/glyphs/shower-head.d.ts +2 -0
- package/dist/icons/glyphs/shredder.d.ts +2 -0
- package/dist/icons/glyphs/shrink.d.ts +2 -0
- package/dist/icons/glyphs/sliders-horizontal.d.ts +2 -0
- package/dist/icons/glyphs/smartphone-charging.d.ts +2 -0
- package/dist/icons/glyphs/smartphone-nfc.d.ts +2 -0
- package/dist/icons/glyphs/smartphone.d.ts +2 -0
- package/dist/icons/glyphs/smile-plus.d.ts +2 -0
- package/dist/icons/glyphs/smile.d.ts +2 -0
- package/dist/icons/glyphs/snowflake.d.ts +2 -0
- package/dist/icons/glyphs/soup.d.ts +2 -0
- package/dist/icons/glyphs/sparkles.d.ts +2 -0
- package/dist/icons/glyphs/spray-can.d.ts +2 -0
- package/dist/icons/glyphs/square-activity.d.ts +2 -0
- package/dist/icons/glyphs/square-arrow-down.d.ts +2 -0
- package/dist/icons/glyphs/square-arrow-left.d.ts +2 -0
- package/dist/icons/glyphs/square-arrow-right.d.ts +2 -0
- package/dist/icons/glyphs/square-arrow-up.d.ts +2 -0
- package/dist/icons/glyphs/square-chevron-down.d.ts +2 -0
- package/dist/icons/glyphs/square-chevron-left.d.ts +2 -0
- package/dist/icons/glyphs/square-chevron-right.d.ts +2 -0
- package/dist/icons/glyphs/square-chevron-up.d.ts +2 -0
- package/dist/icons/glyphs/square-pen.d.ts +2 -0
- package/dist/icons/glyphs/square-stack.d.ts +2 -0
- package/dist/icons/glyphs/stamp.d.ts +2 -0
- package/dist/icons/glyphs/stethoscope.d.ts +2 -0
- package/dist/icons/glyphs/sun-dim.d.ts +2 -0
- package/dist/icons/glyphs/sun-medium.d.ts +2 -0
- package/dist/icons/glyphs/sun-moon.d.ts +2 -0
- package/dist/icons/glyphs/sun.d.ts +2 -0
- package/dist/icons/glyphs/sunset.d.ts +2 -0
- package/dist/icons/glyphs/swiss-franc.d.ts +2 -0
- package/dist/icons/glyphs/switch-camera.d.ts +2 -0
- package/dist/icons/glyphs/syringe.d.ts +2 -0
- package/dist/icons/glyphs/tablet.d.ts +2 -0
- package/dist/icons/glyphs/telescope.d.ts +2 -0
- package/dist/icons/glyphs/terminal.d.ts +2 -0
- package/dist/icons/glyphs/text-align-center.d.ts +2 -0
- package/dist/icons/glyphs/text-align-end.d.ts +2 -0
- package/dist/icons/glyphs/text-align-start.d.ts +2 -0
- package/dist/icons/glyphs/thermometer.d.ts +2 -0
- package/dist/icons/glyphs/thumbs-down.d.ts +2 -0
- package/dist/icons/glyphs/thumbs-up.d.ts +2 -0
- package/dist/icons/glyphs/ticket.d.ts +2 -0
- package/dist/icons/glyphs/timer.d.ts +2 -0
- package/dist/icons/glyphs/tornado.d.ts +2 -0
- package/dist/icons/glyphs/train-track.d.ts +2 -0
- package/dist/icons/glyphs/trash-2.d.ts +2 -0
- package/dist/icons/glyphs/tree-deciduous.d.ts +2 -0
- package/dist/icons/glyphs/tree-pine.d.ts +2 -0
- package/dist/icons/glyphs/trending-down.d.ts +2 -0
- package/dist/icons/glyphs/trending-up-down.d.ts +2 -0
- package/dist/icons/glyphs/trending-up.d.ts +2 -0
- package/dist/icons/glyphs/triangle-alert.d.ts +2 -0
- package/dist/icons/glyphs/truck.d.ts +2 -0
- package/dist/icons/glyphs/turkish-lira.d.ts +2 -0
- package/dist/icons/glyphs/twitch.d.ts +2 -0
- package/dist/icons/glyphs/twitter.d.ts +2 -0
- package/dist/icons/glyphs/underline.d.ts +2 -0
- package/dist/icons/glyphs/undo-dot.d.ts +2 -0
- package/dist/icons/glyphs/undo.d.ts +2 -0
- package/dist/icons/glyphs/unplug.d.ts +2 -0
- package/dist/icons/glyphs/upload.d.ts +2 -0
- package/dist/icons/glyphs/user-check.d.ts +2 -0
- package/dist/icons/glyphs/user-plus.d.ts +2 -0
- package/dist/icons/glyphs/user-round-check.d.ts +2 -0
- package/dist/icons/glyphs/user-round-cog.d.ts +2 -0
- package/dist/icons/glyphs/user-round-plus.d.ts +2 -0
- package/dist/icons/glyphs/user-round.d.ts +2 -0
- package/dist/icons/glyphs/user.d.ts +2 -0
- package/dist/icons/glyphs/users-round.d.ts +2 -0
- package/dist/icons/glyphs/users.d.ts +2 -0
- package/dist/icons/glyphs/vibrate.d.ts +2 -0
- package/dist/icons/glyphs/volume.d.ts +2 -0
- package/dist/icons/glyphs/wallet.d.ts +2 -0
- package/dist/icons/glyphs/washing-machine.d.ts +2 -0
- package/dist/icons/glyphs/waves-arrow-down.d.ts +2 -0
- package/dist/icons/glyphs/waves-arrow-up.d.ts +2 -0
- package/dist/icons/glyphs/waves-ladder.d.ts +2 -0
- package/dist/icons/glyphs/waves.d.ts +2 -0
- package/dist/icons/glyphs/waypoints.d.ts +2 -0
- package/dist/icons/glyphs/webhook.d.ts +2 -0
- package/dist/icons/glyphs/wifi-cog.d.ts +2 -0
- package/dist/icons/glyphs/wifi-low.d.ts +2 -0
- package/dist/icons/glyphs/wifi-pen.d.ts +2 -0
- package/dist/icons/glyphs/wifi-sync.d.ts +2 -0
- package/dist/icons/glyphs/wifi.d.ts +2 -0
- package/dist/icons/glyphs/wind-arrow-down.d.ts +2 -0
- package/dist/icons/glyphs/wind.d.ts +2 -0
- package/dist/icons/glyphs/workflow.d.ts +2 -0
- package/dist/icons/glyphs/wrench.d.ts +2 -0
- package/dist/icons/glyphs/x.d.ts +2 -0
- package/dist/icons/glyphs/youtube.d.ts +2 -0
- package/dist/icons/glyphs/zap-off.d.ts +2 -0
- package/dist/icons/glyphs/zap.d.ts +2 -0
- package/dist/icons/iconPlay.d.ts +2 -0
- package/dist/icons/registry.d.ts +80 -79
- package/dist/icons.js +996 -0
- package/dist/index.css +427 -132
- package/dist/index.js +6 -4
- package/dist/internal/ChoiceField.d.ts +1 -1
- package/dist/internal/FieldFrame.d.ts +17 -0
- package/dist/tokens/primitives.d.ts +1 -0
- package/dist/tokens/semantic.d.ts +1 -0
- package/dist/tokens/themes/dark.d.ts +1 -0
- package/package.json +11 -4
- package/src/components/button/COMPONENT.md +5 -3
- package/src/components/button/examples/in-form.tsx +15 -3
- package/src/components/button/examples/label-morph.tsx +7 -2
- package/src/components/button/examples/variants.tsx +1 -0
- package/src/components/checkbox/COMPONENT.md +1 -1
- package/src/components/color-picker/COMPONENT.md +2 -2
- package/src/components/color-picker/examples/in-form.tsx +13 -5
- package/src/components/color-picker/examples/validation.tsx +10 -4
- package/src/components/color-swatches/COMPONENT.md +2 -2
- package/src/components/color-swatches/examples/in-form.tsx +11 -5
- package/src/components/datepicker/COMPONENT.md +3 -3
- package/src/components/datepicker/examples/in-form.tsx +30 -9
- package/src/components/datepicker/examples/validation.tsx +20 -10
- package/src/components/digit-input/COMPONENT.md +3 -3
- package/src/components/digit-input/examples/in-form.tsx +22 -4
- package/src/components/digit-input/examples/validation.tsx +12 -5
- package/src/components/drawer/COMPONENT.md +1 -1
- package/src/components/drawer/examples/in-form.tsx +7 -2
- package/src/components/file-upload/COMPONENT.md +3 -3
- package/src/components/file-upload/examples/in-form.tsx +28 -4
- package/src/components/file-upload/examples/validation.tsx +37 -6
- package/src/components/input/COMPONENT.md +3 -3
- package/src/components/input/examples/in-form.tsx +42 -7
- package/src/components/input/examples/validation.tsx +38 -13
- package/src/components/modal/COMPONENT.md +1 -1
- package/src/components/modal/examples/in-form.tsx +7 -2
- package/src/components/native-select/COMPONENT.md +3 -3
- package/src/components/native-select/examples/examples.module.css +2 -0
- package/src/components/native-select/examples/in-form.tsx +18 -3
- package/src/components/native-select/examples/validation.tsx +8 -3
- package/src/components/popover/COMPONENT.md +1 -1
- package/src/components/popover/examples/in-form.tsx +27 -5
- package/src/components/radio/COMPONENT.md +1 -1
- package/src/components/select/COMPONENT.md +3 -3
- package/src/components/select/examples/examples.module.css +1 -0
- package/src/components/select/examples/in-form.tsx +25 -3
- package/src/components/select/examples/validation.tsx +8 -3
- package/src/components/slider/COMPONENT.md +1 -1
- package/src/components/switch/COMPONENT.md +1 -1
- package/src/components/tag-select/COMPONENT.md +3 -3
- package/src/components/tag-select/examples/examples.module.css +1 -0
- package/src/components/tag-select/examples/in-form.tsx +19 -2
- package/src/components/tag-select/examples/validation.tsx +7 -2
- package/src/components/textarea/COMPONENT.md +3 -3
- package/src/components/textarea/examples/in-form.tsx +20 -8
- package/src/components/textarea/examples/validation.tsx +24 -8
- package/src/styles/theme-dark.css +1 -0
- package/src/styles/theme-light.css +1 -0
- package/src/styles/tokens.css +1 -0
|
@@ -1,27 +1,91 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import {
|
|
2
|
+
Activity,
|
|
3
|
+
ArrowDown,
|
|
4
|
+
ArrowUp,
|
|
5
|
+
ArrowUpDown,
|
|
6
|
+
Bell,
|
|
7
|
+
Bold,
|
|
8
|
+
BookOpen,
|
|
9
|
+
Calendar,
|
|
10
|
+
ChartColumn,
|
|
11
|
+
Check,
|
|
12
|
+
ChevronDown,
|
|
13
|
+
ChevronLeft,
|
|
14
|
+
ChevronRight,
|
|
15
|
+
ChevronUp,
|
|
16
|
+
ChevronsLeft,
|
|
17
|
+
ChevronsUpDown,
|
|
18
|
+
Circle,
|
|
19
|
+
CircleCheck,
|
|
20
|
+
CircleX,
|
|
21
|
+
CloudOff,
|
|
22
|
+
CloudUpload,
|
|
23
|
+
CodeXml,
|
|
24
|
+
ControlSizeProvider,
|
|
25
|
+
Copy,
|
|
26
|
+
Download,
|
|
27
|
+
Ellipsis,
|
|
28
|
+
ExternalLink,
|
|
29
|
+
Eye,
|
|
30
|
+
EyeOff,
|
|
31
|
+
FileText,
|
|
32
|
+
GripVertical,
|
|
33
|
+
HardDrive,
|
|
34
|
+
House,
|
|
35
|
+
Image,
|
|
36
|
+
Inbox,
|
|
37
|
+
Info,
|
|
38
|
+
Italic,
|
|
39
|
+
KeyRound,
|
|
40
|
+
LayoutDashboard,
|
|
41
|
+
LayoutGrid,
|
|
42
|
+
Link2,
|
|
43
|
+
List,
|
|
44
|
+
ListFilter,
|
|
45
|
+
ListTodo,
|
|
46
|
+
Lock,
|
|
47
|
+
LogIn,
|
|
48
|
+
LogOut,
|
|
49
|
+
Mail,
|
|
50
|
+
MailCheck,
|
|
51
|
+
Menu,
|
|
52
|
+
MessageSquare,
|
|
53
|
+
Minus,
|
|
54
|
+
Monitor,
|
|
55
|
+
Moon,
|
|
56
|
+
Package,
|
|
57
|
+
PanelLeftClose,
|
|
58
|
+
PanelLeftOpen,
|
|
59
|
+
Pipette,
|
|
60
|
+
Plus,
|
|
61
|
+
Receipt,
|
|
62
|
+
RefreshCw,
|
|
63
|
+
Rocket,
|
|
64
|
+
Search,
|
|
65
|
+
Send,
|
|
66
|
+
Settings,
|
|
67
|
+
ShoppingCart,
|
|
68
|
+
Smartphone,
|
|
69
|
+
Sun,
|
|
70
|
+
Tablet,
|
|
71
|
+
Trash2,
|
|
72
|
+
TriangleAlert,
|
|
73
|
+
Truck,
|
|
74
|
+
Underline,
|
|
75
|
+
UserRound,
|
|
76
|
+
Users,
|
|
77
|
+
Wallet,
|
|
78
|
+
X,
|
|
79
|
+
cx,
|
|
80
|
+
iconBoxClass,
|
|
81
|
+
textTone_default,
|
|
82
|
+
useControlSize,
|
|
83
|
+
useIconRoot,
|
|
84
|
+
useOptionalControlSize
|
|
85
|
+
} from "./chunk-GFKDZFQR.js";
|
|
17
86
|
|
|
18
87
|
// src/components/spinner/Spinner.tsx
|
|
19
|
-
import * as
|
|
20
|
-
|
|
21
|
-
// src/internal/cx.ts
|
|
22
|
-
function cx(...classNames) {
|
|
23
|
-
return classNames.filter(Boolean).join(" ");
|
|
24
|
-
}
|
|
88
|
+
import * as React from "react";
|
|
25
89
|
|
|
26
90
|
// src/internal/data-attributes.ts
|
|
27
91
|
function toDataAttributes(input) {
|
|
@@ -36,37 +100,16 @@ function toDataAttributes(input) {
|
|
|
36
100
|
return result;
|
|
37
101
|
}
|
|
38
102
|
|
|
39
|
-
// src/internal/iconBox.module.css
|
|
40
|
-
var iconBox_default = {
|
|
41
|
-
box: "iconBox_box",
|
|
42
|
-
xs: "iconBox_xs",
|
|
43
|
-
s: "iconBox_s",
|
|
44
|
-
m: "iconBox_m",
|
|
45
|
-
l: "iconBox_l",
|
|
46
|
-
xl: "iconBox_xl",
|
|
47
|
-
inherit: "iconBox_inherit"
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
// src/internal/iconBox.ts
|
|
51
|
-
function iconBoxClass(size, tier) {
|
|
52
|
-
return cx(iconBox_default.box, iconBox_default[size ?? tier ?? "m"], size === void 0 && iconBox_default.inherit);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// src/internal/textTone.module.css
|
|
56
|
-
var textTone_default = {
|
|
57
|
-
tone: "textTone_tone"
|
|
58
|
-
};
|
|
59
|
-
|
|
60
103
|
// src/internal/VisuallyHidden.module.css
|
|
61
104
|
var VisuallyHidden_default = {
|
|
62
105
|
root: "VisuallyHidden_root"
|
|
63
106
|
};
|
|
64
107
|
|
|
65
108
|
// src/internal/VisuallyHidden.tsx
|
|
66
|
-
import { jsx
|
|
109
|
+
import { jsx } from "react/jsx-runtime";
|
|
67
110
|
var visuallyHiddenClass = VisuallyHidden_default.root;
|
|
68
111
|
function VisuallyHidden({ className, ...rest }) {
|
|
69
|
-
return /* @__PURE__ */
|
|
112
|
+
return /* @__PURE__ */ jsx("span", { className: cx(VisuallyHidden_default.root, className), ...rest });
|
|
70
113
|
}
|
|
71
114
|
|
|
72
115
|
// src/components/spinner/Spinner.module.css
|
|
@@ -77,7 +120,7 @@ var Spinner_default = {
|
|
|
77
120
|
};
|
|
78
121
|
|
|
79
122
|
// src/components/spinner/Spinner.tsx
|
|
80
|
-
import { jsx as
|
|
123
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
81
124
|
var SPINNER_LABELS = {
|
|
82
125
|
loading: "\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430"
|
|
83
126
|
};
|
|
@@ -89,7 +132,7 @@ function Spinner({
|
|
|
89
132
|
...rest
|
|
90
133
|
}) {
|
|
91
134
|
const controlSize = useOptionalControlSize();
|
|
92
|
-
const labels =
|
|
135
|
+
const labels = React.useMemo(() => ({ ...SPINNER_LABELS, ...labelsProp }), [labelsProp]);
|
|
93
136
|
const size = sizeProp ?? controlSize ?? "m";
|
|
94
137
|
return /* @__PURE__ */ jsxs(
|
|
95
138
|
"span",
|
|
@@ -99,15 +142,15 @@ function Spinner({
|
|
|
99
142
|
...toDataAttributes({ size, tone: tone === "default" ? void 0 : tone }),
|
|
100
143
|
...rest,
|
|
101
144
|
children: [
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
/* @__PURE__ */
|
|
145
|
+
/* @__PURE__ */ jsx2("span", { className: Spinner_default.ring, "aria-hidden": "true" }),
|
|
146
|
+
/* @__PURE__ */ jsx2(VisuallyHidden, { children: labels.loading })
|
|
104
147
|
]
|
|
105
148
|
}
|
|
106
149
|
);
|
|
107
150
|
}
|
|
108
151
|
|
|
109
152
|
// src/components/button/Button.tsx
|
|
110
|
-
import * as
|
|
153
|
+
import * as React7 from "react";
|
|
111
154
|
|
|
112
155
|
// src/internal/fieldSurface.module.css
|
|
113
156
|
var fieldSurface_default = {
|
|
@@ -130,12 +173,12 @@ var fieldTierClass = fieldTier_default.tier;
|
|
|
130
173
|
var fieldTriggerClass = `${fieldTier_default.tier} ${fieldSurface_default.surface} ${fieldTrigger_default.trigger}`;
|
|
131
174
|
|
|
132
175
|
// src/internal/iconLayout.ts
|
|
133
|
-
import * as
|
|
176
|
+
import * as React2 from "react";
|
|
134
177
|
function iconLayout(children, iconType) {
|
|
135
|
-
const content =
|
|
178
|
+
const content = React2.Children.toArray(children).filter(
|
|
136
179
|
(child) => !(typeof child === "string" && child.trim() === "")
|
|
137
180
|
);
|
|
138
|
-
const isIcon = (child) =>
|
|
181
|
+
const isIcon = (child) => React2.isValidElement(child) && child.type === iconType;
|
|
139
182
|
const iconOnly = content.length > 0 && content.every(isIcon);
|
|
140
183
|
return {
|
|
141
184
|
iconOnly,
|
|
@@ -145,10 +188,10 @@ function iconLayout(children, iconType) {
|
|
|
145
188
|
}
|
|
146
189
|
|
|
147
190
|
// src/internal/MorphText.tsx
|
|
148
|
-
import * as
|
|
191
|
+
import * as React4 from "react";
|
|
149
192
|
|
|
150
193
|
// src/hooks/usePresence.ts
|
|
151
|
-
import * as
|
|
194
|
+
import * as React3 from "react";
|
|
152
195
|
var DURATION_FALLBACK_MS = {
|
|
153
196
|
fast: 230,
|
|
154
197
|
base: 380,
|
|
@@ -179,17 +222,17 @@ function exitTimeoutMs(token) {
|
|
|
179
222
|
}
|
|
180
223
|
function usePresence(open, options = {}) {
|
|
181
224
|
const { exitDuration = "base" } = options;
|
|
182
|
-
const [mounted, setMounted] =
|
|
225
|
+
const [mounted, setMounted] = React3.useState(open);
|
|
183
226
|
if (open && !mounted) setMounted(true);
|
|
184
227
|
if (!open && mounted && prefersReducedMotion()) setMounted(false);
|
|
185
|
-
const openRef =
|
|
228
|
+
const openRef = React3.useRef(open);
|
|
186
229
|
openRef.current = open;
|
|
187
|
-
|
|
230
|
+
React3.useEffect(() => {
|
|
188
231
|
if (open || !mounted) return;
|
|
189
232
|
const id = window.setTimeout(() => setMounted(false), exitTimeoutMs(exitDuration));
|
|
190
233
|
return () => window.clearTimeout(id);
|
|
191
234
|
}, [open, mounted, exitDuration]);
|
|
192
|
-
const onExitEnd =
|
|
235
|
+
const onExitEnd = React3.useCallback((event) => {
|
|
193
236
|
if (event.target !== event.currentTarget) return;
|
|
194
237
|
if (!openRef.current) setMounted(false);
|
|
195
238
|
}, []);
|
|
@@ -210,12 +253,12 @@ var MorphText_default = {
|
|
|
210
253
|
};
|
|
211
254
|
|
|
212
255
|
// src/internal/MorphText.tsx
|
|
213
|
-
import { jsx as
|
|
256
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
214
257
|
function digitsOnly(a, b) {
|
|
215
258
|
return a.replace(/\d/g, "") === b.replace(/\d/g, "");
|
|
216
259
|
}
|
|
217
260
|
function letters(text, kind) {
|
|
218
|
-
return [...text].map((char, i) => /* @__PURE__ */
|
|
261
|
+
return [...text].map((char, i) => /* @__PURE__ */ jsx3(
|
|
219
262
|
"span",
|
|
220
263
|
{
|
|
221
264
|
className: cx(MorphText_default.letter, kind === "in" ? MorphText_default.letterIn : MorphText_default.letterOut),
|
|
@@ -233,15 +276,15 @@ function settleMs(text, root) {
|
|
|
233
276
|
return base + step * text.length + 50;
|
|
234
277
|
}
|
|
235
278
|
function MorphText({ children: text, className }) {
|
|
236
|
-
const rootRef =
|
|
237
|
-
const sizerRef =
|
|
238
|
-
const prevText =
|
|
239
|
-
const restWidth =
|
|
240
|
-
const nextId =
|
|
241
|
-
const [morph, setMorph] =
|
|
242
|
-
const morphRef =
|
|
279
|
+
const rootRef = React4.useRef(null);
|
|
280
|
+
const sizerRef = React4.useRef(null);
|
|
281
|
+
const prevText = React4.useRef(null);
|
|
282
|
+
const restWidth = React4.useRef(0);
|
|
283
|
+
const nextId = React4.useRef(0);
|
|
284
|
+
const [morph, setMorph] = React4.useState(null);
|
|
285
|
+
const morphRef = React4.useRef(morph);
|
|
243
286
|
morphRef.current = morph;
|
|
244
|
-
|
|
287
|
+
React4.useLayoutEffect(() => {
|
|
245
288
|
const root = rootRef.current;
|
|
246
289
|
const prev = prevText.current;
|
|
247
290
|
prevText.current = text;
|
|
@@ -255,7 +298,7 @@ function MorphText({ children: text, className }) {
|
|
|
255
298
|
nextId.current += 1;
|
|
256
299
|
setMorph({ id: nextId.current, from: running ? running.to : prev, to: text, width });
|
|
257
300
|
}, [text]);
|
|
258
|
-
|
|
301
|
+
React4.useLayoutEffect(() => {
|
|
259
302
|
if (!morph) return;
|
|
260
303
|
const root = rootRef.current;
|
|
261
304
|
const sizer = sizerRef.current;
|
|
@@ -269,27 +312,27 @@ function MorphText({ children: text, className }) {
|
|
|
269
312
|
const timer = window.setTimeout(() => setMorph(null), settleMs(morph.to, root));
|
|
270
313
|
return () => window.clearTimeout(timer);
|
|
271
314
|
}, [morph]);
|
|
272
|
-
|
|
315
|
+
React4.useLayoutEffect(() => {
|
|
273
316
|
if (morph || !rootRef.current) return;
|
|
274
317
|
rootRef.current.style.width = "";
|
|
275
318
|
restWidth.current = rootRef.current.getBoundingClientRect().width;
|
|
276
319
|
});
|
|
277
320
|
if (!morph) {
|
|
278
|
-
return /* @__PURE__ */
|
|
321
|
+
return /* @__PURE__ */ jsx3("span", { ref: rootRef, className: cx(MorphText_default.root, className), children: text });
|
|
279
322
|
}
|
|
280
323
|
return /* @__PURE__ */ jsxs2("span", { ref: rootRef, className: cx(MorphText_default.root, MorphText_default.morphing, className), children: [
|
|
281
|
-
/* @__PURE__ */
|
|
282
|
-
/* @__PURE__ */
|
|
283
|
-
/* @__PURE__ */
|
|
284
|
-
/* @__PURE__ */
|
|
324
|
+
/* @__PURE__ */ jsx3("span", { ref: sizerRef, className: MorphText_default.sizer, "aria-hidden": "true", children: morph.to }),
|
|
325
|
+
/* @__PURE__ */ jsx3("span", { className: MorphText_default.layer, "aria-hidden": "true", children: letters(morph.from, "out") }, `out-${morph.id}`),
|
|
326
|
+
/* @__PURE__ */ jsx3("span", { className: MorphText_default.layer, "aria-hidden": "true", children: letters(morph.to, "in") }, `in-${morph.id}`),
|
|
327
|
+
/* @__PURE__ */ jsx3(VisuallyHidden, { children: morph.to })
|
|
285
328
|
] });
|
|
286
329
|
}
|
|
287
330
|
|
|
288
331
|
// src/internal/slot.tsx
|
|
289
|
-
import * as
|
|
332
|
+
import * as React6 from "react";
|
|
290
333
|
|
|
291
334
|
// src/hooks/useMergedRefs.ts
|
|
292
|
-
import * as
|
|
335
|
+
import * as React5 from "react";
|
|
293
336
|
|
|
294
337
|
// src/internal/mergeRefs.ts
|
|
295
338
|
function mergeRefs(...refs) {
|
|
@@ -307,11 +350,11 @@ function mergeRefs(...refs) {
|
|
|
307
350
|
|
|
308
351
|
// src/hooks/useMergedRefs.ts
|
|
309
352
|
function useMergedRefs(...refs) {
|
|
310
|
-
return
|
|
353
|
+
return React5.useMemo(() => mergeRefs(...refs), refs);
|
|
311
354
|
}
|
|
312
355
|
|
|
313
356
|
// src/internal/slot.tsx
|
|
314
|
-
import { Fragment, jsx as
|
|
357
|
+
import { Fragment, jsx as jsx4 } from "react/jsx-runtime";
|
|
315
358
|
var isPrevented = (event) => typeof event === "object" && event !== null && event.defaultPrevented === true;
|
|
316
359
|
function mergeProps(slotProps, childProps) {
|
|
317
360
|
const merged = { ...slotProps };
|
|
@@ -350,14 +393,14 @@ function blockDisabledClick(event) {
|
|
|
350
393
|
event.stopPropagation();
|
|
351
394
|
}
|
|
352
395
|
function Slot({ children, ref, ...slotProps }) {
|
|
353
|
-
const child =
|
|
396
|
+
const child = React6.isValidElement(children) ? children : null;
|
|
354
397
|
const childRef = child?.props.ref ?? void 0;
|
|
355
398
|
const composedRef = useMergedRefs(ref, childRef);
|
|
356
|
-
if (!child) return /* @__PURE__ */
|
|
399
|
+
if (!child) return /* @__PURE__ */ jsx4(Fragment, { children });
|
|
357
400
|
const merged = mergeProps(slotProps, child.props);
|
|
358
401
|
const disabled = slotProps["aria-disabled"] === true || slotProps["aria-disabled"] === "true";
|
|
359
402
|
if (disabled) merged.onClickCapture = blockDisabledClick;
|
|
360
|
-
return
|
|
403
|
+
return React6.cloneElement(child, { ...merged, ref: composedRef });
|
|
361
404
|
}
|
|
362
405
|
Slot.displayName = "Slot";
|
|
363
406
|
|
|
@@ -381,15 +424,15 @@ var Button_default = {
|
|
|
381
424
|
};
|
|
382
425
|
|
|
383
426
|
// src/components/button/Button.tsx
|
|
384
|
-
import { Fragment as Fragment2, jsx as
|
|
427
|
+
import { Fragment as Fragment2, jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
385
428
|
var BUTTON_LABELS = { holdHint: "\u0423\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0439\u0442\u0435, \u0447\u0442\u043E\u0431\u044B \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C" };
|
|
386
429
|
var HOLD_MS = 1200;
|
|
387
430
|
function useHoldToConfirm(enabled, onConfirm) {
|
|
388
|
-
const [phase, setPhase] =
|
|
389
|
-
const timer =
|
|
390
|
-
const confirm =
|
|
431
|
+
const [phase, setPhase] = React7.useState("idle");
|
|
432
|
+
const timer = React7.useRef(void 0);
|
|
433
|
+
const confirm = React7.useRef(onConfirm);
|
|
391
434
|
confirm.current = onConfirm;
|
|
392
|
-
|
|
435
|
+
React7.useEffect(() => () => window.clearTimeout(timer.current), []);
|
|
393
436
|
const start = () => {
|
|
394
437
|
if (!enabled || phase === "holding" || phase === "done") return;
|
|
395
438
|
setPhase("holding");
|
|
@@ -411,11 +454,11 @@ function morphLabels(children) {
|
|
|
411
454
|
let run = null;
|
|
412
455
|
const flush = () => {
|
|
413
456
|
if (run !== null && run !== "") {
|
|
414
|
-
out.push(/* @__PURE__ */
|
|
457
|
+
out.push(/* @__PURE__ */ jsx5(MorphText, { children: run }, `label-${out.length}`));
|
|
415
458
|
}
|
|
416
459
|
run = null;
|
|
417
460
|
};
|
|
418
|
-
for (const child of
|
|
461
|
+
for (const child of React7.Children.toArray(children)) {
|
|
419
462
|
if (typeof child === "string" || typeof child === "number") {
|
|
420
463
|
run = (run ?? "") + String(child);
|
|
421
464
|
} else {
|
|
@@ -449,9 +492,9 @@ function ButtonRoot({
|
|
|
449
492
|
const isDisabled = disabled || loading;
|
|
450
493
|
const layout = iconLayout(children, ButtonIcon);
|
|
451
494
|
const hold = useHoldToConfirm(holdToConfirm && !isDisabled, onConfirm);
|
|
452
|
-
const hintId =
|
|
495
|
+
const hintId = React7.useId();
|
|
453
496
|
const inProgress = progress !== void 0;
|
|
454
|
-
const [fillUsed, setFillUsed] =
|
|
497
|
+
const [fillUsed, setFillUsed] = React7.useState(false);
|
|
455
498
|
if ((inProgress || holdToConfirm) && !fillUsed) setFillUsed(true);
|
|
456
499
|
const dataAttrs = toDataAttributes({
|
|
457
500
|
variant,
|
|
@@ -471,7 +514,7 @@ function ButtonRoot({
|
|
|
471
514
|
});
|
|
472
515
|
const classes = cx(fieldTierClass, touchTargetClass, Button_default.root, className);
|
|
473
516
|
if (asChild) {
|
|
474
|
-
return /* @__PURE__ */
|
|
517
|
+
return /* @__PURE__ */ jsx5(ControlSizeProvider, { value: size, children: /* @__PURE__ */ jsx5(
|
|
475
518
|
Slot,
|
|
476
519
|
{
|
|
477
520
|
...rest,
|
|
@@ -551,9 +594,9 @@ function ButtonRoot({
|
|
|
551
594
|
} : rest.style,
|
|
552
595
|
...dataAttrs,
|
|
553
596
|
children: [
|
|
554
|
-
fillUsed ? /* @__PURE__ */
|
|
597
|
+
fillUsed ? /* @__PURE__ */ jsx5("span", { className: Button_default.fillTrack, "aria-hidden": "true", children: /* @__PURE__ */ jsx5("span", { className: Button_default.fill }) }) : null,
|
|
555
598
|
/* @__PURE__ */ jsxs3(ControlSizeProvider, { value: size, children: [
|
|
556
|
-
loading ? /* @__PURE__ */
|
|
599
|
+
loading ? /* @__PURE__ */ jsx5(Spinner, { className: Button_default.spinner, "aria-hidden": "true" }) : null,
|
|
557
600
|
morphLabels(children)
|
|
558
601
|
] })
|
|
559
602
|
]
|
|
@@ -562,12 +605,12 @@ function ButtonRoot({
|
|
|
562
605
|
if (!holdToConfirm) return button;
|
|
563
606
|
return /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
564
607
|
button,
|
|
565
|
-
/* @__PURE__ */
|
|
608
|
+
/* @__PURE__ */ jsx5(VisuallyHidden, { id: hintId, children: { ...BUTTON_LABELS, ...labels }.holdHint })
|
|
566
609
|
] });
|
|
567
610
|
}
|
|
568
611
|
ButtonRoot.displayName = "Button.Root";
|
|
569
612
|
function ButtonIcon({ children, className, ...rest }) {
|
|
570
|
-
return /* @__PURE__ */
|
|
613
|
+
return /* @__PURE__ */ jsx5("span", { className: cx(Button_default.icon, className), "aria-hidden": "true", ...rest, children });
|
|
571
614
|
}
|
|
572
615
|
ButtonIcon.displayName = "Button.Icon";
|
|
573
616
|
var Button = { Root: ButtonRoot, Icon: ButtonIcon };
|
|
@@ -579,7 +622,7 @@ var Divider_default = {
|
|
|
579
622
|
};
|
|
580
623
|
|
|
581
624
|
// src/components/divider/Divider.tsx
|
|
582
|
-
import { jsx as
|
|
625
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
583
626
|
function Divider({
|
|
584
627
|
orientation = "horizontal",
|
|
585
628
|
align = "center",
|
|
@@ -589,7 +632,7 @@ function Divider({
|
|
|
589
632
|
role = "separator",
|
|
590
633
|
...rest
|
|
591
634
|
}) {
|
|
592
|
-
return /* @__PURE__ */
|
|
635
|
+
return /* @__PURE__ */ jsx6(
|
|
593
636
|
"div",
|
|
594
637
|
{
|
|
595
638
|
...rest,
|
|
@@ -597,95 +640,12 @@ function Divider({
|
|
|
597
640
|
role,
|
|
598
641
|
...orientation === "vertical" ? { "aria-orientation": "vertical" } : {},
|
|
599
642
|
...toDataAttributes({ orientation, align, size }),
|
|
600
|
-
children: children != null ? /* @__PURE__ */
|
|
643
|
+
children: children != null ? /* @__PURE__ */ jsx6(ControlSizeProvider, { value: size, children: /* @__PURE__ */ jsx6("span", { className: Divider_default.content, children }) }) : null
|
|
601
644
|
}
|
|
602
645
|
);
|
|
603
646
|
}
|
|
604
647
|
|
|
605
|
-
// src/icons/Icon.module.css
|
|
606
|
-
var Icon_default = {
|
|
607
|
-
root: "Icon_root"
|
|
608
|
-
};
|
|
609
|
-
|
|
610
648
|
// src/icons/registry.ts
|
|
611
|
-
import {
|
|
612
|
-
Activity,
|
|
613
|
-
AlertTriangle,
|
|
614
|
-
ArrowDown,
|
|
615
|
-
ArrowUp,
|
|
616
|
-
ArrowUpDown,
|
|
617
|
-
Bell,
|
|
618
|
-
Bold,
|
|
619
|
-
BookOpen,
|
|
620
|
-
Calendar,
|
|
621
|
-
ChartColumn,
|
|
622
|
-
Check,
|
|
623
|
-
CheckCircle2,
|
|
624
|
-
ChevronDown,
|
|
625
|
-
ChevronLeft,
|
|
626
|
-
ChevronRight,
|
|
627
|
-
ChevronsLeft,
|
|
628
|
-
ChevronsUpDown,
|
|
629
|
-
ChevronUp,
|
|
630
|
-
Circle,
|
|
631
|
-
CloudOff,
|
|
632
|
-
CloudUpload,
|
|
633
|
-
Code2,
|
|
634
|
-
Copy,
|
|
635
|
-
Download,
|
|
636
|
-
ExternalLink,
|
|
637
|
-
Eye,
|
|
638
|
-
EyeOff,
|
|
639
|
-
FileText,
|
|
640
|
-
GripVertical,
|
|
641
|
-
HardDrive,
|
|
642
|
-
House,
|
|
643
|
-
Image,
|
|
644
|
-
Inbox,
|
|
645
|
-
Info,
|
|
646
|
-
Italic,
|
|
647
|
-
KeyRound,
|
|
648
|
-
LayoutDashboard,
|
|
649
|
-
LayoutGrid,
|
|
650
|
-
Link2,
|
|
651
|
-
List,
|
|
652
|
-
ListFilter,
|
|
653
|
-
ListTodo,
|
|
654
|
-
Lock,
|
|
655
|
-
LogIn,
|
|
656
|
-
LogOut,
|
|
657
|
-
Mail,
|
|
658
|
-
MailCheck,
|
|
659
|
-
Menu,
|
|
660
|
-
MessageSquare,
|
|
661
|
-
Minus,
|
|
662
|
-
Monitor,
|
|
663
|
-
Moon,
|
|
664
|
-
MoreHorizontal,
|
|
665
|
-
Package,
|
|
666
|
-
PanelLeftClose,
|
|
667
|
-
PanelLeftOpen,
|
|
668
|
-
Pipette,
|
|
669
|
-
Plus,
|
|
670
|
-
Receipt,
|
|
671
|
-
RefreshCw,
|
|
672
|
-
Rocket,
|
|
673
|
-
Search,
|
|
674
|
-
Send,
|
|
675
|
-
Settings,
|
|
676
|
-
ShoppingCart,
|
|
677
|
-
Smartphone,
|
|
678
|
-
Sun,
|
|
679
|
-
Tablet,
|
|
680
|
-
Trash2,
|
|
681
|
-
Truck,
|
|
682
|
-
Underline,
|
|
683
|
-
UserRound,
|
|
684
|
-
Users,
|
|
685
|
-
Wallet,
|
|
686
|
-
X,
|
|
687
|
-
XCircle
|
|
688
|
-
} from "lucide-react";
|
|
689
649
|
var iconRegistry = {
|
|
690
650
|
"nav.chevronDown": ChevronDown,
|
|
691
651
|
"nav.chevronLeft": ChevronLeft,
|
|
@@ -712,7 +672,7 @@ var iconRegistry = {
|
|
|
712
672
|
"action.filter": ListFilter,
|
|
713
673
|
"action.login": LogIn,
|
|
714
674
|
"action.logout": LogOut,
|
|
715
|
-
"action.more":
|
|
675
|
+
"action.more": Ellipsis,
|
|
716
676
|
"action.refresh": RefreshCw,
|
|
717
677
|
"action.remove": Minus,
|
|
718
678
|
"action.search": Search,
|
|
@@ -750,18 +710,18 @@ var iconRegistry = {
|
|
|
750
710
|
"sort.ascending": ArrowUp,
|
|
751
711
|
"sort.descending": ArrowDown,
|
|
752
712
|
"sort.none": ArrowUpDown,
|
|
753
|
-
"status.danger":
|
|
713
|
+
"status.danger": CircleX,
|
|
754
714
|
"status.emailSent": MailCheck,
|
|
755
715
|
"status.info": Info,
|
|
756
716
|
"status.locked": Lock,
|
|
757
717
|
"status.offline": CloudOff,
|
|
758
|
-
"status.success":
|
|
718
|
+
"status.success": CircleCheck,
|
|
759
719
|
/** A rising trend; a falling one is the same arrow turned half a turn (it rotates between them). */
|
|
760
720
|
"status.trendUp": ArrowUp,
|
|
761
|
-
"status.warning":
|
|
721
|
+
"status.warning": TriangleAlert,
|
|
762
722
|
"theme.dark": Moon,
|
|
763
723
|
"theme.light": Sun,
|
|
764
|
-
"view.code":
|
|
724
|
+
"view.code": CodeXml,
|
|
765
725
|
"view.preview": Eye,
|
|
766
726
|
"viewport.desktop": Monitor,
|
|
767
727
|
"viewport.mobile": Smartphone,
|
|
@@ -769,47 +729,45 @@ var iconRegistry = {
|
|
|
769
729
|
};
|
|
770
730
|
|
|
771
731
|
// src/icons/Icon.tsx
|
|
772
|
-
import { jsx as
|
|
773
|
-
function IconSvg({
|
|
774
|
-
glyph: GlyphSvg,
|
|
775
|
-
className,
|
|
776
|
-
size,
|
|
777
|
-
tone = "default",
|
|
778
|
-
strokeWidth = 1.75,
|
|
779
|
-
...rest
|
|
780
|
-
}) {
|
|
781
|
-
const tier = useOptionalControlSize();
|
|
782
|
-
return /* @__PURE__ */ jsx8(
|
|
783
|
-
GlyphSvg,
|
|
784
|
-
{
|
|
785
|
-
className: cx(Icon_default.root, iconBoxClass(size, tier), textTone_default.tone, className),
|
|
786
|
-
"data-tone": tone === "default" ? void 0 : tone,
|
|
787
|
-
strokeWidth,
|
|
788
|
-
"aria-hidden": "true",
|
|
789
|
-
...rest
|
|
790
|
-
}
|
|
791
|
-
);
|
|
792
|
-
}
|
|
732
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
793
733
|
function Icon({ name, ...rest }) {
|
|
794
|
-
|
|
734
|
+
const Glyph = iconRegistry[name];
|
|
735
|
+
return /* @__PURE__ */ jsx7(Glyph, { ...rest });
|
|
795
736
|
}
|
|
796
737
|
function createIcon(glyph) {
|
|
797
|
-
|
|
798
|
-
|
|
738
|
+
const LucideGlyph = glyph;
|
|
739
|
+
function DomainIcon({
|
|
740
|
+
className,
|
|
741
|
+
size,
|
|
742
|
+
tone,
|
|
743
|
+
animated,
|
|
744
|
+
strokeWidth = 1.75,
|
|
745
|
+
...rest
|
|
746
|
+
}) {
|
|
747
|
+
const root = useIconRoot({ className, size, tone, animated, motion: "generic" });
|
|
748
|
+
return /* @__PURE__ */ jsx7(
|
|
749
|
+
LucideGlyph,
|
|
750
|
+
{
|
|
751
|
+
strokeWidth,
|
|
752
|
+
"aria-hidden": "true",
|
|
753
|
+
...root,
|
|
754
|
+
...rest
|
|
755
|
+
}
|
|
756
|
+
);
|
|
799
757
|
}
|
|
800
758
|
DomainIcon.displayName = `Icon(${glyph.displayName ?? "Glyph"})`;
|
|
801
759
|
return DomainIcon;
|
|
802
760
|
}
|
|
803
761
|
|
|
804
762
|
// src/components/scroll-container/ScrollContainer.tsx
|
|
805
|
-
import * as
|
|
763
|
+
import * as React9 from "react";
|
|
806
764
|
|
|
807
765
|
// src/hooks/useEdgeOverflow.ts
|
|
808
|
-
import * as
|
|
766
|
+
import * as React8 from "react";
|
|
809
767
|
var NONE = { start: false, end: false };
|
|
810
768
|
function useEdgeOverflow(ref, enabled, horizontal) {
|
|
811
|
-
const [overflow, setOverflow] =
|
|
812
|
-
|
|
769
|
+
const [overflow, setOverflow] = React8.useState(NONE);
|
|
770
|
+
React8.useLayoutEffect(() => {
|
|
813
771
|
const node = ref.current;
|
|
814
772
|
if (!enabled || !node) return;
|
|
815
773
|
const update = () => {
|
|
@@ -864,7 +822,7 @@ var ScrollContainer_default = {
|
|
|
864
822
|
};
|
|
865
823
|
|
|
866
824
|
// src/components/scroll-container/ScrollContainer.tsx
|
|
867
|
-
import { jsx as
|
|
825
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
868
826
|
var axisClass = {
|
|
869
827
|
vertical: ScrollContainer_default.vertical,
|
|
870
828
|
horizontal: ScrollContainer_default.horizontal,
|
|
@@ -880,11 +838,11 @@ function ScrollContainer({
|
|
|
880
838
|
ref,
|
|
881
839
|
...rest
|
|
882
840
|
}) {
|
|
883
|
-
const innerRef =
|
|
841
|
+
const innerRef = React9.useRef(null);
|
|
884
842
|
const mergedRef = useMergedRefs(innerRef, ref);
|
|
885
843
|
const horizontal = axis === "horizontal";
|
|
886
844
|
const overflow = useEdgeOverflow(innerRef, fade, horizontal);
|
|
887
|
-
return /* @__PURE__ */
|
|
845
|
+
return /* @__PURE__ */ jsx8(
|
|
888
846
|
Component,
|
|
889
847
|
{
|
|
890
848
|
ref: mergedRef,
|
|
@@ -959,9 +917,9 @@ var Hint_default = {
|
|
|
959
917
|
};
|
|
960
918
|
|
|
961
919
|
// src/components/hint/Hint.tsx
|
|
962
|
-
import { jsx as
|
|
920
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
963
921
|
function HintRoot({ className, size = "m", invalid, disabled, children, ...rest }) {
|
|
964
|
-
return /* @__PURE__ */
|
|
922
|
+
return /* @__PURE__ */ jsx9(ControlSizeProvider, { value: size, children: /* @__PURE__ */ jsx9(
|
|
965
923
|
"p",
|
|
966
924
|
{
|
|
967
925
|
...rest,
|
|
@@ -977,7 +935,7 @@ function HintRoot({ className, size = "m", invalid, disabled, children, ...rest
|
|
|
977
935
|
}
|
|
978
936
|
HintRoot.displayName = "Hint.Root";
|
|
979
937
|
function HintIcon({ className, ...rest }) {
|
|
980
|
-
return /* @__PURE__ */
|
|
938
|
+
return /* @__PURE__ */ jsx9("span", { "aria-hidden": "true", className: cx(Hint_default.icon, className), ...rest });
|
|
981
939
|
}
|
|
982
940
|
HintIcon.displayName = "Hint.Icon";
|
|
983
941
|
var Hint = { Root: HintRoot, Icon: HintIcon };
|
|
@@ -992,7 +950,7 @@ var Label_default = {
|
|
|
992
950
|
};
|
|
993
951
|
|
|
994
952
|
// src/components/label/Label.tsx
|
|
995
|
-
import { jsx as
|
|
953
|
+
import { jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
996
954
|
var LABEL_LABELS = { optional: "\u043D\u0435\u043E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E" };
|
|
997
955
|
function LabelRoot({
|
|
998
956
|
className,
|
|
@@ -1008,7 +966,7 @@ function LabelRoot({
|
|
|
1008
966
|
const size = useControlSize(sizeProp);
|
|
1009
967
|
return (
|
|
1010
968
|
// biome-ignore lint/a11y/noLabelWithoutControl: field label primitive; association via htmlFor or wrapping control is caller responsibility
|
|
1011
|
-
/* @__PURE__ */
|
|
969
|
+
/* @__PURE__ */ jsx10(
|
|
1012
970
|
"label",
|
|
1013
971
|
{
|
|
1014
972
|
ref,
|
|
@@ -1018,8 +976,8 @@ function LabelRoot({
|
|
|
1018
976
|
...toDataAttributes({ disabled: disabled || void 0, size }),
|
|
1019
977
|
children: /* @__PURE__ */ jsxs4(ControlSizeProvider, { value: size, children: [
|
|
1020
978
|
children,
|
|
1021
|
-
required ? /* @__PURE__ */
|
|
1022
|
-
optional ? /* @__PURE__ */
|
|
979
|
+
required ? /* @__PURE__ */ jsx10("span", { className: Label_default.asterisk, "aria-hidden": "true", children: "*" }) : null,
|
|
980
|
+
optional ? /* @__PURE__ */ jsx10("span", { className: Label_default.optional, children: labels?.optional ?? LABEL_LABELS.optional }) : null
|
|
1023
981
|
] })
|
|
1024
982
|
}
|
|
1025
983
|
)
|
|
@@ -1027,11 +985,11 @@ function LabelRoot({
|
|
|
1027
985
|
}
|
|
1028
986
|
LabelRoot.displayName = "Label.Root";
|
|
1029
987
|
function LabelIcon({ className, ...rest }) {
|
|
1030
|
-
return /* @__PURE__ */
|
|
988
|
+
return /* @__PURE__ */ jsx10("span", { className: cx(Label_default.icon, className), "aria-hidden": "true", ...rest });
|
|
1031
989
|
}
|
|
1032
990
|
LabelIcon.displayName = "Label.Icon";
|
|
1033
991
|
function LabelDescription({ className, ...rest }) {
|
|
1034
|
-
return /* @__PURE__ */
|
|
992
|
+
return /* @__PURE__ */ jsx10("span", { className: cx(Label_default.description, className), ...rest });
|
|
1035
993
|
}
|
|
1036
994
|
LabelDescription.displayName = "Label.Description";
|
|
1037
995
|
var Label = {
|
|
@@ -1041,21 +999,21 @@ var Label = {
|
|
|
1041
999
|
};
|
|
1042
1000
|
|
|
1043
1001
|
// src/components/checkbox/Checkbox.tsx
|
|
1044
|
-
import * as
|
|
1002
|
+
import * as React12 from "react";
|
|
1045
1003
|
|
|
1046
1004
|
// src/hooks/useControllableState.ts
|
|
1047
|
-
import * as
|
|
1005
|
+
import * as React10 from "react";
|
|
1048
1006
|
function useControllableState({
|
|
1049
1007
|
value,
|
|
1050
1008
|
defaultValue,
|
|
1051
1009
|
onChange
|
|
1052
1010
|
}) {
|
|
1053
|
-
const [internalValue, setInternalValue] =
|
|
1011
|
+
const [internalValue, setInternalValue] = React10.useState(defaultValue);
|
|
1054
1012
|
const isControlled = value !== void 0;
|
|
1055
1013
|
const currentValue = isControlled ? value : internalValue;
|
|
1056
|
-
const currentValueRef =
|
|
1014
|
+
const currentValueRef = React10.useRef(currentValue);
|
|
1057
1015
|
currentValueRef.current = currentValue;
|
|
1058
|
-
const setValue =
|
|
1016
|
+
const setValue = React10.useCallback(
|
|
1059
1017
|
(nextValue) => {
|
|
1060
1018
|
const previousValue = currentValueRef.current;
|
|
1061
1019
|
const computedValue = typeof nextValue === "function" ? nextValue(previousValue) : nextValue;
|
|
@@ -1081,7 +1039,7 @@ var CheckMark_default = {
|
|
|
1081
1039
|
};
|
|
1082
1040
|
|
|
1083
1041
|
// src/internal/CheckMark.tsx
|
|
1084
|
-
import { jsx as
|
|
1042
|
+
import { jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1085
1043
|
function CheckMark({ state, className }) {
|
|
1086
1044
|
return /* @__PURE__ */ jsxs5(
|
|
1087
1045
|
"svg",
|
|
@@ -1092,69 +1050,15 @@ function CheckMark({ state, className }) {
|
|
|
1092
1050
|
"aria-hidden": "true",
|
|
1093
1051
|
focusable: "false",
|
|
1094
1052
|
children: [
|
|
1095
|
-
/* @__PURE__ */
|
|
1096
|
-
/* @__PURE__ */
|
|
1053
|
+
/* @__PURE__ */ jsx11("path", { d: "M5.5 12.5l4.25 4.25L18.5 8", pathLength: 1, className: CheckMark_default.check }),
|
|
1054
|
+
/* @__PURE__ */ jsx11("path", { d: "M7 12h10", pathLength: 1, className: CheckMark_default.bar })
|
|
1097
1055
|
]
|
|
1098
1056
|
}
|
|
1099
1057
|
);
|
|
1100
1058
|
}
|
|
1101
1059
|
|
|
1102
|
-
// src/internal/ChoiceField.module.css
|
|
1103
|
-
var ChoiceField_default = {
|
|
1104
|
-
tier: "ChoiceField_tier",
|
|
1105
|
-
field: "ChoiceField_field",
|
|
1106
|
-
row: "ChoiceField_row",
|
|
1107
|
-
controlCell: "ChoiceField_controlCell",
|
|
1108
|
-
input: "ChoiceField_input",
|
|
1109
|
-
text: "ChoiceField_text",
|
|
1110
|
-
support: "ChoiceField_support",
|
|
1111
|
-
visual: "ChoiceField_visual"
|
|
1112
|
-
};
|
|
1113
|
-
|
|
1114
|
-
// src/internal/ChoiceField.tsx
|
|
1115
|
-
import { jsx as jsx13, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1116
|
-
var choiceInputClass = ChoiceField_default.input;
|
|
1117
|
-
var choiceVisualClass = ChoiceField_default.visual;
|
|
1118
|
-
var choiceTierClass = ChoiceField_default.tier;
|
|
1119
|
-
function ChoiceField({
|
|
1120
|
-
ids,
|
|
1121
|
-
size,
|
|
1122
|
-
state,
|
|
1123
|
-
disabled,
|
|
1124
|
-
readOnly = false,
|
|
1125
|
-
hint,
|
|
1126
|
-
error,
|
|
1127
|
-
control,
|
|
1128
|
-
className,
|
|
1129
|
-
children
|
|
1130
|
-
}) {
|
|
1131
|
-
return /* @__PURE__ */ jsx13(ControlSizeProvider, { value: size, children: /* @__PURE__ */ jsxs6(
|
|
1132
|
-
"div",
|
|
1133
|
-
{
|
|
1134
|
-
className: cx(ChoiceField_default.tier, ChoiceField_default.field, className),
|
|
1135
|
-
...toDataAttributes({
|
|
1136
|
-
size,
|
|
1137
|
-
state,
|
|
1138
|
-
invalid: ids.invalid || void 0,
|
|
1139
|
-
disabled: disabled || void 0,
|
|
1140
|
-
readonly: readOnly || void 0
|
|
1141
|
-
}),
|
|
1142
|
-
children: [
|
|
1143
|
-
/* @__PURE__ */ jsxs6("label", { htmlFor: ids.controlId, className: ChoiceField_default.row, children: [
|
|
1144
|
-
/* @__PURE__ */ jsx13("span", { className: cx(ChoiceField_default.controlCell, touchTargetClass), children: control }),
|
|
1145
|
-
children
|
|
1146
|
-
] }),
|
|
1147
|
-
ids.showError ? /* @__PURE__ */ jsx13(Hint.Root, { id: ids.errorId, size, invalid: true, className: ChoiceField_default.support, children: error }) : ids.showHint ? /* @__PURE__ */ jsx13(Hint.Root, { id: ids.hintId, size, disabled, className: ChoiceField_default.support, children: hint }) : null
|
|
1148
|
-
]
|
|
1149
|
-
}
|
|
1150
|
-
) });
|
|
1151
|
-
}
|
|
1152
|
-
function ChoiceLabel({ className, ...rest }) {
|
|
1153
|
-
return /* @__PURE__ */ jsx13("span", { className: cx(ChoiceField_default.text, className), ...rest });
|
|
1154
|
-
}
|
|
1155
|
-
|
|
1156
1060
|
// src/internal/FieldFrame.tsx
|
|
1157
|
-
import * as
|
|
1061
|
+
import * as React11 from "react";
|
|
1158
1062
|
|
|
1159
1063
|
// src/internal/formatLabel.ts
|
|
1160
1064
|
function formatLabel(template, values) {
|
|
@@ -1172,12 +1076,12 @@ var RollingNumber_default = {
|
|
|
1172
1076
|
};
|
|
1173
1077
|
|
|
1174
1078
|
// src/internal/RollingNumber.tsx
|
|
1175
|
-
import { jsx as
|
|
1079
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
1176
1080
|
function RollingNumber({ children, className }) {
|
|
1177
1081
|
const chars = [...String(children)];
|
|
1178
|
-
return /* @__PURE__ */
|
|
1082
|
+
return /* @__PURE__ */ jsx12("span", { className: cx(RollingNumber_default.root, className), children: chars.map((char, i) => {
|
|
1179
1083
|
const key = chars.length - i;
|
|
1180
|
-
return /\d/.test(char) ? /* @__PURE__ */
|
|
1084
|
+
return /\d/.test(char) ? /* @__PURE__ */ jsx12(
|
|
1181
1085
|
"span",
|
|
1182
1086
|
{
|
|
1183
1087
|
className: RollingNumber_default.digit,
|
|
@@ -1185,7 +1089,7 @@ function RollingNumber({ children, className }) {
|
|
|
1185
1089
|
children: char
|
|
1186
1090
|
},
|
|
1187
1091
|
`d${key}`
|
|
1188
|
-
) : /* @__PURE__ */
|
|
1092
|
+
) : /* @__PURE__ */ jsx12("span", { className: RollingNumber_default.char, children: char }, `c${key}`);
|
|
1189
1093
|
}) });
|
|
1190
1094
|
}
|
|
1191
1095
|
|
|
@@ -1198,11 +1102,16 @@ var FieldFrame_default = {
|
|
|
1198
1102
|
body: "FieldFrame_body",
|
|
1199
1103
|
supportText: "FieldFrame_supportText",
|
|
1200
1104
|
support: "FieldFrame_support",
|
|
1201
|
-
|
|
1105
|
+
shakeSelf: "FieldFrame_shakeSelf",
|
|
1106
|
+
"field-shake-odd": "FieldFrame_field-shake-odd",
|
|
1107
|
+
"field-shake-even": "FieldFrame_field-shake-even",
|
|
1108
|
+
counter: "FieldFrame_counter",
|
|
1109
|
+
leaving: "FieldFrame_leaving",
|
|
1110
|
+
"field-error-leave": "FieldFrame_field-error-leave"
|
|
1202
1111
|
};
|
|
1203
1112
|
|
|
1204
1113
|
// src/internal/FieldFrame.tsx
|
|
1205
|
-
import { jsx as
|
|
1114
|
+
import { jsx as jsx13, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1206
1115
|
function hasContent(node) {
|
|
1207
1116
|
return node != null && node !== false && node !== "";
|
|
1208
1117
|
}
|
|
@@ -1212,7 +1121,7 @@ function useFieldFrame(explicitId, {
|
|
|
1212
1121
|
error,
|
|
1213
1122
|
invalid
|
|
1214
1123
|
}, ariaDescribedBy) {
|
|
1215
|
-
const generated =
|
|
1124
|
+
const generated = React11.useId();
|
|
1216
1125
|
const controlId = explicitId ?? generated;
|
|
1217
1126
|
const labelId = `${controlId}-label`;
|
|
1218
1127
|
const hintId = `${controlId}-hint`;
|
|
@@ -1232,6 +1141,25 @@ function useFieldFrame(explicitId, {
|
|
|
1232
1141
|
invalid: Boolean(invalid) || showError
|
|
1233
1142
|
};
|
|
1234
1143
|
}
|
|
1144
|
+
function useErrorShake(invalid, error) {
|
|
1145
|
+
const key = !invalid ? null : typeof error === "string" || typeof error === "number" ? String(error) : "invalid";
|
|
1146
|
+
const previous = React11.useRef(key);
|
|
1147
|
+
const [count, setCount] = React11.useState(0);
|
|
1148
|
+
React11.useEffect(() => {
|
|
1149
|
+
if (key !== null && key !== previous.current) setCount((n) => n + 1);
|
|
1150
|
+
previous.current = key;
|
|
1151
|
+
}, [key]);
|
|
1152
|
+
if (count === 0) return void 0;
|
|
1153
|
+
return count % 2 ? "odd" : "even";
|
|
1154
|
+
}
|
|
1155
|
+
function useLeavingError(showError, error) {
|
|
1156
|
+
const last = React11.useRef(error);
|
|
1157
|
+
if (showError) last.current = error;
|
|
1158
|
+
const presence = usePresence(showError, { exitDuration: "fast" });
|
|
1159
|
+
if (showError || !presence.mounted) return null;
|
|
1160
|
+
return { node: last.current, onExitEnd: presence.onExitEnd };
|
|
1161
|
+
}
|
|
1162
|
+
var leavingErrorClass = FieldFrame_default.leaving;
|
|
1235
1163
|
function FieldFrame({
|
|
1236
1164
|
size,
|
|
1237
1165
|
ids,
|
|
@@ -1251,8 +1179,10 @@ function FieldFrame({
|
|
|
1251
1179
|
...rest
|
|
1252
1180
|
}) {
|
|
1253
1181
|
const { showError, showHint } = ids;
|
|
1254
|
-
const
|
|
1255
|
-
const
|
|
1182
|
+
const leaving = useLeavingError(showError, error);
|
|
1183
|
+
const showSupport = showError || showHint || leaving != null || counter != null || reserveSupportRow;
|
|
1184
|
+
const shake = useErrorShake(ids.invalid, error);
|
|
1185
|
+
const labelNode = hasContent(label) ? /* @__PURE__ */ jsx13(
|
|
1256
1186
|
Label.Root,
|
|
1257
1187
|
{
|
|
1258
1188
|
id: ids.labelId,
|
|
@@ -1266,7 +1196,7 @@ function FieldFrame({
|
|
|
1266
1196
|
children: label
|
|
1267
1197
|
}
|
|
1268
1198
|
) : null;
|
|
1269
|
-
return /* @__PURE__ */
|
|
1199
|
+
return /* @__PURE__ */ jsxs6(
|
|
1270
1200
|
"div",
|
|
1271
1201
|
{
|
|
1272
1202
|
...rest,
|
|
@@ -1274,22 +1204,34 @@ function FieldFrame({
|
|
|
1274
1204
|
...toDataAttributes({
|
|
1275
1205
|
size,
|
|
1276
1206
|
invalid: ids.invalid || void 0,
|
|
1277
|
-
disabled: disabled || void 0
|
|
1207
|
+
disabled: disabled || void 0,
|
|
1208
|
+
shake
|
|
1278
1209
|
}),
|
|
1279
1210
|
children: [
|
|
1280
|
-
labelEnd != null ? /* @__PURE__ */
|
|
1211
|
+
labelEnd != null ? /* @__PURE__ */ jsxs6("div", { className: FieldFrame_default.labelRow, children: [
|
|
1281
1212
|
labelNode,
|
|
1282
|
-
/* @__PURE__ */
|
|
1213
|
+
/* @__PURE__ */ jsx13("span", { className: FieldFrame_default.labelEnd, children: labelEnd })
|
|
1283
1214
|
] }) : labelNode,
|
|
1284
|
-
/* @__PURE__ */
|
|
1215
|
+
/* @__PURE__ */ jsxs6("div", { className: FieldFrame_default.body, children: [
|
|
1285
1216
|
children,
|
|
1286
|
-
showSupport ? /* @__PURE__ */
|
|
1217
|
+
showSupport ? /* @__PURE__ */ jsxs6(
|
|
1287
1218
|
"div",
|
|
1288
1219
|
{
|
|
1289
1220
|
className: FieldFrame_default.support,
|
|
1290
1221
|
...toDataAttributes({ size, reserve: reserveSupportRow || void 0 }),
|
|
1291
1222
|
children: [
|
|
1292
|
-
showError ? /* @__PURE__ */
|
|
1223
|
+
showError ? /* @__PURE__ */ jsx13(Hint.Root, { id: ids.errorId, size, invalid: true, className: FieldFrame_default.supportText, children: error }) : leaving ? /* @__PURE__ */ jsx13(
|
|
1224
|
+
Hint.Root,
|
|
1225
|
+
{
|
|
1226
|
+
size,
|
|
1227
|
+
invalid: true,
|
|
1228
|
+
"aria-hidden": "true",
|
|
1229
|
+
"data-state": "closed",
|
|
1230
|
+
onAnimationEnd: leaving.onExitEnd,
|
|
1231
|
+
className: cx(FieldFrame_default.supportText, FieldFrame_default.leaving),
|
|
1232
|
+
children: leaving.node
|
|
1233
|
+
}
|
|
1234
|
+
) : showHint ? /* @__PURE__ */ jsx13(
|
|
1293
1235
|
Hint.Root,
|
|
1294
1236
|
{
|
|
1295
1237
|
id: ids.hintId,
|
|
@@ -1298,7 +1240,7 @@ function FieldFrame({
|
|
|
1298
1240
|
className: FieldFrame_default.supportText,
|
|
1299
1241
|
children: hint
|
|
1300
1242
|
}
|
|
1301
|
-
) : /* @__PURE__ */
|
|
1243
|
+
) : /* @__PURE__ */ jsx13("span", { className: FieldFrame_default.supportText }),
|
|
1302
1244
|
counter
|
|
1303
1245
|
]
|
|
1304
1246
|
}
|
|
@@ -1309,7 +1251,7 @@ function FieldFrame({
|
|
|
1309
1251
|
);
|
|
1310
1252
|
}
|
|
1311
1253
|
function FieldCounter({ current, max, size, label, className, ...rest }) {
|
|
1312
|
-
return /* @__PURE__ */
|
|
1254
|
+
return /* @__PURE__ */ jsxs6(
|
|
1313
1255
|
"span",
|
|
1314
1256
|
{
|
|
1315
1257
|
...rest,
|
|
@@ -1318,17 +1260,92 @@ function FieldCounter({ current, max, size, label, className, ...rest }) {
|
|
|
1318
1260
|
"data-invalid": current > max || void 0,
|
|
1319
1261
|
"aria-live": "polite",
|
|
1320
1262
|
children: [
|
|
1321
|
-
/* @__PURE__ */
|
|
1322
|
-
/* @__PURE__ */
|
|
1263
|
+
/* @__PURE__ */ jsxs6("span", { "aria-hidden": "true", children: [
|
|
1264
|
+
/* @__PURE__ */ jsx13(RollingNumber, { children: current }),
|
|
1323
1265
|
"/",
|
|
1324
1266
|
max
|
|
1325
1267
|
] }),
|
|
1326
|
-
/* @__PURE__ */
|
|
1268
|
+
/* @__PURE__ */ jsx13(VisuallyHidden, { children: formatLabel(label, { current, max }) })
|
|
1327
1269
|
]
|
|
1328
1270
|
}
|
|
1329
1271
|
);
|
|
1330
1272
|
}
|
|
1331
1273
|
|
|
1274
|
+
// src/internal/ChoiceField.module.css
|
|
1275
|
+
var ChoiceField_default = {
|
|
1276
|
+
tier: "ChoiceField_tier",
|
|
1277
|
+
field: "ChoiceField_field",
|
|
1278
|
+
row: "ChoiceField_row",
|
|
1279
|
+
controlCell: "ChoiceField_controlCell",
|
|
1280
|
+
input: "ChoiceField_input",
|
|
1281
|
+
text: "ChoiceField_text",
|
|
1282
|
+
support: "ChoiceField_support",
|
|
1283
|
+
visual: "ChoiceField_visual"
|
|
1284
|
+
};
|
|
1285
|
+
|
|
1286
|
+
// src/internal/ChoiceField.tsx
|
|
1287
|
+
import { jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1288
|
+
var choiceInputClass = ChoiceField_default.input;
|
|
1289
|
+
var choiceVisualClass = ChoiceField_default.visual;
|
|
1290
|
+
var choiceTierClass = ChoiceField_default.tier;
|
|
1291
|
+
function ChoiceField({
|
|
1292
|
+
ids,
|
|
1293
|
+
size,
|
|
1294
|
+
state,
|
|
1295
|
+
disabled,
|
|
1296
|
+
readOnly = false,
|
|
1297
|
+
hint,
|
|
1298
|
+
error,
|
|
1299
|
+
control,
|
|
1300
|
+
className,
|
|
1301
|
+
children
|
|
1302
|
+
}) {
|
|
1303
|
+
const shake = useErrorShake(ids.invalid, error);
|
|
1304
|
+
const leaving = useLeavingError(ids.showError, error);
|
|
1305
|
+
return /* @__PURE__ */ jsx14(ControlSizeProvider, { value: size, children: /* @__PURE__ */ jsxs7(
|
|
1306
|
+
"div",
|
|
1307
|
+
{
|
|
1308
|
+
className: cx(ChoiceField_default.tier, ChoiceField_default.field, className),
|
|
1309
|
+
...toDataAttributes({
|
|
1310
|
+
size,
|
|
1311
|
+
state,
|
|
1312
|
+
invalid: ids.invalid || void 0,
|
|
1313
|
+
disabled: disabled || void 0,
|
|
1314
|
+
readonly: readOnly || void 0
|
|
1315
|
+
}),
|
|
1316
|
+
children: [
|
|
1317
|
+
/* @__PURE__ */ jsxs7(
|
|
1318
|
+
"label",
|
|
1319
|
+
{
|
|
1320
|
+
htmlFor: ids.controlId,
|
|
1321
|
+
className: cx(ChoiceField_default.row, FieldFrame_default.shakeSelf),
|
|
1322
|
+
"data-shake": shake,
|
|
1323
|
+
children: [
|
|
1324
|
+
/* @__PURE__ */ jsx14("span", { className: cx(ChoiceField_default.controlCell, touchTargetClass), children: control }),
|
|
1325
|
+
children
|
|
1326
|
+
]
|
|
1327
|
+
}
|
|
1328
|
+
),
|
|
1329
|
+
ids.showError ? /* @__PURE__ */ jsx14(Hint.Root, { id: ids.errorId, size, invalid: true, className: ChoiceField_default.support, children: error }) : leaving ? /* @__PURE__ */ jsx14(
|
|
1330
|
+
Hint.Root,
|
|
1331
|
+
{
|
|
1332
|
+
size,
|
|
1333
|
+
invalid: true,
|
|
1334
|
+
"aria-hidden": "true",
|
|
1335
|
+
"data-state": "closed",
|
|
1336
|
+
onAnimationEnd: leaving.onExitEnd,
|
|
1337
|
+
className: cx(ChoiceField_default.support, leavingErrorClass),
|
|
1338
|
+
children: leaving.node
|
|
1339
|
+
}
|
|
1340
|
+
) : ids.showHint ? /* @__PURE__ */ jsx14(Hint.Root, { id: ids.hintId, size, disabled, className: ChoiceField_default.support, children: hint }) : null
|
|
1341
|
+
]
|
|
1342
|
+
}
|
|
1343
|
+
) });
|
|
1344
|
+
}
|
|
1345
|
+
function ChoiceLabel({ className, ...rest }) {
|
|
1346
|
+
return /* @__PURE__ */ jsx14("span", { className: cx(ChoiceField_default.text, className), ...rest });
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1332
1349
|
// src/components/checkbox/Checkbox.module.css
|
|
1333
1350
|
var Checkbox_default = {
|
|
1334
1351
|
root: "Checkbox_root",
|
|
@@ -1337,7 +1354,7 @@ var Checkbox_default = {
|
|
|
1337
1354
|
};
|
|
1338
1355
|
|
|
1339
1356
|
// src/components/checkbox/Checkbox.tsx
|
|
1340
|
-
import { Fragment as Fragment3, jsx as
|
|
1357
|
+
import { Fragment as Fragment3, jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1341
1358
|
function CheckboxRoot({
|
|
1342
1359
|
id,
|
|
1343
1360
|
checked: checkedProp,
|
|
@@ -1363,12 +1380,12 @@ function CheckboxRoot({
|
|
|
1363
1380
|
defaultValue: defaultChecked,
|
|
1364
1381
|
onChange: onCheckedChange
|
|
1365
1382
|
});
|
|
1366
|
-
const internalRef =
|
|
1383
|
+
const internalRef = React12.useRef(null);
|
|
1367
1384
|
const mergedRef = useMergedRefs(internalRef, ref);
|
|
1368
|
-
|
|
1385
|
+
React12.useEffect(() => {
|
|
1369
1386
|
if (internalRef.current) internalRef.current.indeterminate = indeterminate;
|
|
1370
1387
|
}, [indeterminate]);
|
|
1371
|
-
return /* @__PURE__ */
|
|
1388
|
+
return /* @__PURE__ */ jsx15(
|
|
1372
1389
|
ChoiceField,
|
|
1373
1390
|
{
|
|
1374
1391
|
ids,
|
|
@@ -1380,7 +1397,7 @@ function CheckboxRoot({
|
|
|
1380
1397
|
error,
|
|
1381
1398
|
className: cx(Checkbox_default.root, className),
|
|
1382
1399
|
control: /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
1383
|
-
/* @__PURE__ */
|
|
1400
|
+
/* @__PURE__ */ jsx15(
|
|
1384
1401
|
"input",
|
|
1385
1402
|
{
|
|
1386
1403
|
...inputRest,
|
|
@@ -1398,7 +1415,7 @@ function CheckboxRoot({
|
|
|
1398
1415
|
"aria-describedby": ids.describedBy
|
|
1399
1416
|
}
|
|
1400
1417
|
),
|
|
1401
|
-
/* @__PURE__ */
|
|
1418
|
+
/* @__PURE__ */ jsx15("span", { className: cx(choiceVisualClass, Checkbox_default.control), "aria-hidden": "true", children: /* @__PURE__ */ jsx15(
|
|
1402
1419
|
CheckMark,
|
|
1403
1420
|
{
|
|
1404
1421
|
state: indeterminate ? "indeterminate" : checked ? "checked" : "unchecked"
|
|
@@ -1411,7 +1428,7 @@ function CheckboxRoot({
|
|
|
1411
1428
|
}
|
|
1412
1429
|
CheckboxRoot.displayName = "Checkbox.Root";
|
|
1413
1430
|
function CheckboxLabel(props) {
|
|
1414
|
-
return /* @__PURE__ */
|
|
1431
|
+
return /* @__PURE__ */ jsx15(ChoiceLabel, { ...props });
|
|
1415
1432
|
}
|
|
1416
1433
|
CheckboxLabel.displayName = "Checkbox.Label";
|
|
1417
1434
|
function CheckboxIndicator({
|
|
@@ -1423,7 +1440,7 @@ function CheckboxIndicator({
|
|
|
1423
1440
|
...rest
|
|
1424
1441
|
}) {
|
|
1425
1442
|
const size = useControlSize(sizeProp);
|
|
1426
|
-
return /* @__PURE__ */
|
|
1443
|
+
return /* @__PURE__ */ jsx15(
|
|
1427
1444
|
"span",
|
|
1428
1445
|
{
|
|
1429
1446
|
"aria-hidden": "true",
|
|
@@ -1440,7 +1457,7 @@ function CheckboxIndicator({
|
|
|
1440
1457
|
disabled: disabled || void 0
|
|
1441
1458
|
}),
|
|
1442
1459
|
...rest,
|
|
1443
|
-
children: /* @__PURE__ */
|
|
1460
|
+
children: /* @__PURE__ */ jsx15(CheckMark, { state: indeterminate ? "indeterminate" : checked ? "checked" : "unchecked" })
|
|
1444
1461
|
}
|
|
1445
1462
|
);
|
|
1446
1463
|
}
|
|
@@ -1452,7 +1469,7 @@ var Checkbox = {
|
|
|
1452
1469
|
};
|
|
1453
1470
|
|
|
1454
1471
|
// src/internal/swatch.tsx
|
|
1455
|
-
import * as
|
|
1472
|
+
import * as React13 from "react";
|
|
1456
1473
|
|
|
1457
1474
|
// src/internal/swatch.module.css
|
|
1458
1475
|
var swatch_default = {
|
|
@@ -1465,7 +1482,7 @@ var swatch_default = {
|
|
|
1465
1482
|
};
|
|
1466
1483
|
|
|
1467
1484
|
// src/internal/swatch.tsx
|
|
1468
|
-
import { Fragment as Fragment4, jsx as
|
|
1485
|
+
import { Fragment as Fragment4, jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1469
1486
|
var COLOR_PRESETS = [
|
|
1470
1487
|
{ value: "#ef4444", label: "\u041A\u0440\u0430\u0441\u043D\u044B\u0439" },
|
|
1471
1488
|
{ value: "#f97316", label: "\u041E\u0440\u0430\u043D\u0436\u0435\u0432\u044B\u0439" },
|
|
@@ -1485,7 +1502,7 @@ var COLOR_PRESETS = [
|
|
|
1485
1502
|
{ value: "#be185d", label: "\u0422\u0451\u043C\u043D\u043E-\u0440\u043E\u0437\u043E\u0432\u044B\u0439" }
|
|
1486
1503
|
];
|
|
1487
1504
|
function useSwatchOptions(presets, allowEmpty, emptyLabel) {
|
|
1488
|
-
return
|
|
1505
|
+
return React13.useMemo(
|
|
1489
1506
|
() => [
|
|
1490
1507
|
...presets.map((preset) => ({ ...preset, contrast: markContrast(preset.value) })),
|
|
1491
1508
|
...allowEmpty ? [{ value: null, label: emptyLabel, contrast: "dark" }] : []
|
|
@@ -1496,17 +1513,17 @@ function useSwatchOptions(presets, allowEmpty, emptyLabel) {
|
|
|
1496
1513
|
var swatchClass = swatch_default.swatch;
|
|
1497
1514
|
var swatchTierClass = swatch_default.tier;
|
|
1498
1515
|
function SwatchFill({ value }) {
|
|
1499
|
-
if (value == null) return /* @__PURE__ */
|
|
1500
|
-
return /* @__PURE__ */
|
|
1516
|
+
if (value == null) return /* @__PURE__ */ jsx16("span", { "aria-hidden": true, className: swatch_default.checker });
|
|
1517
|
+
return /* @__PURE__ */ jsx16("svg", { className: swatch_default.fill, "aria-hidden": "true", viewBox: "0 0 1 1", preserveAspectRatio: "none", children: /* @__PURE__ */ jsx16("rect", { width: "1", height: "1", fill: value }) });
|
|
1501
1518
|
}
|
|
1502
1519
|
function SwatchContent({ value, selected }) {
|
|
1503
1520
|
return /* @__PURE__ */ jsxs9(Fragment4, { children: [
|
|
1504
|
-
/* @__PURE__ */
|
|
1505
|
-
/* @__PURE__ */
|
|
1521
|
+
/* @__PURE__ */ jsx16(SwatchFill, { value }),
|
|
1522
|
+
/* @__PURE__ */ jsx16(CheckMark, { state: selected ? "checked" : "unchecked", className: swatch_default.check })
|
|
1506
1523
|
] });
|
|
1507
1524
|
}
|
|
1508
1525
|
function SwatchChip({ value, className, ...rest }) {
|
|
1509
|
-
return /* @__PURE__ */
|
|
1526
|
+
return /* @__PURE__ */ jsx16("span", { ...rest, "aria-hidden": true, className: cx(swatch_default.chip, className), children: /* @__PURE__ */ jsx16(SwatchFill, { value }) });
|
|
1510
1527
|
}
|
|
1511
1528
|
function sameColor(a, b) {
|
|
1512
1529
|
return (a ?? "").trim().toLowerCase() === (b ?? "").trim().toLowerCase();
|
|
@@ -1550,7 +1567,7 @@ function markContrast(value) {
|
|
|
1550
1567
|
}
|
|
1551
1568
|
|
|
1552
1569
|
// src/components/color-swatches/ColorSwatches.tsx
|
|
1553
|
-
import * as
|
|
1570
|
+
import * as React14 from "react";
|
|
1554
1571
|
|
|
1555
1572
|
// src/internal/rovingFocus.ts
|
|
1556
1573
|
var PREV = {
|
|
@@ -1599,7 +1616,7 @@ var ColorSwatches_default = {
|
|
|
1599
1616
|
};
|
|
1600
1617
|
|
|
1601
1618
|
// src/components/color-swatches/ColorSwatches.tsx
|
|
1602
|
-
import { jsx as
|
|
1619
|
+
import { jsx as jsx17, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1603
1620
|
var COLOR_SWATCHES_LABELS = {
|
|
1604
1621
|
group: "\u0426\u0432\u0435\u0442",
|
|
1605
1622
|
empty: "\u0411\u0435\u0437 \u0446\u0432\u0435\u0442\u0430",
|
|
@@ -1644,7 +1661,7 @@ function ColorSwatches({
|
|
|
1644
1661
|
const options = useSwatchOptions(presets, allowEmpty, labels.empty);
|
|
1645
1662
|
const selectedIndex = options.findIndex((option) => sameColor(option.value, value));
|
|
1646
1663
|
const focusIndex = Math.max(0, selectedIndex);
|
|
1647
|
-
const itemRefs =
|
|
1664
|
+
const itemRefs = React14.useRef([]);
|
|
1648
1665
|
const labelledBy = ariaLabelledBy ?? ids.labelledBy;
|
|
1649
1666
|
const onKeyDown2 = (event) => {
|
|
1650
1667
|
const current = itemRefs.current.indexOf(document.activeElement);
|
|
@@ -1659,7 +1676,7 @@ function ColorSwatches({
|
|
|
1659
1676
|
setValue(options[next].value);
|
|
1660
1677
|
itemRefs.current[next]?.focus();
|
|
1661
1678
|
};
|
|
1662
|
-
return /* @__PURE__ */
|
|
1679
|
+
return /* @__PURE__ */ jsx17(
|
|
1663
1680
|
FieldFrame,
|
|
1664
1681
|
{
|
|
1665
1682
|
...rest,
|
|
@@ -1696,7 +1713,7 @@ function ColorSwatches({
|
|
|
1696
1713
|
const selected = index === selectedIndex;
|
|
1697
1714
|
return (
|
|
1698
1715
|
// biome-ignore lint/a11y/useSemanticElements: a swatch is a styled button in a roving radiogroup; a native radio cannot carry the color fill and check mark
|
|
1699
|
-
/* @__PURE__ */
|
|
1716
|
+
/* @__PURE__ */ jsx17(
|
|
1700
1717
|
"button",
|
|
1701
1718
|
{
|
|
1702
1719
|
ref: (el) => {
|
|
@@ -1715,13 +1732,13 @@ function ColorSwatches({
|
|
|
1715
1732
|
contrast: option.contrast
|
|
1716
1733
|
}),
|
|
1717
1734
|
onClick: () => setValue(option.value),
|
|
1718
|
-
children: /* @__PURE__ */
|
|
1735
|
+
children: /* @__PURE__ */ jsx17(SwatchContent, { value: option.value, selected })
|
|
1719
1736
|
},
|
|
1720
1737
|
option.value ?? "empty"
|
|
1721
1738
|
)
|
|
1722
1739
|
);
|
|
1723
1740
|
}),
|
|
1724
|
-
name ? /* @__PURE__ */
|
|
1741
|
+
name ? /* @__PURE__ */ jsx17("input", { type: "hidden", name, value: value ?? "" }) : null
|
|
1725
1742
|
]
|
|
1726
1743
|
}
|
|
1727
1744
|
)
|
|
@@ -1739,7 +1756,7 @@ var EmptyPage_default = {
|
|
|
1739
1756
|
};
|
|
1740
1757
|
|
|
1741
1758
|
// src/components/empty-page/EmptyPage.tsx
|
|
1742
|
-
import { jsx as
|
|
1759
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1743
1760
|
function EmptyPageRoot({
|
|
1744
1761
|
size = "m",
|
|
1745
1762
|
layout = "default",
|
|
@@ -1747,31 +1764,31 @@ function EmptyPageRoot({
|
|
|
1747
1764
|
children,
|
|
1748
1765
|
...rest
|
|
1749
1766
|
}) {
|
|
1750
|
-
return /* @__PURE__ */
|
|
1767
|
+
return /* @__PURE__ */ jsx18(
|
|
1751
1768
|
"div",
|
|
1752
1769
|
{
|
|
1753
1770
|
className: cx(EmptyPage_default.root, layout !== "compact" && enterMotion_default.enterBaseChildren, className),
|
|
1754
1771
|
...rest,
|
|
1755
1772
|
...toDataAttributes({ size, layout: layout === "default" ? void 0 : layout }),
|
|
1756
|
-
children: /* @__PURE__ */
|
|
1773
|
+
children: /* @__PURE__ */ jsx18(ControlSizeProvider, { value: size, children })
|
|
1757
1774
|
}
|
|
1758
1775
|
);
|
|
1759
1776
|
}
|
|
1760
1777
|
EmptyPageRoot.displayName = "EmptyPage.Root";
|
|
1761
1778
|
function EmptyPageIcon({ tone = "neutral", className, ...rest }) {
|
|
1762
|
-
return /* @__PURE__ */
|
|
1779
|
+
return /* @__PURE__ */ jsx18("div", { className: cx(EmptyPage_default.iconWrap, className), "data-tone": tone, ...rest });
|
|
1763
1780
|
}
|
|
1764
1781
|
EmptyPageIcon.displayName = "EmptyPage.Icon";
|
|
1765
1782
|
function EmptyPageTitle({ as: Tag = "h2", className, ref, ...rest }) {
|
|
1766
|
-
return /* @__PURE__ */
|
|
1783
|
+
return /* @__PURE__ */ jsx18(Tag, { ref, className: cx(EmptyPage_default.title, className), ...rest });
|
|
1767
1784
|
}
|
|
1768
1785
|
EmptyPageTitle.displayName = "EmptyPage.Title";
|
|
1769
1786
|
function EmptyPageDescription({ className, ...rest }) {
|
|
1770
|
-
return /* @__PURE__ */
|
|
1787
|
+
return /* @__PURE__ */ jsx18("p", { className: cx(EmptyPage_default.description, className), ...rest });
|
|
1771
1788
|
}
|
|
1772
1789
|
EmptyPageDescription.displayName = "EmptyPage.Description";
|
|
1773
1790
|
function EmptyPageActions({ className, ...rest }) {
|
|
1774
|
-
return /* @__PURE__ */
|
|
1791
|
+
return /* @__PURE__ */ jsx18("div", { className: cx(EmptyPage_default.actions, className), ...rest });
|
|
1775
1792
|
}
|
|
1776
1793
|
EmptyPageActions.displayName = "EmptyPage.Actions";
|
|
1777
1794
|
var EmptyPage = {
|
|
@@ -1783,7 +1800,7 @@ var EmptyPage = {
|
|
|
1783
1800
|
};
|
|
1784
1801
|
|
|
1785
1802
|
// src/components/progress-bar/ProgressBar.tsx
|
|
1786
|
-
import * as
|
|
1803
|
+
import * as React15 from "react";
|
|
1787
1804
|
|
|
1788
1805
|
// src/internal/progressSegments.ts
|
|
1789
1806
|
function resolveValue(value, max) {
|
|
@@ -1841,13 +1858,13 @@ var ProgressBar_default = {
|
|
|
1841
1858
|
};
|
|
1842
1859
|
|
|
1843
1860
|
// src/components/progress-bar/ProgressBar.tsx
|
|
1844
|
-
import { Fragment as Fragment5, jsx as
|
|
1861
|
+
import { Fragment as Fragment5, jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1845
1862
|
var MIN_STEPS = 2;
|
|
1846
1863
|
var MAX_STEPS = 12;
|
|
1847
1864
|
function useStepOrder(filled, count) {
|
|
1848
|
-
const prev =
|
|
1865
|
+
const prev = React15.useRef(filled);
|
|
1849
1866
|
const from = prev.current;
|
|
1850
|
-
|
|
1867
|
+
React15.useEffect(() => {
|
|
1851
1868
|
prev.current = filled;
|
|
1852
1869
|
}, [filled]);
|
|
1853
1870
|
return Array.from(
|
|
@@ -1871,8 +1888,8 @@ function ProgressBar(props) {
|
|
|
1871
1888
|
"aria-label": ariaLabel,
|
|
1872
1889
|
...rest
|
|
1873
1890
|
} = props;
|
|
1874
|
-
const labelId =
|
|
1875
|
-
const descriptionId =
|
|
1891
|
+
const labelId = React15.useId();
|
|
1892
|
+
const descriptionId = React15.useId();
|
|
1876
1893
|
const stepResolved = !segmentsProp && steps ? resolveValue(valueProp ?? 0, maxProp) : null;
|
|
1877
1894
|
const stepCount = stepResolved ? Math.min(MAX_STEPS, Math.max(MIN_STEPS, Math.round(stepResolved.max))) : 0;
|
|
1878
1895
|
const stepFilled = stepResolved ? Math.round(stepResolved.value / stepResolved.max * stepCount) : 0;
|
|
@@ -1894,7 +1911,7 @@ function ProgressBar(props) {
|
|
|
1894
1911
|
"aria-describedby": descriptionId
|
|
1895
1912
|
} : { "aria-label": text };
|
|
1896
1913
|
bar = /* @__PURE__ */ jsxs11(Fragment5, { children: [
|
|
1897
|
-
named ? /* @__PURE__ */
|
|
1914
|
+
named ? /* @__PURE__ */ jsx19(VisuallyHidden, { id: descriptionId, children: text }) : null,
|
|
1898
1915
|
/* @__PURE__ */ jsxs11(
|
|
1899
1916
|
"div",
|
|
1900
1917
|
{
|
|
@@ -1903,7 +1920,7 @@ function ProgressBar(props) {
|
|
|
1903
1920
|
...a11y,
|
|
1904
1921
|
...toDataAttributes({ "segment-gap": segmentGap }),
|
|
1905
1922
|
children: [
|
|
1906
|
-
total > 0 ? /* @__PURE__ */
|
|
1923
|
+
total > 0 ? /* @__PURE__ */ jsx19("span", { className: ProgressBar_default.segments, style: { flexGrow: total }, children: segments.map((seg, i) => /* @__PURE__ */ jsx19(
|
|
1907
1924
|
"span",
|
|
1908
1925
|
{
|
|
1909
1926
|
className: ProgressBar_default.segment,
|
|
@@ -1913,7 +1930,7 @@ function ProgressBar(props) {
|
|
|
1913
1930
|
},
|
|
1914
1931
|
i
|
|
1915
1932
|
)) }) : null,
|
|
1916
|
-
free > 0 || total === 0 ? /* @__PURE__ */
|
|
1933
|
+
free > 0 || total === 0 ? /* @__PURE__ */ jsx19("span", { className: ProgressBar_default.rest, style: { flexGrow: free > 0 ? free : 1 } }) : null
|
|
1917
1934
|
]
|
|
1918
1935
|
}
|
|
1919
1936
|
)
|
|
@@ -1924,7 +1941,7 @@ function ProgressBar(props) {
|
|
|
1924
1941
|
percent = resolved.percent;
|
|
1925
1942
|
tone = toneProp ?? "accent";
|
|
1926
1943
|
bar = /* @__PURE__ */ jsxs11(Fragment5, { children: [
|
|
1927
|
-
/* @__PURE__ */
|
|
1944
|
+
/* @__PURE__ */ jsx19(
|
|
1928
1945
|
"progress",
|
|
1929
1946
|
{
|
|
1930
1947
|
value,
|
|
@@ -1934,7 +1951,7 @@ function ProgressBar(props) {
|
|
|
1934
1951
|
className: ProgressBar_default.native
|
|
1935
1952
|
}
|
|
1936
1953
|
),
|
|
1937
|
-
steps ? /* @__PURE__ */
|
|
1954
|
+
steps ? /* @__PURE__ */ jsx19("span", { className: ProgressBar_default.bar, "aria-hidden": "true", "data-steps": "true", children: stepOrder.map((order, i) => /* @__PURE__ */ jsx19(
|
|
1938
1955
|
"span",
|
|
1939
1956
|
{
|
|
1940
1957
|
className: ProgressBar_default.step,
|
|
@@ -1942,20 +1959,20 @@ function ProgressBar(props) {
|
|
|
1942
1959
|
style: { "--pb-step-order": order }
|
|
1943
1960
|
},
|
|
1944
1961
|
i
|
|
1945
|
-
)) }) : /* @__PURE__ */
|
|
1962
|
+
)) }) : /* @__PURE__ */ jsx19(
|
|
1946
1963
|
"span",
|
|
1947
1964
|
{
|
|
1948
1965
|
className: ProgressBar_default.bar,
|
|
1949
1966
|
"aria-hidden": "true",
|
|
1950
1967
|
style: { "--pb-ratio": resolved.ratio },
|
|
1951
|
-
children: /* @__PURE__ */
|
|
1968
|
+
children: /* @__PURE__ */ jsx19("span", { className: ProgressBar_default.fill })
|
|
1952
1969
|
}
|
|
1953
1970
|
)
|
|
1954
1971
|
] });
|
|
1955
1972
|
}
|
|
1956
1973
|
return /* @__PURE__ */ jsxs11("div", { className: cx(ProgressBar_default.root, className), ...rest, ...toDataAttributes({ size, tone }), children: [
|
|
1957
1974
|
label || showValue ? /* @__PURE__ */ jsxs11("div", { className: ProgressBar_default.header, children: [
|
|
1958
|
-
label ? /* @__PURE__ */
|
|
1975
|
+
label ? /* @__PURE__ */ jsx19("span", { className: ProgressBar_default.label, id: labelId, children: label }) : null,
|
|
1959
1976
|
showValue ? /* @__PURE__ */ jsxs11("span", { className: ProgressBar_default.value, "aria-hidden": "true", children: [
|
|
1960
1977
|
percent,
|
|
1961
1978
|
"%"
|
|
@@ -1975,15 +1992,15 @@ function getPasswordStrength(value) {
|
|
|
1975
1992
|
}
|
|
1976
1993
|
|
|
1977
1994
|
// src/components/input/Input.tsx
|
|
1978
|
-
import * as
|
|
1995
|
+
import * as React17 from "react";
|
|
1979
1996
|
|
|
1980
1997
|
// src/internal/context.ts
|
|
1981
|
-
import * as
|
|
1998
|
+
import * as React16 from "react";
|
|
1982
1999
|
function createComponentContext(displayName) {
|
|
1983
|
-
const Ctx =
|
|
2000
|
+
const Ctx = React16.createContext(null);
|
|
1984
2001
|
Ctx.displayName = `${displayName}Context`;
|
|
1985
2002
|
function useComponentContext() {
|
|
1986
|
-
const value =
|
|
2003
|
+
const value = React16.useContext(Ctx);
|
|
1987
2004
|
if (value === null) {
|
|
1988
2005
|
throw new Error(
|
|
1989
2006
|
`[prime-ui-kit] \`${displayName}\` sub-component must be used inside \`${displayName}.Root\`.`
|
|
@@ -2007,7 +2024,7 @@ var Input_default = {
|
|
|
2007
2024
|
};
|
|
2008
2025
|
|
|
2009
2026
|
// src/components/input/Input.tsx
|
|
2010
|
-
import { Fragment as Fragment6, jsx as
|
|
2027
|
+
import { Fragment as Fragment6, jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2011
2028
|
var INPUT_LABELS = {
|
|
2012
2029
|
optional: "\u043D\u0435\u043E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E",
|
|
2013
2030
|
clear: "\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C",
|
|
@@ -2044,13 +2061,13 @@ function InputRoot({
|
|
|
2044
2061
|
className,
|
|
2045
2062
|
...rest
|
|
2046
2063
|
}) {
|
|
2047
|
-
const [strengthValue, setStrengthValue] =
|
|
2064
|
+
const [strengthValue, setStrengthValue] = React17.useState("");
|
|
2048
2065
|
const size = useControlSize(sizeProp);
|
|
2049
2066
|
const ids = useFieldFrame(id, { label, hint, error, invalid });
|
|
2050
|
-
const labels =
|
|
2067
|
+
const labels = React17.useMemo(() => ({ ...INPUT_LABELS, ...labelsProp }), [labelsProp]);
|
|
2051
2068
|
const { invalid: isInvalid, controlId: inputId, describedBy } = ids;
|
|
2052
|
-
const inputRef =
|
|
2053
|
-
const contextValue =
|
|
2069
|
+
const inputRef = React17.useRef(null);
|
|
2070
|
+
const contextValue = React17.useMemo(
|
|
2054
2071
|
() => ({
|
|
2055
2072
|
size,
|
|
2056
2073
|
invalid: isInvalid,
|
|
@@ -2066,7 +2083,7 @@ function InputRoot({
|
|
|
2066
2083
|
);
|
|
2067
2084
|
const level = strength ? getStrength(strengthValue) : 0;
|
|
2068
2085
|
const levelWord = level ? [labels.strengthWeak, labels.strengthEasy, labels.strengthMedium, labels.strengthHard][level - 1] : "";
|
|
2069
|
-
return /* @__PURE__ */
|
|
2086
|
+
return /* @__PURE__ */ jsx20(InputProvider, { value: contextValue, children: /* @__PURE__ */ jsx20(ControlSizeProvider, { value: size, children: /* @__PURE__ */ jsxs12(
|
|
2070
2087
|
FieldFrame,
|
|
2071
2088
|
{
|
|
2072
2089
|
...rest,
|
|
@@ -2078,15 +2095,15 @@ function InputRoot({
|
|
|
2078
2095
|
hint,
|
|
2079
2096
|
error,
|
|
2080
2097
|
counter: strength ? /* @__PURE__ */ jsxs12(Fragment6, { children: [
|
|
2081
|
-
/* @__PURE__ */
|
|
2098
|
+
/* @__PURE__ */ jsx20(
|
|
2082
2099
|
"span",
|
|
2083
2100
|
{
|
|
2084
2101
|
className: Input_default.strengthWord,
|
|
2085
2102
|
"data-tone": level ? STRENGTH_TONES[level] : void 0,
|
|
2086
2103
|
"aria-live": "polite",
|
|
2087
2104
|
children: levelWord ? /* @__PURE__ */ jsxs12(Fragment6, { children: [
|
|
2088
|
-
/* @__PURE__ */
|
|
2089
|
-
/* @__PURE__ */
|
|
2105
|
+
/* @__PURE__ */ jsx20(VisuallyHidden, { children: `${labels.strength}: ` }),
|
|
2106
|
+
/* @__PURE__ */ jsx20(MorphText, { children: levelWord })
|
|
2090
2107
|
] }) : null
|
|
2091
2108
|
}
|
|
2092
2109
|
),
|
|
@@ -2097,7 +2114,7 @@ function InputRoot({
|
|
|
2097
2114
|
className: cx(fieldTierClass, Input_default.root, className),
|
|
2098
2115
|
children: [
|
|
2099
2116
|
children,
|
|
2100
|
-
strength ? /* @__PURE__ */
|
|
2117
|
+
strength ? /* @__PURE__ */ jsx20(
|
|
2101
2118
|
ProgressBar,
|
|
2102
2119
|
{
|
|
2103
2120
|
steps: true,
|
|
@@ -2115,7 +2132,7 @@ function InputRoot({
|
|
|
2115
2132
|
InputRoot.displayName = "Input.Root";
|
|
2116
2133
|
function InputWrapper({ children, className, ...rest }) {
|
|
2117
2134
|
const { size, invalid, focusRing } = useInputContext();
|
|
2118
|
-
return /* @__PURE__ */
|
|
2135
|
+
return /* @__PURE__ */ jsx20(
|
|
2119
2136
|
"div",
|
|
2120
2137
|
{
|
|
2121
2138
|
...rest,
|
|
@@ -2149,13 +2166,13 @@ function InputField({
|
|
|
2149
2166
|
} = useInputContext();
|
|
2150
2167
|
const setRefs = useMergedRefs(inputRef, ref);
|
|
2151
2168
|
const controlled = rest.value;
|
|
2152
|
-
|
|
2169
|
+
React17.useEffect(() => {
|
|
2153
2170
|
if (!reportValue) return;
|
|
2154
2171
|
if (controlled !== void 0) reportValue(String(controlled));
|
|
2155
2172
|
else if (inputRef.current) reportValue(inputRef.current.value);
|
|
2156
2173
|
}, [reportValue, controlled, inputRef]);
|
|
2157
2174
|
const resolvedDescribedBy = [ariaDescribedBy, describedBy].filter(Boolean).join(" ") || void 0;
|
|
2158
|
-
return /* @__PURE__ */
|
|
2175
|
+
return /* @__PURE__ */ jsx20(
|
|
2159
2176
|
"input",
|
|
2160
2177
|
{
|
|
2161
2178
|
...rest,
|
|
@@ -2175,15 +2192,15 @@ function InputField({
|
|
|
2175
2192
|
}
|
|
2176
2193
|
InputField.displayName = "Input.Field";
|
|
2177
2194
|
function InputIcon({ side, children, className, ...rest }) {
|
|
2178
|
-
return /* @__PURE__ */
|
|
2195
|
+
return /* @__PURE__ */ jsx20("span", { ...rest, className: cx(Input_default.icon, className), "data-side": side, "aria-hidden": "true", children });
|
|
2179
2196
|
}
|
|
2180
2197
|
InputIcon.displayName = "Input.Icon";
|
|
2181
2198
|
function InputAffix({ side, children, className, ...rest }) {
|
|
2182
|
-
return /* @__PURE__ */
|
|
2199
|
+
return /* @__PURE__ */ jsx20("div", { ...rest, className: cx(Input_default.affix, className), "data-side": side, "aria-hidden": "true", children });
|
|
2183
2200
|
}
|
|
2184
2201
|
InputAffix.displayName = "Input.Affix";
|
|
2185
2202
|
function InputInlineAffix({ side, children, className, ...rest }) {
|
|
2186
|
-
return /* @__PURE__ */
|
|
2203
|
+
return /* @__PURE__ */ jsx20(
|
|
2187
2204
|
"span",
|
|
2188
2205
|
{
|
|
2189
2206
|
...rest,
|
|
@@ -2197,7 +2214,7 @@ function InputInlineAffix({ side, children, className, ...rest }) {
|
|
|
2197
2214
|
InputInlineAffix.displayName = "Input.InlineAffix";
|
|
2198
2215
|
function InputClearButton({ className, onClick: onClick2, ref, ...rest }) {
|
|
2199
2216
|
const { inputId, inputRef, labels } = useInputContext();
|
|
2200
|
-
return /* @__PURE__ */
|
|
2217
|
+
return /* @__PURE__ */ jsx20(
|
|
2201
2218
|
"button",
|
|
2202
2219
|
{
|
|
2203
2220
|
...rest,
|
|
@@ -2210,14 +2227,14 @@ function InputClearButton({ className, onClick: onClick2, ref, ...rest }) {
|
|
|
2210
2227
|
onClick2?.(event);
|
|
2211
2228
|
if (!event.defaultPrevented) inputRef.current?.focus();
|
|
2212
2229
|
},
|
|
2213
|
-
children: /* @__PURE__ */
|
|
2230
|
+
children: /* @__PURE__ */ jsx20(Icon, { name: "action.close" })
|
|
2214
2231
|
}
|
|
2215
2232
|
);
|
|
2216
2233
|
}
|
|
2217
2234
|
InputClearButton.displayName = "Input.ClearButton";
|
|
2218
2235
|
function InputCounter(props) {
|
|
2219
2236
|
const { size, labels } = useInputContext();
|
|
2220
|
-
return /* @__PURE__ */
|
|
2237
|
+
return /* @__PURE__ */ jsx20(FieldCounter, { ...props, size, label: labels.counter });
|
|
2221
2238
|
}
|
|
2222
2239
|
InputCounter.displayName = "Input.Counter";
|
|
2223
2240
|
var Input = {
|
|
@@ -2232,17 +2249,17 @@ var Input = {
|
|
|
2232
2249
|
};
|
|
2233
2250
|
|
|
2234
2251
|
// src/internal/imageSlot.tsx
|
|
2235
|
-
import * as
|
|
2252
|
+
import * as React19 from "react";
|
|
2236
2253
|
|
|
2237
2254
|
// src/hooks/useImageStatus.ts
|
|
2238
|
-
import * as
|
|
2255
|
+
import * as React18 from "react";
|
|
2239
2256
|
function useImageStatus(report, { onLoad, onError } = {}) {
|
|
2240
|
-
const [status, setStatus] =
|
|
2241
|
-
|
|
2257
|
+
const [status, setStatus] = React18.useState("loading");
|
|
2258
|
+
React18.useLayoutEffect(() => {
|
|
2242
2259
|
report("loading");
|
|
2243
2260
|
return () => report("idle");
|
|
2244
2261
|
}, [report]);
|
|
2245
|
-
const handleLoad =
|
|
2262
|
+
const handleLoad = React18.useCallback(
|
|
2246
2263
|
(event) => {
|
|
2247
2264
|
setStatus("loaded");
|
|
2248
2265
|
report("loaded");
|
|
@@ -2250,7 +2267,7 @@ function useImageStatus(report, { onLoad, onError } = {}) {
|
|
|
2250
2267
|
},
|
|
2251
2268
|
[onLoad, report]
|
|
2252
2269
|
);
|
|
2253
|
-
const handleError =
|
|
2270
|
+
const handleError = React18.useCallback(
|
|
2254
2271
|
(event) => {
|
|
2255
2272
|
setStatus("error");
|
|
2256
2273
|
report("error");
|
|
@@ -2262,18 +2279,18 @@ function useImageStatus(report, { onLoad, onError } = {}) {
|
|
|
2262
2279
|
}
|
|
2263
2280
|
|
|
2264
2281
|
// src/internal/imageSlot.tsx
|
|
2265
|
-
import { jsx as
|
|
2282
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
2266
2283
|
function createImageSlot(name, classNames) {
|
|
2267
2284
|
const [Provider, useSlotContext] = createComponentContext(name);
|
|
2268
2285
|
function ImageSlotProvider({ children }) {
|
|
2269
|
-
const [imageStatus, setImageStatus] =
|
|
2270
|
-
const value =
|
|
2271
|
-
return /* @__PURE__ */
|
|
2286
|
+
const [imageStatus, setImageStatus] = React19.useState("idle");
|
|
2287
|
+
const value = React19.useMemo(() => ({ imageStatus, setImageStatus }), [imageStatus]);
|
|
2288
|
+
return /* @__PURE__ */ jsx21(Provider, { value, children });
|
|
2272
2289
|
}
|
|
2273
2290
|
function ImageInner({ src, alt = "", className, onLoad, onError, ...rest }) {
|
|
2274
2291
|
const { setImageStatus } = useSlotContext();
|
|
2275
2292
|
const image = useImageStatus(setImageStatus, { onLoad, onError });
|
|
2276
|
-
return /* @__PURE__ */
|
|
2293
|
+
return /* @__PURE__ */ jsx21(
|
|
2277
2294
|
"img",
|
|
2278
2295
|
{
|
|
2279
2296
|
src,
|
|
@@ -2287,12 +2304,12 @@ function createImageSlot(name, classNames) {
|
|
|
2287
2304
|
);
|
|
2288
2305
|
}
|
|
2289
2306
|
function Image2(props) {
|
|
2290
|
-
return /* @__PURE__ */
|
|
2307
|
+
return /* @__PURE__ */ jsx21(ImageInner, { ...props }, props.src);
|
|
2291
2308
|
}
|
|
2292
2309
|
Image2.displayName = `${name}.Image`;
|
|
2293
2310
|
function Fallback({ className, ...rest }) {
|
|
2294
2311
|
const { imageStatus } = useSlotContext();
|
|
2295
|
-
return /* @__PURE__ */
|
|
2312
|
+
return /* @__PURE__ */ jsx21(
|
|
2296
2313
|
"span",
|
|
2297
2314
|
{
|
|
2298
2315
|
className: cx(classNames.fallback, className),
|
|
@@ -2323,7 +2340,7 @@ var Thumbnail_default = {
|
|
|
2323
2340
|
};
|
|
2324
2341
|
|
|
2325
2342
|
// src/components/thumbnail/Thumbnail.tsx
|
|
2326
|
-
import { jsx as
|
|
2343
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
2327
2344
|
var slot = createImageSlot("Thumbnail", { image: Thumbnail_default.image, fallback: Thumbnail_default.fallback });
|
|
2328
2345
|
function ThumbnailRoot({
|
|
2329
2346
|
size = "m",
|
|
@@ -2336,7 +2353,7 @@ function ThumbnailRoot({
|
|
|
2336
2353
|
children,
|
|
2337
2354
|
...rest
|
|
2338
2355
|
}) {
|
|
2339
|
-
return /* @__PURE__ */
|
|
2356
|
+
return /* @__PURE__ */ jsx22(slot.ImageSlotProvider, { children: /* @__PURE__ */ jsx22(
|
|
2340
2357
|
"div",
|
|
2341
2358
|
{
|
|
2342
2359
|
className: cx(Thumbnail_default.root, palette_default.hue, className),
|
|
@@ -2355,7 +2372,7 @@ function ThumbnailRoot({
|
|
|
2355
2372
|
}
|
|
2356
2373
|
ThumbnailRoot.displayName = "Thumbnail.Root";
|
|
2357
2374
|
function ThumbnailImage({ fit = "cover", ...rest }) {
|
|
2358
|
-
return /* @__PURE__ */
|
|
2375
|
+
return /* @__PURE__ */ jsx22(slot.Image, { ...rest, "data-fit": fit });
|
|
2359
2376
|
}
|
|
2360
2377
|
ThumbnailImage.displayName = "Thumbnail.Image";
|
|
2361
2378
|
var ThumbnailFallback = slot.Fallback;
|
|
@@ -2366,10 +2383,10 @@ var Thumbnail = {
|
|
|
2366
2383
|
};
|
|
2367
2384
|
|
|
2368
2385
|
// src/components/select/Select.tsx
|
|
2369
|
-
import * as
|
|
2386
|
+
import * as React33 from "react";
|
|
2370
2387
|
|
|
2371
2388
|
// src/internal/listbox.ts
|
|
2372
|
-
import * as
|
|
2389
|
+
import * as React20 from "react";
|
|
2373
2390
|
var optionDomId = (listboxId, value) => `${listboxId}-opt-${value.replace(/\s+/g, "_")}`;
|
|
2374
2391
|
function enabledOptions(container) {
|
|
2375
2392
|
if (!container) return [];
|
|
@@ -2394,11 +2411,11 @@ function createStore(initial) {
|
|
|
2394
2411
|
};
|
|
2395
2412
|
}
|
|
2396
2413
|
function useCreateStore(initial) {
|
|
2397
|
-
return
|
|
2414
|
+
return React20.useState(() => createStore(initial))[0];
|
|
2398
2415
|
}
|
|
2399
2416
|
function useStoreSlice(store, select) {
|
|
2400
2417
|
const read = () => select(store.get());
|
|
2401
|
-
return
|
|
2418
|
+
return React20.useSyncExternalStore(store.subscribe, read, read);
|
|
2402
2419
|
}
|
|
2403
2420
|
function handleListboxKeyDown(event, { items, highlight, onSelect }) {
|
|
2404
2421
|
if (items.length === 0) return;
|
|
@@ -2420,10 +2437,10 @@ function handleListboxKeyDown(event, { items, highlight, onSelect }) {
|
|
|
2420
2437
|
}
|
|
2421
2438
|
var TYPEAHEAD_RESET_MS = 500;
|
|
2422
2439
|
function useTypeahead() {
|
|
2423
|
-
const state =
|
|
2424
|
-
|
|
2425
|
-
const isTyping =
|
|
2426
|
-
const find =
|
|
2440
|
+
const state = React20.useRef({ buffer: "", timer: 0 });
|
|
2441
|
+
React20.useEffect(() => () => window.clearTimeout(state.current.timer), []);
|
|
2442
|
+
const isTyping = React20.useCallback(() => state.current.buffer !== "", []);
|
|
2443
|
+
const find = React20.useCallback(
|
|
2427
2444
|
(key, items, highlighted) => {
|
|
2428
2445
|
const s = state.current;
|
|
2429
2446
|
window.clearTimeout(s.timer);
|
|
@@ -2445,7 +2462,7 @@ function useTypeahead() {
|
|
|
2445
2462
|
}
|
|
2446
2463
|
|
|
2447
2464
|
// src/internal/MenuGroup.tsx
|
|
2448
|
-
import * as
|
|
2465
|
+
import * as React21 from "react";
|
|
2449
2466
|
|
|
2450
2467
|
// src/internal/menu.module.css
|
|
2451
2468
|
var menu_default = {
|
|
@@ -2463,9 +2480,9 @@ var menu_default = {
|
|
|
2463
2480
|
};
|
|
2464
2481
|
|
|
2465
2482
|
// src/internal/MenuGroup.tsx
|
|
2466
|
-
import { jsx as
|
|
2483
|
+
import { jsx as jsx23, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2467
2484
|
function MenuGroup({ label, className, children, ...rest }) {
|
|
2468
|
-
const labelId =
|
|
2485
|
+
const labelId = React21.useId();
|
|
2469
2486
|
return (
|
|
2470
2487
|
// biome-ignore lint/a11y/useSemanticElements: role="group" inside a menu / listbox; <fieldset> is not allowed there
|
|
2471
2488
|
/* @__PURE__ */ jsxs13(
|
|
@@ -2476,7 +2493,7 @@ function MenuGroup({ label, className, children, ...rest }) {
|
|
|
2476
2493
|
"aria-labelledby": label != null ? labelId : void 0,
|
|
2477
2494
|
className: cx(menu_default.group, className),
|
|
2478
2495
|
children: [
|
|
2479
|
-
label != null ? /* @__PURE__ */
|
|
2496
|
+
label != null ? /* @__PURE__ */ jsx23("div", { id: labelId, role: "presentation", className: menu_default.groupLabel, children: label }) : null,
|
|
2480
2497
|
children
|
|
2481
2498
|
]
|
|
2482
2499
|
}
|
|
@@ -2513,11 +2530,11 @@ var overlayMotion_default = {
|
|
|
2513
2530
|
};
|
|
2514
2531
|
|
|
2515
2532
|
// src/internal/Portal.tsx
|
|
2516
|
-
import * as
|
|
2533
|
+
import * as React22 from "react";
|
|
2517
2534
|
import { createPortal } from "react-dom";
|
|
2518
2535
|
function Portal({ children, container }) {
|
|
2519
|
-
const [mounted, setMounted] =
|
|
2520
|
-
|
|
2536
|
+
const [mounted, setMounted] = React22.useState(false);
|
|
2537
|
+
React22.useLayoutEffect(() => {
|
|
2521
2538
|
setMounted(true);
|
|
2522
2539
|
return () => setMounted(false);
|
|
2523
2540
|
}, []);
|
|
@@ -2533,8 +2550,8 @@ var sheet_default = {
|
|
|
2533
2550
|
};
|
|
2534
2551
|
|
|
2535
2552
|
// src/internal/surfaceDepth.tsx
|
|
2536
|
-
import * as
|
|
2537
|
-
var SurfaceDepthContext =
|
|
2553
|
+
import * as React23 from "react";
|
|
2554
|
+
var SurfaceDepthContext = React23.createContext(0);
|
|
2538
2555
|
SurfaceDepthContext.displayName = "SurfaceDepthContext";
|
|
2539
2556
|
function nextSurfaceDepth(depth) {
|
|
2540
2557
|
if (typeof depth === "number") return Math.min(depth + 1, 4);
|
|
@@ -2542,18 +2559,18 @@ function nextSurfaceDepth(depth) {
|
|
|
2542
2559
|
return depth === "floating" ? "floating-1" : "floating-2";
|
|
2543
2560
|
}
|
|
2544
2561
|
function useNestedSurfaceDepth() {
|
|
2545
|
-
return nextSurfaceDepth(
|
|
2562
|
+
return nextSurfaceDepth(React23.useContext(SurfaceDepthContext));
|
|
2546
2563
|
}
|
|
2547
2564
|
var SurfaceDepthProvider = SurfaceDepthContext.Provider;
|
|
2548
|
-
var StageDepthContext =
|
|
2565
|
+
var StageDepthContext = React23.createContext(0);
|
|
2549
2566
|
StageDepthContext.displayName = "StageDepthContext";
|
|
2550
2567
|
var StageDepthProvider = StageDepthContext.Provider;
|
|
2551
2568
|
function useStageDepth() {
|
|
2552
|
-
return
|
|
2569
|
+
return React23.useContext(StageDepthContext);
|
|
2553
2570
|
}
|
|
2554
2571
|
|
|
2555
2572
|
// src/internal/overlay/layerStack.ts
|
|
2556
|
-
import * as
|
|
2573
|
+
import * as React24 from "react";
|
|
2557
2574
|
|
|
2558
2575
|
// src/internal/overlay/focus.ts
|
|
2559
2576
|
var FOCUSABLE = [
|
|
@@ -2674,22 +2691,22 @@ function push(entry) {
|
|
|
2674
2691
|
if (stack.length === 0) listen(false);
|
|
2675
2692
|
};
|
|
2676
2693
|
}
|
|
2677
|
-
var LayerContext =
|
|
2694
|
+
var LayerContext = React24.createContext(null);
|
|
2678
2695
|
var LayerProvider = LayerContext.Provider;
|
|
2679
2696
|
function useLayer(open, options) {
|
|
2680
|
-
const parent =
|
|
2681
|
-
const [entry] =
|
|
2697
|
+
const parent = React24.useContext(LayerContext);
|
|
2698
|
+
const [entry] = React24.useState(() => ({ parent, trap: false, ...options }));
|
|
2682
2699
|
entry.parent = parent;
|
|
2683
2700
|
entry.refs = options.refs;
|
|
2684
2701
|
entry.dismiss = options.dismiss;
|
|
2685
2702
|
entry.trap = options.trap ?? false;
|
|
2686
2703
|
entry.onDismiss = options.onDismiss;
|
|
2687
|
-
|
|
2704
|
+
React24.useLayoutEffect(() => open ? push(entry) : void 0, [open, entry]);
|
|
2688
2705
|
return entry;
|
|
2689
2706
|
}
|
|
2690
2707
|
|
|
2691
2708
|
// src/internal/overlay/FloatingPanel.tsx
|
|
2692
|
-
import { Fragment as Fragment7, jsx as
|
|
2709
|
+
import { Fragment as Fragment7, jsx as jsx24, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2693
2710
|
function FloatingPanel({
|
|
2694
2711
|
floating,
|
|
2695
2712
|
size,
|
|
@@ -2725,9 +2742,9 @@ function FloatingPanel({
|
|
|
2725
2742
|
floating.onKeyDown(event);
|
|
2726
2743
|
}
|
|
2727
2744
|
};
|
|
2728
|
-
const panel = scroll ? /* @__PURE__ */
|
|
2729
|
-
return /* @__PURE__ */
|
|
2730
|
-
/* @__PURE__ */
|
|
2745
|
+
const panel = scroll ? /* @__PURE__ */ jsx24(ScrollContainer, { ...props, ref: panelRef, children }) : /* @__PURE__ */ jsx24("div", { ...props, ref: panelRef, children });
|
|
2746
|
+
return /* @__PURE__ */ jsx24(Portal, { children: /* @__PURE__ */ jsx24(LayerProvider, { value: floating.layer, children: /* @__PURE__ */ jsx24(SurfaceDepthProvider, { value: "floating", children: /* @__PURE__ */ jsx24(ControlSizeProvider, { value: size, children: sheet ? /* @__PURE__ */ jsxs14(Fragment7, { children: [
|
|
2747
|
+
/* @__PURE__ */ jsx24(
|
|
2731
2748
|
"div",
|
|
2732
2749
|
{
|
|
2733
2750
|
role: "presentation",
|
|
@@ -2750,7 +2767,7 @@ function FloatingPanel({
|
|
|
2750
2767
|
onAnimationEnd: presence.onExitEnd,
|
|
2751
2768
|
onPointerDown: floating.onSheetPointerDown,
|
|
2752
2769
|
children: [
|
|
2753
|
-
/* @__PURE__ */
|
|
2770
|
+
/* @__PURE__ */ jsx24("div", { className: sheet_default.handle, "data-swipe-handle": "", "aria-hidden": "true" }),
|
|
2754
2771
|
panel
|
|
2755
2772
|
]
|
|
2756
2773
|
}
|
|
@@ -2758,17 +2775,17 @@ function FloatingPanel({
|
|
|
2758
2775
|
] }) : panel }) }) }) });
|
|
2759
2776
|
}
|
|
2760
2777
|
function FloatingTrigger({ triggerProps, children, ...forwarded }) {
|
|
2761
|
-
return /* @__PURE__ */
|
|
2778
|
+
return /* @__PURE__ */ jsx24(Slot, { ...forwarded, children: /* @__PURE__ */ jsx24(Slot, { ...triggerProps, children }) });
|
|
2762
2779
|
}
|
|
2763
2780
|
|
|
2764
2781
|
// src/internal/overlay/useFloatingLayer.ts
|
|
2765
|
-
import * as
|
|
2782
|
+
import * as React30 from "react";
|
|
2766
2783
|
|
|
2767
2784
|
// src/hooks/useMediaQuery.ts
|
|
2768
|
-
import * as
|
|
2785
|
+
import * as React25 from "react";
|
|
2769
2786
|
var COMPACT_QUERY = "(max-width: 639px)";
|
|
2770
2787
|
function useMediaQuery(query, enabled = true) {
|
|
2771
|
-
const subscribe =
|
|
2788
|
+
const subscribe = React25.useCallback(
|
|
2772
2789
|
(onChange) => {
|
|
2773
2790
|
if (!enabled || typeof window === "undefined" || !window.matchMedia) return () => {
|
|
2774
2791
|
};
|
|
@@ -2779,18 +2796,18 @@ function useMediaQuery(query, enabled = true) {
|
|
|
2779
2796
|
[enabled, query]
|
|
2780
2797
|
);
|
|
2781
2798
|
const getSnapshot = () => enabled && typeof window !== "undefined" && !!window.matchMedia ? window.matchMedia(query).matches : false;
|
|
2782
|
-
return
|
|
2799
|
+
return React25.useSyncExternalStore(subscribe, getSnapshot, () => false);
|
|
2783
2800
|
}
|
|
2784
2801
|
|
|
2785
2802
|
// src/hooks/usePosition.ts
|
|
2786
|
-
import * as
|
|
2803
|
+
import * as React27 from "react";
|
|
2787
2804
|
|
|
2788
2805
|
// src/internal/AnchorRectContext.tsx
|
|
2789
|
-
import * as
|
|
2790
|
-
var AnchorRectContext =
|
|
2806
|
+
import * as React26 from "react";
|
|
2807
|
+
var AnchorRectContext = React26.createContext(null);
|
|
2791
2808
|
var AnchorRectProvider = AnchorRectContext.Provider;
|
|
2792
2809
|
function useAnchorRectResolver() {
|
|
2793
|
-
return
|
|
2810
|
+
return React26.useContext(AnchorRectContext);
|
|
2794
2811
|
}
|
|
2795
2812
|
|
|
2796
2813
|
// src/internal/layoutPxFromPrimitives.ts
|
|
@@ -2915,11 +2932,11 @@ function usePosition(enabled, anchorRef, layerRef, {
|
|
|
2915
2932
|
offsetToken = "--prime-panel-offset",
|
|
2916
2933
|
arrowInset
|
|
2917
2934
|
} = {}) {
|
|
2918
|
-
const [attached, setAttached] =
|
|
2919
|
-
const [resolvedSide, setResolvedSide] =
|
|
2935
|
+
const [attached, setAttached] = React27.useState(false);
|
|
2936
|
+
const [resolvedSide, setResolvedSide] = React27.useState(preferredSide);
|
|
2920
2937
|
const resolveAnchorRect = useAnchorRectResolver();
|
|
2921
|
-
const metricsRef =
|
|
2922
|
-
const update =
|
|
2938
|
+
const metricsRef = React27.useRef(null);
|
|
2939
|
+
const update = React27.useCallback(
|
|
2923
2940
|
(remeasure) => {
|
|
2924
2941
|
const anchor = anchorRef.current;
|
|
2925
2942
|
const layer = layerRef.current;
|
|
@@ -2973,9 +2990,9 @@ function usePosition(enabled, anchorRef, layerRef, {
|
|
|
2973
2990
|
resolveAnchorRect
|
|
2974
2991
|
]
|
|
2975
2992
|
);
|
|
2976
|
-
const updateRef =
|
|
2993
|
+
const updateRef = React27.useRef(update);
|
|
2977
2994
|
updateRef.current = update;
|
|
2978
|
-
const attachLayer =
|
|
2995
|
+
const attachLayer = React27.useCallback(
|
|
2979
2996
|
(node) => {
|
|
2980
2997
|
layerRef.current = node;
|
|
2981
2998
|
setAttached(node !== null);
|
|
@@ -2983,10 +3000,10 @@ function usePosition(enabled, anchorRef, layerRef, {
|
|
|
2983
3000
|
[layerRef]
|
|
2984
3001
|
);
|
|
2985
3002
|
const active = enabled && attached;
|
|
2986
|
-
|
|
3003
|
+
React27.useLayoutEffect(() => {
|
|
2987
3004
|
if (active) update(true);
|
|
2988
3005
|
}, [active, update]);
|
|
2989
|
-
|
|
3006
|
+
React27.useLayoutEffect(() => {
|
|
2990
3007
|
if (!active) return;
|
|
2991
3008
|
let frame = 0;
|
|
2992
3009
|
let remeasure = false;
|
|
@@ -3021,7 +3038,7 @@ function usePosition(enabled, anchorRef, layerRef, {
|
|
|
3021
3038
|
}
|
|
3022
3039
|
|
|
3023
3040
|
// src/hooks/useScrollLock.ts
|
|
3024
|
-
import * as
|
|
3041
|
+
import * as React28 from "react";
|
|
3025
3042
|
var lockCount = 0;
|
|
3026
3043
|
var saved = null;
|
|
3027
3044
|
function lockScroll() {
|
|
@@ -3046,7 +3063,7 @@ function unlockScroll() {
|
|
|
3046
3063
|
}
|
|
3047
3064
|
}
|
|
3048
3065
|
function useScrollLock(enabled) {
|
|
3049
|
-
|
|
3066
|
+
React28.useEffect(() => {
|
|
3050
3067
|
if (!enabled) return;
|
|
3051
3068
|
lockScroll();
|
|
3052
3069
|
return unlockScroll;
|
|
@@ -3054,7 +3071,7 @@ function useScrollLock(enabled) {
|
|
|
3054
3071
|
}
|
|
3055
3072
|
|
|
3056
3073
|
// src/hooks/useSwipeDismiss.ts
|
|
3057
|
-
import * as
|
|
3074
|
+
import * as React29 from "react";
|
|
3058
3075
|
var SLOP_PX = 8;
|
|
3059
3076
|
var DISTANCE_RATIO = 0.3;
|
|
3060
3077
|
var FLICK_VELOCITY = 0.5;
|
|
@@ -3082,11 +3099,11 @@ function useSwipeDismiss({
|
|
|
3082
3099
|
touchAnywhere = false,
|
|
3083
3100
|
onProgress
|
|
3084
3101
|
}) {
|
|
3085
|
-
const optionsRef =
|
|
3102
|
+
const optionsRef = React29.useRef({ direction, onDismiss, handle, touchAnywhere, onProgress });
|
|
3086
3103
|
optionsRef.current = { direction, onDismiss, handle, touchAnywhere, onProgress };
|
|
3087
|
-
const cleanupRef =
|
|
3088
|
-
|
|
3089
|
-
const onPointerDown2 =
|
|
3104
|
+
const cleanupRef = React29.useRef(null);
|
|
3105
|
+
React29.useEffect(() => () => cleanupRef.current?.(), []);
|
|
3106
|
+
const onPointerDown2 = React29.useCallback(
|
|
3090
3107
|
(event) => {
|
|
3091
3108
|
if (!enabled || event.defaultPrevented || !event.isPrimary || event.button !== 0) return;
|
|
3092
3109
|
const { direction: direction2, handle: handle2, touchAnywhere: touchAnywhere2 } = optionsRef.current;
|
|
@@ -3193,24 +3210,24 @@ function useFloatingLayer({
|
|
|
3193
3210
|
const sheet = useMediaQuery(COMPACT_QUERY, sheetOption);
|
|
3194
3211
|
const presence = usePresence(open, { exitDuration: sheet ? "base" : exitDuration });
|
|
3195
3212
|
const mounted = presence.mounted && (open || !skipExit);
|
|
3196
|
-
const contentRef =
|
|
3213
|
+
const contentRef = React30.useRef(null);
|
|
3197
3214
|
const position = usePosition(mounted && !sheet, triggerRef, contentRef, positionOptions);
|
|
3198
3215
|
useScrollLock(open && sheet);
|
|
3199
|
-
const [panel, setPanel] =
|
|
3216
|
+
const [panel, setPanel] = React30.useState(null);
|
|
3200
3217
|
const { attachLayer } = position;
|
|
3201
|
-
const panelRef =
|
|
3218
|
+
const panelRef = React30.useCallback(
|
|
3202
3219
|
(node) => {
|
|
3203
3220
|
attachLayer(node);
|
|
3204
3221
|
setPanel(node);
|
|
3205
3222
|
},
|
|
3206
3223
|
[attachLayer]
|
|
3207
3224
|
);
|
|
3208
|
-
const outsideRef =
|
|
3209
|
-
const close =
|
|
3225
|
+
const outsideRef = React30.useRef(false);
|
|
3226
|
+
const close = React30.useCallback(() => {
|
|
3210
3227
|
outsideRef.current = false;
|
|
3211
3228
|
onOpenChange(false);
|
|
3212
3229
|
}, [onOpenChange]);
|
|
3213
|
-
const dismissOutside =
|
|
3230
|
+
const dismissOutside = React30.useCallback(() => {
|
|
3214
3231
|
outsideRef.current = true;
|
|
3215
3232
|
onOpenChange(false);
|
|
3216
3233
|
}, [onOpenChange]);
|
|
@@ -3234,7 +3251,7 @@ function useFloatingLayer({
|
|
|
3234
3251
|
onDismiss
|
|
3235
3252
|
});
|
|
3236
3253
|
const passive = dismiss === "none";
|
|
3237
|
-
|
|
3254
|
+
React30.useEffect(() => {
|
|
3238
3255
|
if (!open || !panel || passive) return;
|
|
3239
3256
|
outsideRef.current = false;
|
|
3240
3257
|
if (focusOnOpen) focusInto(panel);
|
|
@@ -3299,10 +3316,10 @@ var Select_default = {
|
|
|
3299
3316
|
};
|
|
3300
3317
|
|
|
3301
3318
|
// src/components/select/SelectItem.tsx
|
|
3302
|
-
import * as
|
|
3319
|
+
import * as React32 from "react";
|
|
3303
3320
|
|
|
3304
3321
|
// src/internal/HighlightMatch.tsx
|
|
3305
|
-
import * as
|
|
3322
|
+
import * as React31 from "react";
|
|
3306
3323
|
|
|
3307
3324
|
// src/internal/HighlightMatch.module.css
|
|
3308
3325
|
var HighlightMatch_default = {
|
|
@@ -3310,7 +3327,7 @@ var HighlightMatch_default = {
|
|
|
3310
3327
|
};
|
|
3311
3328
|
|
|
3312
3329
|
// src/internal/HighlightMatch.tsx
|
|
3313
|
-
import { Fragment as Fragment8, jsx as
|
|
3330
|
+
import { Fragment as Fragment8, jsx as jsx25, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3314
3331
|
function matchIndex(text, query) {
|
|
3315
3332
|
if (!query) return -1;
|
|
3316
3333
|
return text.toLowerCase().indexOf(query.toLowerCase());
|
|
@@ -3318,18 +3335,18 @@ function matchIndex(text, query) {
|
|
|
3318
3335
|
function HighlightMatch({ text, query }) {
|
|
3319
3336
|
const q = query.trim();
|
|
3320
3337
|
const at = matchIndex(text, q);
|
|
3321
|
-
if (at < 0) return /* @__PURE__ */
|
|
3338
|
+
if (at < 0) return /* @__PURE__ */ jsx25(Fragment8, { children: text });
|
|
3322
3339
|
return /* @__PURE__ */ jsxs15("span", { children: [
|
|
3323
3340
|
text.slice(0, at),
|
|
3324
|
-
/* @__PURE__ */
|
|
3341
|
+
/* @__PURE__ */ jsx25("mark", { className: HighlightMatch_default.match, children: text.slice(at, at + q.length) }),
|
|
3325
3342
|
text.slice(at + q.length)
|
|
3326
3343
|
] });
|
|
3327
3344
|
}
|
|
3328
3345
|
function highlightChildren(children, query) {
|
|
3329
3346
|
if (!query.trim()) return children;
|
|
3330
|
-
return
|
|
3347
|
+
return React31.Children.map(
|
|
3331
3348
|
children,
|
|
3332
|
-
(child) => typeof child === "string" || typeof child === "number" ? /* @__PURE__ */
|
|
3349
|
+
(child) => typeof child === "string" || typeof child === "number" ? /* @__PURE__ */ jsx25(HighlightMatch, { text: String(child), query }) : child
|
|
3333
3350
|
);
|
|
3334
3351
|
}
|
|
3335
3352
|
|
|
@@ -3363,24 +3380,24 @@ function createItemRegistry() {
|
|
|
3363
3380
|
var [SelectProvider, useSelectContext] = createComponentContext("Select");
|
|
3364
3381
|
|
|
3365
3382
|
// src/components/select/SelectItem.tsx
|
|
3366
|
-
import { jsx as
|
|
3383
|
+
import { jsx as jsx26, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3367
3384
|
var MEDIA_SIZE = { xs: "xs", s: "xs", m: "s", l: "s", xl: "m" };
|
|
3368
3385
|
function textOf(node) {
|
|
3369
3386
|
if (node == null || typeof node === "boolean") return "";
|
|
3370
3387
|
if (typeof node === "string" || typeof node === "number") return String(node);
|
|
3371
3388
|
if (Array.isArray(node)) return node.map(textOf).join("");
|
|
3372
|
-
if (
|
|
3389
|
+
if (React32.isValidElement(node))
|
|
3373
3390
|
return textOf(node.props.children);
|
|
3374
3391
|
return "";
|
|
3375
3392
|
}
|
|
3376
3393
|
function SelectItemIcon({ className, ...rest }) {
|
|
3377
|
-
return /* @__PURE__ */
|
|
3394
|
+
return /* @__PURE__ */ jsx26("span", { "aria-hidden": "true", className: cx(menu_default.itemIcon, className), ...rest });
|
|
3378
3395
|
}
|
|
3379
3396
|
SelectItemIcon.displayName = "Select.ItemIcon";
|
|
3380
|
-
var OptionQueryContext =
|
|
3397
|
+
var OptionQueryContext = React32.createContext("");
|
|
3381
3398
|
function SelectItemText({ children, className, ...rest }) {
|
|
3382
|
-
const query =
|
|
3383
|
-
return /* @__PURE__ */
|
|
3399
|
+
const query = React32.useContext(OptionQueryContext);
|
|
3400
|
+
return /* @__PURE__ */ jsx26("span", { ...rest, className: cx(Select_default.itemTitle, className), children: highlightChildren(children, query) });
|
|
3384
3401
|
}
|
|
3385
3402
|
SelectItemText.displayName = "Select.ItemText";
|
|
3386
3403
|
function SelectItemDescription({
|
|
@@ -3388,12 +3405,12 @@ function SelectItemDescription({
|
|
|
3388
3405
|
className,
|
|
3389
3406
|
...rest
|
|
3390
3407
|
}) {
|
|
3391
|
-
const query =
|
|
3392
|
-
return /* @__PURE__ */
|
|
3408
|
+
const query = React32.useContext(OptionQueryContext);
|
|
3409
|
+
return /* @__PURE__ */ jsx26("span", { ...rest, className: cx(Select_default.itemDescription, className), children: highlightChildren(children, query) });
|
|
3393
3410
|
}
|
|
3394
3411
|
SelectItemDescription.displayName = "Select.ItemDescription";
|
|
3395
3412
|
function SelectItemMeta({ children, className, ...rest }) {
|
|
3396
|
-
return /* @__PURE__ */
|
|
3413
|
+
return /* @__PURE__ */ jsx26("span", { ...rest, className: cx(Select_default.itemMeta, className), children });
|
|
3397
3414
|
}
|
|
3398
3415
|
SelectItemMeta.displayName = "Select.ItemMeta";
|
|
3399
3416
|
function splitItemChildren(children) {
|
|
@@ -3406,11 +3423,11 @@ function splitItemChildren(children) {
|
|
|
3406
3423
|
description: ""
|
|
3407
3424
|
};
|
|
3408
3425
|
let plain = "";
|
|
3409
|
-
for (const child of
|
|
3410
|
-
if (!
|
|
3426
|
+
for (const child of React32.Children.toArray(children)) {
|
|
3427
|
+
if (!React32.isValidElement(child)) {
|
|
3411
3428
|
plain += textOf(child);
|
|
3412
3429
|
parts.body.push(child);
|
|
3413
|
-
} else if (child.type ===
|
|
3430
|
+
} else if (child.type === React32.Fragment) {
|
|
3414
3431
|
const inner = splitItemChildren(child.props.children);
|
|
3415
3432
|
parts.leading.push(...inner.leading);
|
|
3416
3433
|
parts.body.push(...inner.body);
|
|
@@ -3440,7 +3457,7 @@ function splitItemChildren(children) {
|
|
|
3440
3457
|
}
|
|
3441
3458
|
function sizeMedia(leading, size) {
|
|
3442
3459
|
return leading.map(
|
|
3443
|
-
(node) =>
|
|
3460
|
+
(node) => React32.isValidElement(node) && node.type === Thumbnail.Root ? React32.cloneElement(node, {
|
|
3444
3461
|
size: node.props.size ?? MEDIA_SIZE[size],
|
|
3445
3462
|
className: cx(Select_default.media, node.props.className),
|
|
3446
3463
|
"aria-hidden": true
|
|
@@ -3462,7 +3479,7 @@ function SelectItem({
|
|
|
3462
3479
|
const haystack = normalize(`${resolvedLabel} ${parts.description} ${keywords ?? ""}`);
|
|
3463
3480
|
const isSelected = selected.includes(value);
|
|
3464
3481
|
const isHighlighted = useStoreSlice(highlight, (current) => current === value);
|
|
3465
|
-
|
|
3482
|
+
React32.useLayoutEffect(
|
|
3466
3483
|
() => registry.register(value, resolvedLabel, haystack),
|
|
3467
3484
|
[registry, value, resolvedLabel, haystack]
|
|
3468
3485
|
);
|
|
@@ -3495,11 +3512,11 @@ function SelectItem({
|
|
|
3495
3512
|
rich: parts.rich || void 0
|
|
3496
3513
|
}),
|
|
3497
3514
|
children: [
|
|
3498
|
-
multiple ? /* @__PURE__ */
|
|
3515
|
+
multiple ? /* @__PURE__ */ jsx26(Checkbox.Indicator, { checked: isSelected, disabled, size: stepDown(size) }) : null,
|
|
3499
3516
|
sizeMedia(parts.leading, size),
|
|
3500
|
-
/* @__PURE__ */
|
|
3517
|
+
/* @__PURE__ */ jsx26("span", { className: Select_default.itemText, children: /* @__PURE__ */ jsx26(OptionQueryContext.Provider, { value: query, children: highlightChildren(parts.body, query) }) }),
|
|
3501
3518
|
parts.meta,
|
|
3502
|
-
multiple ? null : /* @__PURE__ */
|
|
3519
|
+
multiple ? null : /* @__PURE__ */ jsx26("span", { className: menu_default.check, "aria-hidden": "true", children: isSelected ? /* @__PURE__ */ jsx26(Icon, { name: "action.check" }) : null })
|
|
3503
3520
|
]
|
|
3504
3521
|
}
|
|
3505
3522
|
)
|
|
@@ -3508,7 +3525,7 @@ function SelectItem({
|
|
|
3508
3525
|
SelectItem.displayName = "Select.Item";
|
|
3509
3526
|
|
|
3510
3527
|
// src/components/select/Select.tsx
|
|
3511
|
-
import { jsx as
|
|
3528
|
+
import { jsx as jsx27, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3512
3529
|
var SELECT_LABELS = {
|
|
3513
3530
|
search: "\u041F\u043E\u0438\u0441\u043A",
|
|
3514
3531
|
empty: "\u041D\u0438\u0447\u0435\u0433\u043E \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E",
|
|
@@ -3545,14 +3562,14 @@ function SelectRoot(props) {
|
|
|
3545
3562
|
...rest
|
|
3546
3563
|
} = props;
|
|
3547
3564
|
const multiple = props.multiple === true;
|
|
3548
|
-
const labels =
|
|
3565
|
+
const labels = React33.useMemo(() => ({ ...SELECT_LABELS, ...labelsProp }), [labelsProp]);
|
|
3549
3566
|
const ids = useFieldFrame(id, { hint, error, invalid });
|
|
3550
3567
|
const [value, setValue] = useControllableState({
|
|
3551
3568
|
value: props.value,
|
|
3552
3569
|
defaultValue: props.defaultValue ?? (multiple ? [] : void 0),
|
|
3553
3570
|
onChange: props.onValueChange
|
|
3554
3571
|
});
|
|
3555
|
-
const selected =
|
|
3572
|
+
const selected = React33.useMemo(
|
|
3556
3573
|
() => Array.isArray(value) ? value : value ? [value] : [],
|
|
3557
3574
|
[value]
|
|
3558
3575
|
);
|
|
@@ -3562,11 +3579,11 @@ function SelectRoot(props) {
|
|
|
3562
3579
|
onChange: onOpenChange
|
|
3563
3580
|
});
|
|
3564
3581
|
const highlight = useCreateStore(void 0);
|
|
3565
|
-
const [registry] =
|
|
3566
|
-
const [query, setQuery] =
|
|
3567
|
-
const triggerRef =
|
|
3582
|
+
const [registry] = React33.useState(createItemRegistry);
|
|
3583
|
+
const [query, setQuery] = React33.useState("");
|
|
3584
|
+
const triggerRef = React33.useRef(null);
|
|
3568
3585
|
if (!isOpen && query !== "") setQuery("");
|
|
3569
|
-
const pick =
|
|
3586
|
+
const pick = React33.useCallback(
|
|
3570
3587
|
(optionValue) => {
|
|
3571
3588
|
if (multiple) {
|
|
3572
3589
|
setValue((prev) => {
|
|
@@ -3580,8 +3597,8 @@ function SelectRoot(props) {
|
|
|
3580
3597
|
},
|
|
3581
3598
|
[multiple, setValue, setOpen]
|
|
3582
3599
|
);
|
|
3583
|
-
const clear =
|
|
3584
|
-
const context =
|
|
3600
|
+
const clear = React33.useCallback(() => setValue(multiple ? [] : ""), [multiple, setValue]);
|
|
3601
|
+
const context = React33.useMemo(
|
|
3585
3602
|
() => ({
|
|
3586
3603
|
size,
|
|
3587
3604
|
invalid: ids.invalid,
|
|
@@ -3630,7 +3647,7 @@ function SelectRoot(props) {
|
|
|
3630
3647
|
labels
|
|
3631
3648
|
]
|
|
3632
3649
|
);
|
|
3633
|
-
return /* @__PURE__ */
|
|
3650
|
+
return /* @__PURE__ */ jsx27(
|
|
3634
3651
|
FieldFrame,
|
|
3635
3652
|
{
|
|
3636
3653
|
...rest,
|
|
@@ -3644,7 +3661,7 @@ function SelectRoot(props) {
|
|
|
3644
3661
|
disabled,
|
|
3645
3662
|
optionalLabel: labels.optional,
|
|
3646
3663
|
className,
|
|
3647
|
-
children: /* @__PURE__ */
|
|
3664
|
+
children: /* @__PURE__ */ jsx27(SelectProvider, { value: context, children: /* @__PURE__ */ jsx27(ControlSizeProvider, { value: size, children }) })
|
|
3648
3665
|
}
|
|
3649
3666
|
);
|
|
3650
3667
|
}
|
|
@@ -3719,11 +3736,11 @@ function SelectTrigger({
|
|
|
3719
3736
|
"focus-ring": focusRing ? void 0 : false
|
|
3720
3737
|
}),
|
|
3721
3738
|
children: [
|
|
3722
|
-
/* @__PURE__ */
|
|
3739
|
+
/* @__PURE__ */ jsx27("span", { className: Select_default.triggerMain, children }),
|
|
3723
3740
|
showClear ? (
|
|
3724
3741
|
// A segment, not a button: interactive content inside a <button> is invalid. The keyboard
|
|
3725
3742
|
// clears with Delete / Backspace on the trigger.
|
|
3726
|
-
/* @__PURE__ */
|
|
3743
|
+
/* @__PURE__ */ jsx27(
|
|
3727
3744
|
"span",
|
|
3728
3745
|
{
|
|
3729
3746
|
className: Select_default.clear,
|
|
@@ -3735,11 +3752,11 @@ function SelectTrigger({
|
|
|
3735
3752
|
event.stopPropagation();
|
|
3736
3753
|
clear();
|
|
3737
3754
|
},
|
|
3738
|
-
children: /* @__PURE__ */
|
|
3755
|
+
children: /* @__PURE__ */ jsx27(Icon, { name: "action.close" })
|
|
3739
3756
|
}
|
|
3740
3757
|
)
|
|
3741
3758
|
) : null,
|
|
3742
|
-
/* @__PURE__ */
|
|
3759
|
+
/* @__PURE__ */ jsx27("span", { className: Select_default.chevron, "aria-hidden": "true", children: loading ? /* @__PURE__ */ jsx27(Spinner, { "aria-hidden": "true" }) : /* @__PURE__ */ jsx27(Icon, { name: "nav.chevronDown" }) })
|
|
3743
3760
|
]
|
|
3744
3761
|
}
|
|
3745
3762
|
);
|
|
@@ -3759,12 +3776,12 @@ function SelectValue({ renderValue, className, ...rest }) {
|
|
|
3759
3776
|
...toDataAttributes({ rich: parts.rich || void 0 }),
|
|
3760
3777
|
children: [
|
|
3761
3778
|
sizeMedia(parts.leading, size),
|
|
3762
|
-
/* @__PURE__ */
|
|
3779
|
+
/* @__PURE__ */ jsx27("span", { className: Select_default.valueBody, children: parts.body })
|
|
3763
3780
|
]
|
|
3764
3781
|
}
|
|
3765
3782
|
);
|
|
3766
3783
|
}
|
|
3767
|
-
return /* @__PURE__ */
|
|
3784
|
+
return /* @__PURE__ */ jsx27(
|
|
3768
3785
|
"span",
|
|
3769
3786
|
{
|
|
3770
3787
|
...rest,
|
|
@@ -3776,7 +3793,7 @@ function SelectValue({ renderValue, className, ...rest }) {
|
|
|
3776
3793
|
}
|
|
3777
3794
|
SelectValue.displayName = "Select.Value";
|
|
3778
3795
|
function SelectTriggerIcon({ className, ...rest }) {
|
|
3779
|
-
return /* @__PURE__ */
|
|
3796
|
+
return /* @__PURE__ */ jsx27("span", { "aria-hidden": "true", className: cx(Select_default.triggerIcon, className), ...rest });
|
|
3780
3797
|
}
|
|
3781
3798
|
SelectTriggerIcon.displayName = "Select.TriggerIcon";
|
|
3782
3799
|
function SelectContent({ searchable = false, className, children, ...rest }) {
|
|
@@ -3796,7 +3813,7 @@ function SelectContent({ searchable = false, className, children, ...rest }) {
|
|
|
3796
3813
|
labels,
|
|
3797
3814
|
registry
|
|
3798
3815
|
} = useSelectContext();
|
|
3799
|
-
const listboxRef =
|
|
3816
|
+
const listboxRef = React33.useRef(null);
|
|
3800
3817
|
const floating = useFloatingLayer({
|
|
3801
3818
|
open: isOpen,
|
|
3802
3819
|
onOpenChange: setOpen,
|
|
@@ -3827,7 +3844,7 @@ function SelectContent({ searchable = false, className, children, ...rest }) {
|
|
|
3827
3844
|
}
|
|
3828
3845
|
handleListboxKeyDown(event, { items, highlight, onSelect: pick });
|
|
3829
3846
|
};
|
|
3830
|
-
if (!floating.mounted) return /* @__PURE__ */
|
|
3847
|
+
if (!floating.mounted) return /* @__PURE__ */ jsx27("div", { hidden: true, children });
|
|
3831
3848
|
const activeDescendant = isOpen && highlighted !== void 0 ? optionDomId(listboxId, highlighted) : void 0;
|
|
3832
3849
|
return /* @__PURE__ */ jsxs17(
|
|
3833
3850
|
FloatingPanel,
|
|
@@ -3842,8 +3859,8 @@ function SelectContent({ searchable = false, className, children, ...rest }) {
|
|
|
3842
3859
|
searchable ? (
|
|
3843
3860
|
// The permanent focus of the panel: no ring, the caret is the indicator (foundation §7).
|
|
3844
3861
|
/* @__PURE__ */ jsxs17("div", { className: cx(menu_default.searchRow, Select_default.search), "data-focus-ring": "false", children: [
|
|
3845
|
-
/* @__PURE__ */
|
|
3846
|
-
/* @__PURE__ */
|
|
3862
|
+
/* @__PURE__ */ jsx27(Icon, { name: "action.search", size: "s" }),
|
|
3863
|
+
/* @__PURE__ */ jsx27(
|
|
3847
3864
|
"input",
|
|
3848
3865
|
{
|
|
3849
3866
|
type: "text",
|
|
@@ -3863,10 +3880,10 @@ function SelectContent({ searchable = false, className, children, ...rest }) {
|
|
|
3863
3880
|
] })
|
|
3864
3881
|
) : null,
|
|
3865
3882
|
loading ? /* @__PURE__ */ jsxs17("div", { className: Select_default.status, role: "status", children: [
|
|
3866
|
-
/* @__PURE__ */
|
|
3883
|
+
/* @__PURE__ */ jsx27(Spinner, { "aria-hidden": "true" }),
|
|
3867
3884
|
labels.loading
|
|
3868
3885
|
] }) : null,
|
|
3869
|
-
/* @__PURE__ */
|
|
3886
|
+
/* @__PURE__ */ jsx27(
|
|
3870
3887
|
ScrollContainer,
|
|
3871
3888
|
{
|
|
3872
3889
|
ref: listboxRef,
|
|
@@ -3883,10 +3900,10 @@ function SelectContent({ searchable = false, className, children, ...rest }) {
|
|
|
3883
3900
|
}
|
|
3884
3901
|
),
|
|
3885
3902
|
isEmpty && !loading ? /* @__PURE__ */ jsxs17(EmptyPage.Root, { layout: "compact", role: "status", children: [
|
|
3886
|
-
/* @__PURE__ */
|
|
3887
|
-
query !== "" && labels.emptyHint ? /* @__PURE__ */
|
|
3903
|
+
/* @__PURE__ */ jsx27(EmptyPage.Title, { as: "p", children: labels.empty }),
|
|
3904
|
+
query !== "" && labels.emptyHint ? /* @__PURE__ */ jsx27(EmptyPage.Description, { children: labels.emptyHint }) : null
|
|
3888
3905
|
] }) : null,
|
|
3889
|
-
/* @__PURE__ */
|
|
3906
|
+
/* @__PURE__ */ jsx27(HighlightOnOpen, { listboxRef, highlight })
|
|
3890
3907
|
]
|
|
3891
3908
|
}
|
|
3892
3909
|
);
|
|
@@ -3897,9 +3914,9 @@ function HighlightOnOpen({
|
|
|
3897
3914
|
highlight
|
|
3898
3915
|
}) {
|
|
3899
3916
|
const { isOpen, query, selected } = useSelectContext();
|
|
3900
|
-
const selectedRef =
|
|
3917
|
+
const selectedRef = React33.useRef(selected);
|
|
3901
3918
|
selectedRef.current = selected;
|
|
3902
|
-
|
|
3919
|
+
React33.useLayoutEffect(() => {
|
|
3903
3920
|
if (!isOpen) return;
|
|
3904
3921
|
const options = enabledOptions(listboxRef.current);
|
|
3905
3922
|
const first = options.find((item) => selectedRef.current.includes(item.dataset.value ?? ""));
|
|
@@ -3907,17 +3924,17 @@ function HighlightOnOpen({
|
|
|
3907
3924
|
first?.scrollIntoView?.({ block: "nearest" });
|
|
3908
3925
|
return () => highlight.set(void 0);
|
|
3909
3926
|
}, [isOpen, listboxRef, highlight]);
|
|
3910
|
-
|
|
3927
|
+
React33.useLayoutEffect(() => {
|
|
3911
3928
|
if (query !== "") highlight.set(enabledOptions(listboxRef.current)[0]?.dataset.value);
|
|
3912
3929
|
}, [query, listboxRef, highlight]);
|
|
3913
3930
|
return null;
|
|
3914
3931
|
}
|
|
3915
3932
|
function SelectGroup({ className, ...rest }) {
|
|
3916
|
-
return /* @__PURE__ */
|
|
3933
|
+
return /* @__PURE__ */ jsx27(MenuGroup, { ...rest, className: cx(Select_default.group, className) });
|
|
3917
3934
|
}
|
|
3918
3935
|
SelectGroup.displayName = "Select.Group";
|
|
3919
3936
|
function SelectSeparator({ className, ...rest }) {
|
|
3920
|
-
return /* @__PURE__ */
|
|
3937
|
+
return /* @__PURE__ */ jsx27(Divider, { ...rest, className: cx(menu_default.separator, Select_default.separator, className) });
|
|
3921
3938
|
}
|
|
3922
3939
|
SelectSeparator.displayName = "Select.Separator";
|
|
3923
3940
|
var Select = {
|
|
@@ -3936,10 +3953,6 @@ var Select = {
|
|
|
3936
3953
|
};
|
|
3937
3954
|
|
|
3938
3955
|
export {
|
|
3939
|
-
ControlSizeProvider,
|
|
3940
|
-
useOptionalControlSize,
|
|
3941
|
-
useControlSize,
|
|
3942
|
-
cx,
|
|
3943
3956
|
toDataAttributes,
|
|
3944
3957
|
fieldSurfaceClass,
|
|
3945
3958
|
fieldTierClass,
|
|
@@ -3954,7 +3967,6 @@ export {
|
|
|
3954
3967
|
useMergedRefs,
|
|
3955
3968
|
Slot,
|
|
3956
3969
|
touchTargetBlockClass,
|
|
3957
|
-
textTone_default,
|
|
3958
3970
|
Spinner,
|
|
3959
3971
|
Button,
|
|
3960
3972
|
Divider,
|
|
@@ -3999,15 +4011,15 @@ export {
|
|
|
3999
4011
|
textTones,
|
|
4000
4012
|
enterMotion_default,
|
|
4001
4013
|
Hint,
|
|
4002
|
-
choiceInputClass,
|
|
4003
|
-
choiceVisualClass,
|
|
4004
|
-
ChoiceField,
|
|
4005
|
-
ChoiceLabel,
|
|
4006
4014
|
Label,
|
|
4007
4015
|
formatLabel,
|
|
4008
4016
|
useFieldFrame,
|
|
4009
4017
|
FieldFrame,
|
|
4010
4018
|
FieldCounter,
|
|
4019
|
+
choiceInputClass,
|
|
4020
|
+
choiceVisualClass,
|
|
4021
|
+
ChoiceField,
|
|
4022
|
+
ChoiceLabel,
|
|
4011
4023
|
Checkbox,
|
|
4012
4024
|
COLOR_PRESETS,
|
|
4013
4025
|
useSwatchOptions,
|