@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/docs/GUIDE.md
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
# k8ordo
|
|
1
|
+
# @k8ordo/ui Design Guide
|
|
2
2
|
|
|
3
|
-
`@k8ordo/ui`
|
|
3
|
+
How to build UI with the `@k8ordo/ui` design system.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Setup
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
npm install @k8ordo/ui
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
```tsx
|
|
12
|
-
// 1.
|
|
12
|
+
// 1. Load the stylesheet (once, at your entry point)
|
|
13
13
|
import '@k8ordo/ui/styles.css';
|
|
14
|
-
|
|
15
|
-
// 2. Provider でアプリを囲む
|
|
14
|
+
// 2. Wrap the app in the provider
|
|
16
15
|
import { UIProvider } from '@k8ordo/ui';
|
|
17
16
|
|
|
18
17
|
function App() {
|
|
@@ -23,205 +22,325 @@ function App() {
|
|
|
23
22
|
);
|
|
24
23
|
}
|
|
25
24
|
|
|
26
|
-
// 3.
|
|
25
|
+
// 3. Use components
|
|
27
26
|
import { Button, Card } from '@k8ordo/ui';
|
|
28
27
|
```
|
|
29
28
|
|
|
30
|
-
###
|
|
29
|
+
### How the styles arrive
|
|
30
|
+
|
|
31
|
+
`@k8ordo/ui` is written in CSS Modules, and its styles come in two parts:
|
|
31
32
|
|
|
32
|
-
|
|
33
|
+
- **`styles.css`** — import it once. It declares the cascade layers, the design
|
|
34
|
+
tokens (custom properties on `:root` and their modes), a reset (the same
|
|
35
|
+
rules as Tailwind CSS 4's preflight), and the page-wide defaults.
|
|
36
|
+
- **Each component's own CSS** — imported by the component's JavaScript, so a
|
|
37
|
+
page loads the CSS of the components it uses and nothing else. Any bundler
|
|
38
|
+
that handles a CSS import from a package does this for you (Vite, Next.js,
|
|
39
|
+
webpack, Rspack, …).
|
|
33
40
|
|
|
34
|
-
|
|
35
|
-
|
|
41
|
+
Every rule of the library sits in a cascade layer. `styles.css` declares the
|
|
42
|
+
order first:
|
|
36
43
|
|
|
37
44
|
```css
|
|
38
|
-
@
|
|
45
|
+
@layer properties, theme, base, components, utilities;
|
|
39
46
|
```
|
|
40
47
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
48
|
+
The reset and the defaults are in `base` and the components in `components`.
|
|
49
|
+
These are Tailwind CSS 4's layers in Tailwind's order, so in a Tailwind project
|
|
50
|
+
your utilities win over the components; without Tailwind, any CSS of yours that
|
|
51
|
+
is not in a layer wins, and so does a layer you declare after `components`. The
|
|
52
|
+
one rule that does not yield is the reset's
|
|
53
|
+
`[hidden] { display: none !important }`.
|
|
54
|
+
|
|
55
|
+
The CSS is written for what browsers ship today: `@scope`, container style
|
|
56
|
+
queries, `light-dark()`, `:dir()`, nesting. Keep your bundler's CSS target
|
|
57
|
+
recent (in Vite, `build.cssTarget`): an older target makes Lightning CSS
|
|
58
|
+
rewrite `:dir(rtl)` into `:lang()` selectors, which no longer follow `dir`.
|
|
59
|
+
|
|
60
|
+
Components take no `className`. To change how one looks, change the tokens, or
|
|
61
|
+
render your own element through its `renderItem` / `renderAnchor`, which hands
|
|
62
|
+
you the component's `className` to keep or to add to.
|
|
63
|
+
|
|
64
|
+
### Tokens
|
|
65
|
+
|
|
66
|
+
The tokens are custom properties declared at `:root`, named by category:
|
|
67
|
+
`--color-*`, `--spacing` (and `--spacing-em`), `--radius-*`, `--shadow-*`,
|
|
68
|
+
`--font-family-*`, `--font-size-*`, `--font-weight-*`, `--line-height-*`,
|
|
69
|
+
`--letter-spacing-*`, `--z-index-*`, `--duration-*`, `--easing-*` and
|
|
70
|
+
`--breakpoint-*`. Read them in your own CSS (`color: var(--color-fg-mute)`,
|
|
71
|
+
`padding: calc(var(--spacing) * 6)`). The palette they are built from
|
|
72
|
+
(`--gray-500`, …) is not part of the API.
|
|
73
|
+
|
|
74
|
+
They are declared outside any layer, so to override one, declare it after
|
|
75
|
+
`styles.css` is loaded: between unlayered rules of equal specificity, source
|
|
76
|
+
order decides. `@k8ordo/ui/tokens` exports the same tokens as data, a DTCG
|
|
77
|
+
resolver document (Resolver Module 2025.10), with each mode (`.dark`,
|
|
78
|
+
`prefers-contrast: more`) as a modifier.
|
|
79
|
+
|
|
80
|
+
[better-css-modules](https://github.com/k35o/better-css-modules) holds CSS
|
|
81
|
+
Modules to these tokens: list `@k8ordo/ui/styles.css` in its `globalCss`, and
|
|
82
|
+
its `check` reports a raw value, a misspelt token, or a palette color in your
|
|
83
|
+
own modules.
|
|
84
|
+
|
|
85
|
+
### Tailwind CSS 4
|
|
86
|
+
|
|
87
|
+
In a Tailwind CSS 4 project, import `tailwind.css` after Tailwind, instead of
|
|
88
|
+
`styles.css`. It brings in `styles.css` and a theme whose utilities read the
|
|
89
|
+
tokens: `bg-bg-base` is `var(--color-bg-base)`, `text-md` is
|
|
90
|
+
`var(--font-size-md)` with its line height, `p-6` is `calc(var(--spacing) * 6)`.
|
|
91
|
+
It does not import Tailwind itself, so `@k8ordo/ui` does not depend on
|
|
92
|
+
`tailwindcss`; your project's own Tailwind comes first:
|
|
44
93
|
|
|
45
|
-
|
|
94
|
+
```css
|
|
95
|
+
@import 'tailwindcss';
|
|
96
|
+
@import '@k8ordo/ui/tailwind.css';
|
|
97
|
+
```
|
|
46
98
|
|
|
47
|
-
|
|
99
|
+
It also defines the `dark:`, `light:` and `vertical:` variants and the
|
|
100
|
+
`grid-cols-auto-fill-*`, `writing-*` and `z-overlay` / `z-modal` / `z-toast`
|
|
101
|
+
utilities. The components do not need Tailwind; it is only for your own markup.
|
|
102
|
+
|
|
103
|
+
### Page-wide styles
|
|
104
|
+
|
|
105
|
+
Note that `styles.css` applies base styles document-wide. On top of the reset
|
|
106
|
+
(headings, lists, and margins), it unsets bold on `b` / `strong` and italics on
|
|
107
|
+
`i` / `em`, and sets `body` typography defaults (`font-size`,
|
|
108
|
+
`overflow-wrap: anywhere`, `scrollbar-gutter: stable`, …). Adding it to an
|
|
109
|
+
existing app restyles more than the library's own components. Wrap rendered
|
|
110
|
+
Markdown or MDX in `Prose` to get the typesetting of body text back inside it —
|
|
111
|
+
see [Typography](references/typography.md#long-form-text-prose).
|
|
112
|
+
|
|
113
|
+
### Dark mode
|
|
114
|
+
|
|
115
|
+
The tokens switch on a `dark` class: `:root` holds the light values and `.dark`
|
|
116
|
+
the dark ones, so everything under an element with the class is dark. The
|
|
117
|
+
library never adds the class itself. In a k8ordo application
|
|
118
|
+
`@k8ordo/color-scheme` does, resolving the visitor's choice and the system
|
|
119
|
+
preference into `dark` on `<html>` before the first paint; anything else that
|
|
120
|
+
toggles the class works the same.
|
|
121
|
+
|
|
122
|
+
The base layer sets the CSS `color-scheme` property to match — `light` on
|
|
123
|
+
`:root`, `dark` under `.dark` — so the browser's own rendering (scrollbars, form
|
|
124
|
+
controls, a `<dialog>`'s default colors) follows the tokens rather than the OS.
|
|
125
|
+
Your own CSS follows the same way when it reads the tokens. With
|
|
126
|
+
`tailwind.css`, the `dark:` variant applies under `.dark` and `light:`
|
|
127
|
+
everywhere else.
|
|
128
|
+
|
|
129
|
+
### Wording language (i18n)
|
|
130
|
+
|
|
131
|
+
The wording components own internally ("close", "required", "loading", …) is
|
|
132
|
+
read in `@k8ordo/i18n`'s current locale. There is no provider to configure and
|
|
133
|
+
nothing to pass: `@k8ordo/i18n` is a peer dependency, installed with this
|
|
134
|
+
package.
|
|
135
|
+
|
|
136
|
+
- **With a locale set.** Once the application defines its set with
|
|
137
|
+
`defineLocales`, the components speak the locale its messages do — the one
|
|
138
|
+
the URL names, or the set's default.
|
|
139
|
+
- **Without one.** An application that defines no set (a Next.js or plain
|
|
140
|
+
Vite app that does not use `@k8ordo/i18n`) gets **English**, whatever its
|
|
141
|
+
URL starts with — so the server's HTML and the browser agree.
|
|
142
|
+
|
|
143
|
+
```ts
|
|
144
|
+
// src/i18n.ts — a Japanese-only app defines a set of one
|
|
145
|
+
import { defineLocales } from '@k8ordo/i18n';
|
|
146
|
+
|
|
147
|
+
export const locales = defineLocales({
|
|
148
|
+
ja: { timeZone: 'Asia/Tokyo', dir: 'ltr' },
|
|
149
|
+
});
|
|
150
|
+
```
|
|
48
151
|
|
|
49
|
-
|
|
152
|
+
The module that defines the set has to be loaded in the browser too, not
|
|
153
|
+
only by the server render: where no set is defined the components speak
|
|
154
|
+
English, and would disagree with the HTML. In a k8ordo app a client component
|
|
155
|
+
that links (`bindParams`) or switches language already imports it; elsewhere,
|
|
156
|
+
import it from a client module the root renders.
|
|
50
157
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
158
|
+
`ja` and `en` ship with the library. Any other locale is registered next to
|
|
159
|
+
the set, and a regional tag without a dictionary of its own (`en-US`) reads
|
|
160
|
+
its language's (`en`); a locale nothing has text for throws, naming how to
|
|
161
|
+
register it:
|
|
54
162
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
```
|
|
163
|
+
```ts
|
|
164
|
+
import { en, ja, registerMessages } from '@k8ordo/ui/i18n';
|
|
165
|
+
import type { Messages } from '@k8ordo/ui/i18n';
|
|
59
166
|
|
|
60
|
-
|
|
167
|
+
const fr: Messages = { close: 'Fermer' /* …every key */ };
|
|
168
|
+
registerMessages('fr', fr);
|
|
61
169
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
<App />
|
|
65
|
-
</UIProvider>
|
|
170
|
+
// A registered dictionary wins over a built-in one
|
|
171
|
+
registerMessages('en', { ...en, close: 'Dismiss' });
|
|
66
172
|
```
|
|
67
173
|
|
|
68
|
-
|
|
174
|
+
Resolution order is **component prop > registered dictionary > built-in
|
|
175
|
+
dictionary**. For a component with a wording prop of its own, such as
|
|
176
|
+
`Spinner`'s `label`, that prop wins.
|
|
69
177
|
|
|
70
|
-
|
|
178
|
+
`getMessages()` from `@k8ordo/ui/i18n` returns the wording in effect for your
|
|
179
|
+
own elements (a `renderItem`, a component beside the library). It is not a
|
|
180
|
+
hook, so it works in a Server Component — which is also why `Spinner`,
|
|
181
|
+
`Breadcrumb`, `Code`, `Alert`, `Callout`, `Reasoning`, and `ToolInvocation`
|
|
182
|
+
are Server Components.
|
|
71
183
|
|
|
72
|
-
|
|
184
|
+
> [Full key list and details](references/components.md) (the "i18n (message dictionary)" section)
|
|
73
185
|
|
|
74
|
-
|
|
186
|
+
## Design direction
|
|
75
187
|
|
|
76
|
-
|
|
188
|
+
### Core concept
|
|
77
189
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
- **余白で語る**: 詰め込まず、空間にゆとりを持たせる
|
|
81
|
-
- **静かな変化**: アニメーションは控えめに、繊細なフィードバック
|
|
82
|
-
- **穏やかな色**: OKLCH ベースのパレット、セマンティックトークンで抑えたトーンに
|
|
190
|
+
**"Soft where you touch, precise where you read."**
|
|
191
|
+
(触れるものは柔らかく、読むものは端正に)
|
|
83
192
|
|
|
84
|
-
|
|
193
|
+
- **Space and shape lead**: the character of this design comes from generous spacing and soft shapes, not from color
|
|
194
|
+
- **Vary by the element's role**: things you touch (forms, buttons) are soft; things that inform (Alert, Badge) are precise
|
|
195
|
+
- **Let the spacing speak**: do not pack things in; leave room
|
|
196
|
+
- **Quiet motion**: restrained animation, subtle feedback
|
|
197
|
+
- **Calm color**: an OKLCH-based palette kept low-key through semantic tokens
|
|
85
198
|
|
|
86
|
-
|
|
87
|
-
| --------------------------------------- | -------------------------------------------------------- |
|
|
88
|
-
| フォーム(TextField, Textarea, Button) | 柔らかい(大きな角丸、ピル型ボタン、ゆったりパディング) |
|
|
89
|
-
| カード・コンテナ | 柔らかい(`rounded-xl`〜`rounded-2xl`、ふんわり影) |
|
|
90
|
-
| Alert, Badge | 端正(情報の明確さを優先) |
|
|
91
|
-
| Tabs, Breadcrumb | シャープ(構造を示す要素は端正に) |
|
|
199
|
+
Do not give everything the same tone. Soften in proportion to the element's role.
|
|
92
200
|
|
|
93
|
-
|
|
201
|
+
| Element | Direction |
|
|
202
|
+
| ----------------------------------- | ---------------------------------------------------- |
|
|
203
|
+
| Forms (TextField, Textarea, Button) | Soft (large radii, pill buttons, generous padding) |
|
|
204
|
+
| Cards and containers | Soft (`--radius-xl`–`--radius-2xl`, gentle shadow) |
|
|
205
|
+
| Alert, Badge | Precise (clarity of information comes first) |
|
|
206
|
+
| Tabs, Breadcrumb | Sharp (elements that express structure stay precise) |
|
|
94
207
|
|
|
95
|
-
|
|
208
|
+
### Tone
|
|
96
209
|
|
|
97
|
-
|
|
210
|
+
Soft spacing and quiet refinement. The appeal is in space and shape.
|
|
98
211
|
|
|
99
|
-
|
|
212
|
+
## Aesthetic guidelines
|
|
213
|
+
|
|
214
|
+
### Page structure
|
|
100
215
|
|
|
101
216
|
**DO:**
|
|
102
217
|
|
|
103
|
-
-
|
|
104
|
-
-
|
|
105
|
-
-
|
|
218
|
+
- Use `--color-bg-subtle` (a light grey) for the page background
|
|
219
|
+
- Float content on white cards
|
|
220
|
+
- Leave enough room between cards (6–10 steps of `--spacing`)
|
|
106
221
|
|
|
107
222
|
**DON'T:**
|
|
108
223
|
|
|
109
|
-
-
|
|
110
|
-
-
|
|
111
|
-
-
|
|
224
|
+
- Lay flat cards on a pure white background
|
|
225
|
+
- Put everything in a Card
|
|
226
|
+
- Nest cards (Card in Card)
|
|
112
227
|
|
|
113
|
-
###
|
|
228
|
+
### Typography
|
|
114
229
|
|
|
115
230
|
**DO:**
|
|
116
231
|
|
|
117
|
-
-
|
|
118
|
-
-
|
|
119
|
-
-
|
|
232
|
+
- Use the Japanese fonts (Noto Sans JP, M PLUS 2), which your app loads and sets — the library sets no font of its own, so text stays on the reset's system stack until your app sets one
|
|
233
|
+
- Keep to three weights: 400 (the inherited default), `--font-weight-medium`, `--font-weight-bold`
|
|
234
|
+
- Lean on `--font-weight-medium` being 450 — lighter than the usual 500 — for delicate emphasis
|
|
120
235
|
|
|
121
236
|
**DON'T:**
|
|
122
237
|
|
|
123
|
-
- Inter / Roboto / Open Sans
|
|
124
|
-
-
|
|
125
|
-
-
|
|
238
|
+
- Use Inter / Roboto / Open Sans
|
|
239
|
+
- Use four or more font sizes on one screen
|
|
240
|
+
- Apply gradients to text
|
|
126
241
|
|
|
127
|
-
> [
|
|
242
|
+
> [Typography details](references/typography.md)
|
|
128
243
|
|
|
129
|
-
###
|
|
244
|
+
### Color
|
|
130
245
|
|
|
131
246
|
**DO:**
|
|
132
247
|
|
|
133
|
-
- 60-30-10
|
|
134
|
-
-
|
|
135
|
-
-
|
|
136
|
-
-
|
|
248
|
+
- Follow the 60-30-10 rule (60% neutral, 30% supporting, 10% accent)
|
|
249
|
+
- Use semantic color tokens (`--color-bg-subtle`, `--color-fg-mute`, …)
|
|
250
|
+
- Design dark mode as its own tone, not a derivative
|
|
251
|
+
- Keep color calm; let space and shape carry the design
|
|
137
252
|
|
|
138
253
|
**DON'T:**
|
|
139
254
|
|
|
140
|
-
-
|
|
141
|
-
-
|
|
142
|
-
-
|
|
143
|
-
-
|
|
144
|
-
-
|
|
255
|
+
- Use gradient backgrounds
|
|
256
|
+
- Use `--color-primary-bg` on hover — use `--color-bg-mute`
|
|
257
|
+
- Express state with opacity — use the dedicated token
|
|
258
|
+
- Spread vivid color over large areas
|
|
259
|
+
- Use raw palette colors (`--teal-500`) — use semantic tokens (`--color-primary-bg`)
|
|
145
260
|
|
|
146
|
-
> [
|
|
261
|
+
> [Color details](references/color.md)
|
|
147
262
|
|
|
148
|
-
###
|
|
263
|
+
### Spacing
|
|
149
264
|
|
|
150
265
|
**DO:**
|
|
151
266
|
|
|
152
|
-
- `
|
|
153
|
-
-
|
|
154
|
-
- Separator
|
|
267
|
+
- Treat 6 steps of `--spacing` (`calc(var(--spacing) * 6)`) as the standard padding (inside forms and cards), 4 when compact and 8 when generous
|
|
268
|
+
- Express relatedness through the size of the gap (2 steps close, 4 standard, 8 between sections)
|
|
269
|
+
- Separate sections with Separator
|
|
155
270
|
|
|
156
271
|
**DON'T:**
|
|
157
272
|
|
|
158
|
-
-
|
|
159
|
-
-
|
|
160
|
-
-
|
|
273
|
+
- Put everything in a Card
|
|
274
|
+
- Nest cards (Card in Card)
|
|
275
|
+
- Use extremely tight spacing such as one step
|
|
161
276
|
|
|
162
|
-
> [
|
|
277
|
+
> [Spacing details](references/spatial-design.md)
|
|
163
278
|
|
|
164
|
-
###
|
|
279
|
+
### Interaction
|
|
165
280
|
|
|
166
281
|
**DO:**
|
|
167
282
|
|
|
168
|
-
-
|
|
169
|
-
- `
|
|
170
|
-
-
|
|
283
|
+
- Start from a color transition over `--duration-fast` with `--easing-out`
|
|
284
|
+
- Express focus with `box-shadow: var(--shadow-ring-info)` on `:focus-visible`
|
|
285
|
+
- Keep hover gentle with `--color-bg-mute`
|
|
171
286
|
|
|
172
287
|
**DON'T:**
|
|
173
288
|
|
|
174
|
-
- bounce
|
|
175
|
-
- 300ms
|
|
176
|
-
-
|
|
289
|
+
- Use bounce or spring easing
|
|
290
|
+
- Animate for longer than 300ms
|
|
291
|
+
- Use a strong primary color on hover
|
|
177
292
|
|
|
178
|
-
> [
|
|
293
|
+
> [Interaction details](references/interaction-design.md)
|
|
179
294
|
|
|
180
|
-
##
|
|
295
|
+
## Component usage principles
|
|
181
296
|
|
|
182
297
|
### Button
|
|
183
298
|
|
|
184
|
-
`color`
|
|
299
|
+
Styling is unified through `color` and `variant`. Pill-shaped (`--radius-full`).
|
|
185
300
|
|
|
186
301
|
```tsx
|
|
187
302
|
import { Button } from '@k8ordo/ui';
|
|
188
303
|
|
|
189
|
-
//
|
|
190
|
-
<Button color="primary" variant="solid"
|
|
304
|
+
// Primary action
|
|
305
|
+
<Button color="primary" variant="solid">Save</Button>
|
|
191
306
|
|
|
192
|
-
//
|
|
193
|
-
<Button color="base" variant="outline"
|
|
307
|
+
// Secondary action
|
|
308
|
+
<Button color="base" variant="outline">Cancel</Button>
|
|
194
309
|
|
|
195
|
-
//
|
|
196
|
-
<Button variant="skeleton"
|
|
310
|
+
// Text only
|
|
311
|
+
<Button variant="skeleton">View details</Button>
|
|
197
312
|
|
|
198
|
-
//
|
|
313
|
+
// Render as a link (renderItem prop). The bag holds everything the <button>
|
|
314
|
+
// would have received, so drop the two <button>-only members and spread the
|
|
315
|
+
// rest: className, children, ref, onClick, aria-disabled, aria-busy, and any
|
|
316
|
+
// attribute passed to Button all ride along.
|
|
199
317
|
<Button
|
|
200
318
|
color="base"
|
|
201
|
-
renderItem={({
|
|
202
|
-
<a
|
|
319
|
+
renderItem={({ children, disabled: _disabled, type: _type, ...props }) => (
|
|
320
|
+
<a href="/settings" {...props}>{children}</a>
|
|
203
321
|
)}
|
|
204
322
|
>
|
|
205
|
-
|
|
323
|
+
Settings
|
|
206
324
|
</Button>
|
|
207
325
|
```
|
|
208
326
|
|
|
209
327
|
### IconButton
|
|
210
328
|
|
|
211
|
-
`color`
|
|
329
|
+
Styling is controlled by `color` (not `variant`). `label` is required.
|
|
212
330
|
|
|
213
331
|
```tsx
|
|
214
332
|
import { IconButton } from '@k8ordo/ui';
|
|
215
333
|
|
|
216
|
-
<IconButton color="transparent" label="
|
|
217
|
-
<IconButton color="primary" label="
|
|
334
|
+
<IconButton color="transparent" label="Copy"><CopyIcon /></IconButton>
|
|
335
|
+
<IconButton color="primary" label="Send"><SendIcon /></IconButton>
|
|
218
336
|
|
|
219
|
-
//
|
|
337
|
+
// Render as a link (renderItem prop). triggerProps holds the tooltip wiring
|
|
338
|
+
// and the merged ref; spread it alongside the rest.
|
|
220
339
|
<IconButton
|
|
221
340
|
color="base"
|
|
222
|
-
label="
|
|
223
|
-
renderItem={({
|
|
224
|
-
<a
|
|
341
|
+
label="Home"
|
|
342
|
+
renderItem={({ children, disabled: _disabled, triggerProps, type: _type, ...props }) => (
|
|
343
|
+
<a href="/home" {...props} {...triggerProps}>
|
|
225
344
|
{children}
|
|
226
345
|
</a>
|
|
227
346
|
)}
|
|
@@ -230,27 +349,48 @@ import { IconButton } from '@k8ordo/ui';
|
|
|
230
349
|
</IconButton>
|
|
231
350
|
```
|
|
232
351
|
|
|
352
|
+
### CopyButton
|
|
353
|
+
|
|
354
|
+
For copying text, reach for `CopyButton` rather than an `IconButton` and your own
|
|
355
|
+
clipboard code: it writes to the clipboard, shows a check, and announces the
|
|
356
|
+
result to screen readers.
|
|
357
|
+
|
|
358
|
+
```tsx
|
|
359
|
+
import { CopyButton } from '@k8ordo/ui';
|
|
360
|
+
|
|
361
|
+
<CopyButton value={code} label="Copy code" iconOnly size="sm" />
|
|
362
|
+
<CopyButton value={() => window.location.href} label="Copy link" />
|
|
363
|
+
```
|
|
364
|
+
|
|
233
365
|
### Card
|
|
234
366
|
|
|
235
|
-
|
|
367
|
+
Floating on a shadow is the default: a white card over a `--color-bg-subtle`
|
|
368
|
+
page. The card has no padding of its own.
|
|
369
|
+
|
|
370
|
+
```css
|
|
371
|
+
/* card.module.css */
|
|
372
|
+
.body {
|
|
373
|
+
padding: calc(var(--spacing) * 6);
|
|
374
|
+
}
|
|
375
|
+
```
|
|
236
376
|
|
|
237
377
|
```tsx
|
|
238
378
|
import { Card } from '@k8ordo/ui';
|
|
239
379
|
|
|
240
|
-
//
|
|
380
|
+
// Static card (floated with a shadow)
|
|
241
381
|
<Card variant="shadow">
|
|
242
|
-
<div className=
|
|
382
|
+
<div className={styles.body}>Card content</div>
|
|
243
383
|
</Card>
|
|
244
384
|
|
|
245
|
-
//
|
|
385
|
+
// Clickable card (interactive scales it up on hover)
|
|
246
386
|
<Card variant="shadow" interactive>
|
|
247
|
-
<div className=
|
|
387
|
+
<div className={styles.body}>Content</div>
|
|
248
388
|
</Card>
|
|
249
389
|
```
|
|
250
390
|
|
|
251
|
-
###
|
|
391
|
+
### Forms
|
|
252
392
|
|
|
253
|
-
`FormControl`
|
|
393
|
+
`FormControl` plus each form component's `renderInput` pattern.
|
|
254
394
|
|
|
255
395
|
```tsx
|
|
256
396
|
import {
|
|
@@ -261,14 +401,14 @@ import {
|
|
|
261
401
|
TextField,
|
|
262
402
|
} from '@k8ordo/ui';
|
|
263
403
|
|
|
264
|
-
<FormControl label="
|
|
404
|
+
<FormControl label="Email" required renderInput={(props) => (
|
|
265
405
|
<TextField {...props} placeholder="example@mail.com" />
|
|
266
406
|
)} />
|
|
267
407
|
|
|
268
|
-
<FormControl label="
|
|
408
|
+
<FormControl label="Category" renderInput={(props) => (
|
|
269
409
|
<Select
|
|
270
410
|
{...props}
|
|
271
|
-
options={[{ value: '1', label: '
|
|
411
|
+
options={[{ value: '1', label: 'Option 1' }]}
|
|
272
412
|
value={value}
|
|
273
413
|
onChange={onChange}
|
|
274
414
|
/>
|
|
@@ -277,48 +417,90 @@ import {
|
|
|
277
417
|
<FileField.Root accept="image/*" multiple>
|
|
278
418
|
<FileField.Trigger
|
|
279
419
|
renderItem={({ onClick, disabled }) => (
|
|
280
|
-
<Button disabled={disabled} onClick={onClick}
|
|
420
|
+
<Button disabled={disabled} onClick={onClick}>Choose files</Button>
|
|
281
421
|
)}
|
|
282
422
|
/>
|
|
283
423
|
<FileField.ItemList />
|
|
284
424
|
</FileField.Root>
|
|
285
425
|
```
|
|
286
426
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
427
|
+
With `@k8ordo/form`, spread what `form.field(name).input` derives onto the
|
|
428
|
+
field after `FormControl`'s props — `type`, `required`, the length and range
|
|
429
|
+
bounds, and the echoed `defaultValue` all go in as they are, whichever field
|
|
430
|
+
renders them. Uncontrolled fields keep their value in the DOM, so the form's
|
|
431
|
+
reset, `isDirty`, and error clearing hear every change, including ones a
|
|
432
|
+
component makes in code. The pairing per component is in `@k8ordo/form`'s
|
|
433
|
+
guide (`node_modules/@k8ordo/form/docs/GUIDE.md`, "Working with @k8ordo/ui").
|
|
290
434
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
> このUIを誰かに見せて「AIが作った」と言ったら、すぐに信じるだろうか?
|
|
304
|
-
> もし「はい」なら、それが問題だ。
|
|
305
|
-
|
|
306
|
-
## 実装の原則
|
|
307
|
-
|
|
308
|
-
- **既存コンポーネントを使う**: カスタムUIの前にまず k8ordo UI コンポーネントを探す
|
|
309
|
-
- **セマンティックトークンを使う**: 生のカラー値(`bg-teal-500`)ではなくトークン(`bg-primary-bg`)
|
|
310
|
-
- **空間と形で魅せる**: 色の華やかさではなく、余白と角丸の柔らかさで個性を出す
|
|
311
|
-
- **ダークモードを忘れない**: セマンティックトークンを使えば自動対応
|
|
312
|
-
- **アクセシビリティ**: `aria-label`, キーボードナビゲーション, カラーだけに頼らない状態表現
|
|
313
|
-
|
|
314
|
-
## 詳細リファレンス
|
|
435
|
+
```tsx
|
|
436
|
+
const title = form.field('title');
|
|
437
|
+
|
|
438
|
+
<FormControl
|
|
439
|
+
errorText={title.error}
|
|
440
|
+
invalid={title.invalid}
|
|
441
|
+
label="Title"
|
|
442
|
+
required={title.required}
|
|
443
|
+
renderInput={(props) => <TextField {...props} {...title.input} />}
|
|
444
|
+
/>;
|
|
445
|
+
```
|
|
315
446
|
|
|
316
|
-
-
|
|
317
|
-
|
|
318
|
-
-
|
|
319
|
-
|
|
320
|
-
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
447
|
+
## Anti-patterns: avoiding "AI slop"
|
|
448
|
+
|
|
449
|
+
Avoid the traits that make a UI recognizably AI-generated at a glance.
|
|
450
|
+
|
|
451
|
+
| Anti-pattern | The @k8ordo/ui alternative |
|
|
452
|
+
| -------------------------- | --------------------------------------------------------- |
|
|
453
|
+
| Purple gradients | Flat teal/cyan color |
|
|
454
|
+
| Card in Card | A Separator and spacing instead |
|
|
455
|
+
| Grey text on a grey ground | Hold contrast with `--color-fg-base` / `--color-fg-mute` |
|
|
456
|
+
| Bounce / spring animation | A color transition over `--duration-fast`, `--easing-out` |
|
|
457
|
+
| The Inter typeface | Noto Sans JP / M PLUS 2 |
|
|
458
|
+
| Heavy glassmorphism | A border plus a subtle background color |
|
|
459
|
+
| Cramming information in | Sparse placement that lets the space breathe |
|
|
460
|
+
|
|
461
|
+
### The AI slop test
|
|
462
|
+
|
|
463
|
+
> Show this UI to someone and tell them an AI made it. Would they believe it
|
|
464
|
+
> immediately? If yes, that is the problem.
|
|
465
|
+
|
|
466
|
+
## Implementation principles
|
|
467
|
+
|
|
468
|
+
- **Use the existing components**: look for a @k8ordo/ui component before building custom UI
|
|
469
|
+
- **Render from Server Components**: every component, compound ones included (`Dialog.Root`, `Tabs.Root`, …), can be placed in a Server Component; only the interactive parts are client modules
|
|
470
|
+
- **Keep placed state in `@k8ordo/state`**: state that lives in the URL, a history entry, localStorage, or memory is `defineLocalState` and friends, not a hook from this package
|
|
471
|
+
- **Browser-only rendering is React's**: a component that can only render in a browser calls `use(browser())` (`browser` from `react-dom`) under a `<Suspense>`; there is no `useClient` here and no "mounted" flag
|
|
472
|
+
- **Use semantic tokens**: tokens (`--color-primary-bg`), never raw color values or the palette (`--teal-500`)
|
|
473
|
+
- **Let space and shape carry it**: character comes from spacing and soft radii, not from vivid color
|
|
474
|
+
- **Do not forget dark mode**: semantic tokens handle it for you
|
|
475
|
+
- **High contrast is handled too**: the tokens follow `prefers-contrast: more` and the components stay legible under `forced-colors: active`; for your own UI, see [High contrast and forced colors](references/color.md#high-contrast-and-forced-colors)
|
|
476
|
+
- **Accessibility**: `aria-label`, keyboard navigation, and state that does not rely on color alone
|
|
477
|
+
|
|
478
|
+
## Testing
|
|
479
|
+
|
|
480
|
+
Run component tests in a real browser — Vitest browser mode or Playwright —
|
|
481
|
+
the way this library tests itself. Every interactive component is built
|
|
482
|
+
directly on APIs a browser has and jsdom does not: `ResizeObserver`,
|
|
483
|
+
`IntersectionObserver`, `matchMedia`, `HTMLDialogElement`'s `showModal` /
|
|
484
|
+
`close`, and the Popover API. None of them is called through a support check,
|
|
485
|
+
so under jsdom `Tooltip`, `IconButton` (unless `tooltipDisabled`), `Tabs`,
|
|
486
|
+
`Autocomplete`, `Combobox`, `Toolbar`, `ResizablePanels`, `InView`, `Resize`,
|
|
487
|
+
and `Conversation` throw as soon as they mount; `Modal`, `CommandPalette`,
|
|
488
|
+
`Drawer`, `Popover`, `DropdownMenu`, `ContextMenu`, `ListBox`, and `DatePicker`
|
|
489
|
+
throw the moment they open (a `DropdownMenu` holding a `SubMenu` already at
|
|
490
|
+
mount); and a `clearable` `FileField.ItemList` throws once it lists a file.
|
|
491
|
+
|
|
492
|
+
This is not a gap to be stubbed around. A synthetic DOM (jsdom, happy-dom) has
|
|
493
|
+
no layout engine, so even with stubs in place a passing assertion about focus,
|
|
494
|
+
placement, or visibility there means very little — the thing you wanted to
|
|
495
|
+
check is the thing it cannot model.
|
|
496
|
+
|
|
497
|
+
## Detailed reference
|
|
498
|
+
|
|
499
|
+
- Typography: [references/typography.md](references/typography.md)
|
|
500
|
+
- Color system: [references/color.md](references/color.md)
|
|
501
|
+
- Spacing and layout: [references/spatial-design.md](references/spatial-design.md)
|
|
502
|
+
- Interaction: [references/interaction-design.md](references/interaction-design.md)
|
|
503
|
+
- Component catalog: [references/components.md](references/components.md)
|
|
504
|
+
- Types: [references/types.md](references/types.md)
|
|
505
|
+
- AI chat (Conversation / Message / PromptInput, …): [references/ai-chat.md](references/ai-chat.md)
|
|
506
|
+
- Generative UI (having an LLM generate UI via json-render / OpenUI): [references/generative-ui.md](references/generative-ui.md)
|