@k8ordo/ui 2.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 +197 -187
- 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 +4 -5
- 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 -4
- 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 -6
- 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/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 +2 -3
- package/dist/components/ai/suggestion/suggestion.css +32 -0
- package/dist/components/ai/suggestion/suggestion.d.mts +3 -4
- 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 +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 +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/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 +4 -3
- package/dist/components/form/checkbox/checkbox.mjs +29 -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 +4 -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 +9 -7
- 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 -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 +3 -3
- 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/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 +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/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 +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 +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 +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/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 -7
- 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/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 +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 -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 -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 +387 -103
- 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/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 +1664 -242
- package/docs/references/generative-ui.md +125 -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 +64 -62
- 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
|
@@ -4,61 +4,88 @@ Typography in `@k8ordo/ui` aims for readability and quiet at the same time.
|
|
|
4
4
|
|
|
5
5
|
## Font family
|
|
6
6
|
|
|
7
|
-
A font stack tuned for Japanese.
|
|
7
|
+
A font stack tuned for Japanese: Noto Sans JP and M PLUS 2.
|
|
8
|
+
|
|
9
|
+
The library ships no font files and sets no font of its own: until your app
|
|
10
|
+
sets one, text stays on the reset's system stack, `--font-family-sans`
|
|
11
|
+
(Roboto included). Load the fonts yourself (fontsource, `next/font`, …), declare
|
|
12
|
+
them as tokens, and set the body:
|
|
8
13
|
|
|
9
14
|
```css
|
|
10
|
-
|
|
15
|
+
:root {
|
|
16
|
+
--font-family-noto-sans-jp: 'Noto Sans JP', sans-serif;
|
|
17
|
+
--font-family-m-plus-2: 'M PLUS 2', sans-serif;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
body {
|
|
21
|
+
font-family: var(--font-family-noto-sans-jp);
|
|
22
|
+
}
|
|
11
23
|
```
|
|
12
24
|
|
|
25
|
+
- `--font-family-sans` and `--font-family-mono` are the reset's stacks, which `body` and `code` / `kbd` / `pre` use until your app sets its own
|
|
26
|
+
- With `tailwind.css`, `--font-family-noto-sans-jp` and `--font-family-m-plus-2` back the `font-noto-sans-jp` and `font-m-plus-2` utilities. They are the only font-family utilities; the theme removes `font-sans`, `font-serif`, and `font-mono`
|
|
13
27
|
- **Do not use Inter / Roboto / Open Sans** — they read as AI-generated
|
|
14
28
|
- Japanese text dominates, so Japanese faces come first
|
|
15
29
|
|
|
16
30
|
## Font size scale
|
|
17
31
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
|
23
|
-
|
|
|
24
|
-
|
|
|
25
|
-
|
|
|
26
|
-
|
|
|
27
|
-
|
|
|
28
|
-
|
|
|
32
|
+
Each size has a line height to go with it, `--line-height-<size>`
|
|
33
|
+
(`--font-size-sm` with `--line-height-sm`). With `tailwind.css`, `text-<size>`
|
|
34
|
+
sets both.
|
|
35
|
+
|
|
36
|
+
| Token | Value | Use |
|
|
37
|
+
| ----------------------- | -------- | ----------------------- |
|
|
38
|
+
| `--font-size-xs` | 0.75rem | Annotations, captions |
|
|
39
|
+
| `--font-size-sm` | 0.875rem | Supporting text, labels |
|
|
40
|
+
| `--font-size-md` | 1rem | Body text (default) |
|
|
41
|
+
| `--font-size-lg` | 1.125rem | Subheadings |
|
|
42
|
+
| `--font-size-xl` | 1.25rem | Headings |
|
|
43
|
+
| `--font-size-2xl` | 1.5rem | Large headings |
|
|
44
|
+
| `--font-size-3xl` | 1.875rem | Page titles |
|
|
45
|
+
| `--font-size-emphasize` | 3rem | Emphasis display |
|
|
46
|
+
| `--font-size-highlight` | 6rem | Highlight display |
|
|
47
|
+
|
|
48
|
+
Three sizes follow the text they sit in, in `em`: `--font-size-code` (0.875em,
|
|
49
|
+
code in running text), `--font-size-kbd` (0.8125em) and `--font-size-callout`
|
|
50
|
+
(0.9em, the notes of a `CodeBlock`). `--spacing-em` (0.25em) is the spacing step
|
|
51
|
+
that goes with them.
|
|
29
52
|
|
|
30
53
|
## Font weight
|
|
31
54
|
|
|
32
55
|
Use weight sparingly. Heavy type undermines the quiet.
|
|
33
56
|
|
|
34
|
-
|
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
57
|
+
| Token | Value | Use |
|
|
58
|
+
| ---------------------- | ----- | ------------------------------------- |
|
|
59
|
+
| (none) | 400 | Body text (the inherited default) |
|
|
60
|
+
| `--font-weight-medium` | 450 | Emphasized text (restrained emphasis) |
|
|
61
|
+
| `--font-weight-bold` | 700 | Headings, button labels |
|
|
39
62
|
|
|
40
|
-
-
|
|
41
|
-
- Note that
|
|
63
|
+
- There are only these two weight tokens. With `tailwind.css`, `font-medium` and `font-bold` are the only weight utilities
|
|
64
|
+
- Note that `--font-weight-medium` is 450 here — lighter than the usual 500
|
|
42
65
|
|
|
43
66
|
## Line height
|
|
44
67
|
|
|
45
68
|
Japanese text needs more leading than Latin text.
|
|
46
69
|
|
|
47
|
-
|
|
|
48
|
-
|
|
|
49
|
-
|
|
|
50
|
-
|
|
|
51
|
-
|
|
|
52
|
-
|
|
|
53
|
-
|
|
|
54
|
-
|
|
|
70
|
+
| Token | Value | Use |
|
|
71
|
+
| ----------------------- | ----- | ------------------------------- |
|
|
72
|
+
| `--line-height-none` | 1 | Special cases (highlight, …) |
|
|
73
|
+
| `--line-height-tight` | 1.25 | Headings |
|
|
74
|
+
| `--line-height-snug` | 1.375 | Subheadings |
|
|
75
|
+
| `--line-height-normal` | 1.5 | Inside lists; the default |
|
|
76
|
+
| `--line-height-relaxed` | 1.625 | Body text (recommended) |
|
|
77
|
+
| `--line-height-loose` | 2 | When wide leading is called for |
|
|
78
|
+
|
|
79
|
+
With `tailwind.css` these are `leading-none` … `leading-loose`.
|
|
55
80
|
|
|
56
81
|
## Letter spacing
|
|
57
82
|
|
|
58
|
-
|
|
|
59
|
-
|
|
|
60
|
-
|
|
|
61
|
-
|
|
|
83
|
+
| Token | Value | Use |
|
|
84
|
+
| ------------------------- | ------- | --------------------------- |
|
|
85
|
+
| `--letter-spacing-none` | 0em | Default |
|
|
86
|
+
| `--letter-spacing-normal` | 0.025em | When a little air is wanted |
|
|
87
|
+
|
|
88
|
+
With `tailwind.css` these are `tracking-none` and `tracking-normal`.
|
|
62
89
|
|
|
63
90
|
## The Heading component
|
|
64
91
|
|
|
@@ -72,40 +99,121 @@ import { Heading } from '@k8ordo/ui';
|
|
|
72
99
|
<Heading level="h3">Subsection</Heading>
|
|
73
100
|
```
|
|
74
101
|
|
|
102
|
+
## Long-form text (Prose)
|
|
103
|
+
|
|
104
|
+
The base styles reset headings, lists, margins, and emphasis, which is right for
|
|
105
|
+
an interface and wrong for an article. `Prose` puts the typesetting of body text
|
|
106
|
+
back inside it, for Markdown or MDX rendered to HTML:
|
|
107
|
+
|
|
108
|
+
```tsx
|
|
109
|
+
import { Prose } from '@k8ordo/ui';
|
|
110
|
+
|
|
111
|
+
<article>
|
|
112
|
+
<Prose>{content}</Prose>
|
|
113
|
+
</article>;
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
What it sets, tuned for Japanese:
|
|
117
|
+
|
|
118
|
+
- Body text on `--line-height-loose` (2) with `--letter-spacing-normal`:
|
|
119
|
+
Japanese needs more leading than Latin text.
|
|
120
|
+
- `1rem` between blocks, `3rem` above an `h2`, `2rem` above `h3`–`h6`, and
|
|
121
|
+
`0.75rem` between a heading and what follows it.
|
|
122
|
+
- Headings in `--font-weight-bold`, `--line-height-snug`, with
|
|
123
|
+
`text-wrap: balance` and proportional kana (`font-feature-settings: 'palt'`).
|
|
124
|
+
- `strong` in `--font-weight-bold`. `em` as emphasis dots (傍点, `text-emphasis: filled
|
|
125
|
+
sesame`) where the text is Japanese (`:lang(ja)`), and italic elsewhere.
|
|
126
|
+
- Links, inline code, `kbd`, and `pre` drawn like `Anchor`, `Code`, `Kbd`, and a
|
|
127
|
+
code block; lists with their markers back; quotes, tables, rules, images,
|
|
128
|
+
and GFM footnotes and task lists (the footnotes' `sr-only` heading is
|
|
129
|
+
read but not shown).
|
|
130
|
+
- Under `.writing-v`, each paragraph's first line is indented one character,
|
|
131
|
+
as a book is set.
|
|
132
|
+
|
|
133
|
+
**Only bare elements are typeset.** The element rules stop at any element with a
|
|
134
|
+
`class` — which is every `@k8ordo/ui` component — so a component placed in the
|
|
135
|
+
text keeps its own look (an `Alert`'s list does not get bullets). The spacing
|
|
136
|
+
between blocks still applies to it. The classes remark-gfm puts on footnotes
|
|
137
|
+
and task lists (`footnotes`, `contains-task-list`, `task-list-item`,
|
|
138
|
+
`data-footnote-backref`, `sr-only`) are the exception: they are treated as part
|
|
139
|
+
of the text.
|
|
140
|
+
Map an MDX element to a component when you want it to look like the component,
|
|
141
|
+
and leave it bare when you want it to look like text.
|
|
142
|
+
|
|
75
143
|
## Vertical writing mode
|
|
76
144
|
|
|
77
|
-
|
|
145
|
+
`styles.css` ships three classes for the writing mode. They are the public
|
|
146
|
+
markers the components read, not utilities: put them on the element that
|
|
147
|
+
should turn.
|
|
78
148
|
|
|
79
|
-
|
|
149
|
+
| Class | Use |
|
|
150
|
+
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
151
|
+
| `writing-h` | Return to horizontal (`writing-mode: horizontal-tb`). Use it for figures, code blocks, and replaced elements inside a vertical tree. |
|
|
152
|
+
| `writing-v` | Apply vertical writing (`writing-mode: vertical-rl`) together with the recommended defaults such as `text-orientation: mixed`. |
|
|
153
|
+
| `writing-sideways-rl` | Turn a block sideways (`writing-mode: sideways-rl`): it lays out like horizontal text rotated 90° clockwise, Japanese glyphs included. `Table` turns itself this way in vertical text. |
|
|
80
154
|
|
|
81
|
-
|
|
82
|
-
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
|
|
83
|
-
| `writing-h` | Return to horizontal (`writing-mode: horizontal-tb`). Use it for figures, code blocks, and replaced elements inside a vertical tree. |
|
|
84
|
-
| `writing-v` | Apply vertical writing (`writing-mode: vertical-rl`) together with the recommended defaults such as `text-orientation: mixed`. |
|
|
155
|
+
### Styling for vertical text
|
|
85
156
|
|
|
86
|
-
|
|
157
|
+
`writing-v` and `writing-h` also set the custom property `--writing`
|
|
158
|
+
(`vertical` or `horizontal`; `:root` holds `horizontal`), and it inherits. Read
|
|
159
|
+
it with a style query to change your own styles in vertical text:
|
|
87
160
|
|
|
88
|
-
|
|
89
|
-
|
|
161
|
+
```css
|
|
162
|
+
.paragraph {
|
|
163
|
+
margin-block: calc(var(--spacing) * 4);
|
|
164
|
+
|
|
165
|
+
@container style(--writing: vertical) {
|
|
166
|
+
margin-block: 0;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
A style query asks the element's parent, so it does not see a `writing-v` on
|
|
172
|
+
the element itself: style that element through a class of its own. Prefer
|
|
173
|
+
logical properties (`margin-block`, `inline-size`) first; they often make the
|
|
174
|
+
override unnecessary.
|
|
175
|
+
|
|
176
|
+
With `tailwind.css`, the `vertical:` variant does the same for utilities: it
|
|
177
|
+
applies inside a `.writing-v` subtree and not inside `.writing-h`
|
|
178
|
+
(`className="my-4 vertical:my-0"`).
|
|
179
|
+
|
|
180
|
+
### Switching at runtime
|
|
181
|
+
|
|
182
|
+
There is no JavaScript API for the writing mode. Keep the mode in your own
|
|
183
|
+
state, and put `writing-v` on the container that should turn vertical:
|
|
90
184
|
|
|
91
185
|
```tsx
|
|
92
|
-
<
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
186
|
+
const [mode, setMode] = useState<'horizontal' | 'vertical'>('horizontal');
|
|
187
|
+
|
|
188
|
+
<article className={mode === 'vertical' ? 'writing-v' : undefined}>
|
|
189
|
+
<p className={styles.paragraph}>…</p>
|
|
190
|
+
<pre className="writing-h">…</pre>
|
|
191
|
+
</article>;
|
|
97
192
|
```
|
|
98
193
|
|
|
194
|
+
- Components follow a `.writing-v` ancestor on their own, with no props.
|
|
195
|
+
`Tabs` (arrow keys and `aria-orientation`) and `Autocomplete` (the width of
|
|
196
|
+
its list) also follow a class toggled while they are on screen. `Popover`,
|
|
197
|
+
`Tooltip`, `DropdownMenu`, and `ListBox` read the writing mode each time
|
|
198
|
+
they open, so a change made while one is open shows the next time it opens.
|
|
199
|
+
- When your own JavaScript has to branch — hiding a side rail in vertical
|
|
200
|
+
mode, say — branch on the state you toggle, not on the DOM.
|
|
201
|
+
- To read the mode of an element you do not control, call
|
|
202
|
+
`getComputedStyle(element).writingMode` at the moment you need it. There is
|
|
203
|
+
no event to subscribe to, and a `ResizeObserver` does not stand in for one:
|
|
204
|
+
an element that shrinks to fit its content keeps its logical size when the
|
|
205
|
+
writing mode flips, so the observer never fires.
|
|
206
|
+
|
|
99
207
|
### Caveats
|
|
100
208
|
|
|
101
|
-
- Replaced elements such as images and iframes may not size as expected under `vertical-rl`. Return the element itself to horizontal, as in `<img className="
|
|
102
|
-
- `-webkit-line-clamp`
|
|
209
|
+
- Replaced elements such as images and iframes may not size as expected under `vertical-rl`. Return the element itself to horizontal, as in `<img className="writing-h" />`.
|
|
210
|
+
- `-webkit-line-clamp` conflicts with `writing-mode` in Safari. In vertical mode, replace it with a `block-size` cap plus `overflow: hidden`.
|
|
103
211
|
- Libraries that assume horizontal layout internally, such as KaTeX, need `writing-h` applied only where required.
|
|
104
212
|
|
|
105
213
|
## What not to do
|
|
106
214
|
|
|
107
|
-
-
|
|
108
|
-
- Use anything larger than
|
|
109
|
-
- Apply `uppercase` or
|
|
215
|
+
- Reach past the three weights (400, `--font-weight-medium`, `--font-weight-bold`) with an arbitrary value (`font-weight: 600`, …)
|
|
216
|
+
- Use anything larger than `--font-size-3xl` for ordinary text (`--font-size-emphasize` and `--font-size-highlight` are for special cases)
|
|
217
|
+
- Apply `text-transform: uppercase` or wide letter spacing to Japanese text
|
|
110
218
|
- Apply a gradient to text
|
|
111
219
|
- Build hierarchy from font size alone — use spacing as well
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@k8ordo/ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "k8o's React UI library with built-in generative UI adapters (json-render & OpenUI) for LLM-driven, on-brand interfaces",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -67,6 +67,10 @@
|
|
|
67
67
|
"types": "./dist/components/ai/response/index.d.mts",
|
|
68
68
|
"default": "./dist/components/ai/response/index.mjs"
|
|
69
69
|
},
|
|
70
|
+
"./code-block": {
|
|
71
|
+
"types": "./dist/components/data-display/code-block/index.d.mts",
|
|
72
|
+
"default": "./dist/components/data-display/code-block/index.mjs"
|
|
73
|
+
},
|
|
70
74
|
"./ai-sdk": {
|
|
71
75
|
"types": "./dist/integrations/ai-sdk/index.d.mts",
|
|
72
76
|
"default": "./dist/integrations/ai-sdk/index.mjs"
|
|
@@ -84,60 +88,63 @@
|
|
|
84
88
|
},
|
|
85
89
|
"dependencies": {
|
|
86
90
|
"clsx": "2.1.1",
|
|
87
|
-
"lucide-react": "1.
|
|
88
|
-
"
|
|
91
|
+
"lucide-react": "1.52.0",
|
|
92
|
+
"server-only": "0.0.1",
|
|
93
|
+
"shiki": "4.5.0"
|
|
89
94
|
},
|
|
90
95
|
"devDependencies": {
|
|
91
96
|
"@arethetypeswrong/cli": "0.18.5",
|
|
92
|
-
"@
|
|
93
|
-
"@
|
|
94
|
-
"@
|
|
95
|
-
"@
|
|
96
|
-
"@
|
|
97
|
-
"@
|
|
98
|
-
"@
|
|
99
|
-
"@
|
|
100
|
-
"@
|
|
101
|
-
"@
|
|
102
|
-
"@
|
|
103
|
-
"@
|
|
104
|
-
"@
|
|
105
|
-
"@
|
|
106
|
-
"@
|
|
107
|
-
"@
|
|
108
|
-
"@
|
|
109
|
-
"
|
|
110
|
-
"
|
|
111
|
-
"
|
|
112
|
-
"
|
|
113
|
-
"
|
|
114
|
-
"
|
|
115
|
-
"
|
|
116
|
-
"
|
|
97
|
+
"@better-css-modules/cli": "0.4.0",
|
|
98
|
+
"@better-css-modules/core": "0.4.0",
|
|
99
|
+
"@better-css-modules/vite": "0.4.0",
|
|
100
|
+
"@chromatic-com/storybook": "5.4.0",
|
|
101
|
+
"@json-render/core": "0.21.0",
|
|
102
|
+
"@json-render/react": "0.21.0",
|
|
103
|
+
"@k8ordo/form": "^1.0.0",
|
|
104
|
+
"@k8ordo/i18n": "^1.0.0",
|
|
105
|
+
"@openuidev/lang-core": "0.3.1",
|
|
106
|
+
"@openuidev/react-lang": "0.3.1",
|
|
107
|
+
"@storybook/addon-a11y": "10.6.1",
|
|
108
|
+
"@storybook/addon-docs": "10.6.1",
|
|
109
|
+
"@storybook/addon-mcp": "10.6.1",
|
|
110
|
+
"@storybook/addon-vitest": "10.6.1",
|
|
111
|
+
"@storybook/react-vite": "10.6.1",
|
|
112
|
+
"@types/react": "19.3.0",
|
|
113
|
+
"@types/react-dom": "19.3.0",
|
|
114
|
+
"@vitejs/plugin-react": "6.1.2",
|
|
115
|
+
"@vitest/browser-playwright": "5.0.3",
|
|
116
|
+
"@vitest/coverage-v8": "5.0.3",
|
|
117
|
+
"@vitest/ui": "5.0.3",
|
|
118
|
+
"ai": "7.0.130",
|
|
119
|
+
"postcss": "8.5.29",
|
|
120
|
+
"publint": "0.3.25",
|
|
121
|
+
"react": "19.3.0",
|
|
122
|
+
"react-dom": "19.3.0",
|
|
123
|
+
"storybook": "10.6.1",
|
|
124
|
+
"storybook-addon-determinism": "0.2.1",
|
|
125
|
+
"storybook-addon-mock-date": "3.2.1",
|
|
117
126
|
"storybook-addon-vrt": "0.4.0",
|
|
118
|
-
"streamdown": "2.
|
|
119
|
-
"tailwind-token-extractor": "0.2.1",
|
|
120
|
-
"tailwindcss": "4.3.3",
|
|
127
|
+
"streamdown": "2.7.0",
|
|
121
128
|
"typescript": "7.0.2",
|
|
122
|
-
"vite": "
|
|
123
|
-
"vite-plus": "
|
|
124
|
-
"vitest": "
|
|
125
|
-
"vitest-browser-react": "2.
|
|
126
|
-
"zod": "4.
|
|
129
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@1.1.0",
|
|
130
|
+
"vite-plus": "1.1.0",
|
|
131
|
+
"vitest": "5.0.3",
|
|
132
|
+
"vitest-browser-react": "2.3.0",
|
|
133
|
+
"zod": "4.6.5"
|
|
127
134
|
},
|
|
128
135
|
"peerDependencies": {
|
|
129
|
-
"@json-render/core": ">=0.
|
|
130
|
-
"@json-render/react": ">=0.
|
|
131
|
-
"@
|
|
132
|
-
"@openuidev/
|
|
133
|
-
"@
|
|
134
|
-
"@types/react
|
|
136
|
+
"@json-render/core": ">=0.21.0 <0.22.0",
|
|
137
|
+
"@json-render/react": ">=0.21.0 <0.22.0",
|
|
138
|
+
"@k8ordo/i18n": "^1.0.0",
|
|
139
|
+
"@openuidev/lang-core": ">=0.3.0 <0.4.0",
|
|
140
|
+
"@openuidev/react-lang": ">=0.3.0 <0.4.0",
|
|
141
|
+
"@types/react": ">=19.3.0",
|
|
142
|
+
"@types/react-dom": ">=19.3.0",
|
|
135
143
|
"ai": ">=7.0.51",
|
|
136
|
-
"react": ">=19.
|
|
137
|
-
"react-dom": ">=19.
|
|
144
|
+
"react": ">=19.3.0",
|
|
145
|
+
"react-dom": ">=19.3.0",
|
|
138
146
|
"streamdown": ">=2.5.0",
|
|
139
|
-
"
|
|
140
|
-
"typescript": ">=7.0.2",
|
|
147
|
+
"typescript": ">=7.0.0",
|
|
141
148
|
"zod": "^4.4.3"
|
|
142
149
|
},
|
|
143
150
|
"peerDependenciesMeta": {
|
|
@@ -165,9 +172,6 @@
|
|
|
165
172
|
"streamdown": {
|
|
166
173
|
"optional": true
|
|
167
174
|
},
|
|
168
|
-
"tailwindcss": {
|
|
169
|
-
"optional": true
|
|
170
|
-
},
|
|
171
175
|
"typescript": {
|
|
172
176
|
"optional": true
|
|
173
177
|
},
|
|
@@ -176,21 +180,19 @@
|
|
|
176
180
|
}
|
|
177
181
|
},
|
|
178
182
|
"scripts": {
|
|
179
|
-
"build": "vp pack &&
|
|
180
|
-
"
|
|
181
|
-
"
|
|
182
|
-
"check:
|
|
183
|
-
"
|
|
184
|
-
"check:props": "node scripts/extract-props.ts --check && node scripts/generate-components-md.ts --check && node scripts/check-helpers-md.ts",
|
|
185
|
-
"check:package": "publint && attw --pack . --profile esm-only --exclude-entrypoints ./styles.css ./tailwind.css",
|
|
183
|
+
"build": "vp pack && node scripts/build-tokens.ts",
|
|
184
|
+
"generate:props": "node scripts/extract-props.ts && node scripts/generate-component-docs.ts",
|
|
185
|
+
"check:props": "node scripts/extract-props.ts --check && node scripts/generate-component-docs.ts --check",
|
|
186
|
+
"check:dist": "node scripts/check-dist-tests.ts",
|
|
187
|
+
"check:package": "publint && attw --pack . --profile esm-only --exclude-entrypoints ./styles.css ./tailwind.css && pnpm check:dist",
|
|
186
188
|
"storybook": "storybook dev -p 6006 --no-open",
|
|
187
189
|
"build-storybook": "storybook build",
|
|
188
|
-
"test:vrt": "VRT=1 vitest run --project=components",
|
|
190
|
+
"test:vrt": "VRT=1 TEST_BROWSER=chromium vitest run --project=components",
|
|
189
191
|
"test": "vitest run",
|
|
190
|
-
"test:ui": "vitest --ui --coverage",
|
|
191
|
-
"test:coverage": "vitest run --coverage",
|
|
192
|
-
"typecheck": "tsc --noEmit",
|
|
193
|
-
"check": "vp check",
|
|
194
|
-
"check:write": "vp check --fix"
|
|
192
|
+
"test:ui": "TEST_BROWSER=chromium vitest --ui --coverage",
|
|
193
|
+
"test:coverage": "TEST_BROWSER=chromium vitest run --coverage",
|
|
194
|
+
"typecheck": "better-css-modules generate && tsc --noEmit",
|
|
195
|
+
"check": "better-css-modules generate && vp check && better-css-modules check",
|
|
196
|
+
"check:write": "better-css-modules generate && vp check --fix"
|
|
195
197
|
}
|
|
196
198
|
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
//#region src/components/_internal/focus-ring.d.ts
|
|
2
|
-
declare const FOCUS_RING = "focus-visible:border-transparent focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-border-info";
|
|
3
|
-
declare const FOCUS_RING_NO_BORDER = "focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-border-info";
|
|
4
|
-
declare const FOCUS_RING_WITHIN = "focus-within:border-transparent focus-within:outline-hidden focus-within:ring-2 focus-within:ring-border-info";
|
|
5
|
-
declare const FOCUS_RING_PEER = "peer-focus-visible:border-transparent peer-focus-visible:outline-hidden peer-focus-visible:ring-2 peer-focus-visible:ring-border-info";
|
|
6
|
-
declare const FOCUS_RING_PEER_NO_BORDER = "peer-focus-visible:outline-hidden peer-focus-visible:ring-2 peer-focus-visible:ring-border-info";
|
|
7
|
-
//#endregion
|
|
8
|
-
export { FOCUS_RING, FOCUS_RING_NO_BORDER, FOCUS_RING_PEER, FOCUS_RING_PEER_NO_BORDER, FOCUS_RING_WITHIN };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
//#region src/components/_internal/focus-ring.ts
|
|
2
|
-
const FOCUS_RING = "focus-visible:border-transparent focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-border-info";
|
|
3
|
-
const FOCUS_RING_NO_BORDER = "focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-border-info";
|
|
4
|
-
const FOCUS_RING_WITHIN = "focus-within:border-transparent focus-within:outline-hidden focus-within:ring-2 focus-within:ring-border-info";
|
|
5
|
-
const FOCUS_RING_PEER = "peer-focus-visible:border-transparent peer-focus-visible:outline-hidden peer-focus-visible:ring-2 peer-focus-visible:ring-border-info";
|
|
6
|
-
const FOCUS_RING_PEER_NO_BORDER = "peer-focus-visible:outline-hidden peer-focus-visible:ring-2 peer-focus-visible:ring-border-info";
|
|
7
|
-
//#endregion
|
|
8
|
-
export { FOCUS_RING, FOCUS_RING_NO_BORDER, FOCUS_RING_PEER, FOCUS_RING_PEER_NO_BORDER, FOCUS_RING_WITHIN };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { FC, RefObject } from "react";
|
|
2
|
-
//#region src/components/layout/scroll-linked/scroll-linked.d.ts
|
|
3
|
-
/**
|
|
4
|
-
* ページ(または container)のスクロール進捗バー。
|
|
5
|
-
* CSS scroll-driven animations(animation-timeline: scroll())で描画し、
|
|
6
|
-
* 未対応ブラウザ(Firefox)と container 指定時は同じ見た目を
|
|
7
|
-
* scroll リスナー + ResizeObserver で再現する(named timeline +
|
|
8
|
-
* timeline-scope を任意の外部要素へ配線するより単純で確実なため)。
|
|
9
|
-
*/
|
|
10
|
-
declare const ScrollLinked: FC<{
|
|
11
|
-
container?: RefObject<HTMLElement | null>;
|
|
12
|
-
}>;
|
|
13
|
-
//#endregion
|
|
14
|
-
export { ScrollLinked };
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { cn } from "../../../helpers/cn.mjs";
|
|
3
|
-
import { useEffect, useRef } from "react";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
//#region src/components/layout/scroll-linked/scroll-linked.tsx
|
|
6
|
-
/**
|
|
7
|
-
* ページ(または container)のスクロール進捗バー。
|
|
8
|
-
* CSS scroll-driven animations(animation-timeline: scroll())で描画し、
|
|
9
|
-
* 未対応ブラウザ(Firefox)と container 指定時は同じ見た目を
|
|
10
|
-
* scroll リスナー + ResizeObserver で再現する(named timeline +
|
|
11
|
-
* timeline-scope を任意の外部要素へ配線するより単純で確実なため)。
|
|
12
|
-
*/
|
|
13
|
-
const ScrollLinked = ({ container }) => {
|
|
14
|
-
const barRef = useRef(null);
|
|
15
|
-
useEffect(() => {
|
|
16
|
-
const bar = barRef.current;
|
|
17
|
-
if (!bar) return;
|
|
18
|
-
if (container === void 0 && CSS.supports("animation-timeline", "scroll()")) return;
|
|
19
|
-
let cleanup;
|
|
20
|
-
let retryId;
|
|
21
|
-
const attach = () => {
|
|
22
|
-
if (container?.current === null) {
|
|
23
|
-
retryId = window.setTimeout(attach, 50);
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
const target = container?.current ?? null;
|
|
27
|
-
const scroller = target ?? window;
|
|
28
|
-
const update = () => {
|
|
29
|
-
const scrollTop = target ? target.scrollTop : window.scrollY;
|
|
30
|
-
const scrollable = target ? target.scrollHeight - target.clientHeight : document.documentElement.scrollHeight - window.innerHeight;
|
|
31
|
-
const progress = scrollable > 0 ? scrollTop / scrollable : 0;
|
|
32
|
-
bar.style.scale = `${Math.min(1, Math.max(0, progress)).toString()} 1`;
|
|
33
|
-
};
|
|
34
|
-
update();
|
|
35
|
-
scroller.addEventListener("scroll", update, { passive: true });
|
|
36
|
-
const observer = new ResizeObserver(update);
|
|
37
|
-
observer.observe(target ?? document.documentElement);
|
|
38
|
-
if (target) for (const child of target.children) observer.observe(child);
|
|
39
|
-
window.addEventListener("resize", update);
|
|
40
|
-
cleanup = () => {
|
|
41
|
-
scroller.removeEventListener("scroll", update);
|
|
42
|
-
observer.disconnect();
|
|
43
|
-
window.removeEventListener("resize", update);
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
attach();
|
|
47
|
-
return () => {
|
|
48
|
-
if (retryId !== void 0) window.clearTimeout(retryId);
|
|
49
|
-
cleanup?.();
|
|
50
|
-
};
|
|
51
|
-
}, [container]);
|
|
52
|
-
return /* @__PURE__ */ jsx("div", {
|
|
53
|
-
"aria-hidden": "true",
|
|
54
|
-
className: cn("bg-primary-bg fixed top-0 h-2 origin-left scale-[0_1] inset-x-0", container === void 0 && "ao-scroll-progress"),
|
|
55
|
-
ref: barRef
|
|
56
|
-
});
|
|
57
|
-
};
|
|
58
|
-
//#endregion
|
|
59
|
-
export { ScrollLinked };
|
package/dist/helpers/cn.d.mts
DELETED
package/dist/helpers/cn.mjs
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { clsx } from "clsx";
|
|
2
|
-
import { twMerge } from "tailwind-merge";
|
|
3
|
-
//#region src/helpers/cn.ts
|
|
4
|
-
const cn = (...inputs) => twMerge(clsx(inputs));
|
|
5
|
-
if (import.meta.vitest) describe("cn", () => {
|
|
6
|
-
it("複数のクラス名を空白区切りで結合する", () => {
|
|
7
|
-
expect(cn("flex", "items-center")).toBe("flex items-center");
|
|
8
|
-
});
|
|
9
|
-
it("falsyな値と条件付きクラスを除外する", () => {
|
|
10
|
-
expect(cn("flex", void 0, null, false, {
|
|
11
|
-
hidden: false,
|
|
12
|
-
grow: true
|
|
13
|
-
})).toBe("flex grow");
|
|
14
|
-
});
|
|
15
|
-
it("ネストした配列を展開する", () => {
|
|
16
|
-
expect(cn(["flex", ["items-center"]])).toBe("flex items-center");
|
|
17
|
-
});
|
|
18
|
-
it("競合するTailwindクラスは後勝ちで解決する", () => {
|
|
19
|
-
expect(cn("p-2", "p-4")).toBe("p-4");
|
|
20
|
-
expect(cn("text-sm", "text-lg")).toBe("text-lg");
|
|
21
|
-
});
|
|
22
|
-
it("競合しないクラスはどちらも残す", () => {
|
|
23
|
-
expect(cn("px-2", "py-4")).toBe("px-2 py-4");
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
//#endregion
|
|
27
|
-
export { cn };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useCallback, useSyncExternalStore } from "react";
|
|
3
|
-
//#region src/hooks/breakpoint/index.ts
|
|
4
|
-
const BREAKPOINTS = {
|
|
5
|
-
sm: "40rem",
|
|
6
|
-
md: "48rem",
|
|
7
|
-
lg: "64rem",
|
|
8
|
-
xl: "80rem",
|
|
9
|
-
"2xl": "96rem"
|
|
10
|
-
};
|
|
11
|
-
const useBreakpoint = (breakpoint) => {
|
|
12
|
-
const query = `(min-width: ${BREAKPOINTS[breakpoint]})`;
|
|
13
|
-
const subscribe = useCallback((cb) => {
|
|
14
|
-
const mediaQueryList = window.matchMedia(query);
|
|
15
|
-
mediaQueryList.addEventListener("change", cb);
|
|
16
|
-
return () => {
|
|
17
|
-
mediaQueryList.removeEventListener("change", cb);
|
|
18
|
-
};
|
|
19
|
-
}, [query]);
|
|
20
|
-
const getSnapshot = () => window.matchMedia(query).matches;
|
|
21
|
-
return useSyncExternalStore(subscribe, getSnapshot, () => false);
|
|
22
|
-
};
|
|
23
|
-
//#endregion
|
|
24
|
-
export { useBreakpoint };
|