@k8ordo/ui 2.0.0 → 2.2.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 +197 -187
- 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 +34 -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 +15 -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 -2
- 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 +8 -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 +15 -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 +4 -4
- package/dist/components/ai/conversation/conversation.mjs +38 -34
- package/dist/components/ai/conversation/conversation.module.mjs +11 -0
- package/dist/components/ai/conversation/index.d.mts +2 -3
- package/dist/components/ai/index.d.mts +4 -2
- package/dist/components/ai/index.mjs +3 -1
- package/dist/components/ai/message/index.d.mts +29 -3
- package/dist/components/ai/message/index.mjs +7 -2
- package/dist/components/ai/message/message.css +71 -0
- package/dist/components/ai/message/message.d.mts +34 -3
- package/dist/components/ai/message/message.mjs +99 -9
- package/dist/components/ai/message/message.module.mjs +18 -0
- package/dist/components/ai/prompt-input/index.d.mts +11 -4
- package/dist/components/ai/prompt-input/index.mjs +3 -1
- package/dist/components/ai/prompt-input/prompt-input.css +101 -0
- package/dist/components/ai/prompt-input/prompt-input.d.mts +15 -5
- package/dist/components/ai/prompt-input/prompt-input.mjs +152 -37
- package/dist/components/ai/prompt-input/prompt-input.module.mjs +15 -0
- package/dist/components/ai/reasoning/index.mjs +1 -2
- package/dist/components/ai/reasoning/reasoning.css +16 -0
- package/dist/components/ai/reasoning/reasoning.d.mts +2 -2
- package/dist/components/ai/reasoning/reasoning.mjs +5 -5
- package/dist/components/ai/reasoning/reasoning.module.mjs +8 -0
- package/dist/components/ai/response/index.mjs +1 -2
- package/dist/components/ai/response/response.css +453 -0
- package/dist/components/ai/response/response.d.mts +4 -5
- 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 +14 -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 +2 -3
- package/dist/components/ai/suggestion/suggestion.css +32 -0
- package/dist/components/ai/suggestion/suggestion.d.mts +3 -3
- package/dist/components/ai/suggestion/suggestion.mjs +7 -6
- 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 +12 -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/index.mjs +1 -2
- package/dist/components/ai/tool-invocation/tool-invocation.css +55 -0
- package/dist/components/ai/tool-invocation/tool-invocation.d.mts +5 -4
- 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 -8
- 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/button/index.mjs +1 -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 +1 -0
- package/dist/components/buttons/icon-button/icon-button.css +81 -0
- package/dist/components/buttons/icon-button/icon-button.d.mts +39 -11
- package/dist/components/buttons/icon-button/icon-button.mjs +70 -57
- 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/icon-button/index.mjs +1 -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 +19 -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 -2
- 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/avatar/index.mjs +1 -2
- package/dist/components/data-display/badge/badge.css +160 -0
- package/dist/components/data-display/badge/badge.d.mts +2 -2
- 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/badge/index.mjs +1 -2
- package/dist/components/data-display/card/card.css +44 -0
- package/dist/components/data-display/card/card.d.mts +2 -2
- 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/card/index.mjs +1 -2
- package/dist/components/data-display/carousel/carousel.css +83 -0
- package/dist/components/data-display/carousel/carousel.d.mts +12 -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 -2
- 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 -2
- package/dist/components/data-display/code/find-all-colors.mjs +0 -161
- package/dist/components/data-display/code/index.mjs +1 -2
- package/dist/components/data-display/code-block/code-block.css +161 -0
- package/dist/components/data-display/code-block/code-block.d.mts +13 -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 +10 -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 +1 -0
- package/dist/components/data-display/data-table/data-table.css +74 -0
- package/dist/components/data-display/data-table/data-table.d.mts +32 -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 +1 -0
- package/dist/components/data-display/heading/heading.css +99 -0
- package/dist/components/data-display/heading/heading.d.mts +2 -2
- 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/heading/index.mjs +1 -2
- package/dist/components/data-display/kbd/index.d.mts +2 -0
- package/dist/components/data-display/kbd/index.mjs +1 -0
- package/dist/components/data-display/kbd/kbd.css +21 -0
- package/dist/components/data-display/kbd/kbd.d.mts +9 -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 +1 -0
- package/dist/components/data-display/prose/prose.css +253 -0
- package/dist/components/data-display/prose/prose.d.mts +6 -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/index.mjs +1 -2
- package/dist/components/data-display/table/table.css +107 -0
- package/dist/components/data-display/table/table.d.mts +10 -8
- 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 +1 -0
- package/dist/components/data-display/tree/tree.css +70 -0
- package/dist/components/data-display/tree/tree.d.mts +21 -0
- package/dist/components/data-display/tree/tree.mjs +144 -0
- package/dist/components/data-display/tree/tree.module.mjs +14 -0
- package/dist/components/feedback/alert/alert.css +42 -0
- package/dist/components/feedback/alert/alert.d.mts +3 -3
- package/dist/components/feedback/alert/alert.mjs +20 -23
- package/dist/components/feedback/alert/alert.module.mjs +14 -0
- package/dist/components/feedback/alert/index.mjs +1 -2
- package/dist/components/feedback/callout/callout.css +38 -0
- package/dist/components/feedback/callout/callout.d.mts +11 -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 +1 -0
- package/dist/components/feedback/empty-state/empty-state.css +36 -0
- package/dist/components/feedback/empty-state/empty-state.d.mts +11 -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 +1 -0
- package/dist/components/feedback/progress/index.mjs +1 -2
- package/dist/components/feedback/progress/progress.css +78 -0
- package/dist/components/feedback/progress/progress.d.mts +5 -4
- package/dist/components/feedback/progress/progress.mjs +17 -3
- package/dist/components/feedback/progress/progress.module.mjs +12 -0
- package/dist/components/feedback/skeleton/index.mjs +1 -2
- package/dist/components/feedback/skeleton/skeleton.css +64 -0
- package/dist/components/feedback/skeleton/skeleton.d.mts +2 -2
- package/dist/components/feedback/skeleton/skeleton.mjs +19 -2
- package/dist/components/feedback/skeleton/skeleton.module.mjs +17 -0
- package/dist/components/feedback/spinner/index.mjs +1 -2
- package/dist/components/feedback/spinner/spinner.css +40 -0
- package/dist/components/feedback/spinner/spinner.d.mts +2 -2
- 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 -2
- package/dist/components/form/autocomplete/autocomplete.css +154 -0
- package/dist/components/form/autocomplete/autocomplete.d.mts +2 -2
- package/dist/components/form/autocomplete/autocomplete.mjs +70 -46
- package/dist/components/form/autocomplete/autocomplete.module.mjs +21 -0
- package/dist/components/form/autocomplete/index.mjs +1 -2
- package/dist/components/form/calendar/calendar.css +98 -0
- package/dist/components/form/calendar/calendar.d.mts +15 -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 +1 -0
- package/dist/components/form/checkbox/checkbox.css +90 -0
- package/dist/components/form/checkbox/checkbox.d.mts +4 -2
- package/dist/components/form/checkbox/checkbox.mjs +29 -27
- package/dist/components/form/checkbox/checkbox.module.mjs +13 -0
- package/dist/components/form/checkbox/index.mjs +1 -2
- package/dist/components/form/checkbox-card/checkbox-card.css +138 -0
- package/dist/components/form/checkbox-card/checkbox-card.d.mts +3 -3
- 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-card/index.mjs +1 -2
- 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 +4 -3
- package/dist/components/form/color-picker/color-picker.css +172 -0
- package/dist/components/form/color-picker/color-picker.d.mts +29 -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 +1 -0
- package/dist/components/form/combobox/combobox.css +143 -0
- package/dist/components/form/combobox/combobox.d.mts +33 -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 +1 -0
- package/dist/components/form/date-field/date-field.css +31 -0
- package/dist/components/form/date-field/date-field.d.mts +9 -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 +1 -0
- package/dist/components/form/date-picker/date-picker.css +90 -0
- package/dist/components/form/date-picker/date-picker.d.mts +13 -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 +1 -0
- package/dist/components/form/file-field/file-field.css +88 -0
- package/dist/components/form/file-field/file-field.d.mts +9 -6
- package/dist/components/form/file-field/file-field.mjs +130 -37
- package/dist/components/form/file-field/file-field.module.mjs +17 -0
- package/dist/components/form/file-field/index.d.mts +5 -3
- package/dist/components/form/file-field/index.mjs +2 -1
- package/dist/components/form/form/form.css +11 -0
- package/dist/components/form/form/form.d.mts +4 -3
- package/dist/components/form/form/form.mjs +2 -1
- package/dist/components/form/form/form.module.mjs +5 -0
- package/dist/components/form/form/index.mjs +1 -2
- package/dist/components/form/form-control/form-control.css +43 -0
- package/dist/components/form/form-control/form-control.d.mts +2 -2
- 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/form-control/index.mjs +1 -2
- 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/index.mjs +1 -2
- package/dist/components/form/number-field/number-field.css +122 -0
- package/dist/components/form/number-field/number-field.d.mts +10 -9
- 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/index.mjs +1 -2
- package/dist/components/form/password-input/password-input.css +88 -0
- package/dist/components/form/password-input/password-input.d.mts +2 -2
- 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/index.mjs +1 -2
- package/dist/components/form/radio/radio.css +89 -0
- package/dist/components/form/radio/radio.d.mts +3 -2
- package/dist/components/form/radio/radio.mjs +15 -19
- package/dist/components/form/radio/radio.module.mjs +16 -0
- package/dist/components/form/radio-card/index.mjs +1 -2
- package/dist/components/form/radio-card/radio-card.css +147 -0
- package/dist/components/form/radio-card/radio-card.d.mts +4 -3
- 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 +1 -0
- package/dist/components/form/range-slider/range-slider.css +67 -0
- package/dist/components/form/range-slider/range-slider.d.mts +31 -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/index.mjs +1 -2
- package/dist/components/form/select/select.css +74 -0
- package/dist/components/form/select/select.d.mts +2 -2
- package/dist/components/form/select/select.mjs +25 -8
- package/dist/components/form/select/select.module.mjs +12 -0
- package/dist/components/form/slider/index.mjs +1 -2
- 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 -6
- package/dist/components/form/slider/slider.mjs +44 -11
- package/dist/components/form/slider/slider.module.mjs +12 -0
- package/dist/components/form/switch/index.mjs +1 -2
- package/dist/components/form/switch/switch.css +103 -0
- package/dist/components/form/switch/switch.d.mts +2 -2
- 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/index.mjs +1 -2
- package/dist/components/form/text-field/text-field.css +41 -0
- package/dist/components/form/text-field/text-field.d.mts +4 -4
- 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/index.mjs +1 -2
- package/dist/components/form/textarea/textarea.css +50 -0
- package/dist/components/form/textarea/textarea.d.mts +3 -2
- 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 -60
- 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 +48 -9
- package/dist/components/index.mjs +32 -10
- 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/grid/index.mjs +1 -2
- 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 +22 -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/index.mjs +1 -2
- package/dist/components/layout/separator/separator.css +37 -0
- package/dist/components/layout/separator/separator.d.mts +2 -2
- package/dist/components/layout/separator/separator.mjs +12 -9
- package/dist/components/layout/separator/separator.module.mjs +12 -0
- package/dist/components/layout/stack/index.mjs +1 -2
- 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 -2
- package/dist/components/navigation/anchor/anchor.mjs +5 -2
- package/dist/components/navigation/anchor/anchor.module.mjs +8 -0
- package/dist/components/navigation/anchor/index.mjs +1 -2
- package/dist/components/navigation/breadcrumb/breadcrumb.css +72 -0
- package/dist/components/navigation/breadcrumb/breadcrumb.d.mts +5 -5
- 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/index.mjs +1 -2
- package/dist/components/navigation/pagination/pagination.css +36 -0
- package/dist/components/navigation/pagination/pagination.d.mts +2 -2
- 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 +32 -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 +1 -0
- package/dist/components/navigation/stepper/stepper.css +151 -0
- package/dist/components/navigation/stepper/stepper.d.mts +20 -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 +1 -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 +2 -3
- package/dist/components/navigation/tabs/tabs.css +70 -0
- package/dist/components/navigation/tabs/tabs.d.mts +5 -6
- package/dist/components/navigation/tabs/tabs.mjs +51 -42
- 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 +1 -0
- package/dist/components/observers/resize/index.d.mts +2 -0
- package/dist/components/observers/resize/index.mjs +1 -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 +25 -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 +1 -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 +4 -5
- package/dist/components/overlays/dialog/dialog.mjs +10 -7
- package/dist/components/overlays/dialog/dialog.module.mjs +10 -0
- package/dist/components/overlays/dialog/index.d.mts +2 -3
- 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/drawer/index.mjs +1 -2
- package/dist/components/overlays/dropdown-menu/dropdown-menu.d.mts +7 -10
- package/dist/components/overlays/dropdown-menu/dropdown-menu.mjs +10 -9
- package/dist/components/overlays/dropdown-menu/hooks.d.mts +7 -6
- package/dist/components/overlays/dropdown-menu/hooks.mjs +3 -3
- package/dist/components/overlays/dropdown-menu/index.d.mts +8 -10
- 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 +15 -15
- 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 +2 -3
- package/dist/components/overlays/list-box/list-box.css +74 -0
- package/dist/components/overlays/list-box/list-box.d.mts +5 -6
- package/dist/components/overlays/list-box/list-box.mjs +15 -13
- package/dist/components/overlays/list-box/list-box.module.mjs +10 -0
- package/dist/components/overlays/modal/index.mjs +1 -2
- 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 -4
- package/dist/components/overlays/popover/escape-stack.d.mts +2 -3
- package/dist/components/overlays/popover/hooks.d.mts +7 -7
- package/dist/components/overlays/popover/index.d.mts +2 -2
- package/dist/components/overlays/popover/popover.css +51 -0
- package/dist/components/overlays/popover/popover.d.mts +4 -4
- package/dist/components/overlays/popover/popover.mjs +11 -5
- 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 +2 -2
- package/dist/components/overlays/tooltip/tooltip.css +15 -0
- package/dist/components/overlays/tooltip/tooltip.d.mts +5 -6
- package/dist/components/overlays/tooltip/tooltip.mjs +3 -2
- 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 -2
- package/dist/helpers/chain.mjs +0 -23
- package/dist/helpers/create-safe-context.d.mts +2 -2
- 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 -2
- 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 -2
- package/dist/hooks/controllable-state/index.mjs +9 -11
- package/dist/hooks/index.d.mts +2 -20
- package/dist/hooks/index.mjs +2 -19
- 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 +29 -34
- package/dist/index.mjs +32 -35
- 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 +288 -30
- package/dist/integrations/_shared/renderers.module.mjs +14 -0
- package/dist/integrations/_shared/schemas.d.mts +384 -102
- package/dist/integrations/_shared/schemas.mjs +165 -27
- package/dist/integrations/ai-sdk/index.d.mts +2 -2
- package/dist/integrations/ai-sdk/index.mjs +1 -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 -17
- 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 -6
- 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/internal/focus-trap.d.mts +5 -6
- package/dist/internal/focus-trap.mjs +4 -4
- 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 -2526
- 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 +239 -72
- package/docs/llms.txt +11 -7
- package/docs/props.generated.json +2156 -309
- package/docs/references/ai-chat.md +345 -62
- package/docs/references/color.md +222 -78
- package/docs/references/components.md +1667 -242
- package/docs/references/generative-ui.md +126 -17
- package/docs/references/interaction-design.md +65 -35
- package/docs/references/spatial-design.md +83 -63
- package/docs/references/types.md +101 -0
- package/docs/references/typography.md +159 -51
- package/package.json +65 -63
- 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/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/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/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 -223
- package/docs/references/hooks.md +0 -301
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @k8ordo/ui
|
|
2
2
|
|
|
3
3
|
React components from [k8ordo](https://ordo.k8o.me) — semantic design
|
|
4
|
-
tokens, built-in Japanese
|
|
4
|
+
tokens, built-in wording that follows `@k8ordo/i18n` (Japanese and English included), and adapters that let an LLM generate
|
|
5
5
|
on-brand UIs.
|
|
6
6
|
|
|
7
7
|
Like every k8ordo package it assumes React 19 and Server Components, uses only
|
|
@@ -22,63 +22,75 @@ yarn add @k8ordo/ui
|
|
|
22
22
|
|
|
23
23
|
## Peer Dependencies
|
|
24
24
|
|
|
25
|
-
Only React
|
|
25
|
+
Only React and `@k8ordo/i18n` are required:
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
|
-
npm install react react-dom
|
|
28
|
+
npm install react react-dom @k8ordo/i18n
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
| Package | Version |
|
|
32
|
-
| ----------- | ------- |
|
|
33
|
-
| `react` | ≥19.2.6 |
|
|
34
|
-
| `react-dom` | ≥19.2.6 |
|
|
35
|
-
|
|
36
31
|
Everything else is an optional peer, needed only for the entry point that uses
|
|
37
32
|
it. Install one when you import the entry it belongs to.
|
|
38
33
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
|
42
|
-
|
|
|
43
|
-
|
|
|
44
|
-
| `
|
|
45
|
-
| `
|
|
46
|
-
|
|
|
47
|
-
| `@
|
|
48
|
-
| `@
|
|
49
|
-
| `
|
|
50
|
-
| `
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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.1.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.6.6 | 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` | ^1.0.0 | optional | `@k8ordo/ui/openui`, `@k8ordo/ui/openui/prompt` |
|
|
48
|
+
| `@openuidev/react-lang` | ^1.0.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.
|
|
54
64
|
|
|
55
65
|
## Quick Start
|
|
56
66
|
|
|
57
67
|
1. Import the CSS and set up the provider.
|
|
58
68
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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)`, …).
|
|
63
75
|
|
|
64
76
|
```css
|
|
65
77
|
@import '@k8ordo/ui/styles.css';
|
|
66
78
|
```
|
|
67
79
|
|
|
68
|
-
**Using Tailwind CSS 4?** Import the
|
|
69
|
-
|
|
70
|
-
classes (`bg-bg-base`, …) in your own
|
|
71
|
-
|
|
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:
|
|
72
84
|
|
|
73
85
|
```css
|
|
86
|
+
@import 'tailwindcss';
|
|
74
87
|
@import '@k8ordo/ui/tailwind.css';
|
|
75
|
-
@source './src';
|
|
76
88
|
```
|
|
77
89
|
|
|
78
|
-
Note that
|
|
79
|
-
the library base layer (
|
|
80
|
-
|
|
81
|
-
|
|
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.
|
|
82
94
|
|
|
83
95
|
```tsx
|
|
84
96
|
// In your app entry point
|
|
@@ -112,40 +124,20 @@ function MyPage() {
|
|
|
112
124
|
|
|
113
125
|
## Internationalization (i18n)
|
|
114
126
|
|
|
115
|
-
The wording that components own internally — "close", "required", "loading", and so on —
|
|
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:
|
|
116
128
|
|
|
117
|
-
|
|
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.
|
|
118
131
|
|
|
119
|
-
|
|
120
|
-
import { UIProvider } from '@k8ordo/ui';
|
|
121
|
-
import { en } from '@k8ordo/ui/i18n';
|
|
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:
|
|
122
133
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
<UIProvider messages={en}>
|
|
126
|
-
<YourApp />
|
|
127
|
-
</UIProvider>
|
|
128
|
-
);
|
|
129
|
-
}
|
|
130
|
-
```
|
|
134
|
+
```ts
|
|
135
|
+
import { en, registerMessages } from '@k8ordo/ui/i18n';
|
|
131
136
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
```tsx
|
|
135
|
-
<UIProvider messages={{ ...en, close: 'Dismiss' }}>
|
|
136
|
-
<YourApp />
|
|
137
|
-
</UIProvider>
|
|
137
|
+
registerMessages('en', { ...en, close: 'Dismiss' });
|
|
138
138
|
```
|
|
139
139
|
|
|
140
|
-
Resolution order is **component prop >
|
|
141
|
-
|
|
142
|
-
The subpath exports both dictionaries and the type:
|
|
143
|
-
|
|
144
|
-
```tsx
|
|
145
|
-
import { en, ja, type Messages } from '@k8ordo/ui/i18n';
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
`ja` / `en` live behind `@k8ordo/ui/i18n` rather than the root entry so the dictionaries stay out of the main bundle. See [docs/references/components.md](docs/references/components.md) for the full key list.
|
|
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.
|
|
149
141
|
|
|
150
142
|
## AI Agent Documentation
|
|
151
143
|
|
|
@@ -159,8 +151,9 @@ Point your agent at it once by pasting this into your project's `CLAUDE.md` /
|
|
|
159
151
|
Use `@k8ordo/ui` for UI. Before writing or changing UI, read
|
|
160
152
|
`node_modules/@k8ordo/ui/docs/GUIDE.md`, then follow only the
|
|
161
153
|
`docs/references/*.md` links it lists that the task actually needs.
|
|
162
|
-
Colors, spacing, radii and font weights go through semantic tokens
|
|
163
|
-
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`).
|
|
164
157
|
Look up component props in `docs/references/components.md` instead of
|
|
165
158
|
recalling them; a component that is not listed there does not exist.
|
|
166
159
|
```
|
|
@@ -191,73 +184,113 @@ stories and rendered props rather than relying on trained knowledge:
|
|
|
191
184
|
|
|
192
185
|
## Component Categories
|
|
193
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
|
+
|
|
194
192
|
### Buttons
|
|
195
193
|
|
|
196
|
-
-
|
|
197
|
-
-
|
|
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)
|
|
198
198
|
|
|
199
199
|
### Navigation
|
|
200
200
|
|
|
201
|
-
-
|
|
202
|
-
-
|
|
203
|
-
-
|
|
204
|
-
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
-
|
|
212
|
-
-
|
|
213
|
-
-
|
|
214
|
-
-
|
|
215
|
-
-
|
|
216
|
-
-
|
|
217
|
-
-
|
|
218
|
-
-
|
|
219
|
-
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
-
|
|
224
|
-
-
|
|
225
|
-
-
|
|
226
|
-
-
|
|
227
|
-
-
|
|
228
|
-
-
|
|
229
|
-
-
|
|
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)
|
|
230
249
|
|
|
231
250
|
### Feedback
|
|
232
251
|
|
|
233
|
-
-
|
|
234
|
-
-
|
|
235
|
-
-
|
|
236
|
-
-
|
|
237
|
-
-
|
|
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)
|
|
238
259
|
|
|
239
260
|
### Overlays
|
|
240
261
|
|
|
241
|
-
-
|
|
242
|
-
-
|
|
243
|
-
-
|
|
244
|
-
-
|
|
245
|
-
-
|
|
246
|
-
-
|
|
247
|
-
-
|
|
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)
|
|
248
271
|
|
|
249
272
|
### Layout
|
|
250
273
|
|
|
251
|
-
-
|
|
252
|
-
-
|
|
253
|
-
-
|
|
254
|
-
-
|
|
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
|
|
255
285
|
|
|
256
|
-
|
|
286
|
+
- [Icons](docs/references/components.md#icons) — decorative icon components (`CloseIcon`, `ChevronIcon`, …)
|
|
257
287
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
-
|
|
288
|
+
### Providers
|
|
289
|
+
|
|
290
|
+
- [PortalRootProvider](docs/references/components.md#portalrootprovider)
|
|
291
|
+
- [UIProvider](docs/references/components.md#uiprovider)
|
|
292
|
+
|
|
293
|
+
<!-- /generated:component-categories -->
|
|
261
294
|
|
|
262
295
|
## Usage Examples
|
|
263
296
|
|
|
@@ -339,40 +372,44 @@ function MyComponent() {
|
|
|
339
372
|
|
|
340
373
|
## Imports & Bundle Size
|
|
341
374
|
|
|
342
|
-
|
|
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:
|
|
343
376
|
|
|
344
377
|
```tsx
|
|
345
378
|
// Named imports from the root entry — unused exports are tree-shaken away
|
|
346
|
-
import { Button, Card,
|
|
379
|
+
import { Button, Card, Stack } from '@k8ordo/ui';
|
|
347
380
|
```
|
|
348
381
|
|
|
349
382
|
Optional features live behind dedicated subpath exports:
|
|
350
383
|
|
|
351
|
-
| Subpath | Contents
|
|
352
|
-
| --------------------------------- |
|
|
353
|
-
| `@k8ordo/ui` |
|
|
354
|
-
| `@k8ordo/ui/tokens` | Design
|
|
355
|
-
| `@k8ordo/ui/
|
|
356
|
-
| `@k8ordo/ui/
|
|
357
|
-
| `@k8ordo/ui/ai
|
|
358
|
-
| `@k8ordo/ui/ai
|
|
359
|
-
| `@k8ordo/ui/
|
|
360
|
-
| `@k8ordo/ui/
|
|
361
|
-
| `@k8ordo/ui/
|
|
362
|
-
| `@k8ordo/ui/
|
|
363
|
-
| `@k8ordo/ui/
|
|
364
|
-
| `@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 |
|
|
365
400
|
|
|
366
401
|
## AI Chat Components
|
|
367
402
|
|
|
368
403
|
`@k8ordo/ui/ai` ships building blocks for chat UIs:
|
|
369
404
|
|
|
370
405
|
- **Conversation** (`Root` / `Messages` / `ScrollButton`) - Scroll container with stick-to-bottom behavior and a scroll-to-bottom button
|
|
371
|
-
- **Message** (`Root` / `Content`) - Chat bubble, styled by `from="user" | "assistant"`
|
|
372
|
-
- **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
|
|
373
408
|
- **Reasoning** - Collapsible display of the model's thinking text
|
|
374
409
|
- **Suggestion** (`List` / `Item`) - Suggested prompt chips
|
|
375
|
-
- **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
|
|
376
413
|
- **Response** (from `@k8ordo/ui/ai/response`) - Streaming-safe Markdown renderer built on streamdown
|
|
377
414
|
|
|
378
415
|
Two of these need optional peer dependencies:
|
|
@@ -421,18 +458,17 @@ function Chat() {
|
|
|
421
458
|
}
|
|
422
459
|
```
|
|
423
460
|
|
|
424
|
-
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:
|
|
425
462
|
|
|
426
463
|
```tsx
|
|
427
464
|
import { Response } from '@k8ordo/ui/ai/response';
|
|
428
|
-
import 'streamdown/styles.css';
|
|
429
465
|
|
|
430
466
|
<Message.Content>
|
|
431
467
|
<Response isStreaming>{markdownText}</Response>
|
|
432
468
|
</Message.Content>;
|
|
433
469
|
```
|
|
434
470
|
|
|
435
|
-
`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.
|
|
436
472
|
|
|
437
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:
|
|
438
474
|
|
|
@@ -440,12 +476,7 @@ import 'streamdown/styles.css';
|
|
|
440
476
|
<Response linkSafety={{ enabled: true }}>{markdownText}</Response>
|
|
441
477
|
```
|
|
442
478
|
|
|
443
|
-
|
|
444
|
-
/* In your CSS entry (path is relative to the CSS file) */
|
|
445
|
-
@source '../node_modules/streamdown/dist/*.js';
|
|
446
|
-
```
|
|
447
|
-
|
|
448
|
-
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.
|
|
449
480
|
|
|
450
481
|
## Generative UI integrations
|
|
451
482
|
|
|
@@ -456,19 +487,22 @@ These integrations are exposed as optional subpath exports. Install the framewor
|
|
|
456
487
|
```bash
|
|
457
488
|
# json-render
|
|
458
489
|
pnpm add @json-render/core @json-render/react zod
|
|
459
|
-
# OpenUI
|
|
460
|
-
pnpm add @openuidev/react-lang zod
|
|
461
|
-
# OpenUI server-safe prompt entry (@k8ordo/ui/openui/prompt) additionally needs:
|
|
462
|
-
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
|
|
463
492
|
```
|
|
464
493
|
|
|
465
|
-
Supported components (
|
|
494
|
+
Supported components (both frameworks):
|
|
466
495
|
|
|
467
|
-
- **Layout / containers**: `Stack`, `Grid`, `Card`, `Form`
|
|
468
|
-
- **Buttons / nav**: `Button`, `IconButton`, `Anchor`, `Breadcrumb`, `Pagination`
|
|
469
|
-
- **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`
|
|
470
499
|
- **Overlays (self-contained widgets)**: `Modal`, `Dialog`, `Drawer`, `Popover`, `Tooltip`, `DropdownMenu`, `Toast`
|
|
471
|
-
- **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.
|
|
472
506
|
|
|
473
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).
|
|
474
508
|
|
|
@@ -490,9 +524,10 @@ const systemPrompt = catalog.prompt({ customRules: [...uiRules] });
|
|
|
490
524
|
// `JsonRenderUI` wires JSONUIProvider + Renderer and the registry for you —
|
|
491
525
|
// just pass a spec. Pass `onStateChange` to collect form values.
|
|
492
526
|
'use client';
|
|
527
|
+
import type { UISpec } from '@k8ordo/ui/json-render';
|
|
493
528
|
import { JsonRenderUI } from '@k8ordo/ui/json-render/registry';
|
|
494
529
|
|
|
495
|
-
export function GenUi({ spec }: { spec:
|
|
530
|
+
export function GenUi({ spec }: { spec: UISpec }) {
|
|
496
531
|
return <JsonRenderUI spec={spec} />;
|
|
497
532
|
}
|
|
498
533
|
```
|
|
@@ -560,35 +595,8 @@ To generate the prompt inside the client bundle instead, `library.prompt()` stil
|
|
|
560
595
|
> **Notes**
|
|
561
596
|
>
|
|
562
597
|
> - Make sure `@k8ordo/ui/styles.css` (or `tailwind.css` in Tailwind CSS 4 projects) is loaded and the app is wrapped in `UIProvider`.
|
|
563
|
-
> - `@
|
|
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.
|
|
564
599
|
> - `Tabs` panels are text content (`tabs: [{ label, content }]`); rich-component panels are a future enhancement.
|
|
565
|
-
> - 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).
|
|
566
|
-
|
|
567
|
-
## Custom Hooks
|
|
568
|
-
|
|
569
|
-
The library includes several useful hooks:
|
|
570
|
-
|
|
571
|
-
- **useBreakpoint** - Tailwind breakpoint matcher
|
|
572
|
-
- **useClickAway** - Detect clicks outside an element
|
|
573
|
-
- **useClient** - Client-side rendering detection
|
|
574
|
-
- **useClipboard** - Clipboard operations
|
|
575
|
-
- **useControllableState** - Controlled/uncontrolled state pattern
|
|
576
|
-
- **useDebouncedTransition** - Rate-limited transition with `AbortSignal`
|
|
577
|
-
- **useDeferredDebounce** - `useDeferredValue` with pending flag
|
|
578
|
-
- **useDisclosure** - Open/close/toggle disclosure state
|
|
579
|
-
- **useHover** - Element hover detection
|
|
580
|
-
- **useIntersectionObserver** / **useInView** - Element visibility
|
|
581
|
-
- **useInterval** - Interval timer management
|
|
582
|
-
- **useResize** - Element resize detection (ResizeObserver)
|
|
583
|
-
- **useScrollDirection** - Scroll direction detection
|
|
584
|
-
- **useScrollLock** - Body/element scroll lock
|
|
585
|
-
- **useStep** - Step-based state management
|
|
586
|
-
- **useTimeout** - Timeout management
|
|
587
|
-
- **useWindowResize** - Window resize events
|
|
588
|
-
- **useWindowSize** - Window size tracking
|
|
589
|
-
- **useWritingMode** - Detect horizontal/vertical `writing-mode`
|
|
590
|
-
|
|
591
|
-
State that lives in a place — the URL, a history entry, localStorage, memory — is [`@k8ordo/state`](https://www.npmjs.com/package/@k8ordo/state)'s job (`defineLocalState` and friends), not a hook here: a package that owned it twice would give an app two answers.
|
|
592
600
|
|
|
593
601
|
## Accessibility
|
|
594
602
|
|
|
@@ -603,11 +611,13 @@ All components follow WCAG accessibility guidelines:
|
|
|
603
611
|
|
|
604
612
|
## Styling & Customization
|
|
605
613
|
|
|
606
|
-
Components are
|
|
614
|
+
Components are written in CSS Modules and placed in the `components` cascade
|
|
615
|
+
layer. Customize them through:
|
|
607
616
|
|
|
608
|
-
- CSS custom properties (semantic design tokens)
|
|
609
|
-
-
|
|
610
|
-
- 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`
|
|
611
621
|
|
|
612
622
|
## Development
|
|
613
623
|
|
|
@@ -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,34 @@
|
|
|
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
|
|
34
|
+
export {};
|