@k8ordo/ui 1.0.0 → 2.1.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 +206 -171
- package/dist/_virtual/_rolldown/runtime.mjs +13 -0
- package/dist/components/_internal/focus-ring.css +37 -0
- package/dist/components/_internal/focus-ring.module.mjs +9 -0
- package/dist/components/_internal/form-value.d.mts +33 -0
- package/dist/components/_internal/form-value.mjs +91 -0
- package/dist/components/_internal/high-contrast.css +18 -0
- package/dist/components/_internal/high-contrast.module.mjs +5 -0
- package/dist/components/_internal/ignore-changes.d.mts +20 -0
- package/dist/components/_internal/ignore-changes.mjs +37 -0
- package/dist/components/_internal/nav-link.css +78 -0
- package/dist/components/_internal/nav-link.d.mts +5 -0
- package/dist/components/_internal/nav-link.mjs +8 -0
- package/dist/components/_internal/nav-link.module.mjs +14 -0
- package/dist/components/_internal/sr-only.css +17 -0
- package/dist/components/_internal/sr-only.module.mjs +5 -0
- package/dist/components/_internal/status-tone.css +37 -0
- package/dist/components/_internal/status-tone.d.mts +20 -0
- package/dist/components/_internal/status-tone.mjs +22 -0
- package/dist/components/_internal/status-tone.module.mjs +14 -0
- package/dist/components/ai/_internal/attachment-preview.css +75 -0
- package/dist/components/ai/_internal/attachment-preview.d.mts +14 -0
- package/dist/components/ai/_internal/attachment-preview.mjs +50 -0
- package/dist/components/ai/_internal/attachment-preview.module.mjs +14 -0
- package/dist/components/ai/_internal/collapsible.css +62 -0
- package/dist/components/ai/_internal/collapsible.d.mts +4 -3
- package/dist/components/ai/_internal/collapsible.mjs +42 -33
- package/dist/components/ai/_internal/collapsible.module.mjs +12 -0
- package/dist/components/ai/_internal/icons.d.mts +7 -0
- package/dist/components/ai/_internal/icons.mjs +14 -0
- package/dist/components/ai/_internal/streaming-cursor.css +28 -0
- package/dist/components/ai/_internal/streaming-cursor.d.mts +2 -3
- package/dist/components/ai/_internal/streaming-cursor.mjs +2 -1
- package/dist/components/ai/_internal/streaming-cursor.module.mjs +8 -0
- package/dist/components/ai/attachment/attachment.css +17 -0
- package/dist/components/ai/attachment/attachment.d.mts +14 -0
- package/dist/components/ai/attachment/attachment.mjs +25 -0
- package/dist/components/ai/attachment/attachment.module.mjs +8 -0
- package/dist/components/ai/attachment/index.d.mts +13 -0
- package/dist/components/ai/attachment/index.mjs +8 -0
- package/dist/components/ai/conversation/conversation.css +71 -0
- package/dist/components/ai/conversation/conversation.d.mts +8 -11
- package/dist/components/ai/conversation/conversation.mjs +39 -40
- package/dist/components/ai/conversation/conversation.module.mjs +11 -0
- package/dist/components/ai/conversation/index.d.mts +15 -2
- package/dist/components/ai/conversation/index.mjs +8 -1
- package/dist/components/ai/index.d.mts +8 -10
- package/dist/components/ai/index.mjs +7 -5
- package/dist/components/ai/message/index.d.mts +39 -2
- package/dist/components/ai/message/index.mjs +12 -1
- package/dist/components/ai/message/message.css +71 -0
- package/dist/components/ai/message/message.d.mts +33 -5
- package/dist/components/ai/message/message.mjs +98 -12
- package/dist/components/ai/message/message.module.mjs +18 -0
- package/dist/components/ai/prompt-input/index.d.mts +31 -2
- package/dist/components/ai/prompt-input/index.mjs +10 -1
- package/dist/components/ai/prompt-input/prompt-input.css +101 -0
- package/dist/components/ai/prompt-input/prompt-input.d.mts +15 -8
- package/dist/components/ai/prompt-input/prompt-input.mjs +152 -42
- package/dist/components/ai/prompt-input/prompt-input.module.mjs +15 -0
- package/dist/components/ai/reasoning/reasoning.css +16 -0
- package/dist/components/ai/reasoning/reasoning.d.mts +2 -3
- package/dist/components/ai/reasoning/reasoning.mjs +5 -5
- package/dist/components/ai/reasoning/reasoning.module.mjs +8 -0
- package/dist/components/ai/response/response.css +453 -0
- package/dist/components/ai/response/response.d.mts +4 -6
- package/dist/components/ai/response/response.mjs +20 -15
- package/dist/components/ai/response/response.module.mjs +8 -0
- package/dist/components/ai/source/index.d.mts +12 -0
- package/dist/components/ai/source/index.mjs +8 -0
- package/dist/components/ai/source/source.css +54 -0
- package/dist/components/ai/source/source.d.mts +13 -0
- package/dist/components/ai/source/source.mjs +51 -0
- package/dist/components/ai/source/source.module.mjs +12 -0
- package/dist/components/ai/suggestion/index.d.mts +13 -2
- package/dist/components/ai/suggestion/index.mjs +7 -1
- package/dist/components/ai/suggestion/suggestion.css +32 -0
- package/dist/components/ai/suggestion/suggestion.d.mts +3 -6
- package/dist/components/ai/suggestion/suggestion.mjs +8 -11
- package/dist/components/ai/suggestion/suggestion.module.mjs +8 -0
- package/dist/components/ai/tool-invocation/approval-bar.css +26 -0
- package/dist/components/ai/tool-invocation/approval-bar.d.mts +11 -0
- package/dist/components/ai/tool-invocation/approval-bar.mjs +59 -0
- package/dist/components/ai/tool-invocation/approval-bar.module.mjs +9 -0
- package/dist/components/ai/tool-invocation/tool-invocation.css +55 -0
- package/dist/components/ai/tool-invocation/tool-invocation.d.mts +5 -5
- package/dist/components/ai/tool-invocation/tool-invocation.mjs +39 -18
- package/dist/components/ai/tool-invocation/tool-invocation.module.mjs +15 -0
- package/dist/components/ai/types.d.mts +21 -4
- package/dist/components/buttons/button/button.css +158 -0
- package/dist/components/buttons/button/button.d.mts +32 -9
- package/dist/components/buttons/button/button.mjs +46 -36
- package/dist/components/buttons/button/button.module.mjs +23 -0
- package/dist/components/buttons/button/index.d.mts +2 -2
- package/dist/components/buttons/copy-button/copy-button.css +15 -0
- package/dist/components/buttons/copy-button/copy-button.d.mts +10 -0
- package/dist/components/buttons/copy-button/copy-button.mjs +70 -0
- package/dist/components/buttons/copy-button/copy-button.module.mjs +8 -0
- package/dist/components/buttons/copy-button/index.d.mts +2 -0
- package/dist/components/buttons/copy-button/index.mjs +2 -0
- package/dist/components/buttons/icon-button/icon-button.css +81 -0
- package/dist/components/buttons/icon-button/icon-button.d.mts +39 -12
- package/dist/components/buttons/icon-button/icon-button.mjs +71 -58
- package/dist/components/buttons/icon-button/icon-button.module.mjs +15 -0
- package/dist/components/buttons/icon-button/index.d.mts +2 -2
- package/dist/components/buttons/toolbar/index.d.mts +14 -0
- package/dist/components/buttons/toolbar/index.mjs +9 -0
- package/dist/components/buttons/toolbar/toolbar.css +30 -0
- package/dist/components/buttons/toolbar/toolbar.d.mts +18 -0
- package/dist/components/buttons/toolbar/toolbar.mjs +111 -0
- package/dist/components/buttons/toolbar/toolbar.module.mjs +9 -0
- package/dist/components/data-display/accordion/accordion-button.css +48 -0
- package/dist/components/data-display/accordion/accordion-button.d.mts +2 -3
- package/dist/components/data-display/accordion/accordion-button.mjs +5 -4
- package/dist/components/data-display/accordion/accordion-button.module.mjs +9 -0
- package/dist/components/data-display/accordion/accordion-item.css +11 -0
- package/dist/components/data-display/accordion/accordion-item.d.mts +2 -3
- package/dist/components/data-display/accordion/accordion-item.mjs +2 -1
- package/dist/components/data-display/accordion/accordion-item.module.mjs +5 -0
- package/dist/components/data-display/accordion/accordion-panel.css +9 -0
- package/dist/components/data-display/accordion/accordion-panel.d.mts +2 -3
- package/dist/components/data-display/accordion/accordion-panel.mjs +2 -2
- package/dist/components/data-display/accordion/accordion-panel.module.mjs +5 -0
- package/dist/components/data-display/accordion/accordion.css +19 -0
- package/dist/components/data-display/accordion/accordion.d.mts +2 -3
- package/dist/components/data-display/accordion/accordion.mjs +2 -1
- package/dist/components/data-display/accordion/accordion.module.mjs +5 -0
- package/dist/components/data-display/accordion/context.d.mts +3 -3
- package/dist/components/data-display/accordion/index.d.mts +2 -3
- package/dist/components/data-display/avatar/avatar.css +95 -0
- package/dist/components/data-display/avatar/avatar.d.mts +2 -3
- package/dist/components/data-display/avatar/avatar.mjs +22 -6
- package/dist/components/data-display/avatar/avatar.module.mjs +18 -0
- package/dist/components/data-display/badge/badge.css +160 -0
- package/dist/components/data-display/badge/badge.d.mts +2 -3
- package/dist/components/data-display/badge/badge.mjs +30 -5
- package/dist/components/data-display/badge/badge.module.mjs +21 -0
- package/dist/components/data-display/card/card.css +44 -0
- package/dist/components/data-display/card/card.d.mts +2 -3
- package/dist/components/data-display/card/card.mjs +12 -2
- package/dist/components/data-display/card/card.module.mjs +12 -0
- package/dist/components/data-display/carousel/carousel.css +83 -0
- package/dist/components/data-display/carousel/carousel.d.mts +11 -0
- package/dist/components/data-display/carousel/carousel.mjs +186 -0
- package/dist/components/data-display/carousel/carousel.module.mjs +18 -0
- package/dist/components/data-display/carousel/index.d.mts +11 -0
- package/dist/components/data-display/carousel/index.mjs +8 -0
- package/dist/components/data-display/code/code.css +37 -0
- package/dist/components/data-display/code/code.d.mts +2 -3
- package/dist/components/data-display/code/code.mjs +7 -6
- package/dist/components/data-display/code/code.module.mjs +9 -0
- package/dist/components/data-display/code/find-all-colors.d.mts +2 -3
- package/dist/components/data-display/code/find-all-colors.mjs +0 -161
- package/dist/components/data-display/code-block/code-block.css +161 -0
- package/dist/components/data-display/code-block/code-block.d.mts +12 -0
- package/dist/components/data-display/code-block/code-block.mjs +44 -0
- package/dist/components/data-display/code-block/code-block.module.mjs +11 -0
- package/dist/components/data-display/code-block/highlight.d.mts +9 -0
- package/dist/components/data-display/code-block/highlight.mjs +54 -0
- package/dist/components/data-display/code-block/index.d.mts +2 -0
- package/dist/components/data-display/code-block/index.mjs +2 -0
- package/dist/components/data-display/data-table/data-table.css +74 -0
- package/dist/components/data-display/data-table/data-table.d.mts +31 -0
- package/dist/components/data-display/data-table/data-table.mjs +155 -0
- package/dist/components/data-display/data-table/data-table.module.mjs +14 -0
- package/dist/components/data-display/data-table/index.d.mts +2 -0
- package/dist/components/data-display/data-table/index.mjs +2 -0
- package/dist/components/data-display/heading/heading.css +99 -0
- package/dist/components/data-display/heading/heading.d.mts +2 -3
- package/dist/components/data-display/heading/heading.mjs +15 -14
- package/dist/components/data-display/heading/heading.module.mjs +20 -0
- package/dist/components/data-display/kbd/index.d.mts +2 -0
- package/dist/components/data-display/kbd/index.mjs +2 -0
- package/dist/components/data-display/kbd/kbd.css +21 -0
- package/dist/components/data-display/kbd/kbd.d.mts +8 -0
- package/dist/components/data-display/kbd/kbd.mjs +17 -0
- package/dist/components/data-display/kbd/kbd.module.mjs +5 -0
- package/dist/components/data-display/prose/index.d.mts +2 -0
- package/dist/components/data-display/prose/index.mjs +2 -0
- package/dist/components/data-display/prose/prose.css +253 -0
- package/dist/components/data-display/prose/prose.d.mts +5 -0
- package/dist/components/data-display/prose/prose.mjs +10 -0
- package/dist/components/data-display/prose/prose.module.mjs +5 -0
- package/dist/components/data-display/table/table.css +107 -0
- package/dist/components/data-display/table/table.d.mts +10 -9
- package/dist/components/data-display/table/table.mjs +26 -15
- package/dist/components/data-display/table/table.module.mjs +22 -0
- package/dist/components/data-display/tree/index.d.mts +2 -0
- package/dist/components/data-display/tree/index.mjs +2 -0
- package/dist/components/data-display/tree/tree.css +84 -0
- package/dist/components/data-display/tree/tree.d.mts +20 -0
- package/dist/components/data-display/tree/tree.mjs +151 -0
- package/dist/components/data-display/tree/tree.module.mjs +15 -0
- package/dist/components/feedback/alert/alert.css +42 -0
- package/dist/components/feedback/alert/alert.d.mts +3 -4
- package/dist/components/feedback/alert/alert.mjs +20 -23
- package/dist/components/feedback/alert/alert.module.mjs +14 -0
- package/dist/components/feedback/callout/callout.css +38 -0
- package/dist/components/feedback/callout/callout.d.mts +10 -0
- package/dist/components/feedback/callout/callout.mjs +38 -0
- package/dist/components/feedback/callout/callout.module.mjs +11 -0
- package/dist/components/feedback/callout/index.d.mts +2 -0
- package/dist/components/feedback/callout/index.mjs +2 -0
- package/dist/components/feedback/empty-state/empty-state.css +36 -0
- package/dist/components/feedback/empty-state/empty-state.d.mts +10 -0
- package/dist/components/feedback/empty-state/empty-state.mjs +27 -0
- package/dist/components/feedback/empty-state/empty-state.module.mjs +11 -0
- package/dist/components/feedback/empty-state/index.d.mts +2 -0
- package/dist/components/feedback/empty-state/index.mjs +2 -0
- package/dist/components/feedback/progress/progress.css +78 -0
- package/dist/components/feedback/progress/progress.d.mts +5 -5
- package/dist/components/feedback/progress/progress.mjs +17 -3
- package/dist/components/feedback/progress/progress.module.mjs +12 -0
- package/dist/components/feedback/skeleton/skeleton.css +64 -0
- package/dist/components/feedback/skeleton/skeleton.d.mts +2 -3
- package/dist/components/feedback/skeleton/skeleton.mjs +19 -2
- package/dist/components/feedback/skeleton/skeleton.module.mjs +17 -0
- package/dist/components/feedback/spinner/spinner.css +40 -0
- package/dist/components/feedback/spinner/spinner.d.mts +2 -3
- package/dist/components/feedback/spinner/spinner.mjs +13 -7
- package/dist/components/feedback/spinner/spinner.module.mjs +12 -0
- package/dist/components/feedback/toast/context.d.mts +8 -9
- package/dist/components/feedback/toast/provider.css +69 -0
- package/dist/components/feedback/toast/provider.d.mts +2 -3
- package/dist/components/feedback/toast/provider.mjs +17 -13
- package/dist/components/feedback/toast/provider.module.mjs +12 -0
- package/dist/components/feedback/toast/toast.d.mts +2 -3
- package/dist/components/form/autocomplete/autocomplete.css +154 -0
- package/dist/components/form/autocomplete/autocomplete.d.mts +2 -3
- package/dist/components/form/autocomplete/autocomplete.mjs +70 -46
- package/dist/components/form/autocomplete/autocomplete.module.mjs +21 -0
- package/dist/components/form/calendar/calendar.css +98 -0
- package/dist/components/form/calendar/calendar.d.mts +14 -0
- package/dist/components/form/calendar/calendar.mjs +182 -0
- package/dist/components/form/calendar/calendar.module.mjs +18 -0
- package/dist/components/form/calendar/index.d.mts +2 -0
- package/dist/components/form/calendar/index.mjs +2 -0
- package/dist/components/form/checkbox/checkbox.css +90 -0
- package/dist/components/form/checkbox/checkbox.d.mts +5 -3
- package/dist/components/form/checkbox/checkbox.mjs +30 -27
- package/dist/components/form/checkbox/checkbox.module.mjs +13 -0
- package/dist/components/form/checkbox-card/checkbox-card.css +138 -0
- package/dist/components/form/checkbox-card/checkbox-card.d.mts +3 -4
- package/dist/components/form/checkbox-card/checkbox-card.mjs +17 -23
- package/dist/components/form/checkbox-card/checkbox-card.module.mjs +17 -0
- package/dist/components/form/checkbox-group/checkbox-group.css +15 -0
- package/dist/components/form/checkbox-group/checkbox-group.d.mts +7 -5
- package/dist/components/form/checkbox-group/checkbox-group.mjs +12 -16
- package/dist/components/form/checkbox-group/checkbox-group.module.mjs +8 -0
- package/dist/components/form/checkbox-group/index.d.mts +5 -3
- package/dist/components/form/color-picker/color-picker.css +172 -0
- package/dist/components/form/color-picker/color-picker.d.mts +28 -0
- package/dist/components/form/color-picker/color-picker.mjs +239 -0
- package/dist/components/form/color-picker/color-picker.module.mjs +20 -0
- package/dist/components/form/color-picker/index.d.mts +2 -0
- package/dist/components/form/color-picker/index.mjs +2 -0
- package/dist/components/form/combobox/combobox.css +143 -0
- package/dist/components/form/combobox/combobox.d.mts +32 -0
- package/dist/components/form/combobox/combobox.mjs +278 -0
- package/dist/components/form/combobox/combobox.module.mjs +19 -0
- package/dist/components/form/combobox/index.d.mts +2 -0
- package/dist/components/form/combobox/index.mjs +2 -0
- package/dist/components/form/date-field/date-field.css +31 -0
- package/dist/components/form/date-field/date-field.d.mts +8 -0
- package/dist/components/form/date-field/date-field.mjs +20 -0
- package/dist/components/form/date-field/date-field.module.mjs +5 -0
- package/dist/components/form/date-field/index.d.mts +2 -0
- package/dist/components/form/date-field/index.mjs +2 -0
- package/dist/components/form/date-picker/date-picker.css +90 -0
- package/dist/components/form/date-picker/date-picker.d.mts +12 -0
- package/dist/components/form/date-picker/date-picker.mjs +77 -0
- package/dist/components/form/date-picker/date-picker.module.mjs +14 -0
- package/dist/components/form/date-picker/index.d.mts +2 -0
- package/dist/components/form/date-picker/index.mjs +2 -0
- package/dist/components/form/file-field/file-field.css +88 -0
- package/dist/components/form/file-field/file-field.d.mts +18 -19
- package/dist/components/form/file-field/file-field.mjs +130 -42
- package/dist/components/form/file-field/file-field.module.mjs +17 -0
- package/dist/components/form/file-field/index.d.mts +20 -2
- package/dist/components/form/file-field/index.mjs +9 -1
- package/dist/components/form/form/form.css +11 -0
- package/dist/components/form/form/form.d.mts +4 -4
- package/dist/components/form/form/form.mjs +2 -1
- package/dist/components/form/form/form.module.mjs +5 -0
- package/dist/components/form/form-control/form-control.css +43 -0
- package/dist/components/form/form-control/form-control.d.mts +2 -3
- package/dist/components/form/form-control/form-control.mjs +11 -10
- package/dist/components/form/form-control/form-control.module.mjs +12 -0
- package/dist/components/form/number-field/cast.d.mts +2 -3
- package/dist/components/form/number-field/cast.mjs +3 -22
- package/dist/components/form/number-field/number-field.css +122 -0
- package/dist/components/form/number-field/number-field.d.mts +10 -10
- package/dist/components/form/number-field/number-field.mjs +126 -54
- package/dist/components/form/number-field/number-field.module.mjs +10 -0
- package/dist/components/form/password-input/password-input.css +88 -0
- package/dist/components/form/password-input/password-input.d.mts +2 -3
- package/dist/components/form/password-input/password-input.mjs +15 -12
- package/dist/components/form/password-input/password-input.module.mjs +12 -0
- package/dist/components/form/radio/radio.css +89 -0
- package/dist/components/form/radio/radio.d.mts +4 -3
- package/dist/components/form/radio/radio.mjs +16 -19
- package/dist/components/form/radio/radio.module.mjs +16 -0
- package/dist/components/form/radio-card/radio-card.css +147 -0
- package/dist/components/form/radio-card/radio-card.d.mts +4 -4
- package/dist/components/form/radio-card/radio-card.mjs +17 -23
- package/dist/components/form/radio-card/radio-card.module.mjs +19 -0
- package/dist/components/form/range-slider/index.d.mts +2 -0
- package/dist/components/form/range-slider/index.mjs +2 -0
- package/dist/components/form/range-slider/range-slider.css +67 -0
- package/dist/components/form/range-slider/range-slider.d.mts +30 -0
- package/dist/components/form/range-slider/range-slider.mjs +135 -0
- package/dist/components/form/range-slider/range-slider.module.mjs +14 -0
- package/dist/components/form/select/select.css +74 -0
- package/dist/components/form/select/select.d.mts +2 -3
- package/dist/components/form/select/select.mjs +25 -8
- package/dist/components/form/select/select.module.mjs +12 -0
- package/dist/components/form/slider/range-input-class.css +97 -0
- package/dist/components/form/slider/range-input-class.d.mts +7 -0
- package/dist/components/form/slider/range-input-class.mjs +10 -0
- package/dist/components/form/slider/range-input-class.module.mjs +8 -0
- package/dist/components/form/slider/slider.css +55 -0
- package/dist/components/form/slider/slider.d.mts +6 -7
- package/dist/components/form/slider/slider.mjs +44 -11
- package/dist/components/form/slider/slider.module.mjs +12 -0
- package/dist/components/form/switch/switch.css +103 -0
- package/dist/components/form/switch/switch.d.mts +2 -3
- package/dist/components/form/switch/switch.mjs +14 -17
- package/dist/components/form/switch/switch.module.mjs +16 -0
- package/dist/components/form/text-field/text-field.css +41 -0
- package/dist/components/form/text-field/text-field.d.mts +4 -5
- package/dist/components/form/text-field/text-field.mjs +2 -3
- package/dist/components/form/text-field/text-field.module.mjs +5 -0
- package/dist/components/form/textarea/textarea.css +50 -0
- package/dist/components/form/textarea/textarea.d.mts +3 -3
- package/dist/components/form/textarea/textarea.mjs +6 -20
- package/dist/components/form/textarea/textarea.module.mjs +9 -0
- package/dist/components/icons/base.css +40 -0
- package/dist/components/icons/base.d.mts +4 -5
- package/dist/components/icons/base.mjs +10 -10
- package/dist/components/icons/base.module.mjs +13 -0
- package/dist/components/icons/browsers.d.mts +5 -6
- package/dist/components/icons/color-scale.d.mts +2 -3
- package/dist/components/icons/github-mark.d.mts +2 -3
- package/dist/components/icons/logo.css +17 -0
- package/dist/components/icons/logo.d.mts +3 -4
- package/dist/components/icons/logo.mjs +4 -3
- package/dist/components/icons/logo.module.mjs +9 -0
- package/dist/components/icons/lucide-deep.d.mts +3 -1
- package/dist/components/icons/lucide-imports.d.mts +3 -1
- package/dist/components/icons/lucide-imports.mjs +3 -1
- package/dist/components/icons/lucide.d.mts +60 -61
- package/dist/components/icons/qiita.d.mts +2 -3
- package/dist/components/icons/twitter.css +9 -0
- package/dist/components/icons/twitter.d.mts +2 -3
- package/dist/components/icons/twitter.mjs +2 -1
- package/dist/components/icons/twitter.module.mjs +5 -0
- package/dist/components/icons/vertical-writing.d.mts +2 -3
- package/dist/components/index.d.mts +62 -29
- package/dist/components/index.mjs +36 -14
- package/dist/components/layout/_shared/gap.css +25 -0
- package/dist/components/layout/_shared/gap.d.mts +8 -9
- package/dist/components/layout/_shared/gap.mjs +6 -5
- package/dist/components/layout/_shared/gap.module.mjs +11 -0
- package/dist/components/layout/_shared/padding.css +25 -0
- package/dist/components/layout/_shared/padding.d.mts +8 -9
- package/dist/components/layout/_shared/padding.mjs +6 -5
- package/dist/components/layout/_shared/padding.module.mjs +11 -0
- package/dist/components/layout/grid/grid.css +93 -0
- package/dist/components/layout/grid/grid.d.mts +5 -6
- package/dist/components/layout/grid/grid.mjs +21 -20
- package/dist/components/layout/grid/grid.module.mjs +25 -0
- package/dist/components/layout/resizable-panels/index.d.mts +18 -0
- package/dist/components/layout/resizable-panels/index.mjs +9 -0
- package/dist/components/layout/resizable-panels/resizable-panels.css +77 -0
- package/dist/components/layout/resizable-panels/resizable-panels.d.mts +21 -0
- package/dist/components/layout/resizable-panels/resizable-panels.mjs +164 -0
- package/dist/components/layout/resizable-panels/resizable-panels.module.mjs +16 -0
- package/dist/components/layout/separator/separator.css +37 -0
- package/dist/components/layout/separator/separator.d.mts +2 -3
- package/dist/components/layout/separator/separator.mjs +12 -9
- package/dist/components/layout/separator/separator.module.mjs +12 -0
- package/dist/components/layout/stack/stack.css +49 -0
- package/dist/components/layout/stack/stack.d.mts +3 -4
- package/dist/components/layout/stack/stack.mjs +11 -10
- package/dist/components/layout/stack/stack.module.mjs +17 -0
- package/dist/components/navigation/anchor/anchor.css +29 -0
- package/dist/components/navigation/anchor/anchor.d.mts +2 -3
- package/dist/components/navigation/anchor/anchor.mjs +5 -2
- package/dist/components/navigation/anchor/anchor.module.mjs +8 -0
- package/dist/components/navigation/breadcrumb/breadcrumb.css +72 -0
- package/dist/components/navigation/breadcrumb/breadcrumb.d.mts +5 -6
- package/dist/components/navigation/breadcrumb/breadcrumb.mjs +15 -9
- package/dist/components/navigation/breadcrumb/breadcrumb.module.mjs +14 -0
- package/dist/components/navigation/breadcrumb/index.d.mts +2 -3
- package/dist/components/navigation/pagination/pagination.css +36 -0
- package/dist/components/navigation/pagination/pagination.d.mts +2 -3
- package/dist/components/navigation/pagination/pagination.mjs +9 -8
- package/dist/components/navigation/pagination/pagination.module.mjs +11 -0
- package/dist/components/navigation/side-nav/index.d.mts +16 -0
- package/dist/components/navigation/side-nav/index.mjs +10 -0
- package/dist/components/navigation/side-nav/side-nav.css +73 -0
- package/dist/components/navigation/side-nav/side-nav.d.mts +31 -0
- package/dist/components/navigation/side-nav/side-nav.mjs +62 -0
- package/dist/components/navigation/side-nav/side-nav.module.mjs +11 -0
- package/dist/components/navigation/stepper/index.d.mts +2 -0
- package/dist/components/navigation/stepper/index.mjs +2 -0
- package/dist/components/navigation/stepper/stepper.css +151 -0
- package/dist/components/navigation/stepper/stepper.d.mts +19 -0
- package/dist/components/navigation/stepper/stepper.mjs +87 -0
- package/dist/components/navigation/stepper/stepper.module.mjs +29 -0
- package/dist/components/navigation/table-of-contents/index.d.mts +2 -0
- package/dist/components/navigation/table-of-contents/index.mjs +2 -0
- package/dist/components/navigation/table-of-contents/table-of-contents.css +17 -0
- package/dist/components/navigation/table-of-contents/table-of-contents.d.mts +12 -0
- package/dist/components/navigation/table-of-contents/table-of-contents.mjs +94 -0
- package/dist/components/navigation/table-of-contents/table-of-contents.module.mjs +8 -0
- package/dist/components/navigation/tabs/index.d.mts +19 -2
- package/dist/components/navigation/tabs/index.mjs +9 -1
- package/dist/components/navigation/tabs/tabs.css +70 -0
- package/dist/components/navigation/tabs/tabs.d.mts +16 -19
- package/dist/components/navigation/tabs/tabs.mjs +52 -49
- package/dist/components/navigation/tabs/tabs.module.mjs +12 -0
- package/dist/components/observers/fragment-instance.d.mts +1 -0
- package/dist/components/observers/in-view/in-view.d.mts +11 -0
- package/dist/components/observers/in-view/in-view.mjs +60 -0
- package/dist/components/observers/in-view/index.d.mts +2 -0
- package/dist/components/observers/in-view/index.mjs +2 -0
- package/dist/components/observers/resize/index.d.mts +2 -0
- package/dist/components/observers/resize/index.mjs +2 -0
- package/dist/components/observers/resize/resize.d.mts +7 -0
- package/dist/components/observers/resize/resize.mjs +25 -0
- package/dist/components/overlays/_internal/modal-dialog-context.d.mts +4 -5
- package/dist/components/overlays/_internal/use-can-hover.d.mts +2 -3
- package/dist/components/overlays/_internal/use-hover-intent.d.mts +3 -4
- package/dist/components/overlays/_internal/use-list-navigation.d.mts +17 -11
- package/dist/components/overlays/_internal/use-list-navigation.mjs +42 -26
- package/dist/components/overlays/command-palette/command-palette.css +91 -0
- package/dist/components/overlays/command-palette/command-palette.d.mts +24 -0
- package/dist/components/overlays/command-palette/command-palette.mjs +139 -0
- package/dist/components/overlays/command-palette/command-palette.module.mjs +14 -0
- package/dist/components/overlays/command-palette/index.d.mts +2 -0
- package/dist/components/overlays/command-palette/index.mjs +2 -0
- package/dist/components/overlays/context-menu/context-menu.d.mts +13 -0
- package/dist/components/overlays/context-menu/context-menu.mjs +79 -0
- package/dist/components/overlays/context-menu/index.d.mts +21 -0
- package/dist/components/overlays/context-menu/index.mjs +13 -0
- package/dist/components/overlays/dialog/dialog.css +31 -0
- package/dist/components/overlays/dialog/dialog.d.mts +12 -17
- package/dist/components/overlays/dialog/dialog.mjs +11 -13
- package/dist/components/overlays/dialog/dialog.module.mjs +10 -0
- package/dist/components/overlays/dialog/index.d.mts +17 -2
- package/dist/components/overlays/dialog/index.mjs +8 -1
- package/dist/components/overlays/drawer/drawer.css +48 -0
- package/dist/components/overlays/drawer/drawer.d.mts +2 -3
- package/dist/components/overlays/drawer/drawer.mjs +11 -10
- package/dist/components/overlays/drawer/drawer.module.mjs +13 -0
- package/dist/components/overlays/dropdown-menu/dropdown-menu.d.mts +19 -26
- package/dist/components/overlays/dropdown-menu/dropdown-menu.mjs +12 -20
- package/dist/components/overlays/dropdown-menu/hooks.d.mts +7 -7
- package/dist/components/overlays/dropdown-menu/hooks.mjs +3 -3
- package/dist/components/overlays/dropdown-menu/index.d.mts +30 -2
- package/dist/components/overlays/dropdown-menu/index.mjs +12 -1
- package/dist/components/overlays/dropdown-menu/shared.css +51 -0
- package/dist/components/overlays/dropdown-menu/shared.d.mts +3 -6
- package/dist/components/overlays/dropdown-menu/shared.mjs +4 -6
- package/dist/components/overlays/dropdown-menu/shared.module.mjs +8 -0
- package/dist/components/overlays/dropdown-menu/sub-menu.css +28 -0
- package/dist/components/overlays/dropdown-menu/sub-menu.d.mts +3 -6
- package/dist/components/overlays/dropdown-menu/sub-menu.mjs +16 -16
- package/dist/components/overlays/dropdown-menu/sub-menu.module.mjs +9 -0
- package/dist/components/overlays/dropdown-menu/use-safe-triangle.d.mts +2 -3
- package/dist/components/overlays/list-box/hooks.d.mts +6 -5
- package/dist/components/overlays/list-box/hooks.mjs +5 -4
- package/dist/components/overlays/list-box/index.d.mts +27 -2
- package/dist/components/overlays/list-box/index.mjs +9 -1
- package/dist/components/overlays/list-box/list-box.css +74 -0
- package/dist/components/overlays/list-box/list-box.d.mts +20 -23
- package/dist/components/overlays/list-box/list-box.mjs +17 -21
- package/dist/components/overlays/list-box/list-box.module.mjs +10 -0
- package/dist/components/overlays/modal/modal.css +119 -0
- package/dist/components/overlays/modal/modal.d.mts +2 -3
- package/dist/components/overlays/modal/modal.mjs +14 -11
- package/dist/components/overlays/modal/modal.module.mjs +11 -0
- package/dist/components/overlays/popover/anchor-positioning.d.mts +4 -5
- package/dist/components/overlays/popover/escape-stack.d.mts +2 -3
- package/dist/components/overlays/popover/hooks.d.mts +7 -8
- package/dist/components/overlays/popover/index.d.mts +25 -2
- package/dist/components/overlays/popover/index.mjs +8 -1
- package/dist/components/overlays/popover/popover.css +51 -0
- package/dist/components/overlays/popover/popover.d.mts +18 -20
- package/dist/components/overlays/popover/popover.mjs +13 -12
- package/dist/components/overlays/popover/popover.module.mjs +11 -0
- package/dist/components/overlays/tooltip/bridge.css +68 -0
- package/dist/components/overlays/tooltip/bridge.d.mts +2 -3
- package/dist/components/overlays/tooltip/bridge.mjs +7 -21
- package/dist/components/overlays/tooltip/bridge.module.mjs +11 -0
- package/dist/components/overlays/tooltip/index.d.mts +22 -2
- package/dist/components/overlays/tooltip/index.mjs +8 -1
- package/dist/components/overlays/tooltip/tooltip.css +15 -0
- package/dist/components/overlays/tooltip/tooltip.d.mts +19 -24
- package/dist/components/overlays/tooltip/tooltip.mjs +5 -9
- package/dist/components/overlays/tooltip/tooltip.module.mjs +5 -0
- package/dist/components/providers/index.d.mts +1 -2
- package/dist/components/providers/portal-root.d.mts +9 -7
- package/dist/components/providers/portal-root.mjs +7 -7
- package/dist/components/providers/ui-provider.d.mts +2 -6
- package/dist/components/providers/ui-provider.mjs +1 -5
- package/dist/helpers/chain.d.mts +2 -3
- package/dist/helpers/chain.mjs +0 -23
- package/dist/helpers/create-safe-context.d.mts +2 -3
- package/dist/helpers/create-safe-context.mjs +0 -17
- package/dist/helpers/index.d.mts +1 -2
- package/dist/helpers/index.mjs +2 -3
- package/dist/helpers/merge-props.d.mts +2 -3
- package/dist/helpers/merge-props.mjs +2 -37
- package/dist/helpers/merge-refs.d.mts +2 -3
- package/dist/helpers/merge-refs.mjs +0 -32
- package/dist/hooks/click-away/index.d.mts +2 -3
- package/dist/hooks/controllable-state/index.d.mts +2 -3
- package/dist/hooks/controllable-state/index.mjs +9 -11
- package/dist/hooks/index.d.mts +2 -23
- package/dist/hooks/index.mjs +2 -22
- package/dist/hooks/writing-mode/index.d.mts +15 -5
- package/dist/hooks/writing-mode/index.mjs +21 -14
- package/dist/i18n/current.d.mts +23 -0
- package/dist/i18n/current.mjs +43 -0
- package/dist/i18n/en.d.mts +2 -3
- package/dist/i18n/en.mjs +46 -0
- package/dist/i18n/index.d.mts +3 -2
- package/dist/i18n/index.mjs +4 -3
- package/dist/i18n/ja.d.mts +2 -3
- package/dist/i18n/ja.mjs +46 -0
- package/dist/i18n/messages.d.mts +81 -3
- package/dist/i18n/usage.d.mts +8 -0
- package/dist/i18n/usage.mjs +131 -0
- package/dist/index.d.mts +40 -47
- package/dist/index.mjs +36 -42
- package/dist/integrations/_shared/openui-defs.d.mts +3 -4
- package/dist/integrations/_shared/openui-defs.mjs +123 -54
- package/dist/integrations/_shared/renderers.css +50 -0
- package/dist/integrations/_shared/renderers.d.mts +71 -52
- package/dist/integrations/_shared/renderers.mjs +292 -34
- package/dist/integrations/_shared/renderers.module.mjs +14 -0
- package/dist/integrations/_shared/schemas.d.mts +388 -104
- package/dist/integrations/_shared/schemas.mjs +165 -27
- package/dist/integrations/ai-sdk/index.d.mts +2 -2
- package/dist/integrations/ai-sdk/map-parts.d.mts +25 -7
- package/dist/integrations/ai-sdk/map-parts.mjs +28 -3
- package/dist/integrations/json-render/catalog.d.mts +336 -18
- package/dist/integrations/json-render/catalog.mjs +120 -57
- package/dist/integrations/json-render/registry.d.mts +3 -4
- package/dist/integrations/json-render/registry.mjs +38 -4
- package/dist/integrations/openui/form-views.d.mts +23 -18
- package/dist/integrations/openui/form-views.mjs +27 -3
- package/dist/integrations/openui/library.d.mts +59 -7
- package/dist/integrations/openui/library.mjs +18 -3
- package/dist/integrations/openui/prompt.d.mts +2 -3
- package/dist/internal/accepts-file.d.mts +8 -0
- package/dist/internal/accepts-file.mjs +19 -0
- package/dist/internal/carries-files.d.mts +3 -0
- package/dist/internal/carries-files.mjs +4 -0
- package/dist/internal/clamp.d.mts +2 -3
- package/dist/internal/clamp.mjs +0 -11
- package/dist/internal/commit-input-value.d.mts +10 -0
- package/dist/internal/commit-input-value.mjs +15 -0
- package/dist/internal/dropped-files.d.mts +3 -0
- package/dist/internal/dropped-files.mjs +8 -0
- package/dist/{hooks/focus-trap/index.d.mts → internal/focus-trap.d.mts} +6 -7
- package/dist/{hooks/focus-trap/index.mjs → internal/focus-trap.mjs} +5 -5
- package/dist/internal/hex-color.d.mts +22 -0
- package/dist/internal/hex-color.mjs +53 -0
- package/dist/internal/iso-date.d.mts +39 -0
- package/dist/internal/iso-date.mjs +98 -0
- package/dist/internal/to-precision.d.mts +2 -3
- package/dist/internal/to-precision.mjs +0 -8
- package/dist/styles/index.css +513 -2534
- package/dist/styles/tailwind.css +217 -17
- package/dist/styles/tokens.d.mts +1 -2
- package/dist/styles/tokens.mjs +1 -2
- package/dist/types/variables.d.mts +7 -9
- package/docs/GUIDE.md +340 -158
- package/docs/llms.txt +18 -10
- package/docs/props.generated.json +2157 -292
- package/docs/references/ai-chat.md +396 -113
- package/docs/references/color.md +258 -113
- package/docs/references/components.md +1891 -461
- package/docs/references/generative-ui.md +163 -34
- package/docs/references/interaction-design.md +103 -73
- package/docs/references/spatial-design.md +112 -90
- package/docs/references/types.md +101 -0
- package/docs/references/typography.md +182 -73
- package/package.json +71 -70
- package/dist/components/_internal/focus-ring.d.mts +0 -8
- package/dist/components/_internal/focus-ring.mjs +0 -8
- package/dist/components/layout/scroll-linked/index.d.mts +0 -2
- package/dist/components/layout/scroll-linked/index.mjs +0 -2
- package/dist/components/layout/scroll-linked/scroll-linked.d.mts +0 -14
- package/dist/components/layout/scroll-linked/scroll-linked.mjs +0 -59
- package/dist/helpers/cn.d.mts +0 -5
- package/dist/helpers/cn.mjs +0 -27
- package/dist/hooks/breakpoint/index.d.mts +0 -5
- package/dist/hooks/breakpoint/index.mjs +0 -24
- package/dist/hooks/client/index.d.mts +0 -4
- package/dist/hooks/client/index.mjs +0 -6
- package/dist/hooks/clipboard/index.d.mts +0 -7
- package/dist/hooks/clipboard/index.mjs +0 -15
- package/dist/hooks/debounced-transition/index.d.mts +0 -5
- package/dist/hooks/debounced-transition/index.mjs +0 -49
- package/dist/hooks/deferred-debounce/index.d.mts +0 -4
- package/dist/hooks/deferred-debounce/index.mjs +0 -9
- package/dist/hooks/disclosure/index.d.mts +0 -10
- package/dist/hooks/disclosure/index.mjs +0 -20
- package/dist/hooks/hash/index.d.mts +0 -4
- package/dist/hooks/hash/index.mjs +0 -25
- package/dist/hooks/hover/index.d.mts +0 -12
- package/dist/hooks/hover/index.mjs +0 -19
- package/dist/hooks/intersection-observer/index.d.mts +0 -3
- package/dist/hooks/intersection-observer/index.mjs +0 -3
- package/dist/hooks/intersection-observer/use-in-view.d.mts +0 -11
- package/dist/hooks/intersection-observer/use-in-view.mjs +0 -18
- package/dist/hooks/intersection-observer/use-intersection-observer.d.mts +0 -11
- package/dist/hooks/intersection-observer/use-intersection-observer.mjs +0 -33
- package/dist/hooks/interval/index.d.mts +0 -4
- package/dist/hooks/interval/index.mjs +0 -19
- package/dist/hooks/local-storage/index.d.mts +0 -4
- package/dist/hooks/local-storage/index.mjs +0 -46
- package/dist/hooks/resize/index.d.mts +0 -8
- package/dist/hooks/resize/index.mjs +0 -24
- package/dist/hooks/scroll-direction/index.d.mts +0 -13
- package/dist/hooks/scroll-direction/index.mjs +0 -67
- package/dist/hooks/scroll-lock/index.d.mts +0 -9
- package/dist/hooks/scroll-lock/index.mjs +0 -59
- package/dist/hooks/session-storage/index.d.mts +0 -4
- package/dist/hooks/session-storage/index.mjs +0 -46
- package/dist/hooks/step/index.d.mts +0 -15
- package/dist/hooks/step/index.mjs +0 -39
- package/dist/hooks/timeout/index.d.mts +0 -4
- package/dist/hooks/timeout/index.mjs +0 -19
- package/dist/hooks/window-resize/index.d.mts +0 -11
- package/dist/hooks/window-resize/index.mjs +0 -21
- package/dist/hooks/window-size/index.d.mts +0 -8
- package/dist/hooks/window-size/index.mjs +0 -31
- package/dist/i18n/context.d.mts +0 -9
- package/dist/i18n/context.mjs +0 -19
- package/dist/styles/base.css +0 -315
- package/dist/styles/tokens.css +0 -380
- package/dist/styles/tokens.generated.d.mts +0 -840
- package/dist/styles/tokens.generated.mjs +0 -813
- package/dist/styles/utilities.css +0 -62
- package/docs/references/helpers.md +0 -120
- package/docs/references/hooks.md +0 -314
package/README.md
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
# @k8ordo/ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
React components from [k8ordo](https://ordo.k8o.me) — semantic design
|
|
4
|
+
tokens, built-in wording that follows `@k8ordo/i18n` (Japanese and English included), and adapters that let an LLM generate
|
|
5
|
+
on-brand UIs.
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
Like every k8ordo package it assumes React 19 and Server Components, uses only
|
|
8
|
+
what has reached Baseline, and ships no polyfills or legacy fallbacks.
|
|
9
|
+
|
|
10
|
+
- **Documentation**: https://ordo.k8o.me/ui
|
|
6
11
|
- **Storybook**: https://main--687a213c85e2e4589d8db1bb.chromatic.com
|
|
7
12
|
|
|
8
13
|
## Installation
|
|
@@ -17,45 +22,75 @@ yarn add @k8ordo/ui
|
|
|
17
22
|
|
|
18
23
|
## Peer Dependencies
|
|
19
24
|
|
|
20
|
-
|
|
25
|
+
Only React and `@k8ordo/i18n` are required:
|
|
21
26
|
|
|
22
27
|
```bash
|
|
23
|
-
npm install react react-dom
|
|
28
|
+
npm install react react-dom @k8ordo/i18n
|
|
24
29
|
```
|
|
25
30
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
Everything else is an optional peer, needed only for the entry point that uses
|
|
32
|
+
it. Install one when you import the entry it belongs to.
|
|
33
|
+
|
|
34
|
+
<!-- peers -->
|
|
35
|
+
|
|
36
|
+
| Package | Version | Required | Needed for |
|
|
37
|
+
| ----------------------- | --------------- | -------- | ------------------------------------------------- |
|
|
38
|
+
| `react` | ≥19.3.0 | yes | the components and hooks |
|
|
39
|
+
| `react-dom` | ≥19.3.0 | yes | portals and `useFormStatus` |
|
|
40
|
+
| `@k8ordo/i18n` | ^1.0.0 | yes | the locale the components' own wording is read in |
|
|
41
|
+
| `typescript` | ≥7.0.0 | optional | the shipped type declarations |
|
|
42
|
+
| `@types/react` | ≥19.3.0 | optional | the shipped type declarations |
|
|
43
|
+
| `@types/react-dom` | ≥19.3.0 | optional | the shipped type declarations |
|
|
44
|
+
| `zod` | ^4.4.3 | optional | generative-UI schemas |
|
|
45
|
+
| `@json-render/core` | ≥0.21.0 <0.22.0 | optional | `@k8ordo/ui/json-render` |
|
|
46
|
+
| `@json-render/react` | ≥0.21.0 <0.22.0 | optional | `@k8ordo/ui/json-render` |
|
|
47
|
+
| `@openuidev/lang-core` | ≥0.3.0 <0.4.0 | optional | `@k8ordo/ui/openui`, `@k8ordo/ui/openui/prompt` |
|
|
48
|
+
| `@openuidev/react-lang` | ≥0.3.0 <0.4.0 | optional | `@k8ordo/ui/openui` |
|
|
49
|
+
| `ai` | ≥7.0.51 | optional | `@k8ordo/ui/ai-sdk` |
|
|
50
|
+
| `streamdown` | ≥2.5.0 | optional | `@k8ordo/ui/ai/response` |
|
|
51
|
+
|
|
52
|
+
<!-- /peers -->
|
|
53
|
+
|
|
54
|
+
The generative-UI peers are 0.x, where a minor bump is a breaking release, so
|
|
55
|
+
the declared range stops at the next minor: `@k8ordo/ui` only claims the line it
|
|
56
|
+
is tested against. Resolve exactly **one copy** of each — the adapters read the
|
|
57
|
+
framework's own React context, so two copies let every schema check and the
|
|
58
|
+
build pass while the form views throw at render time.
|
|
59
|
+
|
|
60
|
+
The components need no CSS tooling of their own: they are written in CSS Modules
|
|
61
|
+
and ship compiled CSS, which each component imports. The package does not
|
|
62
|
+
depend on `tailwindcss`, not even for the optional `tailwind.css` entry, which
|
|
63
|
+
reads the Tailwind your project already has.
|
|
31
64
|
|
|
32
65
|
## Quick Start
|
|
33
66
|
|
|
34
67
|
1. Import the CSS and set up the provider.
|
|
35
68
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
69
|
+
Import `styles.css` once — the layer order, the design tokens, a reset, and the
|
|
70
|
+
page-wide defaults. Each component brings its own CSS through its JavaScript
|
|
71
|
+
import, so a page loads only the CSS of the components it uses. Every library
|
|
72
|
+
rule sits in a cascade layer (`components` for the components), so your own
|
|
73
|
+
(unlayered) CSS takes precedence, and the design tokens are available as CSS
|
|
74
|
+
custom properties (`var(--color-fg-mute)`, `calc(var(--spacing) * 6)`, …).
|
|
40
75
|
|
|
41
76
|
```css
|
|
42
77
|
@import '@k8ordo/ui/styles.css';
|
|
43
78
|
```
|
|
44
79
|
|
|
45
|
-
**Using Tailwind CSS 4?** Import the
|
|
46
|
-
|
|
47
|
-
classes (`bg-bg-base`, …) in your own
|
|
48
|
-
|
|
80
|
+
**Using Tailwind CSS 4?** Import the bridge after Tailwind, instead of
|
|
81
|
+
`styles.css`. It includes `styles.css`, and its theme makes the design tokens
|
|
82
|
+
usable as Tailwind classes (`bg-bg-base`, `text-md`, `p-6`, …) in your own
|
|
83
|
+
markup:
|
|
49
84
|
|
|
50
85
|
```css
|
|
86
|
+
@import 'tailwindcss';
|
|
51
87
|
@import '@k8ordo/ui/tailwind.css';
|
|
52
|
-
@source './src';
|
|
53
88
|
```
|
|
54
89
|
|
|
55
|
-
Note that
|
|
56
|
-
the library base layer (
|
|
57
|
-
|
|
58
|
-
|
|
90
|
+
Note that `styles.css` applies a document-wide base: a reset with the same
|
|
91
|
+
rules as Tailwind's preflight, plus the library base layer (`b`/`strong` weight
|
|
92
|
+
and `i`/`em` style unset, `body` typography defaults). Adding it to an existing
|
|
93
|
+
app restyles more than the library components.
|
|
59
94
|
|
|
60
95
|
```tsx
|
|
61
96
|
// In your app entry point
|
|
@@ -89,40 +124,20 @@ function MyPage() {
|
|
|
89
124
|
|
|
90
125
|
## Internationalization (i18n)
|
|
91
126
|
|
|
92
|
-
The wording that components own internally — "close", "required", "loading", and so on —
|
|
93
|
-
|
|
94
|
-
To switch to English, pass the `en` dictionary from `@k8ordo/ui/i18n`:
|
|
95
|
-
|
|
96
|
-
```tsx
|
|
97
|
-
import { UIProvider } from '@k8ordo/ui';
|
|
98
|
-
import { en } from '@k8ordo/ui/i18n';
|
|
99
|
-
|
|
100
|
-
function App() {
|
|
101
|
-
return (
|
|
102
|
-
<UIProvider messages={en}>
|
|
103
|
-
<YourApp />
|
|
104
|
-
</UIProvider>
|
|
105
|
-
);
|
|
106
|
-
}
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
`messages` takes a `Partial<Messages>`, so you can spread a dictionary and override only the keys you care about:
|
|
127
|
+
The wording that components own internally — "close", "required", "loading", and so on — is read in [`@k8ordo/i18n`](https://ordo.k8o.me/i18n)'s current locale. There is no provider and nothing to pass:
|
|
110
128
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
<YourApp />
|
|
114
|
-
</UIProvider>
|
|
115
|
-
```
|
|
129
|
+
- an application that defines its locale set with `defineLocales` gets the locale its messages render in;
|
|
130
|
+
- an application that defines none gets **English**, whatever its URL starts with.
|
|
116
131
|
|
|
117
|
-
|
|
132
|
+
`ja` and `en` ship with the library. Register any other locale, or replace a built-in one, next to where the set is defined:
|
|
118
133
|
|
|
119
|
-
|
|
134
|
+
```ts
|
|
135
|
+
import { en, registerMessages } from '@k8ordo/ui/i18n';
|
|
120
136
|
|
|
121
|
-
|
|
122
|
-
import { en, ja, type Messages } from '@k8ordo/ui/i18n';
|
|
137
|
+
registerMessages('en', { ...en, close: 'Dismiss' });
|
|
123
138
|
```
|
|
124
139
|
|
|
125
|
-
`
|
|
140
|
+
Resolution order is **component prop > registered dictionary > built-in dictionary**. Components that expose a wording prop of their own — `Spinner`'s `label`, `Alert`'s `closeLabel`, `PasswordInput`'s `showLabel` / `hideLabel`, `Pagination`'s `prevLabel` / `nextLabel` — take it over the dictionary. `getMessages()` returns the wording in effect for elements you draw yourself; it is not a hook, so a Server Component calls it too. See [docs/references/components.md](docs/references/components.md) for the full key list.
|
|
126
141
|
|
|
127
142
|
## AI Agent Documentation
|
|
128
143
|
|
|
@@ -136,8 +151,9 @@ Point your agent at it once by pasting this into your project's `CLAUDE.md` /
|
|
|
136
151
|
Use `@k8ordo/ui` for UI. Before writing or changing UI, read
|
|
137
152
|
`node_modules/@k8ordo/ui/docs/GUIDE.md`, then follow only the
|
|
138
153
|
`docs/references/*.md` links it lists that the task actually needs.
|
|
139
|
-
Colors, spacing, radii and font weights go through semantic tokens
|
|
140
|
-
never raw values
|
|
154
|
+
Colors, spacing, radii and font weights go through the semantic tokens
|
|
155
|
+
(`var(--color-fg-mute)`, `calc(var(--spacing) * 6)`) — never raw values or
|
|
156
|
+
the palette (`--teal-500`).
|
|
141
157
|
Look up component props in `docs/references/components.md` instead of
|
|
142
158
|
recalling them; a component that is not listed there does not exist.
|
|
143
159
|
```
|
|
@@ -168,71 +184,113 @@ stories and rendered props rather than relying on trained knowledge:
|
|
|
168
184
|
|
|
169
185
|
## Component Categories
|
|
170
186
|
|
|
187
|
+
Every component, grouped by its folder in `src/components/`. Each links to its
|
|
188
|
+
entry in [docs/references/components.md](docs/references/components.md).
|
|
189
|
+
|
|
190
|
+
<!-- generated:component-categories -->
|
|
191
|
+
|
|
171
192
|
### Buttons
|
|
172
193
|
|
|
173
|
-
-
|
|
174
|
-
-
|
|
194
|
+
- [Button](docs/references/components.md#button)
|
|
195
|
+
- [CopyButton](docs/references/components.md#copybutton)
|
|
196
|
+
- [IconButton](docs/references/components.md#iconbutton)
|
|
197
|
+
- [Toolbar](docs/references/components.md#toolbar)
|
|
175
198
|
|
|
176
199
|
### Navigation
|
|
177
200
|
|
|
178
|
-
-
|
|
179
|
-
-
|
|
180
|
-
-
|
|
181
|
-
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
-
|
|
189
|
-
-
|
|
190
|
-
-
|
|
191
|
-
-
|
|
192
|
-
-
|
|
193
|
-
-
|
|
194
|
-
-
|
|
195
|
-
-
|
|
196
|
-
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
-
|
|
201
|
-
-
|
|
202
|
-
-
|
|
203
|
-
-
|
|
204
|
-
-
|
|
205
|
-
-
|
|
206
|
-
-
|
|
201
|
+
- [Anchor](docs/references/components.md#anchor)
|
|
202
|
+
- [Breadcrumb](docs/references/components.md#breadcrumb)
|
|
203
|
+
- [Pagination](docs/references/components.md#pagination)
|
|
204
|
+
- [SideNav](docs/references/components.md#sidenav)
|
|
205
|
+
- [Stepper](docs/references/components.md#stepper)
|
|
206
|
+
- [TableOfContents](docs/references/components.md#tableofcontents)
|
|
207
|
+
- [Tabs](docs/references/components.md#tabs)
|
|
208
|
+
|
|
209
|
+
### Forms
|
|
210
|
+
|
|
211
|
+
- [Autocomplete](docs/references/components.md#autocomplete)
|
|
212
|
+
- [Calendar](docs/references/components.md#calendar)
|
|
213
|
+
- [Checkbox](docs/references/components.md#checkbox)
|
|
214
|
+
- [CheckboxCard](docs/references/components.md#checkboxcard)
|
|
215
|
+
- [CheckboxGroup](docs/references/components.md#checkboxgroup)
|
|
216
|
+
- [ColorPicker](docs/references/components.md#colorpicker)
|
|
217
|
+
- [Combobox](docs/references/components.md#combobox)
|
|
218
|
+
- [DateField](docs/references/components.md#datefield)
|
|
219
|
+
- [DatePicker](docs/references/components.md#datepicker)
|
|
220
|
+
- [FileField](docs/references/components.md#filefield)
|
|
221
|
+
- [Form](docs/references/components.md#form)
|
|
222
|
+
- [FormControl](docs/references/components.md#formcontrol)
|
|
223
|
+
- [NumberField](docs/references/components.md#numberfield)
|
|
224
|
+
- [PasswordInput](docs/references/components.md#passwordinput)
|
|
225
|
+
- [Radio](docs/references/components.md#radio)
|
|
226
|
+
- [RadioCard](docs/references/components.md#radiocard)
|
|
227
|
+
- [RangeSlider](docs/references/components.md#rangeslider)
|
|
228
|
+
- [Select](docs/references/components.md#select)
|
|
229
|
+
- [Slider](docs/references/components.md#slider)
|
|
230
|
+
- [Switch](docs/references/components.md#switch)
|
|
231
|
+
- [Textarea](docs/references/components.md#textarea)
|
|
232
|
+
- [TextField](docs/references/components.md#textfield)
|
|
233
|
+
|
|
234
|
+
### Data display
|
|
235
|
+
|
|
236
|
+
- [Accordion](docs/references/components.md#accordion)
|
|
237
|
+
- [Avatar](docs/references/components.md#avatar)
|
|
238
|
+
- [Badge](docs/references/components.md#badge)
|
|
239
|
+
- [Card](docs/references/components.md#card)
|
|
240
|
+
- [Carousel](docs/references/components.md#carousel)
|
|
241
|
+
- [Code](docs/references/components.md#code)
|
|
242
|
+
- [CodeBlock](docs/references/components.md#codeblock)
|
|
243
|
+
- [DataTable](docs/references/components.md#datatable)
|
|
244
|
+
- [Heading](docs/references/components.md#heading)
|
|
245
|
+
- [Kbd](docs/references/components.md#kbd)
|
|
246
|
+
- [Prose](docs/references/components.md#prose)
|
|
247
|
+
- [Table](docs/references/components.md#table)
|
|
248
|
+
- [Tree](docs/references/components.md#tree)
|
|
207
249
|
|
|
208
250
|
### Feedback
|
|
209
251
|
|
|
210
|
-
-
|
|
211
|
-
-
|
|
212
|
-
-
|
|
213
|
-
-
|
|
214
|
-
-
|
|
252
|
+
- [Alert](docs/references/components.md#alert)
|
|
253
|
+
- [Callout](docs/references/components.md#callout)
|
|
254
|
+
- [EmptyState](docs/references/components.md#emptystate)
|
|
255
|
+
- [Progress](docs/references/components.md#progress)
|
|
256
|
+
- [Skeleton](docs/references/components.md#skeleton)
|
|
257
|
+
- [Spinner](docs/references/components.md#spinner)
|
|
258
|
+
- [ToastProvider](docs/references/components.md#toastprovider)
|
|
215
259
|
|
|
216
260
|
### Overlays
|
|
217
261
|
|
|
218
|
-
-
|
|
219
|
-
-
|
|
220
|
-
-
|
|
221
|
-
-
|
|
222
|
-
-
|
|
223
|
-
-
|
|
224
|
-
-
|
|
262
|
+
- [CommandPalette](docs/references/components.md#commandpalette)
|
|
263
|
+
- [ContextMenu](docs/references/components.md#contextmenu)
|
|
264
|
+
- [Dialog](docs/references/components.md#dialog)
|
|
265
|
+
- [Drawer](docs/references/components.md#drawer)
|
|
266
|
+
- [DropdownMenu](docs/references/components.md#dropdownmenu)
|
|
267
|
+
- [ListBox](docs/references/components.md#listbox)
|
|
268
|
+
- [Modal](docs/references/components.md#modal)
|
|
269
|
+
- [Popover](docs/references/components.md#popover)
|
|
270
|
+
- [Tooltip](docs/references/components.md#tooltip)
|
|
225
271
|
|
|
226
272
|
### Layout
|
|
227
273
|
|
|
228
|
-
-
|
|
229
|
-
-
|
|
274
|
+
- [Grid](docs/references/components.md#grid)
|
|
275
|
+
- [ResizablePanels](docs/references/components.md#resizablepanels)
|
|
276
|
+
- [Separator](docs/references/components.md#separator)
|
|
277
|
+
- [Stack](docs/references/components.md#stack)
|
|
278
|
+
|
|
279
|
+
### Observers
|
|
280
|
+
|
|
281
|
+
- [InView](docs/references/components.md#inview)
|
|
282
|
+
- [Resize](docs/references/components.md#resize)
|
|
283
|
+
|
|
284
|
+
### Icons
|
|
230
285
|
|
|
231
|
-
|
|
286
|
+
- [Icons](docs/references/components.md#icons) — decorative icon components (`CloseIcon`, `ChevronIcon`, …)
|
|
232
287
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
-
|
|
288
|
+
### Providers
|
|
289
|
+
|
|
290
|
+
- [PortalRootProvider](docs/references/components.md#portalrootprovider)
|
|
291
|
+
- [UIProvider](docs/references/components.md#uiprovider)
|
|
292
|
+
|
|
293
|
+
<!-- /generated:component-categories -->
|
|
236
294
|
|
|
237
295
|
## Usage Examples
|
|
238
296
|
|
|
@@ -314,40 +372,44 @@ function MyComponent() {
|
|
|
314
372
|
|
|
315
373
|
## Imports & Bundle Size
|
|
316
374
|
|
|
317
|
-
|
|
375
|
+
The core UI components ship from the root entry — there are no per-component subpaths; the AI chat components live under `@k8ordo/ui/ai`, with `Response` under `@k8ordo/ui/ai/response`, and `CodeBlock` under `@k8ordo/ui/code-block` so the highlighter stays out of everything else. The package is tree-shakeable (`sideEffects` is limited to CSS), so bundlers drop everything you don't import — the CSS too, since each component imports its own stylesheet:
|
|
318
376
|
|
|
319
377
|
```tsx
|
|
320
378
|
// Named imports from the root entry — unused exports are tree-shaken away
|
|
321
|
-
import { Button, Card,
|
|
379
|
+
import { Button, Card, Stack } from '@k8ordo/ui';
|
|
322
380
|
```
|
|
323
381
|
|
|
324
382
|
Optional features live behind dedicated subpath exports:
|
|
325
383
|
|
|
326
|
-
| Subpath | Contents
|
|
327
|
-
| --------------------------------- |
|
|
328
|
-
| `@k8ordo/ui` |
|
|
329
|
-
| `@k8ordo/ui/tokens` | Design
|
|
330
|
-
| `@k8ordo/ui/
|
|
331
|
-
| `@k8ordo/ui/
|
|
332
|
-
| `@k8ordo/ui/ai
|
|
333
|
-
| `@k8ordo/ui/ai
|
|
334
|
-
| `@k8ordo/ui/
|
|
335
|
-
| `@k8ordo/ui/
|
|
336
|
-
| `@k8ordo/ui/
|
|
337
|
-
| `@k8ordo/ui/
|
|
338
|
-
| `@k8ordo/ui/
|
|
339
|
-
| `@k8ordo/ui/
|
|
384
|
+
| Subpath | Contents |
|
|
385
|
+
| --------------------------------- | ----------------------------------------------------------------------------------------- |
|
|
386
|
+
| `@k8ordo/ui` | Core UI components, their types, and provider hooks |
|
|
387
|
+
| `@k8ordo/ui/tokens` | Design tokens as a DTCG resolver document |
|
|
388
|
+
| `@k8ordo/ui/props.json` | Every component's props as JSON, generated from the types |
|
|
389
|
+
| `@k8ordo/ui/i18n` | `ja` / `en`, `registerMessages`, `getMessages`, `messageUsage`, and the `Messages` type |
|
|
390
|
+
| `@k8ordo/ui/ai` | AI chat components |
|
|
391
|
+
| `@k8ordo/ui/ai/response` | `Response` Markdown renderer (needs optional peer `streamdown`) |
|
|
392
|
+
| `@k8ordo/ui/ai-sdk` | AI SDK adapter (needs optional peer `ai`) |
|
|
393
|
+
| `@k8ordo/ui/code-block` | `CodeBlock`, highlighted on the server with shiki (Server Component) |
|
|
394
|
+
| `@k8ordo/ui/json-render` | json-render catalog (server-safe) |
|
|
395
|
+
| `@k8ordo/ui/json-render/registry` | json-render registry (`'use client'`) |
|
|
396
|
+
| `@k8ordo/ui/openui` | OpenUI library (`'use client'`) |
|
|
397
|
+
| `@k8ordo/ui/openui/prompt` | OpenUI prompt generation (server-safe) |
|
|
398
|
+
| `@k8ordo/ui/styles.css` | Layer order, tokens, reset and base (required) |
|
|
399
|
+
| `@k8ordo/ui/tailwind.css` | Tailwind CSS 4 bridge, imported after Tailwind: `styles.css` and utilities for the tokens |
|
|
340
400
|
|
|
341
401
|
## AI Chat Components
|
|
342
402
|
|
|
343
403
|
`@k8ordo/ui/ai` ships building blocks for chat UIs:
|
|
344
404
|
|
|
345
405
|
- **Conversation** (`Root` / `Messages` / `ScrollButton`) - Scroll container with stick-to-bottom behavior and a scroll-to-bottom button
|
|
346
|
-
- **Message** (`Root` / `Content`) - Chat bubble, styled by `from="user" | "assistant"`
|
|
347
|
-
- **PromptInput** (`Root` / `Textarea` / `Submit`) - Message input form with IME-aware Enter-to-send and a stop button while streaming
|
|
406
|
+
- **Message** (`Root` / `Content` / `Actions` / `Action` / `Copy` / `Regenerate` / `Feedback`) - Chat bubble, styled by `from="user" | "assistant"`, with an optional `avatar`; `Actions` holds copy, regenerate, and good/bad feedback under the message
|
|
407
|
+
- **PromptInput** (`Root` / `Attachments` / `Attach` / `Textarea` / `Submit`) - Message input form with IME-aware Enter-to-send and a stop button while streaming; pass `accept` to take attachments from a file picker, drag and drop, or paste
|
|
348
408
|
- **Reasoning** - Collapsible display of the model's thinking text
|
|
349
409
|
- **Suggestion** (`List` / `Item`) - Suggested prompt chips
|
|
350
|
-
- **ToolInvocation** - Tool call display with input/output and `state` (`'input-streaming' | 'input-available' | 'output-available' | 'output-error'`)
|
|
410
|
+
- **ToolInvocation** - Tool call display with input/output and `state` (`'input-streaming' | 'input-available' | 'approval-requested' | 'approval-responded' | 'output-available' | 'output-error' | 'output-denied'`); with `approval` and `onApprovalResponse` it asks the user to allow or deny the call and answers with the approval `id`
|
|
411
|
+
- **Attachment** (`List` / `Item`) - Files attached to a message: image thumbnails, or a name and media-type chip
|
|
412
|
+
- **Source** (`List` / `Item`) - The sources a response cites, as links (http(s) only) or document titles
|
|
351
413
|
- **Response** (from `@k8ordo/ui/ai/response`) - Streaming-safe Markdown renderer built on streamdown
|
|
352
414
|
|
|
353
415
|
Two of these need optional peer dependencies:
|
|
@@ -396,18 +458,17 @@ function Chat() {
|
|
|
396
458
|
}
|
|
397
459
|
```
|
|
398
460
|
|
|
399
|
-
To render assistant Markdown, wrap it in `Response` (children must be a string).
|
|
461
|
+
To render assistant Markdown, wrap it in `Response` (children must be a string). It styles what streamdown renders itself, through the `data-streamdown` attribute on each element, so no Tailwind is involved; import `streamdown/styles.css` only if you turn on streamdown's `animated` option:
|
|
400
462
|
|
|
401
463
|
```tsx
|
|
402
464
|
import { Response } from '@k8ordo/ui/ai/response';
|
|
403
|
-
import 'streamdown/styles.css';
|
|
404
465
|
|
|
405
466
|
<Message.Content>
|
|
406
467
|
<Response isStreaming>{markdownText}</Response>
|
|
407
468
|
</Message.Content>;
|
|
408
469
|
```
|
|
409
470
|
|
|
410
|
-
`Response` forwards the rest of streamdown's props (`translations`, `controls`, `linkSafety`, `plugins`, …); only `className` and `
|
|
471
|
+
`Response` forwards the rest of streamdown's props (`translations`, `controls`, `linkSafety`, `plugins`, …); only `className`, `mode` and `portal` are owned by the library. Built-in labels come from the message dictionary, so they follow the app's language by default.
|
|
411
472
|
|
|
412
473
|
`linkSafety` defaults to **disabled** here, unlike streamdown. With it enabled, links render as `<button>` instead of `<a>`, which loses ⌘-click, middle-click, "copy link address", and the `link` role for assistive tech. Dangerous schemes such as `javascript:` are neutralized by rehype-harden regardless, so links stay safe with the default. Opt in when you want the confirmation dialog:
|
|
413
474
|
|
|
@@ -415,12 +476,7 @@ import 'streamdown/styles.css';
|
|
|
415
476
|
<Response linkSafety={{ enabled: true }}>{markdownText}</Response>
|
|
416
477
|
```
|
|
417
478
|
|
|
418
|
-
|
|
419
|
-
/* In your CSS entry (path is relative to the CSS file) */
|
|
420
|
-
@source '../node_modules/streamdown/dist/*.js';
|
|
421
|
-
```
|
|
422
|
-
|
|
423
|
-
With the [AI SDK](https://ai-sdk.dev), `mapMessageParts` from `@k8ordo/ui/ai-sdk` converts a `UIMessage` into a flat array of `{ kind: 'text' | 'reasoning' | 'tool', ... }` parts that map 1:1 onto `Response`, `Reasoning`, and `ToolInvocation`.
|
|
479
|
+
With the [AI SDK](https://ai-sdk.dev), `mapMessageParts` from `@k8ordo/ui/ai-sdk` converts a `UIMessage` into a flat array of `{ kind: 'text' | 'reasoning' | 'tool' | 'file' | 'source' | 'data', ... }` parts that map onto `Response`, `Reasoning`, `ToolInvocation`, `Attachment`, and `Source`; `data` parts are yours to render. A tool part keeps its `approval`, so `onApprovalResponse={addToolApprovalResponse}` answers the SDK directly.
|
|
424
480
|
|
|
425
481
|
## Generative UI integrations
|
|
426
482
|
|
|
@@ -431,19 +487,22 @@ These integrations are exposed as optional subpath exports. Install the framewor
|
|
|
431
487
|
```bash
|
|
432
488
|
# json-render
|
|
433
489
|
pnpm add @json-render/core @json-render/react zod
|
|
434
|
-
# OpenUI
|
|
435
|
-
pnpm add @openuidev/react-lang zod
|
|
436
|
-
# OpenUI server-safe prompt entry (@k8ordo/ui/openui/prompt) additionally needs:
|
|
437
|
-
pnpm add @openuidev/lang-core
|
|
490
|
+
# OpenUI (both entries import lang-core directly, so install both packages)
|
|
491
|
+
pnpm add @openuidev/react-lang @openuidev/lang-core zod
|
|
438
492
|
```
|
|
439
493
|
|
|
440
|
-
Supported components (
|
|
494
|
+
Supported components (both frameworks):
|
|
441
495
|
|
|
442
|
-
- **Layout / containers**: `Stack`, `Grid`, `Card`, `Form`
|
|
443
|
-
- **Buttons / nav**: `Button`, `IconButton`, `Anchor`, `Breadcrumb`, `Pagination`
|
|
444
|
-
- **Display**: `Badge`, `Heading`, `Avatar`, `Code`, `Icon`, `ChevronIcon`, `StatusIcon`, `Alert`, `Spinner`, `Progress`, `Skeleton`, `Separator`, `Tabs`, `Accordion`, `Table`, `
|
|
496
|
+
- **Layout / containers**: `Stack`, `Grid`, `Card`, `Form`, `Carousel`
|
|
497
|
+
- **Buttons / nav**: `Button`, `IconButton`, `CopyButton`, `Toolbar`, `Anchor`, `Breadcrumb`, `Pagination`, `Stepper`, `SideNav`
|
|
498
|
+
- **Display**: `Badge`, `Heading`, `Avatar`, `Code`, `Kbd`, `EmptyState`, `Icon`, `ChevronIcon`, `StatusIcon`, `Alert`, `Callout`, `Spinner`, `Progress`, `Skeleton`, `Separator`, `Tabs`, `Accordion`, `Table`, `DataTable`, `Tree`
|
|
445
499
|
- **Overlays (self-contained widgets)**: `Modal`, `Dialog`, `Drawer`, `Popover`, `Tooltip`, `DropdownMenu`, `Toast`
|
|
446
|
-
- **Form**: `TextField`, `Textarea`, `PasswordInput`, `NumberField`, `Slider`, `Checkbox`, `Switch`, `Select`, `Radio`, `RadioCard`, `CheckboxCard`, `ListBox`, `CheckboxGroup`, `Autocomplete`, `FileField`, `FormControl`
|
|
500
|
+
- **Form**: `TextField`, `Textarea`, `PasswordInput`, `NumberField`, `Slider`, `RangeSlider`, `DateField`, `DatePicker`, `Calendar`, `ColorPicker`, `Combobox`, `Checkbox`, `Switch`, `Select`, `Radio`, `RadioCard`, `CheckboxCard`, `ListBox`, `CheckboxGroup`, `Autocomplete`, `FileField`, `FormControl`
|
|
501
|
+
|
|
502
|
+
The rest of the exports — `CommandPalette`, `ContextMenu`, `ResizablePanels`, the
|
|
503
|
+
observers, the providers, and the AI chat components — are left out on purpose;
|
|
504
|
+
[docs/references/generative-ui.md](docs/references/generative-ui.md#what-the-catalog-leaves-out)
|
|
505
|
+
says why.
|
|
447
506
|
|
|
448
507
|
Overlays are exposed as **self-contained widgets**: a `Modal`/`Dialog`/`Drawer`/`Popover` declares its own trigger button via `triggerLabel`, manages open/close internally, and renders the supplied children inside the surface. This lets a model generate UIs that include overlays without modelling imperative open/close state. `Tooltip`/`DropdownMenu`/`Toast` follow the same self-contained pattern (trigger + content).
|
|
449
508
|
|
|
@@ -465,9 +524,10 @@ const systemPrompt = catalog.prompt({ customRules: [...uiRules] });
|
|
|
465
524
|
// `JsonRenderUI` wires JSONUIProvider + Renderer and the registry for you —
|
|
466
525
|
// just pass a spec. Pass `onStateChange` to collect form values.
|
|
467
526
|
'use client';
|
|
527
|
+
import type { UISpec } from '@k8ordo/ui/json-render';
|
|
468
528
|
import { JsonRenderUI } from '@k8ordo/ui/json-render/registry';
|
|
469
529
|
|
|
470
|
-
export function GenUi({ spec }: { spec:
|
|
530
|
+
export function GenUi({ spec }: { spec: UISpec }) {
|
|
471
531
|
return <JsonRenderUI spec={spec} />;
|
|
472
532
|
}
|
|
473
533
|
```
|
|
@@ -535,35 +595,8 @@ To generate the prompt inside the client bundle instead, `library.prompt()` stil
|
|
|
535
595
|
> **Notes**
|
|
536
596
|
>
|
|
537
597
|
> - Make sure `@k8ordo/ui/styles.css` (or `tailwind.css` in Tailwind CSS 4 projects) is loaded and the app is wrapped in `UIProvider`.
|
|
538
|
-
> - `@
|
|
598
|
+
> - Both OpenUI entries need `@openuidev/lang-core` — `openui/prompt` is the React-free one, and `openui` builds its component library with it. Install it alongside `@openuidev/react-lang`: pnpm will not resolve it for you just because `react-lang` depends on it.
|
|
539
599
|
> - `Tabs` panels are text content (`tabs: [{ label, content }]`); rich-component panels are a future enhancement.
|
|
540
|
-
> - In OpenUI, `Card` can contain a `Stack` or `Grid`, but `Stack`/`Grid` cannot directly nest a `Stack`/`Grid`/`Card` (no self-referential schemas) — put nested layout inside a `Card`. json-render nests freely (slots-based).
|
|
541
|
-
|
|
542
|
-
## Custom Hooks
|
|
543
|
-
|
|
544
|
-
The library includes several useful hooks:
|
|
545
|
-
|
|
546
|
-
- **useBreakpoint** - Tailwind breakpoint matcher
|
|
547
|
-
- **useClickAway** - Detect clicks outside an element
|
|
548
|
-
- **useClient** - Client-side rendering detection
|
|
549
|
-
- **useClipboard** - Clipboard operations
|
|
550
|
-
- **useControllableState** - Controlled/uncontrolled state pattern
|
|
551
|
-
- **useDebouncedTransition** - Rate-limited transition with `AbortSignal`
|
|
552
|
-
- **useDeferredDebounce** - `useDeferredValue` with pending flag
|
|
553
|
-
- **useDisclosure** - Open/close/toggle disclosure state
|
|
554
|
-
- **useHash** - URL hash management
|
|
555
|
-
- **useHover** - Element hover detection
|
|
556
|
-
- **useIntersectionObserver** / **useInView** - Element visibility
|
|
557
|
-
- **useInterval** - Interval timer management
|
|
558
|
-
- **useLocalStorage** / **useSessionStorage** - Web Storage with React state
|
|
559
|
-
- **useResize** - Element resize detection (ResizeObserver)
|
|
560
|
-
- **useScrollDirection** - Scroll direction detection
|
|
561
|
-
- **useScrollLock** - Body/element scroll lock
|
|
562
|
-
- **useStep** - Step-based state management
|
|
563
|
-
- **useTimeout** - Timeout management
|
|
564
|
-
- **useWindowResize** - Window resize events
|
|
565
|
-
- **useWindowSize** - Window size tracking
|
|
566
|
-
- **useWritingMode** - Detect horizontal/vertical `writing-mode`
|
|
567
600
|
|
|
568
601
|
## Accessibility
|
|
569
602
|
|
|
@@ -578,11 +611,13 @@ All components follow WCAG accessibility guidelines:
|
|
|
578
611
|
|
|
579
612
|
## Styling & Customization
|
|
580
613
|
|
|
581
|
-
Components are
|
|
614
|
+
Components are written in CSS Modules and placed in the `components` cascade
|
|
615
|
+
layer. Customize them through:
|
|
582
616
|
|
|
583
|
-
- CSS custom properties (semantic design tokens)
|
|
584
|
-
-
|
|
585
|
-
- Light / Dark mode via semantic color tokens
|
|
617
|
+
- CSS custom properties (semantic design tokens), overridden after `styles.css`
|
|
618
|
+
- `renderItem` / `renderAnchor`, which hand you the component's `className`
|
|
619
|
+
- Light / Dark mode via semantic color tokens (`.dark`)
|
|
620
|
+
- Tailwind utility classes on your own markup, through `tailwind.css`
|
|
586
621
|
|
|
587
622
|
## Development
|
|
588
623
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __exportAll = (all, no_symbols) => {
|
|
4
|
+
let target = {};
|
|
5
|
+
for (var name in all) __defProp(target, name, {
|
|
6
|
+
get: all[name],
|
|
7
|
+
enumerable: true
|
|
8
|
+
});
|
|
9
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
10
|
+
return target;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { __exportAll };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
@layer properties, theme, base;
|
|
2
|
+
|
|
3
|
+
@layer components {
|
|
4
|
+
.XbmKcG_ring:focus-visible {
|
|
5
|
+
box-shadow: var(--shadow-ring-info);
|
|
6
|
+
border-color: #0000;
|
|
7
|
+
outline-style: none;
|
|
8
|
+
|
|
9
|
+
@media (forced-colors: active) {
|
|
10
|
+
outline-offset: 2px;
|
|
11
|
+
outline: 2px solid #0000;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.XbmKcG_ringNoBorder:focus-visible {
|
|
16
|
+
box-shadow: var(--shadow-ring-info);
|
|
17
|
+
outline-style: none;
|
|
18
|
+
|
|
19
|
+
@media (forced-colors: active) {
|
|
20
|
+
outline-offset: 2px;
|
|
21
|
+
outline: 2px solid #0000;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.XbmKcG_ringWithin:focus-within {
|
|
26
|
+
box-shadow: var(--shadow-ring-info);
|
|
27
|
+
border-color: #0000;
|
|
28
|
+
outline-style: none;
|
|
29
|
+
|
|
30
|
+
@media (forced-colors: active) {
|
|
31
|
+
outline-offset: 2px;
|
|
32
|
+
outline: 2px solid #0000;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@layer utilities;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import './focus-ring.css';
|
|
2
|
+
//#region src/components/_internal/focus-ring.module.css
|
|
3
|
+
var focus_ring_module_default = {
|
|
4
|
+
"ring": "XbmKcG_ring",
|
|
5
|
+
"ringNoBorder": "XbmKcG_ringNoBorder",
|
|
6
|
+
"ringWithin": "XbmKcG_ringWithin"
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { focus_ring_module_default as default };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { FC, RefObject } from "react";
|
|
2
|
+
//#region src/components/_internal/form-value.d.ts
|
|
3
|
+
type Props = {
|
|
4
|
+
name: string | undefined;
|
|
5
|
+
/** What the visible control holds now. */
|
|
6
|
+
values: readonly string[];
|
|
7
|
+
/**
|
|
8
|
+
* What a reset goes back to, and what the form measures dirtiness against.
|
|
9
|
+
* `undefined` for a controlled caller: the values it mounted with.
|
|
10
|
+
*/
|
|
11
|
+
defaultValues: readonly string[] | undefined;
|
|
12
|
+
multiple: boolean;
|
|
13
|
+
required: boolean;
|
|
14
|
+
disabled: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Put the visible control's own state back to `defaultValues`. The browser
|
|
17
|
+
* restores this element itself.
|
|
18
|
+
*/
|
|
19
|
+
onReset: () => void;
|
|
20
|
+
/** Where focus goes when the form focuses this element after a failure. */
|
|
21
|
+
focusTarget: RefObject<HTMLElement | null>;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* The named control a composite component submits through. `type="hidden"`
|
|
25
|
+
* would not do: it is barred from constraint validation, it cannot take focus
|
|
26
|
+
* when the form moves to a failure, and with nothing selected there would be
|
|
27
|
+
* no element carrying the name at all — so neither `required` nor a rule could
|
|
28
|
+
* reach it. A `<select>` is always present, validates natively (`required`
|
|
29
|
+
* means "at least one"), restores itself on reset, and keeps the baseline in
|
|
30
|
+
* each option's `defaultSelected`, where dirtiness is read from.
|
|
31
|
+
*/
|
|
32
|
+
export declare const FormValue: FC<Props>;
|
|
33
|
+
//#endregion
|