prime-ui-kit 0.9.2 → 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 +18 -9
- package/THIRD_PARTY_NOTICES +76 -0
- package/dist/chunks/{chunk-ZEFCDEEQ.js → chunk-4TRNUP45.js} +1085 -526
- package/dist/chunks/chunk-EJ2ZVQYL.js +5805 -0
- package/dist/chunks/chunk-GFKDZFQR.js +1208 -0
- package/dist/chunks/{chunk-LXGRKN34.js → chunk-K4FACFQ2.js} +776 -484
- package/dist/chunks/{chunk-IQELQNMR.js → chunk-T7CLQXGB.js} +20 -5
- package/dist/color-picker.js +3 -2
- package/dist/components/button/Button.d.ts +24 -4
- package/dist/components/card/Card.d.ts +1 -1
- package/dist/components/code-block/CodeBlock.d.ts +1 -1
- package/dist/components/color-picker/ColorPicker.d.ts +1 -1
- package/dist/components/data-table/Row.d.ts +3 -1
- package/dist/components/data-table/rows.d.ts +4 -0
- package/dist/components/digit-input/DigitInput.d.ts +6 -1
- package/dist/components/index.d.ts +4 -1
- package/dist/components/input/Input.d.ts +16 -1
- package/dist/components/input/passwordStrength.d.ts +9 -0
- package/dist/components/progress-bar/ProgressBar.d.ts +16 -1
- package/dist/components/sparkline/Sparkline.d.ts +26 -0
- package/dist/hooks/useEdgeOverflow.d.ts +4 -0
- 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 +81 -78
- package/dist/icons.js +996 -0
- package/dist/index.css +1257 -399
- package/dist/index.d.ts +1 -0
- package/dist/index.js +13 -5
- package/dist/internal/CheckMark.d.ts +12 -0
- package/dist/internal/ChoiceField.d.ts +1 -1
- package/dist/internal/FieldFrame.d.ts +17 -0
- package/dist/internal/MorphText.d.ts +12 -0
- package/dist/internal/RollingNumber.d.ts +14 -0
- package/dist/internal/surfaceDepth.d.ts +25 -0
- package/dist/internal/swatch.d.ts +4 -1
- package/dist/layout/app-shell/AppShell.d.ts +2 -2
- package/dist/motion/celebrate.d.ts +18 -0
- package/dist/tokens/layers.d.ts +37 -0
- package/dist/tokens/naming.d.ts +1 -1
- package/dist/tokens/primitives.d.ts +1 -0
- package/dist/tokens/semantic.d.ts +67 -56
- package/dist/tokens/themes/dark.d.ts +7 -14
- package/package.json +11 -4
- package/src/components/accordion/COMPONENT.md +4 -4
- package/src/components/avatar/COMPONENT.md +1 -1
- package/src/components/button/COMPONENT.md +30 -7
- package/src/components/button/examples/download.tsx +45 -0
- package/src/components/button/examples/hold-to-confirm.tsx +23 -0
- package/src/components/button/examples/in-form.tsx +15 -3
- package/src/components/button/examples/label-morph.tsx +38 -0
- package/src/components/button/examples/variants.tsx +1 -0
- package/src/components/card/COMPONENT.md +4 -2
- package/src/components/card/examples/narrow.tsx +2 -2
- package/src/components/card/examples/panel-chart.tsx +1 -1
- package/src/components/card/examples/variants.tsx +1 -1
- package/src/components/checkbox/COMPONENT.md +1 -1
- package/src/components/checkbox/examples/examples.module.css +1 -1
- package/src/components/code-block/COMPONENT.md +6 -6
- package/src/components/code-block/examples/overview.tsx +1 -1
- package/src/components/code-block/examples/variants.tsx +1 -1
- package/src/components/color-picker/COMPONENT.md +3 -3
- 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 +6 -6
- package/src/components/color-swatches/examples/in-form.tsx +11 -5
- package/src/components/command-menu/COMPONENT.md +1 -1
- package/src/components/crossfade/examples/overview.tsx +3 -3
- package/src/components/data-table/COMPONENT.md +5 -4
- 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 +8 -6
- package/src/components/digit-input/examples/in-form.tsx +22 -4
- package/src/components/digit-input/examples/on-complete.tsx +7 -6
- package/src/components/digit-input/examples/validation.tsx +12 -5
- package/src/components/dnd/COMPONENT.md +1 -1
- package/src/components/dnd/examples/examples.module.css +4 -4
- package/src/components/drawer/COMPONENT.md +1 -1
- package/src/components/drawer/examples/in-form.tsx +7 -2
- package/src/components/dropdown/COMPONENT.md +1 -1
- package/src/components/dropdown/examples/examples.module.css +1 -1
- package/src/components/empty-page/examples/examples.module.css +1 -1
- package/src/components/example-frame/COMPONENT.md +1 -1
- 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 +13 -4
- package/src/components/input/examples/in-form.tsx +42 -7
- package/src/components/input/examples/password-strength.tsx +12 -0
- package/src/components/input/examples/validation.tsx +38 -13
- package/src/components/kanban/COMPONENT.md +4 -4
- package/src/components/login-form/COMPONENT.md +4 -4
- package/src/components/login-form/examples/register.tsx +2 -2
- package/src/components/login-form/examples/reset-password.tsx +2 -2
- package/src/components/modal/COMPONENT.md +3 -3
- package/src/components/modal/examples/examples.module.css +2 -2
- 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/page-content/examples/examples.module.css +1 -1
- package/src/components/popover/COMPONENT.md +2 -2
- package/src/components/popover/examples/in-form.tsx +27 -5
- package/src/components/progress-bar/COMPONENT.md +5 -1
- package/src/components/progress-bar/examples/examples.module.css +7 -0
- package/src/components/progress-bar/examples/milestone.tsx +43 -0
- package/src/components/progress-bar/examples/steps.tsx +35 -0
- 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/skeleton/examples/with-crossfade.tsx +3 -3
- package/src/components/slider/COMPONENT.md +1 -1
- package/src/components/sparkline/COMPONENT.md +98 -0
- package/src/components/sparkline/examples/examples.module.css +13 -0
- package/src/components/sparkline/examples/overview.tsx +27 -0
- package/src/components/sparkline/examples/period.tsx +46 -0
- package/src/components/switch/COMPONENT.md +1 -1
- package/src/components/tabs/COMPONENT.md +15 -16
- package/src/components/tabs/examples/examples.module.css +14 -0
- package/src/components/tabs/examples/orientation.tsx +87 -33
- 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/components/tooltip/COMPONENT.md +8 -6
- package/src/components/tooltip/examples/examples.module.css +2 -2
- package/src/layout/app-header/COMPONENT.md +1 -1
- package/src/layout/app-header/examples/examples.module.css +4 -4
- package/src/layout/app-shell/COMPONENT.md +8 -8
- package/src/layout/app-shell/examples/examples.module.css +3 -3
- package/src/layout/bottom-nav/COMPONENT.md +1 -1
- package/src/layout/bottom-nav/examples/examples.module.css +1 -1
- package/src/layout/sidebar/COMPONENT.md +4 -4
- package/src/layout/sidebar/examples/examples.module.css +5 -5
- package/src/styles/globals.css +125 -2
- package/src/styles/theme-dark.css +37 -13
- package/src/styles/theme-light.css +61 -16
- package/src/styles/tokens.css +1 -0
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
## When to use
|
|
9
9
|
- Primary, secondary and destructive actions in forms, toolbars, dialogs, cards and empty states.
|
|
10
|
-
- Async actions: `loading` shows a spinner, blocks clicks and keeps the width.
|
|
10
|
+
- Async actions: `loading` shows a spinner, blocks clicks and keeps the width; when it ends, a new label («Сохранено») flows in.
|
|
11
|
+
- Long actions with known progress (downloads, exports): `progress` fills the button itself.
|
|
12
|
+
- Destructive actions without a dialog: `holdToConfirm` needs a held press.
|
|
11
13
|
- Compact toolbars: icon-only buttons (only `Button.Icon` inside) are square.
|
|
12
14
|
- Action-styled navigation: `asChild` with an `<a>` or a router link.
|
|
13
15
|
|
|
@@ -26,8 +28,11 @@ import { Button } from "prime-ui-kit";
|
|
|
26
28
|
## Anatomy
|
|
27
29
|
```
|
|
28
30
|
Button.Root <button> (or the single child with asChild); variant, tone, size; size tier for nested icons
|
|
31
|
+
├─ (fill) progress / hold wash under the label, rendered by Root once used, aria-hidden
|
|
29
32
|
├─ (Spinner) rendered by Root while loading, aria-hidden
|
|
33
|
+
├─ (label) text children; a changed label flows in letter by letter
|
|
30
34
|
└─ Button.Icon decorative icon wrapper (aria-hidden), sized to the tier
|
|
35
|
+
(hold hint) visually hidden description beside the button with holdToConfirm
|
|
31
36
|
```
|
|
32
37
|
|
|
33
38
|
## API
|
|
@@ -40,14 +45,18 @@ Button.Root <button> (or the single child with asChild); variant, tone, s
|
|
|
40
45
|
| Prop | Type | Default | Description |
|
|
41
46
|
|---|---|---|---|
|
|
42
47
|
| `variant` | `"solid" \| "soft" \| "outline" \| "ghost"` | `"solid"` | Visual treatment. |
|
|
43
|
-
| `tone` | `"accent" \| "neutral" \| "danger" \| "inherit"` | `"accent"` | Meaning of the action; `danger` for destructive actions. `inherit` takes the host's text color for an action on a colored host (a solid Banner); it needs `variant` `ghost`, `soft` or `outline`. |
|
|
48
|
+
| `tone` | `"accent" \| "neutral" \| "success" \| "danger" \| "inherit"` | `"accent"` | Meaning of the action; `danger` for destructive actions; `success` for an action that is done (a payment went through). `inherit` takes the host's text color for an action on a colored host (a solid Banner); it needs `variant` `ghost`, `soft` or `outline`. |
|
|
44
49
|
| `size` | `"xs" \| "s" \| "m" \| "l" \| "xl"` | `host tier, else "m"` | Control tier: height 28 · 32 · 36 · 40 · 48, padding, text, icon, radius. Without it the button takes the tier of its host (LoginForm, Popover, a field, a panel with a size), else `m`. |
|
|
45
50
|
| `fullWidth` | `boolean` | — | Stretches to the container width. |
|
|
46
51
|
| `loading` | `boolean` | `false` | Shows a `Spinner` in place of the leading icon or over the label, sets `aria-busy`, blocks clicks; width does not change. With `asChild` no spinner is added — the child owns its content. |
|
|
52
|
+
| `progress` | `number` | — | Progress of a long action started by the button, `0…1`: a wash of the text color grows inside from the start edge, `aria-busy` is set and the button stays pressable (to cancel). Put the number in the label («Скачивание 42%»); remove the prop when done and the fill fades out. |
|
|
53
|
+
| `holdToConfirm` | `boolean` | `false` | The action needs a held press: the fill runs for 1.2 s (a gesture clock, kept under reduced motion) and `onConfirm` fires at its end. Releasing, leaving or losing focus earlier rolls it back. Space and Enter hold too; the gesture is described to assistive tech by `labels.holdHint`. |
|
|
54
|
+
| `onConfirm` | `() => void` | — | Fires when a `holdToConfirm` press completes; the action goes here, not in `onClick`. |
|
|
55
|
+
| `labels` | `Partial<ButtonLabels>` | — | Built-in strings, see Labels. |
|
|
47
56
|
| `asChild` | `boolean` | `false` | Merges Button props and styles onto the single child element instead of rendering `<button>`. `disabled`/`loading` become `aria-disabled`. |
|
|
48
57
|
| `type` | `"button" \| "submit" \| "reset"` | `"button"` | Native button type; not forwarded with `asChild`. |
|
|
49
58
|
| `disabled` | `boolean` | — | Disabled state; `loading` also disables. |
|
|
50
|
-
| `children` | `ReactNode` | — | Label and `Button.Icon`. Only `Button.Icon` children → square icon-only button; give it `aria-label`. |
|
|
59
|
+
| `children` | `ReactNode` | — | Label and `Button.Icon`. Only `Button.Icon` children → square icon-only button; give it `aria-label`. A changed text label flows into the new one letter by letter while the width glides; a change of digits only («58 с» → «57 с», «42%» → «43%») stays in place. |
|
|
51
60
|
| `…rest` | `Omit<ButtonHTMLAttributes<HTMLButtonElement>, "size">` | — | `onClick`, `className`, `aria-*`, `data-*` and the other button attributes. |
|
|
52
61
|
|
|
53
62
|
### Button.Icon
|
|
@@ -66,9 +75,11 @@ Button.Root <button> (or the single child with asChild); variant, tone, s
|
|
|
66
75
|
| `solid` + `accent` | accent fill, accent-fg text, hover `accent-hover` | the one primary action of an area (Save, Publish) | yes |
|
|
67
76
|
| `solid` + `neutral` | `fill-muted` fill, primary text | a neutral filled action next to fields | |
|
|
68
77
|
| `solid` + `danger` | danger fill, danger-fg text | confirming a destructive action in a dialog | |
|
|
78
|
+
| `solid` + `success` | success fill, success-fg text; a button turning success glides its fill over `fast` | an action that is done: «Оплачено», «Отправлено» | |
|
|
69
79
|
| `soft` + `accent` | `accent-soft` fill, accent text | secondary but highlighted action | |
|
|
70
80
|
| `soft` + `neutral` | translucent `fill-subtle` wash, primary text | secondary actions (Cancel, Filters) | |
|
|
71
81
|
| `soft` + `danger` | `danger-soft` fill, danger text | secondary destructive action | |
|
|
82
|
+
| `soft` / `outline` / `ghost` + `success` | `success-soft` fill or wash, success text | a quieter done state next to other actions | |
|
|
72
83
|
| `outline` + `accent` | transparent, 1px `border-default` inset line, accent text | rare; accent action lighter than solid | |
|
|
73
84
|
| `outline` + `neutral` | transparent, 1px inset line, primary text | secondary action that needs an edge (Draft, Back) | |
|
|
74
85
|
| `outline` + `danger` | 1px inset line, danger text, `danger-soft` on hover | destructive trigger that opens a confirm | |
|
|
@@ -109,6 +120,9 @@ A Button lines up exactly with Input, Select, Datepicker trigger, SegmentedContr
|
|
|
109
120
|
| focus-visible | keyboard | outer focus ring with `--prime-focus-offset`; `tone="inherit"` draws it in `currentColor` |
|
|
110
121
|
| disabled | `disabled` | native `disabled`, `data-disabled="true"`, `fill-muted` + `text-disabled`, `cursor: not-allowed`; ghost stays transparent |
|
|
111
122
|
| loading | `loading` (native `<button>`) | `data-loading="true"`, native `disabled`, `aria-busy="true"`, colors kept (busy, not unavailable), no hover or press; a `Spinner` (`aria-hidden`) replaces the leading (or only) icon, otherwise it is centered over the hidden label (`data-loading-overlay="true"`) |
|
|
123
|
+
| progress | `progress` (0…1) | `data-progress="true"`, `aria-busy="true"`, still pressable; a plate of the text color with the button's radius slides in from the start edge (`fast` · standard), so corners match at any value; removing the prop fades it where it is |
|
|
124
|
+
| holding | `holdToConfirm` + a held pointer, `Space` or `Enter` | `data-hold="holding"`: the fill runs linearly for 1.2 s (kept under reduced motion — it is a gesture clock), then `onConfirm` and `data-hold="done"` (on release the fill fades in place, `data-hold="idle"`); releasing earlier → `data-hold="cancel"`, the fill rolls back (`fast` · exit) |
|
|
125
|
+
| label change | new text children | the old letters leave upward, the new ones rise from below one short step apart (`base` · emphasized, blur `--prime-motion-blur`) while the width glides; digits-only changes and reduced motion change in place |
|
|
112
126
|
| asChild disabled / loading | `asChild` + `disabled`/`loading` | `aria-disabled="true"`, `pointer-events: none`, click `preventDefault`; no native `disabled`, no automatic spinner |
|
|
113
127
|
|
|
114
128
|
Other data attributes: `data-variant`, `data-tone`, `data-size`, `data-full-width`, `data-icon-only`, `data-leading-icon`, `data-trailing-icon`.
|
|
@@ -123,19 +137,23 @@ Other data attributes: `data-variant`, `data-tone`, `data-size`, `data-full-widt
|
|
|
123
137
|
### Keyboard
|
|
124
138
|
| Key | Action |
|
|
125
139
|
|---|---|
|
|
126
|
-
| `Enter` · `Space` | Presses the button (native `<button>`). |
|
|
140
|
+
| `Enter` · `Space` | Presses the button (native `<button>`); with `holdToConfirm` the key is held until the fill completes. |
|
|
127
141
|
| `Tab` | Moves focus; a disabled button is skipped, with `asChild` it stays focusable with `aria-disabled`. |
|
|
128
142
|
|
|
129
143
|
### ARIA
|
|
130
144
|
- Native `<button>`, `type="button"` by default, so it never submits a form by accident.
|
|
131
145
|
- Icon-only buttons need `aria-label`; `Button.Icon` is `aria-hidden`.
|
|
132
|
-
- `loading` sets `aria-busy="true"` and blocks the press.
|
|
146
|
+
- `loading` sets `aria-busy="true"` and blocks the press; `progress` sets `aria-busy` and keeps the button pressable.
|
|
147
|
+
- `holdToConfirm` describes the gesture through `aria-describedby` (`labels.holdHint`); `Space` / `Enter` hold like a pointer.
|
|
148
|
+
- A changed label is announced once: the animated letters are hidden, the name is the new text.
|
|
133
149
|
- With `asChild` the disabled state is `aria-disabled="true"` without a native `disabled`.
|
|
134
150
|
|
|
135
151
|
### Labels
|
|
136
152
|
<!-- Generated from api.ts by `bun run docs:build`. Edit api.ts, not this section. -->
|
|
137
153
|
|
|
138
|
-
|
|
154
|
+
| Key | Default | Used for |
|
|
155
|
+
|---|---|---|
|
|
156
|
+
| `holdHint` | `"Удерживайте, чтобы подтвердить"` | Description of a `holdToConfirm` button for assistive tech (`aria-describedby`). |
|
|
139
157
|
|
|
140
158
|
## Examples
|
|
141
159
|
| Example | Shows |
|
|
@@ -145,9 +163,12 @@ No `labels`.
|
|
|
145
163
|
| [sizes.tsx](examples/sizes.tsx) | Every size tier, 28 to 48 px high — `size`. |
|
|
146
164
|
| [states.tsx](examples/states.tsx) | Disabled and loading next to the default; the spinner keeps the width — `disabled`, `loading`. |
|
|
147
165
|
| [with-icon.tsx](examples/with-icon.tsx) | An icon before or after the label, and a square icon-only button — `Button.Icon`, `aria-label`. |
|
|
166
|
+
| [download.tsx](examples/download.tsx) | A long download inside the button: the fill shows how far it got, the label counts and then offers the file — `progress`. |
|
|
167
|
+
| [hold-to-confirm.tsx](examples/hold-to-confirm.tsx) | A destructive action that needs a held press; letting go early rolls the fill back and does nothing — `holdToConfirm`, `onConfirm`. |
|
|
168
|
+
| [label-morph.tsx](examples/label-morph.tsx) | A new label flows into the button letter by letter while the width glides: save, then saved; a step flow that turns green once paid — `children`, `loading`, `tone`. |
|
|
148
169
|
| [on-colored-host.tsx](examples/on-colored-host.tsx) | Actions on a colored strip take its text color: a ghost icon close and a soft action — `tone="inherit"`. |
|
|
149
170
|
| [as-child.tsx](examples/as-child.tsx) | The button look on a real link; a disabled link blocks navigation — `asChild`, `disabled`. |
|
|
150
|
-
| [in-form.tsx](examples/in-form.tsx) | A full-width submit button that shows the request in progress — `type`, `loading`, `fullWidth`. |
|
|
171
|
+
| [in-form.tsx](examples/in-form.tsx) | A full-width submit button that shows the request in progress after the email passes validation — `type`, `loading`, `fullWidth`. |
|
|
151
172
|
|
|
152
173
|
## Mistakes
|
|
153
174
|
- `<Button.Root><Icon name="action.copy" /></Button.Root>` → wrap in `Button.Icon` so the button becomes square and the icon is sized.
|
|
@@ -156,6 +177,8 @@ No `labels`.
|
|
|
156
177
|
- Putting a `<Spinner />` inside a loading button → just set `loading`; the button places it.
|
|
157
178
|
- `<a>` inside `<Button.Root>` → use `asChild` so there is one interactive element.
|
|
158
179
|
- Submit button without `type="submit"` → the default is `"button"` and will not submit.
|
|
180
|
+
- A destructive `holdToConfirm` action in `onClick` → it fires on any click; put it in `onConfirm`.
|
|
181
|
+
- Rebuilding a progress label with a new word every tick («Загрузка…» / «Скачивание…») → keep the words, change only the number; digits update in place, words morph.
|
|
159
182
|
|
|
160
183
|
## Related
|
|
161
184
|
- **Built from:** [Spinner](../spinner/COMPONENT.md)
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** A long download inside the button: the fill shows how far it got, the label counts and then offers the file — `progress`. */
|
|
2
|
+
import { Button, Icon } from "prime-ui-kit";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
|
|
5
|
+
/** Share of the file received at each network tick. */
|
|
6
|
+
const TICKS = [0.06, 0.15, 0.27, 0.34, 0.48, 0.61, 0.66, 0.79, 0.88, 0.97, 1];
|
|
7
|
+
|
|
8
|
+
export default function ButtonDownloadExample() {
|
|
9
|
+
const [tick, setTick] = React.useState<number | null>(null);
|
|
10
|
+
const [ready, setReady] = React.useState(false);
|
|
11
|
+
|
|
12
|
+
React.useEffect(() => {
|
|
13
|
+
if (tick === null) return;
|
|
14
|
+
const timer = window.setTimeout(() => {
|
|
15
|
+
if (tick + 1 < TICKS.length) setTick(tick + 1);
|
|
16
|
+
else {
|
|
17
|
+
setTick(null);
|
|
18
|
+
setReady(true);
|
|
19
|
+
}
|
|
20
|
+
}, 220);
|
|
21
|
+
return () => window.clearTimeout(timer);
|
|
22
|
+
}, [tick]);
|
|
23
|
+
|
|
24
|
+
const progress = tick === null ? undefined : TICKS[tick];
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<Button.Root
|
|
28
|
+
variant={ready ? "soft" : "solid"}
|
|
29
|
+
progress={progress}
|
|
30
|
+
onClick={() => {
|
|
31
|
+
if (ready) setReady(false);
|
|
32
|
+
else if (tick === null) setTick(0);
|
|
33
|
+
}}
|
|
34
|
+
>
|
|
35
|
+
<Button.Icon>
|
|
36
|
+
<Icon name={ready ? "action.externalLink" : "action.download"} />
|
|
37
|
+
</Button.Icon>
|
|
38
|
+
{progress !== undefined
|
|
39
|
+
? `Скачивание ${Math.round(progress * 100)}%`
|
|
40
|
+
: ready
|
|
41
|
+
? "Открыть отчёт"
|
|
42
|
+
: "Скачать отчёт за октябрь"}
|
|
43
|
+
</Button.Root>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** A destructive action that needs a held press; letting go early rolls the fill back and does nothing — `holdToConfirm`, `onConfirm`. */
|
|
2
|
+
import { Button, Icon } from "prime-ui-kit";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
|
|
5
|
+
export default function ButtonHoldToConfirmExample() {
|
|
6
|
+
const [deleted, setDeleted] = React.useState(false);
|
|
7
|
+
|
|
8
|
+
return deleted ? (
|
|
9
|
+
<Button.Root variant="ghost" tone="neutral" onClick={() => setDeleted(false)}>
|
|
10
|
+
<Button.Icon>
|
|
11
|
+
<Icon name="action.refresh" />
|
|
12
|
+
</Button.Icon>
|
|
13
|
+
Восстановить проект
|
|
14
|
+
</Button.Root>
|
|
15
|
+
) : (
|
|
16
|
+
<Button.Root variant="soft" tone="danger" holdToConfirm onConfirm={() => setDeleted(true)}>
|
|
17
|
+
<Button.Icon>
|
|
18
|
+
<Icon name="action.delete" />
|
|
19
|
+
</Button.Icon>
|
|
20
|
+
Удерживайте, чтобы удалить проект
|
|
21
|
+
</Button.Root>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
@@ -1,27 +1,39 @@
|
|
|
1
|
-
/** A full-width submit button that shows the request in progress — `type`, `loading`, `fullWidth`. */
|
|
1
|
+
/** A full-width submit button that shows the request in progress after the email passes validation — `type`, `loading`, `fullWidth`. */
|
|
2
2
|
import { Button, Input } from "prime-ui-kit";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
|
|
5
5
|
import styles from "./examples.module.css";
|
|
6
6
|
|
|
7
|
+
/** The email error, or nothing when the address is valid. */
|
|
8
|
+
function emailError(value: string) {
|
|
9
|
+
if (!value.trim()) return "Введите рабочую почту";
|
|
10
|
+
if (!/^\S+@\S+\.\S+$/.test(value.trim())) return "Проверьте адрес: нужен вид name@company.ru";
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
|
|
7
14
|
export default function ButtonInFormExample() {
|
|
8
15
|
const [sending, setSending] = React.useState(false);
|
|
16
|
+
const [error, setError] = React.useState<string>();
|
|
9
17
|
|
|
10
18
|
const submit = (event: React.FormEvent<HTMLFormElement>) => {
|
|
11
19
|
event.preventDefault();
|
|
20
|
+
const next = emailError(String(new FormData(event.currentTarget).get("email") ?? ""));
|
|
21
|
+
setError(next);
|
|
22
|
+
if (next) return;
|
|
12
23
|
setSending(true);
|
|
13
24
|
window.setTimeout(() => setSending(false), 1500);
|
|
14
25
|
};
|
|
15
26
|
|
|
16
27
|
return (
|
|
17
|
-
<form className={styles.form} onSubmit={submit}>
|
|
18
|
-
<Input.Root label="Рабочая почта" required>
|
|
28
|
+
<form className={styles.form} noValidate onSubmit={submit}>
|
|
29
|
+
<Input.Root label="Рабочая почта" required error={error} reserveSupportRow>
|
|
19
30
|
<Input.Wrapper>
|
|
20
31
|
<Input.Field
|
|
21
32
|
type="email"
|
|
22
33
|
name="email"
|
|
23
34
|
placeholder="name@company.ru"
|
|
24
35
|
autoComplete="email"
|
|
36
|
+
onValueChange={() => setError(undefined)}
|
|
25
37
|
/>
|
|
26
38
|
</Input.Wrapper>
|
|
27
39
|
</Input.Root>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/** A new label flows into the button letter by letter while the width glides: save, then saved; a step flow that turns green once paid — `children`, `loading`, `tone`. */
|
|
2
|
+
import { Button } from "prime-ui-kit";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
|
|
5
|
+
const STEPS = ["Продолжить", "Подтвердить оплату", "Оплачено"];
|
|
6
|
+
|
|
7
|
+
export default function ButtonLabelMorphExample() {
|
|
8
|
+
const [save, setSave] = React.useState<"idle" | "saving" | "saved">("idle");
|
|
9
|
+
const [step, setStep] = React.useState(0);
|
|
10
|
+
|
|
11
|
+
React.useEffect(() => {
|
|
12
|
+
if (save === "idle") return;
|
|
13
|
+
const timer = window.setTimeout(
|
|
14
|
+
() => setSave(save === "saving" ? "saved" : "idle"),
|
|
15
|
+
save === "saving" ? 1200 : 2000,
|
|
16
|
+
);
|
|
17
|
+
return () => window.clearTimeout(timer);
|
|
18
|
+
}, [save]);
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<>
|
|
22
|
+
<Button.Root
|
|
23
|
+
variant="soft"
|
|
24
|
+
tone="neutral"
|
|
25
|
+
loading={save === "saving"}
|
|
26
|
+
onClick={() => setSave("saving")}
|
|
27
|
+
>
|
|
28
|
+
{save === "saved" ? "Изменения сохранены" : "Сохранить изменения"}
|
|
29
|
+
</Button.Root>
|
|
30
|
+
<Button.Root
|
|
31
|
+
tone={step === STEPS.length - 1 ? "success" : "accent"}
|
|
32
|
+
onClick={() => setStep((step + 1) % STEPS.length)}
|
|
33
|
+
>
|
|
34
|
+
{STEPS[step]}
|
|
35
|
+
</Button.Root>
|
|
36
|
+
</>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
@@ -39,7 +39,7 @@ Card.Root variant="cover" Media · Body(Title, Description) · Footer
|
|
|
39
39
|
<!-- Generated from api.ts by `bun run docs:build`. Edit api.ts, not this section. -->
|
|
40
40
|
|
|
41
41
|
### Card.Root
|
|
42
|
-
`ref` → `HTMLDivElement`.
|
|
42
|
+
`ref` → `HTMLDivElement`. A layer of the surface ladder (`data-depth` one above the surface around it: white on the light page, the next layer when nested; radius 12, the raised whisper only on the page, no border) and a size container; `variant` picks the template layout of its parts.
|
|
43
43
|
|
|
44
44
|
| Prop | Type | Default | Description |
|
|
45
45
|
|---|---|---|---|
|
|
@@ -143,13 +143,15 @@ Card.Root variant="cover" Media · Body(Title, Description) · Footer
|
|
|
143
143
|
|---|---|---|
|
|
144
144
|
| template | `variant` | `data-variant` |
|
|
145
145
|
| flat | `flat` | `data-flat` |
|
|
146
|
+
| depth | nesting: one above the nearest surface (the page and the AppShell panel are 0) | `data-depth` (`1`–`4`, `floating-1`/`floating-2` inside a floating layer); the fill is `--prime-color-layer-current`, the shadow only at depth 1 |
|
|
146
147
|
| card width | container queries | `split` stacks below 22rem, `Header` wraps below 22rem, the `stat-trend` value changes at 20rem / 36rem |
|
|
147
148
|
|
|
148
149
|
Card is static: no hover, focus or press of its own.
|
|
149
150
|
|
|
150
151
|
## Layout & spacing
|
|
151
152
|
- Grid of cards: `repeat(auto-fit, minmax(min(100%, 14rem), 1fr))`, gap `--prime-space-4`.
|
|
152
|
-
- Padding `--prime-card-padding-m` (20); `Body` gap `--prime-card-gap` (16); fields inside `Body` 20 apart,
|
|
153
|
+
- Padding `--prime-card-padding-m` (20); `Body` gap `--prime-card-gap` (16); fields inside `Body` 20 apart, one ladder step off the card.
|
|
154
|
+
- Depth comes from nesting (foundation §4): on the page — the AppShell panel is the page — a card is layer 1 (white in light) with the raised whisper; inside another card it is the next layer, a flat tile. The ladder stops at layer 4.
|
|
153
155
|
- Long values wrap, labels truncate; a chart SVG needs a CSS height.
|
|
154
156
|
- In a `Header` the title takes the free width; a control or a caption after it sits at the end without a wrapper.
|
|
155
157
|
|
|
@@ -28,7 +28,7 @@ export default function CardNarrowExample() {
|
|
|
28
28
|
<Icon name="object.wallet" />
|
|
29
29
|
</Card.Icon>
|
|
30
30
|
<Card.Label>Средний чек</Card.Label>
|
|
31
|
-
<Card.Value
|
|
31
|
+
<Card.Value>2 450 ₽</Card.Value>
|
|
32
32
|
</div>
|
|
33
33
|
</Card.Body>
|
|
34
34
|
</Card.Root>
|
|
@@ -36,7 +36,7 @@ export default function CardNarrowExample() {
|
|
|
36
36
|
<div className={width.className}>
|
|
37
37
|
<Card.Root variant="stat-trend">
|
|
38
38
|
<Card.Label>Выручка</Card.Label>
|
|
39
|
-
<Card.Value
|
|
39
|
+
<Card.Value>4,2 млн ₽</Card.Value>
|
|
40
40
|
<Card.Delta tone="success">+18% к прошлому месяцу</Card.Delta>
|
|
41
41
|
</Card.Root>
|
|
42
42
|
</div>
|
|
@@ -23,7 +23,7 @@ export default function CardPanelChartExample() {
|
|
|
23
23
|
</Card.Header>
|
|
24
24
|
<Card.Body>
|
|
25
25
|
<Typography variant="body-s" tone="secondary">
|
|
26
|
-
С начала квартала:
|
|
26
|
+
С начала квартала: 12,6 млн ₽, план выполнен на 84%.
|
|
27
27
|
</Typography>
|
|
28
28
|
</Card.Body>
|
|
29
29
|
<Card.Media>
|
|
@@ -24,7 +24,7 @@ export default function CardVariantsExample() {
|
|
|
24
24
|
|
|
25
25
|
<Card.Root variant="stat-trend">
|
|
26
26
|
<Card.Label>Выручка за месяц</Card.Label>
|
|
27
|
-
<Card.Value
|
|
27
|
+
<Card.Value>4,2 млн ₽</Card.Value>
|
|
28
28
|
<Card.Delta tone="success">+18% к сентябрю</Card.Delta>
|
|
29
29
|
</Card.Root>
|
|
30
30
|
|
|
@@ -103,7 +103,7 @@ Checkbox has no `variant` / `tone` / `color`.
|
|
|
103
103
|
| unchecked | `checked={false}` / default | `data-state="unchecked"`; box `fill-strong`, hover `fill-strong-hover` |
|
|
104
104
|
| checked | `checked` / `defaultChecked` | `data-state="checked"`; accent box, the check draws in |
|
|
105
105
|
| indeterminate | `indeterminate` | `data-state="indeterminate"`, `input.indeterminate`; accent box with a bar |
|
|
106
|
-
| invalid | `invalid` or a non-empty `error` | `data-invalid="true"`, `aria-invalid` on the input; danger ring on the unchecked box and on focus |
|
|
106
|
+
| invalid | `invalid` or a non-empty `error` | `data-invalid="true"`, `aria-invalid` on the input; danger ring on the unchecked box and on focus; the row shakes once when an error arrives (`data-shake`) |
|
|
107
107
|
| disabled | `disabled` | `data-disabled="true"` on the root; `fill-muted` box, disabled text, `cursor: not-allowed` |
|
|
108
108
|
| read-only | `readOnly` | `aria-readonly="true"` on the input, `data-readonly="true"` on the root; the state stays, no hover or press, default cursor |
|
|
109
109
|
| pressed | pointer press | the box scales to the compact press scale |
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
width: min(100%, var(--prime-panel-min-width));
|
|
42
42
|
padding: var(--prime-panel-padding);
|
|
43
43
|
border-radius: var(--prime-panel-radius);
|
|
44
|
-
background: var(--prime-color-bg
|
|
44
|
+
background: var(--prime-color-layer-floating-bg);
|
|
45
45
|
box-shadow: var(--prime-shadow-overlay);
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**Category:** data-display
|
|
4
4
|
**Kind:** primitive
|
|
5
5
|
|
|
6
|
-
> A static TypeScript / TSX snippet with syntax highlighting, on a
|
|
6
|
+
> A static TypeScript / TSX snippet with syntax highlighting, on a filled panel or bare inside a host.
|
|
7
7
|
|
|
8
8
|
## When to use
|
|
9
9
|
- Code samples in docs, settings («API key usage») and onboarding.
|
|
@@ -37,7 +37,7 @@ CodeBlock <pre>; variant, colorScheme (data-theme)
|
|
|
37
37
|
| Prop | Type | Default | Description |
|
|
38
38
|
|---|---|---|---|
|
|
39
39
|
| `code` | `string` | — (required) | TS / TSX source; trailing whitespace is trimmed, then highlighted. |
|
|
40
|
-
| `variant` | `"soft" \| "ghost"` | `"soft"` | `soft` —
|
|
40
|
+
| `variant` | `"soft" \| "ghost"` | `"soft"` | `soft` — a filled panel (one ladder step off its host) with padding and the `code` text role; `ghost` — bare `pre` that inherits type and background from its host. |
|
|
41
41
|
| `colorScheme` | `"light" \| "dark"` | — | Fixes the theme for this block only (`data-theme`). Omit to follow the page theme. |
|
|
42
42
|
| `tabIndex` | `number` | — | Default `0` for `soft` (a scrolling block stays reachable from the keyboard), none for `ghost`; pass `-1` when it never overflows. |
|
|
43
43
|
| `…rest` | `Omit<HTMLAttributes<HTMLPreElement>, "children" \| "dangerouslySetInnerHTML">` | — | `className`, `aria-label` and the other `<pre>` attributes. |
|
|
@@ -54,8 +54,8 @@ CodeBlock <pre>; variant, colorScheme (data-theme)
|
|
|
54
54
|
| Value | Looks like | Use when | Default |
|
|
55
55
|
|---|---|---|---|
|
|
56
56
|
| — (omitted) | token colors and fill follow the page theme | normal case | yes |
|
|
57
|
-
| `light` | light palette; the soft fill becomes that scheme's `bg
|
|
58
|
-
| `dark` | dark palette; the soft fill becomes that scheme's `bg
|
|
57
|
+
| `light` | light palette; the soft fill becomes that scheme's floating layer (`layer-floating-bg`) | a light sample inside a dark page | |
|
|
58
|
+
| `dark` | dark palette; the soft fill becomes that scheme's floating layer (`layer-floating-bg`) | a terminal-like sample inside a light page | |
|
|
59
59
|
|
|
60
60
|
Syntax tokens: keywords purple (weight 500), strings teal, numbers orange, JSX tags blue, comments muted italic — palette text tokens, readable in both themes.
|
|
61
61
|
|
|
@@ -92,8 +92,8 @@ No `labels`.
|
|
|
92
92
|
## Examples
|
|
93
93
|
| Example | Shows |
|
|
94
94
|
|---|---|
|
|
95
|
-
| [overview.tsx](examples/overview.tsx) | An API response sample on a
|
|
96
|
-
| [variants.tsx](examples/variants.tsx) | A
|
|
95
|
+
| [overview.tsx](examples/overview.tsx) | An API response sample on a filled panel, named for screen readers — `code`, `aria-label`. |
|
|
96
|
+
| [variants.tsx](examples/variants.tsx) | A filled panel and a bare block that takes type and background from its host — `variant`. |
|
|
97
97
|
| [color-scheme.tsx](examples/color-scheme.tsx) | A block fixed to one scheme looks the same in both page themes — `colorScheme`. |
|
|
98
98
|
| [narrow.tsx](examples/narrow.tsx) | In a narrow column a long line scrolls inside the block and never wraps; Tab, then arrow keys. |
|
|
99
99
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** An API response sample on a
|
|
1
|
+
/** An API response sample on a filled panel, named for screen readers — `code`, `aria-label`. */
|
|
2
2
|
import { CodeBlock } from "prime-ui-kit";
|
|
3
3
|
|
|
4
4
|
import styles from "./examples.module.css";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** A
|
|
1
|
+
/** A filled panel and a bare block that takes type and background from its host — `variant`. */
|
|
2
2
|
import { CodeBlock, Typography } from "prime-ui-kit";
|
|
3
3
|
|
|
4
4
|
const SAMPLE = `const total = formatPrice(14990);`;
|
|
@@ -211,7 +211,7 @@ No `variant` / `tone` / `color`.
|
|
|
211
211
|
| Value | Looks like | Use when | Default |
|
|
212
212
|
|---|---|---|---|
|
|
213
213
|
| `none` | parts stacked with a 12px gap, no own background | inside a Popover or a Card | yes |
|
|
214
|
-
| `raised` | `
|
|
214
|
+
| `raised` | the floating layer of the ladder (`data-depth="floating"`), panel radius and padding, `shadow-overlay`; fields take that layer's fill | a standalone panel on the page | |
|
|
215
215
|
|
|
216
216
|
### defaultFormat (ColorPicker.Root)
|
|
217
217
|
| Value | Looks like | Use when | Default |
|
|
@@ -307,13 +307,13 @@ There is no `disabled` on `ColorPicker.Root` — disable parts individually. Con
|
|
|
307
307
|
| [overview.tsx](examples/overview.tsx) | A color field: a hex value and a swatch button that opens the picker panel — `ColorPicker.HexInput`, `ColorPicker.TriggerSwatch`. |
|
|
308
308
|
| [sizes.tsx](examples/sizes.tsx) | Every size of the hex field with a swatch button of the same tier — `size`. |
|
|
309
309
|
| [states.tsx](examples/states.tsx) | A disabled area and hue slider keep showing the color but take no input — `disabled`. |
|
|
310
|
-
| [validation.tsx](examples/validation.tsx) | A
|
|
310
|
+
| [validation.tsx](examples/validation.tsx) | A button color checked live: a too light color shakes in an error that leaves once the color is darker; a hint under the other field, invalid text reverts on blur — `hint`, `error`. |
|
|
311
311
|
| [panel.tsx](examples/panel.tsx) | The full raised panel and its part order: format, area, hue and alpha sliders, channels, brand swatches — `ColorPicker.Panel`, `surface`, `ColorPicker.Swatches`. |
|
|
312
312
|
| [formats.tsx](examples/formats.tsx) | The channel strip in each value format; three pickers edit one color — `defaultFormat`, `ColorPicker.ChannelStrip`. |
|
|
313
313
|
| [presets.tsx](examples/presets.tsx) | A quick color from the palette: a square trigger next to a field and a Button trigger; «no color» allowed — `ColorPresets`, `allowEmpty`, `asChild`. |
|
|
314
314
|
| [presets-sizes.tsx](examples/presets-sizes.tsx) | The preset trigger in every size, a square of the control height next to an input of the same tier — `ColorPresets`, `size`. |
|
|
315
315
|
| [controlled.tsx](examples/controlled.tsx) | The parent owns the color: brand swatches and the hex field edit it, a button resets it — `value`, `onValueChange`. |
|
|
316
|
-
| [in-form.tsx](examples/in-form.tsx) | Theme settings: the color goes with the form
|
|
316
|
+
| [in-form.tsx](examples/in-form.tsx) | Theme settings: the color goes with the form, a too light color shakes in an error on save that leaves once the color changes — `value`, `error`. |
|
|
317
317
|
|
|
318
318
|
## Mistakes
|
|
319
319
|
- Trigger in one `ColorPicker.Root` and panel in another → they will not share the color; wrap both in one Root.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/** Theme settings: the color goes with the form
|
|
2
|
-
import { Button, Input } from "prime-ui-kit";
|
|
1
|
+
/** Theme settings: the color goes with the form, a too light color shakes in an error on save that leaves once the color changes — `value`, `error`. */
|
|
2
|
+
import { Button, Input, Typography } from "prime-ui-kit";
|
|
3
3
|
import { ColorPicker, parseColor } from "prime-ui-kit/color-picker";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
|
|
@@ -10,13 +10,15 @@ const MAX_LIGHTNESS = 80;
|
|
|
10
10
|
export default function ColorPickerInFormExample() {
|
|
11
11
|
const [color, setColor] = React.useState(() => parseColor("#f2f2f2"));
|
|
12
12
|
const [error, setError] = React.useState<string>();
|
|
13
|
+
const [saved, setSaved] = React.useState(false);
|
|
13
14
|
|
|
14
15
|
const submit = (event: React.FormEvent<HTMLFormElement>) => {
|
|
15
16
|
event.preventDefault();
|
|
16
17
|
const lightness = color.toFormat("hsl").getChannelValue("lightness");
|
|
17
|
-
|
|
18
|
-
lightness > MAX_LIGHTNESS ? "Слишком светлый: белый текст на нём не читается" : undefined
|
|
19
|
-
);
|
|
18
|
+
const next =
|
|
19
|
+
lightness > MAX_LIGHTNESS ? "Слишком светлый: белый текст на нём не читается" : undefined;
|
|
20
|
+
setError(next);
|
|
21
|
+
setSaved(next === undefined);
|
|
20
22
|
};
|
|
21
23
|
|
|
22
24
|
return (
|
|
@@ -31,11 +33,17 @@ export default function ColorPickerInFormExample() {
|
|
|
31
33
|
onValueChange={(next) => {
|
|
32
34
|
setColor(next);
|
|
33
35
|
setError(undefined);
|
|
36
|
+
setSaved(false);
|
|
34
37
|
}}
|
|
35
38
|
>
|
|
36
39
|
<ColorPicker.HexInput label="Цвет кнопок" error={error} />
|
|
37
40
|
</ColorPicker.Root>
|
|
38
41
|
<input type="hidden" name="buttonColor" value={color.toString("hex")} />
|
|
42
|
+
{saved ? (
|
|
43
|
+
<Typography as="p" variant="body-s" tone="secondary" role="status">
|
|
44
|
+
Тема сохранена.
|
|
45
|
+
</Typography>
|
|
46
|
+
) : null}
|
|
39
47
|
<div className={styles.actions}>
|
|
40
48
|
<Button.Root type="submit">Сохранить тему</Button.Root>
|
|
41
49
|
</div>
|
|
@@ -1,16 +1,22 @@
|
|
|
1
|
-
/** A
|
|
2
|
-
import { ColorPicker } from "prime-ui-kit/color-picker";
|
|
1
|
+
/** A button color checked live: a too light color shakes in an error that leaves once the color is darker; a hint under the other field, invalid text reverts on blur — `hint`, `error`. */
|
|
2
|
+
import { ColorPicker, parseColor } from "prime-ui-kit/color-picker";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
|
|
5
|
+
const MAX_LIGHTNESS = 80;
|
|
3
6
|
|
|
4
7
|
export default function ColorPickerValidationExample() {
|
|
8
|
+
const [color, setColor] = React.useState(() => parseColor("#f5f5f5"));
|
|
9
|
+
const tooLight = color.toFormat("hsl").getChannelValue("lightness") > MAX_LIGHTNESS;
|
|
10
|
+
|
|
5
11
|
return (
|
|
6
12
|
<>
|
|
7
13
|
<ColorPicker.Root defaultValue="#0090ff">
|
|
8
14
|
<ColorPicker.HexInput label="Цвет ссылок" hint="Формат #RRGGBB или #RRGGBBAA" />
|
|
9
15
|
</ColorPicker.Root>
|
|
10
|
-
<ColorPicker.Root
|
|
16
|
+
<ColorPicker.Root value={color} onValueChange={setColor}>
|
|
11
17
|
<ColorPicker.HexInput
|
|
12
18
|
label="Цвет кнопок"
|
|
13
|
-
error="Слишком светлый: белый текст на нём не читается"
|
|
19
|
+
error={tooLight ? "Слишком светлый: белый текст на нём не читается" : undefined}
|
|
14
20
|
/>
|
|
15
21
|
</ColorPicker.Root>
|
|
16
22
|
</>
|
|
@@ -48,7 +48,7 @@ ColorSwatches field frame: label → swatches → hint | error
|
|
|
48
48
|
| `optional` | `boolean` | — | Muted marker right after the label text (`labels.optional`). |
|
|
49
49
|
| `hint` | `ReactNode` | — | Help text under the swatches. Hidden while `error` is shown. |
|
|
50
50
|
| `error` | `ReactNode` | — | Error message in the hint slot; implies `invalid`. |
|
|
51
|
-
| `invalid` | `boolean` | — | Danger
|
|
51
|
+
| `invalid` | `boolean` | — | Danger inner edge on every swatch and `aria-invalid`. A non-empty `error` implies it. |
|
|
52
52
|
| `disabled` | `boolean` | `false` | Disables every swatch (grey, half transparent). |
|
|
53
53
|
| `allowEmpty` | `boolean` | `false` | Adds the «no color» checkerboard swatch after the presets (value `null`). |
|
|
54
54
|
| `name` | `string` | — | Form field name: a hidden input submits the selected color (empty string for no color). |
|
|
@@ -76,7 +76,7 @@ ColorSwatches field frame: label → swatches → hint | error
|
|
|
76
76
|
| Value | Looks like | Use when | Default |
|
|
77
77
|
|---|---|---|---|
|
|
78
78
|
| `allowEmpty` | an extra checkerboard swatch «Без цвета» at the end | the color is optional | `false` |
|
|
79
|
-
| `invalid` | the
|
|
79
|
+
| `invalid` | the inner edge of every swatch turns danger | the message is shown elsewhere; otherwise pass `error` | — |
|
|
80
80
|
| `disabled` | every swatch grey at half opacity | the choice is unavailable | `false` |
|
|
81
81
|
|
|
82
82
|
**Combinations**
|
|
@@ -87,17 +87,17 @@ ColorSwatches field frame: label → swatches → hint | error
|
|
|
87
87
|
## States
|
|
88
88
|
| State | Driven by | DOM |
|
|
89
89
|
|---|---|---|
|
|
90
|
-
| selected | `value` / `defaultValue` | `aria-checked="true"`, `data-state="checked"` on the radio;
|
|
90
|
+
| selected | `value` / `defaultValue` | `aria-checked="true"`, `data-state="checked"` on the radio; the check mark (light or dark by color contrast) scales in from half size (`base` · emphasized) and leaves faster (`fast` · exit); no ring — the check is the selection |
|
|
91
91
|
| hover | pointer | the swatch scales to 1.08 (fine pointers only) |
|
|
92
92
|
| focus-visible | keyboard | focus ring outside the swatch |
|
|
93
|
-
| invalid | `invalid` / `error` | `aria-invalid`, `data-invalid` on the group; the
|
|
93
|
+
| invalid | `invalid` / `error` | `aria-invalid`, `data-invalid` on the group; the inner edge of every swatch turns `danger-border`; the control shakes once when an error arrives (`data-shake` on the frame) |
|
|
94
94
|
| disabled | `disabled` | native `disabled` on every radio, `aria-disabled` and `data-disabled` on the group |
|
|
95
95
|
|
|
96
96
|
Controlled with `value` + `onValueChange`; uncontrolled with `defaultValue`.
|
|
97
97
|
|
|
98
98
|
## Layout & spacing
|
|
99
99
|
- The swatches take the container width and wrap to new rows by themselves; no column count to set. In a content-sized container they stay in one row.
|
|
100
|
-
- The
|
|
100
|
+
- The keyboard focus ring sits outside the swatches; kit hosts (Modal / Drawer body, panels, cards) already keep `--prime-focus-space` padding, so the ring is never clipped. In your own `overflow` container, keep that padding.
|
|
101
101
|
- Label → swatches and swatches → hint use the tier `label-gap` / `hint-gap`; field → field 20.
|
|
102
102
|
|
|
103
103
|
## Accessibility
|
|
@@ -132,7 +132,7 @@ Controlled with `value` + `onValueChange`; uncontrolled with `defaultValue`.
|
|
|
132
132
|
| [states.tsx](examples/states.tsx) | A default palette next to an invalid and a disabled one — `invalid`, `disabled`. |
|
|
133
133
|
| [wrapping.tsx](examples/wrapping.tsx) | In a narrow column the swatches wrap by themselves and the arrows move by the visual rows. |
|
|
134
134
|
| [controlled.tsx](examples/controlled.tsx) | The parent owns the color, «no color» included, and names it in the hint — `value`, `onValueChange`, `allowEmpty`. |
|
|
135
|
-
| [in-form.tsx](examples/in-form.tsx) | A calendar event form: the color is submitted by `name` and required on save — `name`, `required`, `error`. |
|
|
135
|
+
| [in-form.tsx](examples/in-form.tsx) | A calendar event form: the color is submitted by `name` and required on save: submitting an empty title or no color shakes the field, picking or typing clears the error — `name`, `required`, `error`. |
|
|
136
136
|
|
|
137
137
|
## Mistakes
|
|
138
138
|
- `<ColorSwatches.Root>` → the component is a single export: `<ColorSwatches />`.
|
|
@@ -1,23 +1,29 @@
|
|
|
1
|
-
/** A calendar event form: the color is submitted by `name` and required on save — `name`, `required`, `error`. */
|
|
1
|
+
/** A calendar event form: the color is submitted by `name` and required on save: submitting an empty title or no color shakes the field, picking or typing clears the error — `name`, `required`, `error`. */
|
|
2
2
|
import { Button, ColorSwatches, Input } from "prime-ui-kit";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
|
|
5
5
|
import styles from "./examples.module.css";
|
|
6
6
|
|
|
7
7
|
export default function ColorSwatchesInFormExample() {
|
|
8
|
+
const [titleError, setTitleError] = React.useState<string>();
|
|
8
9
|
const [error, setError] = React.useState<string>();
|
|
9
10
|
|
|
10
11
|
const submit = (event: React.FormEvent<HTMLFormElement>) => {
|
|
11
12
|
event.preventDefault();
|
|
12
|
-
const
|
|
13
|
-
|
|
13
|
+
const data = new FormData(event.currentTarget);
|
|
14
|
+
setTitleError(String(data.get("title") ?? "").trim() ? undefined : "Введите название события");
|
|
15
|
+
setError(data.get("color") ? undefined : "Выберите цвет события");
|
|
14
16
|
};
|
|
15
17
|
|
|
16
18
|
return (
|
|
17
19
|
<form className={styles.form} noValidate onSubmit={submit}>
|
|
18
|
-
<Input.Root label="Название события" required>
|
|
20
|
+
<Input.Root label="Название события" required error={titleError} reserveSupportRow>
|
|
19
21
|
<Input.Wrapper>
|
|
20
|
-
<Input.Field
|
|
22
|
+
<Input.Field
|
|
23
|
+
name="title"
|
|
24
|
+
defaultValue="Встреча с поставщиком"
|
|
25
|
+
onValueChange={() => setTitleError(undefined)}
|
|
26
|
+
/>
|
|
21
27
|
</Input.Wrapper>
|
|
22
28
|
</Input.Root>
|
|
23
29
|
<ColorSwatches
|
|
@@ -111,7 +111,7 @@ CommandMenu.Root Modal + top-aligned palette panel, query state
|
|
|
111
111
|
| `keys` | `ReactNode[]` | — (required) | FooterHint: the keys (text or icons). |
|
|
112
112
|
|
|
113
113
|
## Variants
|
|
114
|
-
One look:
|
|
114
|
+
One look: the floating layer of the ladder (it is a Modal), `--prime-modal-radius`, `shadow-modal`, `--prime-modal-width-l` wide, placed in the top part of the viewport so the search row never jumps while the list filters.
|
|
115
115
|
|
|
116
116
|
### size (Root)
|
|
117
117
|
| Value | Looks like | Use when | Default |
|