@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
|
@@ -2,24 +2,24 @@ import { FC, InputHTMLAttributes, Ref } from "react";
|
|
|
2
2
|
//#region src/components/form/number-field/number-field.d.ts
|
|
3
3
|
type BaseProps = {
|
|
4
4
|
invalid?: boolean;
|
|
5
|
+
/** 小数の桁数。省略すると step の桁数に合わせ、step が 'any' なら丸めない */
|
|
5
6
|
precision?: number;
|
|
6
7
|
ref?: Ref<HTMLInputElement>;
|
|
7
8
|
} & Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'role' | 'className' | 'style' | 'value' | 'onChange' | 'defaultValue' | 'children' | 'step' | 'min' | 'max'> & {
|
|
8
|
-
step?: number;
|
|
9
|
-
min?: number;
|
|
10
|
-
max?: number;
|
|
9
|
+
step?: number | 'any';
|
|
10
|
+
min?: number | string;
|
|
11
|
+
max?: number | string;
|
|
11
12
|
};
|
|
12
13
|
type ControlledProps = {
|
|
13
|
-
value: number;
|
|
14
|
-
onChange: (value: number) => void;
|
|
14
|
+
value: number | null;
|
|
15
|
+
onChange: (value: number | null) => void;
|
|
15
16
|
defaultValue?: never;
|
|
16
17
|
};
|
|
17
18
|
type UncontrolledProps = {
|
|
18
|
-
defaultValue?: number;
|
|
19
|
+
defaultValue?: number | string;
|
|
19
20
|
value?: never;
|
|
20
|
-
onChange?: (value: number) => void;
|
|
21
|
+
onChange?: (value: number | null) => void;
|
|
21
22
|
};
|
|
22
23
|
type Props = BaseProps & (ControlledProps | UncontrolledProps);
|
|
23
|
-
declare const NumberField: FC<Props>;
|
|
24
|
-
//#endregion
|
|
25
|
-
export { NumberField };
|
|
24
|
+
export declare const NumberField: FC<Props>;
|
|
25
|
+
//#endregion
|
|
@@ -1,107 +1,179 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
2
|
+
import { getMessages } from "../../../i18n/current.mjs";
|
|
3
|
+
import sr_only_module_default from "../../_internal/sr-only.module.mjs";
|
|
4
|
+
import { mergeRefs } from "../../../helpers/merge-refs.mjs";
|
|
5
|
+
import { ChevronIcon } from "../../icons/lucide.mjs";
|
|
5
6
|
import { chain } from "../../../helpers/chain.mjs";
|
|
6
7
|
import { useControllableState } from "../../../hooks/controllable-state/index.mjs";
|
|
7
|
-
import { ChevronIcon } from "../../icons/lucide.mjs";
|
|
8
8
|
import { toPrecision } from "../../../internal/to-precision.mjs";
|
|
9
9
|
import { clamp } from "../../../internal/clamp.mjs";
|
|
10
10
|
import { cast } from "./cast.mjs";
|
|
11
|
-
import
|
|
11
|
+
import number_field_module_default from "./number-field.module.mjs";
|
|
12
|
+
import { useEffect, useEffectEvent, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
12
13
|
import { useFormStatus } from "react-dom";
|
|
13
14
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
15
|
//#region src/components/form/number-field/number-field.tsx
|
|
15
|
-
const
|
|
16
|
-
|
|
16
|
+
const format = (value, precision) => {
|
|
17
|
+
if (value === null) return "";
|
|
18
|
+
return precision === void 0 ? String(value) : value.toFixed(precision);
|
|
19
|
+
};
|
|
20
|
+
const toBound = (value, fallback) => {
|
|
21
|
+
const bound = value === void 0 || value === "" ? NaN : Number(value);
|
|
22
|
+
return Number.isFinite(bound) ? bound : fallback;
|
|
23
|
+
};
|
|
24
|
+
const decimalsOf = (step) => String(step).split(".")[1]?.length ?? 0;
|
|
25
|
+
const rangeErrorOf = (value, min, max, messages) => {
|
|
26
|
+
if (value !== null && value < min) return messages.numberFieldRangeUnderflow.replace("{min}", String(min));
|
|
27
|
+
if (value !== null && value > max) return messages.numberFieldRangeOverflow.replace("{max}", String(max));
|
|
28
|
+
return "";
|
|
29
|
+
};
|
|
30
|
+
const ownRangeErrors = /* @__PURE__ */ new WeakMap();
|
|
31
|
+
const applyRangeError = (input, error) => {
|
|
32
|
+
if (error !== "") input.setCustomValidity(error);
|
|
33
|
+
else if (input.validationMessage === ownRangeErrors.get(input)) input.setCustomValidity("");
|
|
34
|
+
ownRangeErrors.set(input, error);
|
|
35
|
+
};
|
|
36
|
+
const NumberField = ({ invalid = false, disabled = false, readOnly = false, required = false, value, defaultValue, onChange, onBlur, onKeyDown, ref, step = 1, precision: precisionProp, max: maxProp, min: minProp, onInput, ...rest }) => {
|
|
37
|
+
const messages = getMessages();
|
|
38
|
+
const inputRef = useRef(null);
|
|
39
|
+
const mergedRef = useMemo(() => mergeRefs(inputRef, ref), [ref]);
|
|
40
|
+
const isControlled = value !== void 0;
|
|
41
|
+
const max = toBound(maxProp, Number.MAX_SAFE_INTEGER);
|
|
42
|
+
const min = toBound(minProp, Number.MIN_SAFE_INTEGER);
|
|
43
|
+
const stepSize = step === "any" ? 1 : step;
|
|
44
|
+
const precision = precisionProp ?? (step === "any" ? void 0 : decimalsOf(step));
|
|
45
|
+
const initialValue = typeof defaultValue === "string" ? cast(defaultValue, precision) : defaultValue ?? null;
|
|
17
46
|
const [currentValue, setCurrentValue] = useControllableState({
|
|
18
47
|
value,
|
|
19
|
-
defaultValue:
|
|
48
|
+
defaultValue: initialValue,
|
|
20
49
|
onChange
|
|
21
50
|
});
|
|
22
|
-
const
|
|
23
|
-
|
|
51
|
+
const reportRange = (input, text) => {
|
|
52
|
+
applyRangeError(input, rangeErrorOf(cast(text, precision), min, max, messages));
|
|
53
|
+
};
|
|
54
|
+
const [displayValue, setDisplayValue] = useState(() => format(currentValue, precision));
|
|
55
|
+
const [shownValue, setShownValue] = useState(currentValue);
|
|
24
56
|
const { pending } = useFormStatus();
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
57
|
+
const readOnlyResolved = readOnly || pending;
|
|
58
|
+
if (isControlled && currentValue !== shownValue) {
|
|
59
|
+
setDisplayValue(format(currentValue, precision));
|
|
60
|
+
setShownValue(currentValue);
|
|
28
61
|
}
|
|
29
|
-
|
|
30
|
-
|
|
62
|
+
useLayoutEffect(() => {
|
|
63
|
+
const input = inputRef.current;
|
|
64
|
+
if (input === null) return;
|
|
65
|
+
applyRangeError(input, rangeErrorOf(cast(isControlled ? displayValue : input.value, precision), min, max, messages));
|
|
66
|
+
}, [
|
|
67
|
+
isControlled,
|
|
68
|
+
displayValue,
|
|
69
|
+
precision,
|
|
70
|
+
min,
|
|
71
|
+
max,
|
|
72
|
+
messages
|
|
73
|
+
]);
|
|
74
|
+
const handleReset = useEffectEvent(() => {
|
|
75
|
+
if (!isControlled) setCurrentValue(initialValue);
|
|
76
|
+
});
|
|
77
|
+
const handleRestored = useEffectEvent(() => {
|
|
78
|
+
const input = inputRef.current;
|
|
79
|
+
if (input !== null) reportRange(input, input.value);
|
|
80
|
+
});
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
const form = inputRef.current?.form;
|
|
83
|
+
if (!form) return;
|
|
84
|
+
const listener = () => {
|
|
85
|
+
handleReset();
|
|
86
|
+
setTimeout(() => {
|
|
87
|
+
handleRestored();
|
|
88
|
+
}, 0);
|
|
89
|
+
};
|
|
90
|
+
form.addEventListener("reset", listener);
|
|
91
|
+
return () => {
|
|
92
|
+
form.removeEventListener("reset", listener);
|
|
93
|
+
};
|
|
94
|
+
}, []);
|
|
95
|
+
const commit = (input, next) => {
|
|
96
|
+
const text = format(next, precision);
|
|
97
|
+
const changed = input.value !== text;
|
|
98
|
+
if (isControlled) {
|
|
99
|
+
setDisplayValue(text);
|
|
100
|
+
setShownValue(next);
|
|
101
|
+
}
|
|
102
|
+
input.value = text;
|
|
103
|
+
setCurrentValue(next);
|
|
104
|
+
reportRange(input, text);
|
|
105
|
+
if (changed) input.dispatchEvent(new Event("input", { bubbles: true }));
|
|
106
|
+
};
|
|
107
|
+
const stepBy = (input, delta) => {
|
|
108
|
+
if (readOnlyResolved) return;
|
|
109
|
+
const current = cast(input.value, precision);
|
|
110
|
+
commit(input, current === null ? clamp(0, min, max) : clamp(toPrecision(current + delta, precision), min, max));
|
|
31
111
|
};
|
|
32
112
|
return /* @__PURE__ */ jsxs("div", {
|
|
33
|
-
className:
|
|
113
|
+
className: number_field_module_default.root,
|
|
34
114
|
children: [/* @__PURE__ */ jsx("input", {
|
|
35
115
|
autoComplete: "off",
|
|
36
116
|
autoCorrect: "off",
|
|
37
117
|
inputMode: "decimal",
|
|
38
118
|
...rest,
|
|
119
|
+
...isControlled ? {
|
|
120
|
+
value: displayValue,
|
|
121
|
+
onChange: (e) => {
|
|
122
|
+
if (e.nativeEvent instanceof InputEvent && e.nativeEvent.isComposing) return;
|
|
123
|
+
setDisplayValue(e.target.value);
|
|
124
|
+
}
|
|
125
|
+
} : { defaultValue: format(initialValue, precision) },
|
|
39
126
|
"aria-invalid": invalid,
|
|
40
127
|
"aria-required": required,
|
|
41
128
|
"aria-valuemax": max,
|
|
42
129
|
"aria-valuemin": min,
|
|
43
|
-
"aria-valuenow": currentValue,
|
|
44
|
-
className:
|
|
130
|
+
"aria-valuenow": currentValue ?? void 0,
|
|
131
|
+
className: number_field_module_default.input,
|
|
45
132
|
disabled,
|
|
46
|
-
readOnly:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
133
|
+
readOnly: readOnlyResolved,
|
|
134
|
+
required,
|
|
135
|
+
onInput: chain(onInput, (e) => {
|
|
136
|
+
reportRange(e.currentTarget, e.currentTarget.value);
|
|
137
|
+
}),
|
|
138
|
+
onBlur: chain(onBlur, (e) => {
|
|
139
|
+
const parsed = cast(e.currentTarget.value, precision);
|
|
140
|
+
commit(e.currentTarget, parsed === null ? null : clamp(parsed, min, max));
|
|
51
141
|
}),
|
|
52
|
-
onChange: (e) => {
|
|
53
|
-
if (e.nativeEvent instanceof InputEvent && e.nativeEvent.isComposing) return;
|
|
54
|
-
setDisplayValue(e.target.value);
|
|
55
|
-
},
|
|
56
142
|
onKeyDown: chain(onKeyDown, (e) => {
|
|
57
|
-
if (e.key === "ArrowUp")
|
|
58
|
-
|
|
59
|
-
handleChange(newValue);
|
|
60
|
-
setDisplayValue(newValue.toFixed(precision));
|
|
61
|
-
}
|
|
62
|
-
if (e.key === "ArrowDown") {
|
|
63
|
-
const newValue = clamp(toPrecision(cast(displayValue, precision) - step, precision), min, max);
|
|
64
|
-
handleChange(newValue);
|
|
65
|
-
setDisplayValue(newValue.toFixed(precision));
|
|
66
|
-
}
|
|
143
|
+
if (e.key === "ArrowUp") stepBy(e.currentTarget, stepSize);
|
|
144
|
+
if (e.key === "ArrowDown") stepBy(e.currentTarget, -stepSize);
|
|
67
145
|
}),
|
|
68
|
-
|
|
69
|
-
ref,
|
|
146
|
+
ref: mergedRef,
|
|
70
147
|
role: "spinbutton",
|
|
71
|
-
type: "text"
|
|
72
|
-
value: displayValue
|
|
148
|
+
type: "text"
|
|
73
149
|
}), /* @__PURE__ */ jsxs("div", {
|
|
74
150
|
"aria-hidden": "true",
|
|
75
|
-
className:
|
|
151
|
+
className: number_field_module_default.steppers,
|
|
76
152
|
children: [/* @__PURE__ */ jsxs("button", {
|
|
77
|
-
className:
|
|
78
|
-
disabled: disabled ||
|
|
153
|
+
className: number_field_module_default.step,
|
|
154
|
+
disabled: disabled || readOnlyResolved,
|
|
79
155
|
onClick: () => {
|
|
80
|
-
|
|
81
|
-
handleChange(newValue);
|
|
82
|
-
setDisplayValue(newValue.toFixed(precision));
|
|
156
|
+
if (inputRef.current) stepBy(inputRef.current, stepSize);
|
|
83
157
|
},
|
|
84
158
|
tabIndex: -1,
|
|
85
159
|
type: "button",
|
|
86
160
|
children: [/* @__PURE__ */ jsx("span", {
|
|
87
|
-
className:
|
|
161
|
+
className: sr_only_module_default.srOnly,
|
|
88
162
|
children: messages.numberFieldIncrement
|
|
89
163
|
}), /* @__PURE__ */ jsx(ChevronIcon, {
|
|
90
164
|
direction: "up",
|
|
91
165
|
size: "sm"
|
|
92
166
|
})]
|
|
93
167
|
}), /* @__PURE__ */ jsxs("button", {
|
|
94
|
-
className:
|
|
95
|
-
disabled: disabled ||
|
|
168
|
+
className: number_field_module_default.step,
|
|
169
|
+
disabled: disabled || readOnlyResolved,
|
|
96
170
|
onClick: () => {
|
|
97
|
-
|
|
98
|
-
handleChange(newValue);
|
|
99
|
-
setDisplayValue(newValue.toFixed(precision));
|
|
171
|
+
if (inputRef.current) stepBy(inputRef.current, -stepSize);
|
|
100
172
|
},
|
|
101
173
|
tabIndex: -1,
|
|
102
174
|
type: "button",
|
|
103
175
|
children: [/* @__PURE__ */ jsx("span", {
|
|
104
|
-
className:
|
|
176
|
+
className: sr_only_module_default.srOnly,
|
|
105
177
|
children: messages.numberFieldDecrement
|
|
106
178
|
}), /* @__PURE__ */ jsx(ChevronIcon, {
|
|
107
179
|
direction: "down",
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import './number-field.css';
|
|
2
|
+
//#region src/components/form/number-field/number-field.module.css
|
|
3
|
+
var number_field_module_default = {
|
|
4
|
+
"input": "iUg6Ca_input",
|
|
5
|
+
"root": "iUg6Ca_root",
|
|
6
|
+
"step": "iUg6Ca_step",
|
|
7
|
+
"steppers": "iUg6Ca_steppers"
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { number_field_module_default as default };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
@layer properties, theme, base;
|
|
2
|
+
|
|
3
|
+
@layer components {
|
|
4
|
+
.StCDRW_root {
|
|
5
|
+
border-radius: var(--radius-xl);
|
|
6
|
+
border-width: 1px;
|
|
7
|
+
border-color: var(--color-border-base);
|
|
8
|
+
background-color: var(--color-bg-base);
|
|
9
|
+
align-items: center;
|
|
10
|
+
width: 100%;
|
|
11
|
+
display: flex;
|
|
12
|
+
position: relative;
|
|
13
|
+
|
|
14
|
+
@container style(--writing: vertical) {
|
|
15
|
+
width: auto;
|
|
16
|
+
height: 100%;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.StCDRW_invalid {
|
|
21
|
+
border-color: var(--color-border-error);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.StCDRW_disabled {
|
|
25
|
+
cursor: not-allowed;
|
|
26
|
+
border-color: var(--color-border-mute);
|
|
27
|
+
background-color: var(--color-bg-mute);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.StCDRW_input {
|
|
31
|
+
width: 100%;
|
|
32
|
+
padding-inline: calc(var(--spacing) * 3);
|
|
33
|
+
padding-block: calc(var(--spacing) * 2);
|
|
34
|
+
background-color: #0000;
|
|
35
|
+
flex-grow: 1;
|
|
36
|
+
|
|
37
|
+
@container style(--writing: vertical) {
|
|
38
|
+
width: auto;
|
|
39
|
+
height: 100%;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.StCDRW_input:read-only {
|
|
44
|
+
cursor: not-allowed;
|
|
45
|
+
background-color: var(--color-bg-subtle);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.StCDRW_input:focus-visible {
|
|
49
|
+
outline-style: none;
|
|
50
|
+
|
|
51
|
+
@media (forced-colors: active) {
|
|
52
|
+
outline-offset: 2px;
|
|
53
|
+
outline: 2px solid #0000;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.StCDRW_input:disabled {
|
|
58
|
+
cursor: not-allowed;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.StCDRW_toggle {
|
|
62
|
+
border-radius: var(--radius-md);
|
|
63
|
+
padding: var(--spacing);
|
|
64
|
+
color: var(--color-fg-mute);
|
|
65
|
+
transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke;
|
|
66
|
+
transition-duration: var(--duration-fast);
|
|
67
|
+
transition-timing-function: var(--easing-out);
|
|
68
|
+
flex-shrink: 0;
|
|
69
|
+
justify-content: center;
|
|
70
|
+
align-items: center;
|
|
71
|
+
margin-inline-end: calc(var(--spacing) * 2);
|
|
72
|
+
display: inline-flex;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@media (hover: hover) {
|
|
76
|
+
.StCDRW_toggle:not(.StCDRW_toggleDisabled):hover {
|
|
77
|
+
background-color: var(--color-bg-mute);
|
|
78
|
+
color: var(--color-fg-base);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.StCDRW_toggleDisabled {
|
|
83
|
+
cursor: not-allowed;
|
|
84
|
+
color: var(--color-fg-subtle);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@layer utilities;
|
|
@@ -6,6 +6,5 @@ type Props = {
|
|
|
6
6
|
hideLabel?: string;
|
|
7
7
|
ref?: Ref<HTMLInputElement>;
|
|
8
8
|
} & Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'className' | 'style'>;
|
|
9
|
-
declare const PasswordInput: FC<Props>;
|
|
10
|
-
//#endregion
|
|
11
|
-
export { PasswordInput };
|
|
9
|
+
export declare const PasswordInput: FC<Props>;
|
|
10
|
+
//#endregion
|
|
@@ -1,32 +1,35 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { useMessages } from "../../../i18n/context.mjs";
|
|
5
|
-
import { useDisclosure } from "../../../hooks/disclosure/index.mjs";
|
|
2
|
+
import { getMessages } from "../../../i18n/current.mjs";
|
|
3
|
+
import focus_ring_module_default from "../../_internal/focus-ring.module.mjs";
|
|
6
4
|
import { ViewIcon, ViewOffIcon } from "../../icons/lucide.mjs";
|
|
5
|
+
import password_input_module_default from "./password-input.module.mjs";
|
|
6
|
+
import { clsx } from "clsx";
|
|
7
|
+
import { useState } from "react";
|
|
7
8
|
import { useFormStatus } from "react-dom";
|
|
8
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
10
|
//#region src/components/form/password-input/password-input.tsx
|
|
10
11
|
const PasswordInput = ({ invalid = false, autoComplete = "current-password", showLabel, hideLabel, disabled = false, readOnly, ref, ...rest }) => {
|
|
11
|
-
const messages =
|
|
12
|
-
const
|
|
12
|
+
const messages = getMessages();
|
|
13
|
+
const [isVisible, setIsVisible] = useState(false);
|
|
13
14
|
const { pending } = useFormStatus();
|
|
14
15
|
return /* @__PURE__ */ jsxs("div", {
|
|
15
|
-
className:
|
|
16
|
+
className: clsx(password_input_module_default.root, invalid && password_input_module_default.invalid, (disabled || pending) && password_input_module_default.disabled, focus_ring_module_default.ringWithin),
|
|
16
17
|
children: [/* @__PURE__ */ jsx("input", {
|
|
17
18
|
"aria-invalid": invalid,
|
|
18
19
|
autoComplete,
|
|
19
|
-
className:
|
|
20
|
+
className: password_input_module_default.input,
|
|
20
21
|
disabled,
|
|
21
22
|
readOnly: pending || readOnly,
|
|
22
23
|
ref,
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
...rest,
|
|
25
|
+
type: isVisible ? "text" : "password"
|
|
25
26
|
}), /* @__PURE__ */ jsx("button", {
|
|
26
27
|
"aria-label": isVisible ? hideLabel ?? messages.passwordHide : showLabel ?? messages.passwordShow,
|
|
27
|
-
className:
|
|
28
|
+
className: clsx(password_input_module_default.toggle, focus_ring_module_default.ringNoBorder, (disabled || pending) && password_input_module_default.toggleDisabled),
|
|
28
29
|
disabled: disabled || pending,
|
|
29
|
-
onClick:
|
|
30
|
+
onClick: () => {
|
|
31
|
+
setIsVisible((current) => !current);
|
|
32
|
+
},
|
|
30
33
|
type: "button",
|
|
31
34
|
children: isVisible ? /* @__PURE__ */ jsx(ViewOffIcon, { size: "sm" }) : /* @__PURE__ */ jsx(ViewIcon, { size: "sm" })
|
|
32
35
|
})]
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import './password-input.css';
|
|
2
|
+
//#region src/components/form/password-input/password-input.module.css
|
|
3
|
+
var password_input_module_default = {
|
|
4
|
+
"disabled": "StCDRW_disabled",
|
|
5
|
+
"input": "StCDRW_input",
|
|
6
|
+
"invalid": "StCDRW_invalid",
|
|
7
|
+
"root": "StCDRW_root",
|
|
8
|
+
"toggle": "StCDRW_toggle",
|
|
9
|
+
"toggleDisabled": "StCDRW_toggleDisabled"
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
12
|
+
export { password_input_module_default as default };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
@layer properties, theme, base;
|
|
2
|
+
|
|
3
|
+
@layer components {
|
|
4
|
+
._8JmqZW_root {
|
|
5
|
+
cursor: pointer;
|
|
6
|
+
gap: calc(var(--spacing) * 2);
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
display: flex;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
._8JmqZW_disabled {
|
|
12
|
+
cursor: not-allowed;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
._8JmqZW_option {
|
|
16
|
+
align-items: center;
|
|
17
|
+
gap: calc(var(--spacing) * 2);
|
|
18
|
+
text-align: left;
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
display: flex;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
._8JmqZW_optionDisabled {
|
|
24
|
+
cursor: not-allowed;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
._8JmqZW_circle {
|
|
28
|
+
width: calc(var(--spacing) * 5);
|
|
29
|
+
height: calc(var(--spacing) * 5);
|
|
30
|
+
border-radius: var(--radius-full);
|
|
31
|
+
border-width: 2px;
|
|
32
|
+
border-color: var(--color-border-mute);
|
|
33
|
+
transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke;
|
|
34
|
+
transition-duration: var(--duration-fast);
|
|
35
|
+
transition-timing-function: var(--easing-out);
|
|
36
|
+
justify-content: center;
|
|
37
|
+
align-items: center;
|
|
38
|
+
display: inline-flex;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
._8JmqZW_circleEnabled {
|
|
42
|
+
background-color: var(--color-bg-base);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
._8JmqZW_circleDisabled {
|
|
46
|
+
background-color: var(--color-bg-mute);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
._8JmqZW_input:checked ~ ._8JmqZW_circleEnabled {
|
|
50
|
+
border-color: var(--color-border-base);
|
|
51
|
+
background-color: var(--color-primary-bg);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
._8JmqZW_invalid, ._8JmqZW_input:checked ~ ._8JmqZW_invalid {
|
|
55
|
+
border-color: var(--color-border-error);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
._8JmqZW_input:focus-visible ~ ._8JmqZW_circle {
|
|
59
|
+
box-shadow: var(--shadow-ring-info);
|
|
60
|
+
border-color: #0000;
|
|
61
|
+
outline-style: none;
|
|
62
|
+
|
|
63
|
+
@media (forced-colors: active) {
|
|
64
|
+
outline-offset: 2px;
|
|
65
|
+
outline: 2px solid #0000;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
._8JmqZW_dot {
|
|
70
|
+
width: calc(var(--spacing) * 2);
|
|
71
|
+
height: calc(var(--spacing) * 2);
|
|
72
|
+
border-radius: var(--radius-full);
|
|
73
|
+
background-color: var(--color-primary-border);
|
|
74
|
+
opacity: 0;
|
|
75
|
+
transition-property: opacity;
|
|
76
|
+
transition-duration: var(--duration-fast);
|
|
77
|
+
transition-timing-function: var(--easing-in-out);
|
|
78
|
+
|
|
79
|
+
@media (forced-colors: active) {
|
|
80
|
+
background-color: var(--color-system-canvas-text);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
._8JmqZW_input:checked ~ ._8JmqZW_circle > ._8JmqZW_dot {
|
|
85
|
+
opacity: 1;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@layer utilities;
|
|
@@ -6,6 +6,7 @@ type BaseProps = {
|
|
|
6
6
|
name?: string;
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
invalid?: boolean;
|
|
9
|
+
required?: boolean;
|
|
9
10
|
options: readonly Option[];
|
|
10
11
|
ref?: Ref<HTMLDivElement>;
|
|
11
12
|
} & Omit<HTMLAttributes<HTMLDivElement>, 'role' | 'className' | 'style' | 'children' | 'aria-labelledby' | 'onChange'>;
|
|
@@ -20,6 +21,5 @@ type UncontrolledProps = {
|
|
|
20
21
|
onChange?: (value: string, event: ChangeEvent<HTMLInputElement>) => void;
|
|
21
22
|
};
|
|
22
23
|
type Props = BaseProps & (ControlledProps | UncontrolledProps);
|
|
23
|
-
declare const Radio: FC<Props>;
|
|
24
|
-
//#endregion
|
|
25
|
-
export { Radio };
|
|
24
|
+
export declare const Radio: FC<Props>;
|
|
25
|
+
//#endregion
|
|
@@ -1,47 +1,43 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
2
|
+
import sr_only_module_default from "../../_internal/sr-only.module.mjs";
|
|
3
|
+
import { ignoreClick } from "../../_internal/ignore-changes.mjs";
|
|
4
|
+
import radio_module_default from "./radio.module.mjs";
|
|
5
|
+
import { clsx } from "clsx";
|
|
5
6
|
import { useFormStatus } from "react-dom";
|
|
6
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
8
|
//#region src/components/form/radio/radio.tsx
|
|
8
|
-
const Radio = ({ "aria-labelledby": labelledbyId, name, disabled = false, invalid = false, value, defaultValue, onChange, options, ref, ...rest }) => {
|
|
9
|
-
const [selectedValue, setSelectedValue] = useControllableState({
|
|
10
|
-
value,
|
|
11
|
-
defaultValue
|
|
12
|
-
});
|
|
9
|
+
const Radio = ({ "aria-labelledby": labelledbyId, name, disabled = false, invalid = false, required = false, value, defaultValue, onChange, options, ref, ...rest }) => {
|
|
13
10
|
const { pending } = useFormStatus();
|
|
14
11
|
const isControlled = value !== void 0;
|
|
15
12
|
const disabledResolved = disabled || pending;
|
|
16
|
-
const selectValue = (nextValue, event) => {
|
|
17
|
-
setSelectedValue(nextValue);
|
|
18
|
-
onChange?.(nextValue, event);
|
|
19
|
-
};
|
|
20
13
|
return /* @__PURE__ */ jsx("div", {
|
|
21
14
|
...rest,
|
|
22
15
|
"aria-invalid": invalid,
|
|
23
16
|
"aria-labelledby": labelledbyId,
|
|
24
|
-
className:
|
|
17
|
+
className: clsx(radio_module_default.root, disabledResolved && radio_module_default.disabled),
|
|
25
18
|
ref,
|
|
26
19
|
role: "radiogroup",
|
|
27
20
|
children: options.map((option) => /* @__PURE__ */ jsxs("label", {
|
|
28
|
-
className:
|
|
21
|
+
className: clsx(radio_module_default.option, disabledResolved && radio_module_default.optionDisabled),
|
|
22
|
+
onClickCapture: pending ? ignoreClick : void 0,
|
|
29
23
|
children: [
|
|
30
24
|
/* @__PURE__ */ jsx("input", {
|
|
31
25
|
...isControlled ? { checked: value === option.value } : { defaultChecked: defaultValue === option.value },
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
"aria-disabled": pending || void 0,
|
|
27
|
+
className: clsx(sr_only_module_default.srOnly, radio_module_default.input),
|
|
28
|
+
disabled,
|
|
34
29
|
name: name ?? labelledbyId,
|
|
35
30
|
onChange: (event) => {
|
|
36
|
-
|
|
31
|
+
onChange?.(option.value, event);
|
|
37
32
|
},
|
|
33
|
+
required,
|
|
38
34
|
type: "radio",
|
|
39
35
|
value: option.value
|
|
40
36
|
}),
|
|
41
37
|
/* @__PURE__ */ jsx("span", {
|
|
42
38
|
"aria-hidden": true,
|
|
43
|
-
className:
|
|
44
|
-
children: /* @__PURE__ */ jsx("span", { className:
|
|
39
|
+
className: clsx(radio_module_default.circle, disabledResolved ? radio_module_default.circleDisabled : radio_module_default.circleEnabled, invalid && radio_module_default.invalid),
|
|
40
|
+
children: /* @__PURE__ */ jsx("span", { className: radio_module_default.dot })
|
|
45
41
|
}),
|
|
46
42
|
/* @__PURE__ */ jsx("span", { children: option.label })
|
|
47
43
|
]
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import './radio.css';
|
|
2
|
+
//#region src/components/form/radio/radio.module.css
|
|
3
|
+
var radio_module_default = {
|
|
4
|
+
"circle": "_8JmqZW_circle",
|
|
5
|
+
"circleDisabled": "_8JmqZW_circleDisabled",
|
|
6
|
+
"circleEnabled": "_8JmqZW_circleEnabled",
|
|
7
|
+
"disabled": "_8JmqZW_disabled",
|
|
8
|
+
"dot": "_8JmqZW_dot",
|
|
9
|
+
"input": "_8JmqZW_input",
|
|
10
|
+
"invalid": "_8JmqZW_invalid",
|
|
11
|
+
"option": "_8JmqZW_option",
|
|
12
|
+
"optionDisabled": "_8JmqZW_optionDisabled",
|
|
13
|
+
"root": "_8JmqZW_root"
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { radio_module_default as default };
|