@k8ordo/ui 2.3.1 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +75 -183
- package/dist/catalog/icon-map.d.mts +108 -0
- package/dist/catalog/icon-map.mjs +212 -0
- package/dist/catalog/icon-names.d.mts +1 -0
- package/dist/catalog/icon-names.mjs +108 -0
- package/dist/catalog/index.d.mts +1289 -0
- package/dist/catalog/index.mjs +419 -0
- package/dist/catalog/render.css +34 -0
- package/dist/catalog/render.d.mts +72 -0
- package/dist/catalog/render.mjs +631 -0
- package/dist/catalog/render.module.mjs +11 -0
- package/dist/{integrations/_shared → catalog}/schemas.d.mts +550 -307
- package/dist/{integrations/_shared → catalog}/schemas.mjs +191 -184
- package/dist/catalog/to-tree.d.mts +4 -0
- package/dist/catalog/to-tree.mjs +17 -0
- package/dist/components/_internal/checked-values.d.mts +1 -0
- package/dist/components/_internal/checked-values.mjs +5 -0
- package/dist/components/_internal/field-message.css +25 -0
- package/dist/components/_internal/field-message.d.mts +10 -0
- package/dist/components/_internal/field-message.mjs +22 -0
- package/dist/components/_internal/field-message.module.mjs +9 -0
- package/dist/components/_internal/focus-ring.css +1 -1
- package/dist/components/_internal/high-contrast.css +1 -0
- package/dist/components/{observers/in-view → _internal}/in-view.mjs +1 -1
- package/dist/components/{observers/resize → _internal}/resize.mjs +1 -1
- package/dist/components/ai/_internal/attachment-preview.mjs +3 -3
- package/dist/components/ai/_internal/collapsible.mjs +2 -2
- package/dist/components/ai/attachment/attachment.d.mts +1 -1
- package/dist/components/ai/attachment/index.d.mts +1 -1
- package/dist/components/ai/conversation/conversation.mjs +4 -4
- package/dist/components/ai/index.d.mts +2 -2
- package/dist/components/ai/message/index.d.mts +2 -2
- package/dist/components/ai/message/message.d.mts +2 -2
- package/dist/components/ai/message/message.mjs +14 -12
- package/dist/components/ai/prompt-input/prompt-input.mjs +5 -5
- package/dist/components/ai/reasoning/reasoning.mjs +1 -1
- package/dist/components/ai/source/index.d.mts +2 -2
- package/dist/components/ai/source/source.d.mts +2 -2
- package/dist/components/ai/source/source.mjs +2 -2
- package/dist/components/ai/tool-invocation/approval-bar.mjs +11 -22
- package/dist/components/ai/tool-invocation/tool-invocation.d.mts +2 -2
- package/dist/components/ai/tool-invocation/tool-invocation.mjs +2 -1
- package/dist/components/buttons/button/button.css +1 -1
- package/dist/components/buttons/button/button.d.mts +34 -37
- package/dist/components/buttons/button/button.mjs +37 -24
- package/dist/components/buttons/button/button.module.mjs +0 -1
- package/dist/components/buttons/button/index.d.mts +2 -2
- package/dist/components/buttons/copy-button/copy-button.mjs +6 -4
- package/dist/components/buttons/icon-button/icon-button.css +3 -3
- package/dist/components/buttons/icon-button/icon-button.d.mts +37 -43
- package/dist/components/buttons/icon-button/icon-button.mjs +73 -63
- package/dist/components/buttons/icon-button/icon-button.module.mjs +2 -2
- package/dist/components/buttons/icon-button/index.d.mts +2 -2
- package/dist/components/buttons/toolbar/toolbar.css +5 -1
- package/dist/components/buttons/toolbar/toolbar.mjs +1 -1
- package/dist/components/data-display/accordion/accordion-button.d.mts +4 -1
- package/dist/components/data-display/accordion/accordion-button.mjs +5 -5
- package/dist/components/data-display/accordion/index.d.mts +3 -3
- package/dist/components/data-display/card/card-action.d.mts +6 -0
- package/dist/components/data-display/card/card-action.mjs +21 -0
- package/dist/components/data-display/card/card.css +24 -0
- package/dist/components/data-display/card/card.d.mts +26 -3
- package/dist/components/data-display/card/card.mjs +46 -6
- package/dist/components/data-display/card/card.module.mjs +4 -1
- package/dist/components/data-display/card/index.d.mts +2 -2
- package/dist/components/data-display/carousel/carousel.mjs +3 -3
- package/dist/components/data-display/code/code.css +4 -0
- package/dist/components/data-display/code-block/code-block.mjs +1 -1
- package/dist/components/data-display/data-table/data-table.css +0 -3
- package/dist/components/data-display/data-table/data-table.mjs +25 -26
- package/dist/components/data-display/tree/tree.d.mts +1 -1
- package/dist/components/data-display/tree/tree.mjs +7 -6
- package/dist/components/feedback/alert/alert.d.mts +2 -7
- package/dist/components/feedback/alert/alert.mjs +12 -11
- package/dist/components/feedback/alert/index.d.mts +2 -2
- package/dist/components/feedback/callout/callout.mjs +3 -3
- package/dist/components/feedback/progress/progress.mjs +1 -1
- package/dist/components/feedback/toast/context.d.mts +4 -5
- package/dist/components/feedback/toast/index.d.mts +2 -2
- package/dist/components/feedback/toast/provider.d.mts +7 -2
- package/dist/components/feedback/toast/provider.mjs +7 -2
- package/dist/components/feedback/toast/toast.d.mts +2 -3
- package/dist/components/form/autocomplete/autocomplete.d.mts +2 -2
- package/dist/components/form/autocomplete/autocomplete.mjs +15 -12
- package/dist/components/form/calendar/calendar.mjs +4 -6
- package/dist/components/form/checkbox/checkbox.d.mts +3 -1
- package/dist/components/form/checkbox/checkbox.mjs +45 -45
- package/dist/components/form/checkbox-card/checkbox-card.d.mts +3 -2
- package/dist/components/form/checkbox-card/checkbox-card.mjs +13 -6
- package/dist/components/form/checkbox-group/checkbox-group.d.mts +15 -20
- package/dist/components/form/checkbox-group/checkbox-group.mjs +18 -26
- package/dist/components/form/checkbox-group/index.d.mts +2 -34
- package/dist/components/form/checkbox-group/index.mjs +1 -8
- package/dist/components/form/color-picker/color-picker.css +3 -5
- package/dist/components/form/color-picker/color-picker.d.mts +0 -1
- package/dist/components/form/color-picker/color-picker.mjs +4 -4
- package/dist/components/form/combobox/combobox.d.mts +0 -1
- package/dist/components/form/combobox/combobox.mjs +9 -8
- package/dist/components/form/date-picker/date-picker.css +0 -5
- package/dist/components/form/date-picker/date-picker.mjs +22 -23
- package/dist/components/form/file-field/file-field.d.mts +6 -3
- package/dist/components/form/file-field/file-field.mjs +42 -19
- package/dist/components/form/file-field/index.d.mts +4 -1
- package/dist/components/form/form/form.mjs +0 -1
- package/dist/components/form/form-control/form-control.css +0 -15
- package/dist/components/form/form-control/form-control.d.mts +3 -4
- package/dist/components/form/form-control/form-control.mjs +44 -46
- package/dist/components/form/form-control/form-control.module.mjs +0 -3
- package/dist/components/form/number-field/number-field.d.mts +2 -2
- package/dist/components/form/number-field/number-field.mjs +13 -52
- package/dist/components/form/password-input/password-input.mjs +3 -2
- package/dist/components/form/radio/radio.mjs +4 -2
- package/dist/components/form/radio-card/radio-card.mjs +9 -2
- package/dist/components/form/range-slider/range-slider.d.mts +4 -2
- package/dist/components/form/range-slider/range-slider.mjs +2 -4
- package/dist/components/form/select/select.css +6 -4
- package/dist/components/form/select/select.d.mts +5 -0
- package/dist/components/form/select/select.mjs +10 -7
- package/dist/components/form/slider/slider.d.mts +2 -2
- package/dist/components/form/slider/slider.mjs +3 -6
- package/dist/components/form/switch/switch.d.mts +3 -0
- package/dist/components/form/switch/switch.mjs +43 -31
- package/dist/components/form/text-field/index.d.mts +2 -2
- package/dist/components/form/text-field/text-field.css +4 -0
- package/dist/components/form/text-field/text-field.d.mts +1 -1
- package/dist/components/form/textarea/textarea.d.mts +0 -1
- package/dist/components/form/textarea/textarea.mjs +1 -1
- package/dist/components/icons/alert.d.mts +6 -0
- package/dist/components/icons/alert.mjs +17 -0
- package/dist/components/icons/{vertical-writing.d.mts → arrow-down.d.mts} +1 -1
- package/dist/components/icons/arrow-down.mjs +8 -0
- package/dist/components/icons/arrow-left.d.mts +3 -0
- package/dist/components/icons/arrow-left.mjs +8 -0
- package/dist/components/icons/arrow-right.d.mts +3 -0
- package/dist/components/icons/arrow-right.mjs +8 -0
- package/dist/components/icons/{twitter.d.mts → arrow-up.d.mts} +1 -1
- package/dist/components/icons/arrow-up.mjs +8 -0
- package/dist/components/icons/base.d.mts +0 -1
- package/dist/components/icons/base.mjs +1 -2
- package/dist/components/icons/{qiita.d.mts → bell.d.mts} +1 -1
- package/dist/components/icons/bell.mjs +8 -0
- package/dist/components/icons/{github-mark.d.mts → blend.d.mts} +1 -1
- package/dist/components/icons/blend.mjs +16 -0
- package/dist/components/icons/book-text.d.mts +3 -0
- package/dist/components/icons/book-text.mjs +8 -0
- package/dist/components/icons/bookmark.d.mts +3 -0
- package/dist/components/icons/bookmark.mjs +8 -0
- package/dist/components/icons/bot-message.d.mts +3 -0
- package/dist/components/icons/bot-message.mjs +8 -0
- package/dist/components/icons/bot.d.mts +3 -0
- package/dist/components/icons/bot.mjs +14 -0
- package/dist/components/icons/calendar.d.mts +3 -0
- package/dist/components/icons/calendar.mjs +14 -0
- package/dist/components/icons/check.d.mts +3 -0
- package/dist/components/icons/check.mjs +8 -0
- package/dist/components/icons/chevron-down.d.mts +3 -0
- package/dist/components/icons/chevron-down.mjs +8 -0
- package/dist/components/icons/chevron-left.d.mts +3 -0
- package/dist/components/icons/chevron-left.mjs +8 -0
- package/dist/components/icons/chevron-right.d.mts +3 -0
- package/dist/components/icons/chevron-right.mjs +8 -0
- package/dist/components/icons/chevron-up.d.mts +3 -0
- package/dist/components/icons/chevron-up.mjs +8 -0
- package/dist/components/icons/chevron.d.mts +6 -0
- package/dist/components/icons/chevron.mjs +17 -0
- package/dist/components/icons/chevrons-up-down.d.mts +3 -0
- package/dist/components/icons/chevrons-up-down.mjs +8 -0
- package/dist/components/icons/circle-alert.d.mts +3 -0
- package/dist/components/icons/circle-alert.mjs +12 -0
- package/dist/components/icons/circle-check.d.mts +3 -0
- package/dist/components/icons/circle-check.mjs +12 -0
- package/dist/components/icons/circle-help.d.mts +3 -0
- package/dist/components/icons/circle-help.mjs +12 -0
- package/dist/components/icons/circle-x.d.mts +3 -0
- package/dist/components/icons/circle-x.mjs +12 -0
- package/dist/components/icons/clipboard-check.d.mts +3 -0
- package/dist/components/icons/clipboard-check.mjs +18 -0
- package/dist/components/icons/clock.d.mts +3 -0
- package/dist/components/icons/clock.mjs +12 -0
- package/dist/components/icons/code.d.mts +3 -0
- package/dist/components/icons/code.mjs +8 -0
- package/dist/components/icons/color-scale.mjs +18 -30
- package/dist/components/icons/contrast.d.mts +3 -0
- package/dist/components/icons/contrast.mjs +15 -0
- package/dist/components/icons/copy.d.mts +3 -0
- package/dist/components/icons/copy.mjs +14 -0
- package/dist/components/icons/download.d.mts +3 -0
- package/dist/components/icons/download.mjs +8 -0
- package/dist/components/icons/ellipsis-vertical.d.mts +3 -0
- package/dist/components/icons/ellipsis-vertical.mjs +27 -0
- package/dist/components/icons/ellipsis.d.mts +3 -0
- package/dist/components/icons/ellipsis.mjs +27 -0
- package/dist/components/icons/external-link.d.mts +3 -0
- package/dist/components/icons/external-link.mjs +8 -0
- package/dist/components/icons/eye-closed.d.mts +3 -0
- package/dist/components/icons/eye-closed.mjs +8 -0
- package/dist/components/icons/eye.d.mts +3 -0
- package/dist/components/icons/eye.mjs +12 -0
- package/dist/components/icons/file-text.d.mts +3 -0
- package/dist/components/icons/file-text.mjs +12 -0
- package/dist/components/icons/file.d.mts +3 -0
- package/dist/components/icons/file.mjs +8 -0
- package/dist/components/icons/filter.d.mts +3 -0
- package/dist/components/icons/filter.mjs +8 -0
- package/dist/components/icons/flask.d.mts +3 -0
- package/dist/components/icons/flask.mjs +8 -0
- package/dist/components/icons/folder-open.d.mts +3 -0
- package/dist/components/icons/folder-open.mjs +8 -0
- package/dist/components/icons/folder.d.mts +3 -0
- package/dist/components/icons/folder.mjs +8 -0
- package/dist/components/icons/git-fork.d.mts +3 -0
- package/dist/components/icons/git-fork.mjs +25 -0
- package/dist/components/icons/git-pull-request.d.mts +3 -0
- package/dist/components/icons/git-pull-request.mjs +20 -0
- package/dist/components/icons/globe.d.mts +3 -0
- package/dist/components/icons/globe.mjs +12 -0
- package/dist/components/icons/grid.d.mts +3 -0
- package/dist/components/icons/grid.mjs +37 -0
- package/dist/components/icons/grip-vertical.d.mts +3 -0
- package/dist/components/icons/grip-vertical.mjs +45 -0
- package/dist/components/icons/heart.d.mts +3 -0
- package/dist/components/icons/heart.mjs +8 -0
- package/dist/components/icons/history.d.mts +3 -0
- package/dist/components/icons/history.mjs +8 -0
- package/dist/components/icons/home.d.mts +3 -0
- package/dist/components/icons/home.mjs +8 -0
- package/dist/components/icons/image.d.mts +3 -0
- package/dist/components/icons/image.mjs +22 -0
- package/dist/components/icons/index.d.mts +107 -9
- package/dist/components/icons/index.mjs +107 -8
- package/dist/components/icons/info.d.mts +3 -0
- package/dist/components/icons/info.mjs +12 -0
- package/dist/components/icons/lightbulb.d.mts +3 -0
- package/dist/components/icons/lightbulb.mjs +8 -0
- package/dist/components/icons/line-icon.d.mts +3 -0
- package/dist/components/icons/line-icon.mjs +17 -0
- package/dist/components/icons/link.d.mts +3 -0
- package/dist/components/icons/link.mjs +11 -0
- package/dist/components/icons/list.d.mts +3 -0
- package/dist/components/icons/list.mjs +8 -0
- package/dist/components/icons/lock-open.d.mts +3 -0
- package/dist/components/icons/lock-open.mjs +14 -0
- package/dist/components/icons/lock.d.mts +3 -0
- package/dist/components/icons/lock.mjs +14 -0
- package/dist/components/icons/log-in.d.mts +3 -0
- package/dist/components/icons/log-in.mjs +8 -0
- package/dist/components/icons/log-out.d.mts +3 -0
- package/dist/components/icons/log-out.mjs +8 -0
- package/dist/components/icons/mail.d.mts +3 -0
- package/dist/components/icons/mail.mjs +14 -0
- package/dist/components/icons/map-pin.d.mts +3 -0
- package/dist/components/icons/map-pin.mjs +12 -0
- package/dist/components/icons/maximize.d.mts +3 -0
- package/dist/components/icons/maximize.mjs +8 -0
- package/dist/components/icons/menu.d.mts +3 -0
- package/dist/components/icons/menu.mjs +8 -0
- package/dist/components/icons/message-circle.d.mts +3 -0
- package/dist/components/icons/message-circle.mjs +8 -0
- package/dist/components/icons/minimize.d.mts +3 -0
- package/dist/components/icons/minimize.mjs +8 -0
- package/dist/components/icons/minus.d.mts +3 -0
- package/dist/components/icons/minus.mjs +8 -0
- package/dist/components/icons/monitor.d.mts +3 -0
- package/dist/components/icons/monitor.mjs +14 -0
- package/dist/components/icons/moon.d.mts +3 -0
- package/dist/components/icons/moon.mjs +8 -0
- package/dist/components/icons/package.d.mts +3 -0
- package/dist/components/icons/package.mjs +8 -0
- package/dist/components/icons/paint-bucket.d.mts +3 -0
- package/dist/components/icons/paint-bucket.mjs +8 -0
- package/dist/components/icons/palette.d.mts +3 -0
- package/dist/components/icons/palette.mjs +8 -0
- package/dist/components/icons/panel-left.d.mts +3 -0
- package/dist/components/icons/panel-left.mjs +14 -0
- package/dist/components/icons/paperclip.d.mts +3 -0
- package/dist/components/icons/paperclip.mjs +11 -0
- package/dist/components/icons/pause.d.mts +3 -0
- package/dist/components/icons/pause.mjs +20 -0
- package/dist/components/icons/pencil.d.mts +3 -0
- package/dist/components/icons/pencil.mjs +8 -0
- package/dist/components/icons/pin.d.mts +3 -0
- package/dist/components/icons/pin.mjs +11 -0
- package/dist/components/icons/play.d.mts +3 -0
- package/dist/components/icons/play.mjs +8 -0
- package/dist/components/icons/plus.d.mts +3 -0
- package/dist/components/icons/plus.mjs +8 -0
- package/dist/components/icons/presentation.d.mts +3 -0
- package/dist/components/icons/presentation.mjs +8 -0
- package/dist/components/icons/redo.d.mts +3 -0
- package/dist/components/icons/redo.mjs +8 -0
- package/dist/components/icons/refresh.d.mts +3 -0
- package/dist/components/icons/refresh.mjs +8 -0
- package/dist/components/icons/rocket.d.mts +3 -0
- package/dist/components/icons/rocket.mjs +19 -0
- package/dist/components/icons/rss.d.mts +3 -0
- package/dist/components/icons/rss.mjs +13 -0
- package/dist/components/icons/search.d.mts +3 -0
- package/dist/components/icons/search.mjs +12 -0
- package/dist/components/icons/send.d.mts +3 -0
- package/dist/components/icons/send.mjs +8 -0
- package/dist/components/icons/settings.d.mts +3 -0
- package/dist/components/icons/settings.mjs +12 -0
- package/dist/components/icons/share.d.mts +3 -0
- package/dist/components/icons/share.mjs +25 -0
- package/dist/components/icons/shield-check.d.mts +3 -0
- package/dist/components/icons/shield-check.mjs +8 -0
- package/dist/components/icons/smile.d.mts +3 -0
- package/dist/components/icons/smile.mjs +12 -0
- package/dist/components/icons/sparkles.d.mts +3 -0
- package/dist/components/icons/sparkles.mjs +8 -0
- package/dist/components/icons/square.d.mts +3 -0
- package/dist/components/icons/square.mjs +14 -0
- package/dist/components/icons/squircle.d.mts +3 -0
- package/dist/components/icons/squircle.mjs +8 -0
- package/dist/components/icons/star.d.mts +3 -0
- package/dist/components/icons/star.mjs +8 -0
- package/dist/components/icons/sun.d.mts +3 -0
- package/dist/components/icons/sun.mjs +12 -0
- package/dist/components/icons/table.d.mts +3 -0
- package/dist/components/icons/table.mjs +14 -0
- package/dist/components/icons/tag.d.mts +3 -0
- package/dist/components/icons/tag.mjs +8 -0
- package/dist/components/icons/text-horizontal.d.mts +3 -0
- package/dist/components/icons/text-horizontal.mjs +8 -0
- package/dist/components/icons/text-vertical.d.mts +3 -0
- package/dist/components/icons/text-vertical.mjs +8 -0
- package/dist/components/icons/thumbs-down.d.mts +3 -0
- package/dist/components/icons/thumbs-down.mjs +8 -0
- package/dist/components/icons/thumbs-up.d.mts +3 -0
- package/dist/components/icons/thumbs-up.mjs +8 -0
- package/dist/components/icons/trash.d.mts +3 -0
- package/dist/components/icons/trash.mjs +8 -0
- package/dist/components/icons/triangle-alert.d.mts +3 -0
- package/dist/components/icons/triangle-alert.mjs +8 -0
- package/dist/components/icons/undo.d.mts +3 -0
- package/dist/components/icons/undo.mjs +8 -0
- package/dist/components/icons/upload.d.mts +3 -0
- package/dist/components/icons/upload.mjs +8 -0
- package/dist/components/icons/user.d.mts +3 -0
- package/dist/components/icons/user.mjs +12 -0
- package/dist/components/icons/users.d.mts +3 -0
- package/dist/components/icons/users.mjs +12 -0
- package/dist/components/icons/x.d.mts +3 -0
- package/dist/components/icons/x.mjs +8 -0
- package/dist/components/index.d.mts +58 -76
- package/dist/components/index.mjs +13 -27
- package/dist/components/layout/resizable-panels/resizable-panels.mjs +3 -3
- package/dist/components/navigation/anchor/anchor.css +3 -3
- package/dist/components/navigation/anchor/anchor.mjs +20 -7
- package/dist/components/navigation/anchor/anchor.module.mjs +1 -1
- package/dist/components/navigation/breadcrumb/breadcrumb.d.mts +6 -4
- package/dist/components/navigation/breadcrumb/breadcrumb.mjs +3 -2
- package/dist/components/navigation/pagination/pagination.d.mts +2 -2
- package/dist/components/navigation/pagination/pagination.mjs +3 -3
- package/dist/components/navigation/side-nav/side-nav.mjs +1 -1
- package/dist/components/navigation/stepper/stepper.mjs +3 -3
- package/dist/components/navigation/tabs/index.d.mts +10 -5
- package/dist/components/navigation/tabs/tabs.d.mts +11 -6
- package/dist/components/navigation/tabs/tabs.mjs +24 -27
- package/dist/components/overlays/_internal/modal-header.css +38 -0
- package/dist/components/overlays/_internal/modal-header.d.mts +7 -0
- package/dist/components/overlays/_internal/modal-header.mjs +32 -0
- package/dist/components/overlays/_internal/modal-header.module.mjs +10 -0
- package/dist/components/overlays/command-palette/command-palette.d.mts +2 -2
- package/dist/components/overlays/command-palette/command-palette.mjs +9 -8
- package/dist/components/overlays/context-menu/context-menu.mjs +3 -3
- package/dist/components/overlays/context-menu/index.d.mts +27 -2
- package/dist/components/overlays/dialog/dialog.css +3 -21
- package/dist/components/overlays/dialog/dialog.d.mts +20 -9
- package/dist/components/overlays/dialog/dialog.mjs +35 -73
- package/dist/components/overlays/dialog/dialog.module.mjs +1 -3
- package/dist/components/overlays/dialog/index.d.mts +2 -15
- package/dist/components/overlays/dialog/index.mjs +1 -8
- package/dist/components/overlays/drawer/drawer.css +4 -26
- package/dist/components/overlays/drawer/drawer.d.mts +7 -2
- package/dist/components/overlays/drawer/drawer.mjs +24 -37
- package/dist/components/overlays/drawer/drawer.module.mjs +2 -6
- package/dist/components/overlays/dropdown-menu/dropdown-menu.d.mts +35 -5
- package/dist/components/overlays/dropdown-menu/dropdown-menu.mjs +30 -12
- package/dist/components/overlays/dropdown-menu/hooks.d.mts +1 -1
- package/dist/components/overlays/dropdown-menu/hooks.mjs +1 -1
- package/dist/components/overlays/dropdown-menu/index.d.mts +34 -4
- package/dist/components/overlays/dropdown-menu/shared.css +1 -0
- package/dist/components/overlays/dropdown-menu/sub-menu.mjs +4 -4
- package/dist/components/overlays/list-box/hooks.mjs +2 -2
- package/dist/components/overlays/list-box/index.d.mts +2 -25
- package/dist/components/overlays/list-box/index.mjs +1 -9
- package/dist/components/overlays/list-box/list-box.d.mts +11 -16
- package/dist/components/overlays/list-box/list-box.mjs +24 -16
- package/dist/components/overlays/modal/modal.d.mts +8 -7
- package/dist/components/overlays/modal/modal.mjs +23 -32
- package/dist/components/overlays/popover/anchor-positioning.d.mts +3 -16
- package/dist/components/overlays/popover/anchor-positioning.mjs +14 -6
- package/dist/components/overlays/popover/hooks.d.mts +0 -2
- package/dist/components/overlays/popover/hooks.mjs +0 -2
- package/dist/components/overlays/popover/index.d.mts +19 -2
- package/dist/components/overlays/popover/index.mjs +7 -2
- package/dist/components/overlays/popover/popover.css +6 -0
- package/dist/components/overlays/popover/popover.d.mts +15 -2
- package/dist/components/overlays/popover/popover.mjs +28 -13
- package/dist/components/overlays/popover/popover.module.mjs +2 -1
- package/dist/components/overlays/tooltip/bridge.css +1 -1
- package/dist/components/overlays/tooltip/tooltip.mjs +5 -5
- package/dist/helpers/index.mjs +1 -1
- package/dist/i18n/en.mjs +1 -2
- package/dist/i18n/index.d.mts +3 -4
- package/dist/i18n/index.mjs +1 -2
- package/dist/i18n/ja.mjs +1 -2
- package/dist/i18n/messages.d.mts +2 -4
- package/dist/i18n/usage.d.mts +2 -1
- package/dist/i18n/usage.mjs +3 -3
- package/dist/index.d.mts +30 -45
- package/dist/index.mjs +4 -18
- package/dist/internal/iso-date.mjs +1 -1
- package/dist/styles/index.css +79 -231
- package/dist/styles/tailwind.css +1 -4
- package/dist/styles/tokens.css +281 -0
- package/dist/styles/tokens.d.mts +1 -1
- package/dist/styles/tokens.mjs +1 -1
- package/dist/types/index.d.mts +2 -2
- package/dist/types/variables.d.mts +4 -2
- package/docs/GUIDE.md +145 -69
- package/docs/llms.txt +38 -11
- package/docs/props.generated.json +1414 -645
- package/docs/references/ai-chat.md +94 -44
- package/docs/references/color.md +15 -15
- package/docs/references/components.md +636 -504
- package/docs/references/generative-ui.md +378 -187
- package/docs/references/interaction-design.md +6 -5
- package/docs/references/spatial-design.md +8 -8
- package/docs/references/types.md +22 -25
- package/package.json +43 -73
- package/dist/components/ai/_internal/icons.d.mts +0 -6
- package/dist/components/ai/_internal/icons.mjs +0 -13
- package/dist/components/form/date-field/date-field.css +0 -31
- package/dist/components/form/date-field/date-field.d.mts +0 -7
- package/dist/components/form/date-field/date-field.mjs +0 -19
- package/dist/components/form/date-field/date-field.module.mjs +0 -4
- package/dist/components/form/date-field/index.d.mts +0 -2
- package/dist/components/form/date-field/index.mjs +0 -1
- package/dist/components/icons/browsers.d.mts +0 -6
- package/dist/components/icons/browsers.mjs +0 -890
- package/dist/components/icons/github-mark.mjs +0 -18
- package/dist/components/icons/logo.css +0 -17
- package/dist/components/icons/logo.d.mts +0 -4
- package/dist/components/icons/logo.mjs +0 -29
- package/dist/components/icons/logo.module.mjs +0 -8
- package/dist/components/icons/lucide-imports.d.mts +0 -67
- package/dist/components/icons/lucide-imports.mjs +0 -67
- package/dist/components/icons/lucide.d.mts +0 -67
- package/dist/components/icons/lucide.mjs +0 -255
- package/dist/components/icons/qiita.mjs +0 -27
- package/dist/components/icons/twitter.css +0 -9
- package/dist/components/icons/twitter.mjs +0 -20
- package/dist/components/icons/twitter.module.mjs +0 -4
- package/dist/components/icons/vertical-writing.mjs +0 -25
- package/dist/components/observers/in-view/index.d.mts +0 -2
- package/dist/components/observers/in-view/index.mjs +0 -1
- package/dist/components/observers/resize/index.d.mts +0 -2
- package/dist/components/observers/resize/index.mjs +0 -1
- package/dist/components/overlays/_internal/modal-dialog-context.d.mts +0 -11
- package/dist/components/overlays/_internal/modal-dialog-context.mjs +0 -12
- package/dist/components/providers/index.d.mts +0 -3
- package/dist/components/providers/index.mjs +0 -3
- package/dist/components/providers/portal-root.d.mts +0 -8
- package/dist/components/providers/portal-root.mjs +0 -11
- package/dist/components/providers/ui-provider.d.mts +0 -2
- package/dist/components/providers/ui-provider.mjs +0 -6
- package/dist/integrations/_shared/openui-defs.d.mts +0 -15
- package/dist/integrations/_shared/openui-defs.mjs +0 -230
- package/dist/integrations/_shared/renderers.css +0 -50
- package/dist/integrations/_shared/renderers.d.mts +0 -88
- package/dist/integrations/_shared/renderers.mjs +0 -936
- package/dist/integrations/_shared/renderers.module.mjs +0 -13
- package/dist/integrations/ai-sdk/index.d.mts +0 -3
- package/dist/integrations/ai-sdk/index.mjs +0 -1
- package/dist/integrations/ai-sdk/map-parts.d.mts +0 -44
- package/dist/integrations/ai-sdk/map-parts.mjs +0 -56
- package/dist/integrations/json-render/catalog.d.mts +0 -1155
- package/dist/integrations/json-render/catalog.mjs +0 -373
- package/dist/integrations/json-render/registry.d.mts +0 -26
- package/dist/integrations/json-render/registry.mjs +0 -192
- package/dist/integrations/openui/form-views.d.mts +0 -24
- package/dist/integrations/openui/form-views.mjs +0 -89
- package/dist/integrations/openui/library.d.mts +0 -202
- package/dist/integrations/openui/library.mjs +0 -83
- package/dist/integrations/openui/prompt.d.mts +0 -2
- package/dist/integrations/openui/prompt.mjs +0 -18
- /package/dist/components/{observers → _internal}/fragment-instance.d.mts +0 -0
- /package/dist/components/{observers/in-view → _internal}/in-view.d.mts +0 -0
- /package/dist/components/{observers/resize → _internal}/resize.d.mts +0 -0
|
@@ -16,8 +16,6 @@ import {
|
|
|
16
16
|
Suggestion,
|
|
17
17
|
ToolInvocation,
|
|
18
18
|
} from '@k8ordo/ui/ai';
|
|
19
|
-
// AI SDK integration (optional peer: ai)
|
|
20
|
-
import { mapMessageParts } from '@k8ordo/ui/ai-sdk';
|
|
21
19
|
// Streaming-aware Markdown rendering (optional peer: streamdown)
|
|
22
20
|
import { Response } from '@k8ordo/ui/ai/response';
|
|
23
21
|
```
|
|
@@ -32,13 +30,10 @@ The types are exported from `@k8ordo/ui/ai` too:
|
|
|
32
30
|
|
|
33
31
|
### Setting up the optional peers
|
|
34
32
|
|
|
35
|
-
|
|
33
|
+
`@k8ordo/ui/ai` itself needs nothing more. `@k8ordo/ui/ai/response` needs streamdown:
|
|
36
34
|
|
|
37
35
|
```bash
|
|
38
|
-
# If you use @k8ordo/ui/ai/response (Response)
|
|
39
36
|
pnpm add streamdown
|
|
40
|
-
# If you use @k8ordo/ui/ai-sdk (mapMessageParts)
|
|
41
|
-
pnpm add ai
|
|
42
37
|
```
|
|
43
38
|
|
|
44
39
|
`Response` styles what streamdown renders itself, through the
|
|
@@ -56,13 +51,14 @@ The "default" shown for `label`, `sendLabel`, and similar props below is the bui
|
|
|
56
51
|
|
|
57
52
|
## The whole picture
|
|
58
53
|
|
|
59
|
-
`Conversation` (the log), `Message` (a bubble), and `PromptInput` (the input box) form the skeleton. `Response`, `Reasoning`, `ToolInvocation`, `Attachment`, `Source`, and the message actions can be added later — [AI SDK
|
|
54
|
+
`Conversation` (the log), `Message` (a bubble), and `PromptInput` (the input box) form the skeleton. `Response`, `Reasoning`, `ToolInvocation`, `Attachment`, `Source`, and the message actions can be added later — [With the AI SDK](#with-the-ai-sdk) shows all of them together.
|
|
60
55
|
|
|
61
56
|
```tsx
|
|
62
57
|
'use client';
|
|
63
58
|
import { useChat } from '@ai-sdk/react';
|
|
64
|
-
import { Avatar
|
|
59
|
+
import { Avatar } from '@k8ordo/ui';
|
|
65
60
|
import { Conversation, Message, PromptInput } from '@k8ordo/ui/ai';
|
|
61
|
+
import { BotMessageIcon } from '@k8ordo/ui/icons';
|
|
66
62
|
import type { UIMessage } from 'ai';
|
|
67
63
|
|
|
68
64
|
const textOf = (m: UIMessage) =>
|
|
@@ -88,7 +84,7 @@ export function Chat() {
|
|
|
88
84
|
m.role === 'user' ? undefined : (
|
|
89
85
|
<Avatar
|
|
90
86
|
color="primary"
|
|
91
|
-
icon={<
|
|
87
|
+
icon={<BotMessageIcon />}
|
|
92
88
|
name="AI"
|
|
93
89
|
size="sm"
|
|
94
90
|
/>
|
|
@@ -152,7 +148,7 @@ import { Message } from '@k8ordo/ui/ai';
|
|
|
152
148
|
<Message.Content>Hello</Message.Content>
|
|
153
149
|
</Message.Root>
|
|
154
150
|
|
|
155
|
-
<Message.Root avatar={<Avatar icon={<
|
|
151
|
+
<Message.Root avatar={<Avatar icon={<BotMessageIcon />} name="AI" size="sm" />} from="assistant">
|
|
156
152
|
<Message.Content isStreaming>Text still streaming…</Message.Content>
|
|
157
153
|
</Message.Root>
|
|
158
154
|
```
|
|
@@ -179,10 +175,10 @@ Props (Message.Content):
|
|
|
179
175
|
<Message.Copy value={text} />
|
|
180
176
|
<Message.Regenerate
|
|
181
177
|
disabled={status === 'submitted' || status === 'streaming'}
|
|
182
|
-
|
|
178
|
+
action={() => regenerate({ messageId: message.id })}
|
|
183
179
|
/>
|
|
184
180
|
<Message.Feedback onChange={(value) => saveFeedback(message.id, value)} />
|
|
185
|
-
<Message.Action
|
|
181
|
+
<Message.Action action={() => share(message.id)} label="Share">
|
|
186
182
|
<LinkIcon size="sm" />
|
|
187
183
|
</Message.Action>
|
|
188
184
|
</Message.Actions>
|
|
@@ -190,7 +186,7 @@ Props (Message.Content):
|
|
|
190
186
|
```
|
|
191
187
|
|
|
192
188
|
- `Copy` is an icon-only, `sm` [`CopyButton`](components.md#copybutton): it writes `value` to the clipboard, shows a check icon — or an error icon when the clipboard refuses — for two seconds, and announces 「コピーしました」 or 「コピーできませんでした」 through a `status` region. Nothing is thrown either way.
|
|
193
|
-
- `Regenerate` and `Action` take `
|
|
189
|
+
- `Regenerate` and `Action` take `action`, which runs in a transition: a returned promise keeps the button busy (`aria-busy`, `aria-disabled`, presses ignored) until it settles, so `() => regenerate(...)` does not need its own pending state. The button keeps focus meanwhile.
|
|
194
190
|
- `Feedback` is a pair of toggle buttons (`aria-pressed`). Pressing the pressed one again clears it, so `onChange` receives `null`.
|
|
195
191
|
|
|
196
192
|
Props (Message.Actions):
|
|
@@ -200,7 +196,7 @@ Props (Message.Actions):
|
|
|
200
196
|
Props (Message.Action):
|
|
201
197
|
|
|
202
198
|
- `label`: string (required; the accessible name and the tooltip)
|
|
203
|
-
- `
|
|
199
|
+
- `action`: `() => void | Promise<void>`
|
|
204
200
|
- `disabled`: boolean
|
|
205
201
|
- `children`: ReactNode (the icon, `size="sm"`)
|
|
206
202
|
|
|
@@ -211,7 +207,7 @@ Props (Message.Copy):
|
|
|
211
207
|
|
|
212
208
|
Props (Message.Regenerate):
|
|
213
209
|
|
|
214
|
-
- `
|
|
210
|
+
- `action`: `() => void | Promise<void>` (required)
|
|
215
211
|
- `label`: string (default: `'再生成'`)
|
|
216
212
|
- `disabled`: boolean
|
|
217
213
|
|
|
@@ -457,9 +453,9 @@ Props:
|
|
|
457
453
|
- `onApprovalResponse`: `(response: ToolApprovalResponse) => void | PromiseLike<void>` (called with the approval `id` and the user's answer)
|
|
458
454
|
- `isOpen` / `defaultOpen` / `onChange`: open state, controlled or uncontrolled
|
|
459
455
|
|
|
460
|
-
## AI SDK
|
|
456
|
+
## With the AI SDK
|
|
461
457
|
|
|
462
|
-
|
|
458
|
+
The types `@k8ordo/ui/ai` exports (`ChatStatus`, `ToolState`, `ToolApproval`, `ToolApprovalResponse`) take the AI SDK's own shapes, so the SDK's values pass to the components as they are, and `@k8ordo/ui` does not depend on the SDK. What is left is turning a `UIMessage`'s parts into rows of components. `examples/ui-integrations` in the repository does it with `mapMessageParts` (`src/ai-sdk/map-parts.ts`, about a hundred lines with no React): copy it into your application. It turns `UIMessage.parts` into a `MappedPart[]` that is easy to render:
|
|
463
459
|
|
|
464
460
|
```ts
|
|
465
461
|
type MappedPart =
|
|
@@ -472,29 +468,35 @@ type MappedPart =
|
|
|
472
468
|
state: ToolState;
|
|
473
469
|
input?: unknown;
|
|
474
470
|
output?: unknown;
|
|
475
|
-
errorText?: string;
|
|
476
|
-
approval?: ToolApproval; // the part's own approval object, id included
|
|
471
|
+
errorText?: string | undefined;
|
|
472
|
+
approval?: ToolApproval | undefined; // the part's own approval object, id included
|
|
473
|
+
part: ToolUIPart | DynamicToolUIPart; // the AI SDK part itself, for MCPAppRenderer
|
|
474
|
+
}
|
|
475
|
+
| {
|
|
476
|
+
kind: 'file';
|
|
477
|
+
url: string;
|
|
478
|
+
mediaType: string;
|
|
479
|
+
filename?: string | undefined;
|
|
477
480
|
}
|
|
478
|
-
| { kind: 'file'; url: string; mediaType: string; filename?: string }
|
|
479
481
|
| {
|
|
480
482
|
kind: 'source'; // both source-url and source-document
|
|
481
483
|
id: string;
|
|
482
484
|
url?: string; // source-url only
|
|
483
|
-
title?: string;
|
|
485
|
+
title?: string | undefined;
|
|
484
486
|
mediaType?: string; // source-document only
|
|
485
|
-
filename?: string; // source-document only
|
|
487
|
+
filename?: string | undefined; // source-document only
|
|
486
488
|
}
|
|
487
|
-
| { kind: 'data'; name: string; id?: string; data: unknown }; // `data-weather` → name 'weather'
|
|
489
|
+
| { kind: 'data'; name: string; id?: string | undefined; data: unknown }; // `data-weather` → name 'weather'
|
|
488
490
|
```
|
|
489
491
|
|
|
490
492
|
Order is preserved. `step-start`, `custom`, and `reasoning-file` parts are skipped.
|
|
491
493
|
|
|
492
|
-
Render each part as its own row under `Message.Root` — the children stack in a column. Files and sources read better as one list each, so pull them out with `filter` and skip them in the loop.
|
|
494
|
+
Render each part as its own row under `Message.Root` — the children stack in a column. Files and sources read better as one list each, so pull them out with `filter` and skip them in the loop.
|
|
493
495
|
|
|
494
496
|
```tsx
|
|
495
497
|
'use client';
|
|
496
498
|
import { useChat } from '@ai-sdk/react';
|
|
497
|
-
import { Avatar
|
|
499
|
+
import { Avatar } from '@k8ordo/ui';
|
|
498
500
|
import {
|
|
499
501
|
Attachment,
|
|
500
502
|
Message,
|
|
@@ -502,13 +504,14 @@ import {
|
|
|
502
504
|
Source,
|
|
503
505
|
ToolInvocation,
|
|
504
506
|
} from '@k8ordo/ui/ai';
|
|
505
|
-
import { mapMessageParts } from '@k8ordo/ui/ai-sdk';
|
|
506
507
|
import { Response } from '@k8ordo/ui/ai/response';
|
|
507
|
-
import {
|
|
508
|
-
import { JsonRenderUI } from '@k8ordo/ui/json-render/registry';
|
|
508
|
+
import { BotMessageIcon } from '@k8ordo/ui/icons';
|
|
509
509
|
import { lastAssistantMessageIsCompleteWithApprovalResponses } from 'ai';
|
|
510
510
|
import type { UIMessage } from 'ai';
|
|
511
511
|
|
|
512
|
+
// copied from examples/ui-integrations: the AI SDK glue
|
|
513
|
+
import { mapMessageParts } from './ai-sdk/map-parts';
|
|
514
|
+
|
|
512
515
|
type Chat = ReturnType<typeof useChat>;
|
|
513
516
|
|
|
514
517
|
function ChatMessage({ message, chat }: { message: UIMessage; chat: Chat }) {
|
|
@@ -524,7 +527,7 @@ function ChatMessage({ message, chat }: { message: UIMessage; chat: Chat }) {
|
|
|
524
527
|
<Message.Root
|
|
525
528
|
avatar={
|
|
526
529
|
isUser ? undefined : (
|
|
527
|
-
<Avatar icon={<
|
|
530
|
+
<Avatar icon={<BotMessageIcon />} name="AI" size="sm" />
|
|
528
531
|
)
|
|
529
532
|
}
|
|
530
533
|
from={isUser ? 'user' : 'assistant'}
|
|
@@ -572,12 +575,6 @@ function ChatMessage({ message, chat }: { message: UIMessage; chat: Chat }) {
|
|
|
572
575
|
/>
|
|
573
576
|
);
|
|
574
577
|
}
|
|
575
|
-
if (part.kind === 'data' && part.name === 'ui') {
|
|
576
|
-
const result = validateGeneratedSpec(part.data);
|
|
577
|
-
return result.ok ? (
|
|
578
|
-
<JsonRenderUI key={key} spec={result.spec} />
|
|
579
|
-
) : null;
|
|
580
|
-
}
|
|
581
578
|
return null;
|
|
582
579
|
})}
|
|
583
580
|
{sources.length > 0 && (
|
|
@@ -598,7 +595,7 @@ function ChatMessage({ message, chat }: { message: UIMessage; chat: Chat }) {
|
|
|
598
595
|
disabled={
|
|
599
596
|
chat.status === 'submitted' || chat.status === 'streaming'
|
|
600
597
|
}
|
|
601
|
-
|
|
598
|
+
action={() => chat.regenerate({ messageId: message.id })}
|
|
602
599
|
/>
|
|
603
600
|
<Message.Feedback />
|
|
604
601
|
</Message.Actions>
|
|
@@ -618,20 +615,73 @@ export function Chat() {
|
|
|
618
615
|
|
|
619
616
|
`examples/ui-integrations` in the repository runs this against the real `useChat`, with a scripted transport in place of a model.
|
|
620
617
|
|
|
621
|
-
|
|
618
|
+
### MCP Apps
|
|
619
|
+
|
|
620
|
+
A tool from an MCP server can come with an App ([MCP Apps](https://github.com/modelcontextprotocol/ext-apps)): a `ui://` HTML resource the host draws in a sandboxed iframe. The AI SDK puts it in the tool part's `toolMetadata.app` when the tools come from `@ai-sdk/mcp`'s `createMCPClient` with `mcpAppClientCapabilities`, and draws it with `MCPAppRenderer` from `@ai-sdk/react`. Hand it `part.part` from `mapMessageParts`, in place of `ToolInvocation`, inside `Message.Root`:
|
|
621
|
+
|
|
622
|
+
```tsx
|
|
623
|
+
import { MCPAppRenderer } from '@ai-sdk/react';
|
|
624
|
+
|
|
625
|
+
if (part.kind === 'tool' && part.part.toolMetadata?.app !== undefined) {
|
|
626
|
+
return (
|
|
627
|
+
<MCPAppRenderer
|
|
628
|
+
key={part.toolCallId}
|
|
629
|
+
part={part.part}
|
|
630
|
+
sandbox={{ url: sandboxUrl }} // a page of yours, on another origin
|
|
631
|
+
loadResource={loadResource} // reads the ui:// resource on your server
|
|
632
|
+
hostContext={{ theme: 'light' }}
|
|
633
|
+
handlers={{
|
|
634
|
+
sendMessage: (params) => {
|
|
635
|
+
/* chat.sendMessage(...) */
|
|
636
|
+
},
|
|
637
|
+
}}
|
|
638
|
+
/>
|
|
639
|
+
);
|
|
640
|
+
}
|
|
641
|
+
```
|
|
642
|
+
|
|
643
|
+
`examples/ui-integrations` keeps the whole of it under test: the sandbox page, the chat that sizes the App and opens it fullscreen, and an MCP server whose App draws A2UI screens with `@k8ordo/ui`, following the host's light or dark.
|
|
622
644
|
|
|
623
645
|
## Combining with generative UI
|
|
624
646
|
|
|
625
|
-
|
|
647
|
+
With the AI SDK, generative UI in a chat is a tool whose part you draw: the model calls a tool such as `show_ui` with the screen as its input, and the chat draws the tool part with the glue of the format you use, copied from `examples/ui-integrations` (see the [generative UI reference](generative-ui.md)). The part's `input` grows while the call streams in (`state: 'input-streaming'`), so the screen can appear as it arrives. A part in `output-error` is a call your server refused: take its screen away.
|
|
648
|
+
|
|
649
|
+
What the user does on the screen goes back as their next message. Send it as a `data` part, so that the chat shows a short line while the model reads the whole action:
|
|
626
650
|
|
|
627
651
|
```tsx
|
|
628
652
|
'use client';
|
|
629
653
|
import { Message } from '@k8ordo/ui/ai';
|
|
630
|
-
import { JsonRenderUI } from '@k8ordo/ui/json-render/registry';
|
|
631
654
|
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
655
|
+
// in the loop over mapMessageParts(message)
|
|
656
|
+
if (part.kind === 'tool' && part.name === 'show_ui') {
|
|
657
|
+
return part.state === 'output-error' ? null : (
|
|
658
|
+
<Screen input={part.input} key={part.toolCallId} /> // your format's glue
|
|
659
|
+
);
|
|
660
|
+
}
|
|
661
|
+
if (part.kind === 'data' && part.name === 'action') {
|
|
662
|
+
return (
|
|
663
|
+
<Message.Content key={key}>{(part.data as Action).text}</Message.Content>
|
|
664
|
+
);
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
// when the user presses something on a screen
|
|
668
|
+
void chat.sendMessage({ parts: [{ type: 'data-action', data: action }] });
|
|
637
669
|
```
|
|
670
|
+
|
|
671
|
+
On the server, `convertToModelMessages` turns the part into text for the model through `convertDataPart`, with the action and the state of the screen:
|
|
672
|
+
|
|
673
|
+
```ts
|
|
674
|
+
const result = streamText({
|
|
675
|
+
model,
|
|
676
|
+
tools,
|
|
677
|
+
messages: await convertToModelMessages(messages, {
|
|
678
|
+
tools,
|
|
679
|
+
convertDataPart: (part) =>
|
|
680
|
+
part.type === 'data-action'
|
|
681
|
+
? { type: 'text', text: `The user acted: ${JSON.stringify(part.data)}` }
|
|
682
|
+
: undefined,
|
|
683
|
+
}),
|
|
684
|
+
});
|
|
685
|
+
```
|
|
686
|
+
|
|
687
|
+
`examples/ui-integrations` keeps such a chat under test: Claude shows screens written in A2UI with `show_ui`, answers a press by changing the screen in place with `update_ui`, and receives what every screen holds with each request.
|
package/docs/references/color.md
CHANGED
|
@@ -49,19 +49,19 @@ the browser maps them to what the display can show.
|
|
|
49
49
|
|
|
50
50
|
## Semantic colors (background)
|
|
51
51
|
|
|
52
|
-
| Token | Light | Dark | Use
|
|
53
|
-
| ---------------------- | ---------- | ---------- |
|
|
54
|
-
| `--color-bg-base` | white | gray-800 | Card background
|
|
55
|
-
| `--color-bg-raised` | white | gray-800 | Overlays (
|
|
56
|
-
| `--color-bg-surface` | gray-50 | gray-950 | Outermost ground: lighter than `bg-subtle` in light, darker in dark
|
|
57
|
-
| `--color-bg-subtle` | gray-100 | gray-900 | Page background
|
|
58
|
-
| `--color-bg-mute` | gray-200 | gray-700 | For the hover state
|
|
59
|
-
| `--color-bg-emphasize` | gray-300 | gray-600 | For the active state
|
|
60
|
-
| `--color-bg-inverse` | gray-900 | white | Inverted background
|
|
61
|
-
| `--color-bg-info` | blue-100 | blue-900 | Information ground
|
|
62
|
-
| `--color-bg-success` | green-100 | green-900 | Success ground
|
|
63
|
-
| `--color-bg-warning` | yellow-100 | yellow-900 | Warning ground
|
|
64
|
-
| `--color-bg-error` | red-100 | red-900 | Error ground
|
|
52
|
+
| Token | Light | Dark | Use |
|
|
53
|
+
| ---------------------- | ---------- | ---------- | ---------------------------------------------------------------------------- |
|
|
54
|
+
| `--color-bg-base` | white | gray-800 | Card background |
|
|
55
|
+
| `--color-bg-raised` | white | gray-800 | Overlays (Dialog, Drawer, DropdownMenu, ListBox, Autocomplete's option list) |
|
|
56
|
+
| `--color-bg-surface` | gray-50 | gray-950 | Outermost ground: lighter than `bg-subtle` in light, darker in dark |
|
|
57
|
+
| `--color-bg-subtle` | gray-100 | gray-900 | Page background |
|
|
58
|
+
| `--color-bg-mute` | gray-200 | gray-700 | For the hover state |
|
|
59
|
+
| `--color-bg-emphasize` | gray-300 | gray-600 | For the active state |
|
|
60
|
+
| `--color-bg-inverse` | gray-900 | white | Inverted background |
|
|
61
|
+
| `--color-bg-info` | blue-100 | blue-900 | Information ground |
|
|
62
|
+
| `--color-bg-success` | green-100 | green-900 | Success ground |
|
|
63
|
+
| `--color-bg-warning` | yellow-100 | yellow-900 | Warning ground |
|
|
64
|
+
| `--color-bg-error` | red-100 | red-900 | Error ground |
|
|
65
65
|
|
|
66
66
|
## Semantic colors (border)
|
|
67
67
|
|
|
@@ -176,7 +176,7 @@ In dark, `bg-emphasize` moves a step darker as well, because white text on the
|
|
|
176
176
|
usual gray-600 would stay near 5:1.
|
|
177
177
|
|
|
178
178
|
Surfaces outlined only by a shadow or a ground — `Card`'s `shadow` variant,
|
|
179
|
-
`
|
|
179
|
+
`Dialog`, `Drawer`, `Alert`, `Callout` and `Toast`, a user `Message` — gain a
|
|
180
180
|
1px `border-base` outline, as do the `Switch` track and thumb and the `Slider`
|
|
181
181
|
and `Progress` tracks. A focused `DropdownMenu` or `ListBox` item and the
|
|
182
182
|
active `Autocomplete` option draw a 2px outline on top of their ground.
|
|
@@ -198,7 +198,7 @@ boundaries, focus rings, and selected states visible:
|
|
|
198
198
|
- Write the two settings as media queries: `@media (prefers-contrast: more)` and `@media (forced-colors: active)` (with `tailwind.css`, the `contrast-more:` and `forced-colors:` variants). Under forced colors only system colors survive, so paint state with them (`background-color: var(--color-system-highlight)`)
|
|
199
199
|
- Do not draw a boundary or a focus ring with `box-shadow` alone
|
|
200
200
|
- Do not hide something with a transparent color: forced colors paints it. Use `visibility: hidden`
|
|
201
|
-
- To tune the high-contrast values, redefine the tokens inside `@media (prefers-contrast: more)`,
|
|
201
|
+
- To tune the high-contrast values, redefine the tokens on `:root` inside `@media (prefers-contrast: more)`, as `light-dark(<light>, <dark>)`, in CSS loaded after the library stylesheet
|
|
202
202
|
|
|
203
203
|
## Usage examples
|
|
204
204
|
|