solid-tom-ui 1.0.7 → 1.0.10
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 +246 -246
- package/dist/README.md +246 -0
- package/dist/components/avatar/avatar.js.map +1 -0
- package/dist/components/avatar/index.d.ts +3 -0
- package/{components → dist/components}/avatar/index.d.ts.map +1 -1
- package/dist/components/badge/badge.js.map +1 -0
- package/dist/components/breadcrumb/breadcrumb.js.map +1 -0
- package/dist/components/button/button.js.map +1 -0
- package/dist/components/button/index.d.ts +3 -0
- package/{components → dist/components}/button/index.d.ts.map +1 -1
- package/dist/components/carousel/carousel.js.map +1 -0
- package/dist/components/chat-bubble/chatBubble.js.map +1 -0
- package/dist/components/checkbox/checkbox.js.map +1 -0
- package/dist/components/collapse/collapse.js.map +1 -0
- package/dist/components/collapse/index.d.ts +3 -0
- package/{components → dist/components}/collapse/index.d.ts.map +1 -1
- package/dist/components/context-menu/context-menu.js.map +1 -0
- package/dist/components/context-menu/context-menu.store.js.map +1 -0
- package/dist/components/divider/divider.js.map +1 -0
- package/dist/components/dropdown/dropdown.js.map +1 -0
- package/dist/components/dropdown/dropdown.store.js.map +1 -0
- package/dist/components/float-button/float-button.js.map +1 -0
- package/dist/components/float-button/index.d.ts +3 -0
- package/{components → dist/components}/float-button/index.d.ts.map +1 -1
- package/dist/components/hover-3d-image/hover-3d-image.js.map +1 -0
- package/dist/components/image-preview/image-preview.js.map +1 -0
- package/dist/components/input/index.d.ts +3 -0
- package/dist/components/input/index.d.ts.map +1 -0
- package/dist/components/input/input.js.map +1 -0
- package/dist/components/input/input.utils.js.map +1 -0
- package/dist/components/input/variants/input-color.js.map +1 -0
- package/dist/components/input/variants/input-date.js.map +1 -0
- package/dist/components/input/variants/input-number.js.map +1 -0
- package/dist/components/input/variants/input-otp.js.map +1 -0
- package/dist/components/input/variants/input-password.js.map +1 -0
- package/dist/components/input/variants/input-radio.js.map +1 -0
- package/dist/components/input/variants/input-range.js.map +1 -0
- package/dist/components/input/variants/input-text.js.map +1 -0
- package/dist/components/input/variants/input-textarea.js.map +1 -0
- package/dist/components/loading/loading.js.map +1 -0
- package/dist/components/mansory/mansory.js.map +1 -0
- package/dist/components/menu/index.d.ts +4 -0
- package/{components → dist/components}/menu/index.d.ts.map +1 -1
- package/dist/components/menu/menu.js.map +1 -0
- package/{components → dist/components}/menu/menu.types.d.ts +7 -7
- package/{components → dist/components}/menu/menu.types.d.ts.map +1 -1
- package/dist/components/modal/modal.js.map +1 -0
- package/dist/components/modal/modalContext.js.map +1 -0
- package/dist/components/pagination/pagination.js.map +1 -0
- package/dist/components/progress-bar/progress-bar.js.map +1 -0
- package/dist/components/qr-code/qr-code.js.map +1 -0
- package/dist/components/rating/index.d.ts +3 -0
- package/{components → dist/components}/rating/index.d.ts.map +1 -1
- package/dist/components/select/select.js.map +1 -0
- package/dist/components/select-zone/select-zone.js.map +1 -0
- package/dist/components/skeleton/skeleton.js.map +1 -0
- package/dist/components/slider/index.d.ts +3 -0
- package/{components → dist/components}/slider/index.d.ts.map +1 -1
- package/dist/components/slider/slider.js.map +1 -0
- package/dist/components/splitter/splitter.js.map +1 -0
- package/dist/components/steps/steps.js.map +1 -0
- package/dist/components/swap/swap.js.map +1 -0
- package/dist/components/switch/switch.js.map +1 -0
- package/dist/components/tab/tab.js.map +1 -0
- package/dist/components/table/table.js.map +1 -0
- package/dist/components/timeline/timeline.js.map +1 -0
- package/dist/components/toast/icons/ErrorIcon.js.map +1 -0
- package/dist/components/toast/icons/IconCircle.js.map +1 -0
- package/dist/components/toast/icons/InfoIcon.js.map +1 -0
- package/dist/components/toast/icons/LoaderIcon.js.map +1 -0
- package/dist/components/toast/icons/SuccessIcon.js.map +1 -0
- package/dist/components/toast/icons/WarningIcon.js.map +1 -0
- package/dist/components/toast/toast.js.map +1 -0
- package/dist/components/toast/toast.store.js.map +1 -0
- package/dist/components/tooltip/tooltip.js.map +1 -0
- package/{components → dist/components}/tour/tour.d.ts.map +1 -1
- package/{components → dist/components}/tour/tour.js +1 -1
- package/dist/components/tour/tour.js.map +1 -0
- package/dist/components/upload/upload.js.map +1 -0
- package/dist/components/z-index/z-index.context.js.map +1 -0
- package/dist/components/z-index/z-index.js.map +1 -0
- package/dist/components/z-index/z-index.store.js.map +1 -0
- package/dist/components/z-index/z-index.types.js.map +1 -0
- package/dist/package.json +45 -0
- package/dist/skill/avatar.skill.md.txt +255 -0
- package/dist/skill/badge.skill.md.txt +223 -0
- package/dist/skill/blank.skill.md.txt +0 -0
- package/dist/skill/breadcrumb.skill.md.txt +177 -0
- package/dist/skill/button.skill.md.txt +198 -0
- package/dist/skill/carousel.skill.md.txt +406 -0
- package/dist/skill/chat-bubble.skill.md.txt +342 -0
- package/dist/skill/checkbox.skill.md.txt +326 -0
- package/dist/skill/code-preview.skill.md.txt +240 -0
- package/dist/skill/collapse.skill.md.txt +329 -0
- package/dist/skill/context-menu.skill.md.txt +233 -0
- package/dist/skill/diff.skill.md.txt +244 -0
- package/dist/skill/divider.skill.md.txt +151 -0
- package/dist/skill/doc.skill.md.txt +191 -0
- package/dist/skill/drawer.skill.md.txt +157 -0
- package/dist/skill/dropdown.skill.md.txt +198 -0
- package/dist/skill/float-button.skill.md.txt +315 -0
- package/dist/skill/hover-3d-image.skill.md.txt +120 -0
- package/dist/skill/iframe.skill.md.txt +114 -0
- package/dist/skill/image-preview.skill.md.txt +162 -0
- package/dist/skill/indicator.skill.md.txt +60 -0
- package/dist/skill/input.skill.md.txt +489 -0
- package/dist/skill/loading.skill.md.txt +127 -0
- package/dist/skill/mansory.skill.md.txt +0 -0
- package/dist/skill/menu.skill.md.txt +476 -0
- package/dist/skill/modal.skill.md.txt +359 -0
- package/dist/skill/pagination.skill.md.txt +405 -0
- package/dist/skill/progress-bar.skill.md.txt +207 -0
- package/dist/skill/qr-code.skill.md.txt +136 -0
- package/dist/skill/rating.skill.md.txt +167 -0
- package/dist/skill/select-zone.skill.md.txt +93 -0
- package/dist/skill/select.skill.md.txt +663 -0
- package/dist/skill/skeleton.skill.md.txt +192 -0
- package/dist/skill/slider.skill.md.txt +404 -0
- package/dist/skill/splitter.skill.md.txt +411 -0
- package/dist/skill/steps.skill.md.txt +264 -0
- package/dist/skill/swap.skill.md.txt +139 -0
- package/dist/skill/switch.skill.md.txt +191 -0
- package/dist/skill/tab.skill.md.txt +484 -0
- package/dist/skill/table.example.header.md.txt +667 -0
- package/dist/skill/table.skill.md.txt +1407 -0
- package/dist/skill/text-rotate.skill.md.txt +186 -0
- package/dist/skill/timeline.skill.md.txt +247 -0
- package/dist/skill/toast.skill.md.txt +531 -0
- package/dist/skill/tooltip.skill.md.txt +222 -0
- package/dist/skill/tour.skill.md.txt +156 -0
- package/dist/skill/upload.skill.md.txt +358 -0
- package/dist/skill/z-index.skill.md.txt +0 -0
- package/{solid-ui.css → dist/solid-ui.css} +2 -2
- package/dist/utils/cn.js.map +1 -0
- package/dist/utils/element-tracker.js.map +1 -0
- package/dist/utils/helper.js.map +1 -0
- package/dist/utils/hoc.js.map +1 -0
- package/package.json +101 -7
- package/components/avatar/avatar.js.map +0 -1
- package/components/avatar/index.d.ts +0 -2
- package/components/badge/badge.js.map +0 -1
- package/components/breadcrumb/breadcrumb.js.map +0 -1
- package/components/button/button.js.map +0 -1
- package/components/button/index.d.ts +0 -2
- package/components/carousel/carousel.js.map +0 -1
- package/components/chat-bubble/chatBubble.js.map +0 -1
- package/components/checkbox/checkbox.js.map +0 -1
- package/components/collapse/collapse.js.map +0 -1
- package/components/collapse/index.d.ts +0 -2
- package/components/context-menu/context-menu.js.map +0 -1
- package/components/context-menu/context-menu.store.js.map +0 -1
- package/components/divider/divider.js.map +0 -1
- package/components/dropdown/dropdown.js.map +0 -1
- package/components/dropdown/dropdown.store.js.map +0 -1
- package/components/float-button/float-button.js.map +0 -1
- package/components/float-button/index.d.ts +0 -2
- package/components/hover-3d-image/hover-3d-image.js.map +0 -1
- package/components/image-preview/image-preview.js.map +0 -1
- package/components/input/index.d.ts +0 -2
- package/components/input/index.d.ts.map +0 -1
- package/components/input/input.js.map +0 -1
- package/components/input/input.utils.js.map +0 -1
- package/components/input/variants/input-color.js.map +0 -1
- package/components/input/variants/input-date.js.map +0 -1
- package/components/input/variants/input-number.js.map +0 -1
- package/components/input/variants/input-otp.js.map +0 -1
- package/components/input/variants/input-password.js.map +0 -1
- package/components/input/variants/input-radio.js.map +0 -1
- package/components/input/variants/input-range.js.map +0 -1
- package/components/input/variants/input-text.js.map +0 -1
- package/components/input/variants/input-textarea.js.map +0 -1
- package/components/loading/loading.js.map +0 -1
- package/components/mansory/mansory.js.map +0 -1
- package/components/menu/index.d.ts +0 -4
- package/components/menu/menu.js.map +0 -1
- package/components/modal/modal.js.map +0 -1
- package/components/modal/modalContext.js.map +0 -1
- package/components/pagination/pagination.js.map +0 -1
- package/components/progress-bar/progress-bar.js.map +0 -1
- package/components/qr-code/qr-code.js.map +0 -1
- package/components/rating/index.d.ts +0 -2
- package/components/select/select.js.map +0 -1
- package/components/select-zone/select-zone.js.map +0 -1
- package/components/skeleton/skeleton.js.map +0 -1
- package/components/slider/index.d.ts +0 -2
- package/components/slider/slider.js.map +0 -1
- package/components/splitter/splitter.js.map +0 -1
- package/components/steps/steps.js.map +0 -1
- package/components/swap/swap.js.map +0 -1
- package/components/switch/switch.js.map +0 -1
- package/components/tab/tab.js.map +0 -1
- package/components/table/table.js.map +0 -1
- package/components/timeline/timeline.js.map +0 -1
- package/components/toast/icons/ErrorIcon.js.map +0 -1
- package/components/toast/icons/IconCircle.js.map +0 -1
- package/components/toast/icons/InfoIcon.js.map +0 -1
- package/components/toast/icons/LoaderIcon.js.map +0 -1
- package/components/toast/icons/SuccessIcon.js.map +0 -1
- package/components/toast/icons/WarningIcon.js.map +0 -1
- package/components/toast/toast.js.map +0 -1
- package/components/toast/toast.store.js.map +0 -1
- package/components/tooltip/tooltip.js.map +0 -1
- package/components/tour/tour.js.map +0 -1
- package/components/upload/upload.js.map +0 -1
- package/components/z-index/z-index.context.js.map +0 -1
- package/components/z-index/z-index.js.map +0 -1
- package/components/z-index/z-index.store.js.map +0 -1
- package/components/z-index/z-index.types.js.map +0 -1
- package/utils/cn.js.map +0 -1
- package/utils/element-tracker.js.map +0 -1
- package/utils/helper.js.map +0 -1
- package/utils/hoc.js.map +0 -1
- package/workspace.code-workspace +0 -8
- /package/{components → dist/components}/avatar/avatar.d.ts +0 -0
- /package/{components → dist/components}/avatar/avatar.d.ts.map +0 -0
- /package/{components → dist/components}/avatar/avatar.js +0 -0
- /package/{components → dist/components}/avatar/avatar.types.d.ts +0 -0
- /package/{components → dist/components}/avatar/avatar.types.d.ts.map +0 -0
- /package/{components → dist/components}/badge/badge.d.ts +0 -0
- /package/{components → dist/components}/badge/badge.d.ts.map +0 -0
- /package/{components → dist/components}/badge/badge.js +0 -0
- /package/{components → dist/components}/badge/badge.types.d.ts +0 -0
- /package/{components → dist/components}/badge/badge.types.d.ts.map +0 -0
- /package/{components → dist/components}/badge/index.d.ts +0 -0
- /package/{components → dist/components}/badge/index.d.ts.map +0 -0
- /package/{components → dist/components}/blank/blank.d.ts +0 -0
- /package/{components → dist/components}/blank/blank.d.ts.map +0 -0
- /package/{components → dist/components}/blank/index.d.ts +0 -0
- /package/{components → dist/components}/blank/index.d.ts.map +0 -0
- /package/{components → dist/components}/breadcrumb/breadcrumb.d.ts +0 -0
- /package/{components → dist/components}/breadcrumb/breadcrumb.d.ts.map +0 -0
- /package/{components → dist/components}/breadcrumb/breadcrumb.js +0 -0
- /package/{components → dist/components}/breadcrumb/index.d.ts +0 -0
- /package/{components → dist/components}/breadcrumb/index.d.ts.map +0 -0
- /package/{components → dist/components}/button/button.d.ts +0 -0
- /package/{components → dist/components}/button/button.d.ts.map +0 -0
- /package/{components → dist/components}/button/button.js +0 -0
- /package/{components → dist/components}/button/button.types.d.ts +0 -0
- /package/{components → dist/components}/button/button.types.d.ts.map +0 -0
- /package/{components → dist/components}/carousel/carousel.d.ts +0 -0
- /package/{components → dist/components}/carousel/carousel.d.ts.map +0 -0
- /package/{components → dist/components}/carousel/carousel.js +0 -0
- /package/{components → dist/components}/carousel/carousel.types.d.ts +0 -0
- /package/{components → dist/components}/carousel/carousel.types.d.ts.map +0 -0
- /package/{components → dist/components}/carousel/index.d.ts +0 -0
- /package/{components → dist/components}/carousel/index.d.ts.map +0 -0
- /package/{components → dist/components}/chat-bubble/chatBubble.d.ts +0 -0
- /package/{components → dist/components}/chat-bubble/chatBubble.d.ts.map +0 -0
- /package/{components → dist/components}/chat-bubble/chatBubble.js +0 -0
- /package/{components → dist/components}/chat-bubble/chatBubble.type.d.ts +0 -0
- /package/{components → dist/components}/chat-bubble/chatBubble.type.d.ts.map +0 -0
- /package/{components → dist/components}/chat-bubble/index.d.ts +0 -0
- /package/{components → dist/components}/chat-bubble/index.d.ts.map +0 -0
- /package/{components → dist/components}/checkbox/checkbox.d.ts +0 -0
- /package/{components → dist/components}/checkbox/checkbox.d.ts.map +0 -0
- /package/{components → dist/components}/checkbox/checkbox.js +0 -0
- /package/{components → dist/components}/checkbox/index.d.ts +0 -0
- /package/{components → dist/components}/checkbox/index.d.ts.map +0 -0
- /package/{components → dist/components}/collapse/collapse.d.ts +0 -0
- /package/{components → dist/components}/collapse/collapse.d.ts.map +0 -0
- /package/{components → dist/components}/collapse/collapse.js +0 -0
- /package/{components → dist/components}/collapse/collapse.types.d.ts +0 -0
- /package/{components → dist/components}/collapse/collapse.types.d.ts.map +0 -0
- /package/{components → dist/components}/context-menu/context-menu.d.ts +0 -0
- /package/{components → dist/components}/context-menu/context-menu.d.ts.map +0 -0
- /package/{components → dist/components}/context-menu/context-menu.js +0 -0
- /package/{components → dist/components}/context-menu/context-menu.store.d.ts +0 -0
- /package/{components → dist/components}/context-menu/context-menu.store.d.ts.map +0 -0
- /package/{components → dist/components}/context-menu/context-menu.store.js +0 -0
- /package/{components → dist/components}/context-menu/context-menu.types.d.ts +0 -0
- /package/{components → dist/components}/context-menu/context-menu.types.d.ts.map +0 -0
- /package/{components → dist/components}/context-menu/index.d.ts +0 -0
- /package/{components → dist/components}/context-menu/index.d.ts.map +0 -0
- /package/{components → dist/components}/diff/diff.d.ts +0 -0
- /package/{components → dist/components}/diff/diff.d.ts.map +0 -0
- /package/{components → dist/components}/diff/diff.js +0 -0
- /package/{components → dist/components}/diff/diff.js.map +0 -0
- /package/{components → dist/components}/diff/index.d.ts +0 -0
- /package/{components → dist/components}/diff/index.d.ts.map +0 -0
- /package/{components → dist/components}/divider/divider.d.ts +0 -0
- /package/{components → dist/components}/divider/divider.d.ts.map +0 -0
- /package/{components → dist/components}/divider/divider.js +0 -0
- /package/{components → dist/components}/divider/divider.types.d.ts +0 -0
- /package/{components → dist/components}/divider/divider.types.d.ts.map +0 -0
- /package/{components → dist/components}/divider/index.d.ts +0 -0
- /package/{components → dist/components}/divider/index.d.ts.map +0 -0
- /package/{components → dist/components}/drawer/drawer.d.ts +0 -0
- /package/{components → dist/components}/drawer/drawer.d.ts.map +0 -0
- /package/{components → dist/components}/drawer/drawer.js +0 -0
- /package/{components → dist/components}/drawer/drawer.js.map +0 -0
- /package/{components → dist/components}/drawer/drawer.types.d.ts +0 -0
- /package/{components → dist/components}/drawer/drawer.types.d.ts.map +0 -0
- /package/{components → dist/components}/drawer/index.d.ts +0 -0
- /package/{components → dist/components}/drawer/index.d.ts.map +0 -0
- /package/{components → dist/components}/dropdown/dropdown.d.ts +0 -0
- /package/{components → dist/components}/dropdown/dropdown.d.ts.map +0 -0
- /package/{components → dist/components}/dropdown/dropdown.js +0 -0
- /package/{components → dist/components}/dropdown/dropdown.store.d.ts +0 -0
- /package/{components → dist/components}/dropdown/dropdown.store.d.ts.map +0 -0
- /package/{components → dist/components}/dropdown/dropdown.store.js +0 -0
- /package/{components → dist/components}/dropdown/dropdown.types.d.ts +0 -0
- /package/{components → dist/components}/dropdown/dropdown.types.d.ts.map +0 -0
- /package/{components → dist/components}/dropdown/index.d.ts +0 -0
- /package/{components → dist/components}/dropdown/index.d.ts.map +0 -0
- /package/{components → dist/components}/float-button/float-button.d.ts +0 -0
- /package/{components → dist/components}/float-button/float-button.d.ts.map +0 -0
- /package/{components → dist/components}/float-button/float-button.js +0 -0
- /package/{components → dist/components}/float-button/float-button.types.d.ts +0 -0
- /package/{components → dist/components}/float-button/float-button.types.d.ts.map +0 -0
- /package/{components → dist/components}/hover-3d-image/hover-3d-example.d.ts +0 -0
- /package/{components → dist/components}/hover-3d-image/hover-3d-example.d.ts.map +0 -0
- /package/{components → dist/components}/hover-3d-image/hover-3d-image.d.ts +0 -0
- /package/{components → dist/components}/hover-3d-image/hover-3d-image.d.ts.map +0 -0
- /package/{components → dist/components}/hover-3d-image/hover-3d-image.js +0 -0
- /package/{components → dist/components}/hover-3d-image/index.d.ts +0 -0
- /package/{components → dist/components}/hover-3d-image/index.d.ts.map +0 -0
- /package/{components → dist/components}/image-preview/image-preview.d.ts +0 -0
- /package/{components → dist/components}/image-preview/image-preview.d.ts.map +0 -0
- /package/{components → dist/components}/image-preview/image-preview.js +0 -0
- /package/{components → dist/components}/image-preview/index.d.ts +0 -0
- /package/{components → dist/components}/image-preview/index.d.ts.map +0 -0
- /package/{components → dist/components}/indicator/index.d.ts +0 -0
- /package/{components → dist/components}/indicator/index.d.ts.map +0 -0
- /package/{components → dist/components}/indicator/indicator.d.ts +0 -0
- /package/{components → dist/components}/indicator/indicator.d.ts.map +0 -0
- /package/{components → dist/components}/indicator/indicator.js +0 -0
- /package/{components → dist/components}/indicator/indicator.js.map +0 -0
- /package/{components → dist/components}/indicator/indicator.types.d.ts +0 -0
- /package/{components → dist/components}/indicator/indicator.types.d.ts.map +0 -0
- /package/{components → dist/components}/input/input.d.ts +0 -0
- /package/{components → dist/components}/input/input.d.ts.map +0 -0
- /package/{components → dist/components}/input/input.js +0 -0
- /package/{components → dist/components}/input/input.types.d.ts +0 -0
- /package/{components → dist/components}/input/input.types.d.ts.map +0 -0
- /package/{components → dist/components}/input/input.utils.d.ts +0 -0
- /package/{components → dist/components}/input/input.utils.d.ts.map +0 -0
- /package/{components → dist/components}/input/input.utils.js +0 -0
- /package/{components → dist/components}/input/variants/input-color.d.ts +0 -0
- /package/{components → dist/components}/input/variants/input-color.d.ts.map +0 -0
- /package/{components → dist/components}/input/variants/input-color.js +0 -0
- /package/{components → dist/components}/input/variants/input-date.d.ts +0 -0
- /package/{components → dist/components}/input/variants/input-date.d.ts.map +0 -0
- /package/{components → dist/components}/input/variants/input-date.js +0 -0
- /package/{components → dist/components}/input/variants/input-number.d.ts +0 -0
- /package/{components → dist/components}/input/variants/input-number.d.ts.map +0 -0
- /package/{components → dist/components}/input/variants/input-number.js +0 -0
- /package/{components → dist/components}/input/variants/input-otp.d.ts +0 -0
- /package/{components → dist/components}/input/variants/input-otp.d.ts.map +0 -0
- /package/{components → dist/components}/input/variants/input-otp.js +0 -0
- /package/{components → dist/components}/input/variants/input-password.d.ts +0 -0
- /package/{components → dist/components}/input/variants/input-password.d.ts.map +0 -0
- /package/{components → dist/components}/input/variants/input-password.js +0 -0
- /package/{components → dist/components}/input/variants/input-radio.d.ts +0 -0
- /package/{components → dist/components}/input/variants/input-radio.d.ts.map +0 -0
- /package/{components → dist/components}/input/variants/input-radio.js +0 -0
- /package/{components → dist/components}/input/variants/input-range.d.ts +0 -0
- /package/{components → dist/components}/input/variants/input-range.d.ts.map +0 -0
- /package/{components → dist/components}/input/variants/input-range.js +0 -0
- /package/{components → dist/components}/input/variants/input-text.d.ts +0 -0
- /package/{components → dist/components}/input/variants/input-text.d.ts.map +0 -0
- /package/{components → dist/components}/input/variants/input-text.js +0 -0
- /package/{components → dist/components}/input/variants/input-textarea.d.ts +0 -0
- /package/{components → dist/components}/input/variants/input-textarea.d.ts.map +0 -0
- /package/{components → dist/components}/input/variants/input-textarea.js +0 -0
- /package/{components → dist/components}/loading/index.d.ts +0 -0
- /package/{components → dist/components}/loading/index.d.ts.map +0 -0
- /package/{components → dist/components}/loading/loading.d.ts +0 -0
- /package/{components → dist/components}/loading/loading.d.ts.map +0 -0
- /package/{components → dist/components}/loading/loading.js +0 -0
- /package/{components → dist/components}/mansory/index.d.ts +0 -0
- /package/{components → dist/components}/mansory/index.d.ts.map +0 -0
- /package/{components → dist/components}/mansory/mansory.d.ts +0 -0
- /package/{components → dist/components}/mansory/mansory.d.ts.map +0 -0
- /package/{components → dist/components}/mansory/mansory.js +0 -0
- /package/{components → dist/components}/mansory/mansory.types.d.ts +0 -0
- /package/{components → dist/components}/mansory/mansory.types.d.ts.map +0 -0
- /package/{components → dist/components}/menu/menu.d.ts +0 -0
- /package/{components → dist/components}/menu/menu.d.ts.map +0 -0
- /package/{components → dist/components}/menu/menu.data-example.d.ts +0 -0
- /package/{components → dist/components}/menu/menu.data-example.d.ts.map +0 -0
- /package/{components → dist/components}/menu/menu.js +0 -0
- /package/{components → dist/components}/modal/index.d.ts +0 -0
- /package/{components → dist/components}/modal/index.d.ts.map +0 -0
- /package/{components → dist/components}/modal/modal.d.ts +0 -0
- /package/{components → dist/components}/modal/modal.d.ts.map +0 -0
- /package/{components → dist/components}/modal/modal.js +0 -0
- /package/{components → dist/components}/modal/modalContext.d.ts +0 -0
- /package/{components → dist/components}/modal/modalContext.d.ts.map +0 -0
- /package/{components → dist/components}/modal/modalContext.js +0 -0
- /package/{components → dist/components}/pagination/index.d.ts +0 -0
- /package/{components → dist/components}/pagination/index.d.ts.map +0 -0
- /package/{components → dist/components}/pagination/pagination.d.ts +0 -0
- /package/{components → dist/components}/pagination/pagination.d.ts.map +0 -0
- /package/{components → dist/components}/pagination/pagination.js +0 -0
- /package/{components → dist/components}/pagination/pagination.types.d.ts +0 -0
- /package/{components → dist/components}/pagination/pagination.types.d.ts.map +0 -0
- /package/{components → dist/components}/progress-bar/index.d.ts +0 -0
- /package/{components → dist/components}/progress-bar/index.d.ts.map +0 -0
- /package/{components → dist/components}/progress-bar/progress-bar.d.ts +0 -0
- /package/{components → dist/components}/progress-bar/progress-bar.d.ts.map +0 -0
- /package/{components → dist/components}/progress-bar/progress-bar.js +0 -0
- /package/{components → dist/components}/progress-bar/progress-bar.types.d.ts +0 -0
- /package/{components → dist/components}/progress-bar/progress-bar.types.d.ts.map +0 -0
- /package/{components → dist/components}/qr-code/index.d.ts +0 -0
- /package/{components → dist/components}/qr-code/index.d.ts.map +0 -0
- /package/{components → dist/components}/qr-code/qr-code.d.ts +0 -0
- /package/{components → dist/components}/qr-code/qr-code.d.ts.map +0 -0
- /package/{components → dist/components}/qr-code/qr-code.js +0 -0
- /package/{components → dist/components}/qr-code/qr-code.types.d.ts +0 -0
- /package/{components → dist/components}/qr-code/qr-code.types.d.ts.map +0 -0
- /package/{components → dist/components}/rating/rating.d.ts +0 -0
- /package/{components → dist/components}/rating/rating.d.ts.map +0 -0
- /package/{components → dist/components}/rating/rating.js +0 -0
- /package/{components → dist/components}/rating/rating.js.map +0 -0
- /package/{components → dist/components}/rating/rating.types.d.ts +0 -0
- /package/{components → dist/components}/rating/rating.types.d.ts.map +0 -0
- /package/{components → dist/components}/select/index.d.ts +0 -0
- /package/{components → dist/components}/select/index.d.ts.map +0 -0
- /package/{components → dist/components}/select/select.d.ts +0 -0
- /package/{components → dist/components}/select/select.d.ts.map +0 -0
- /package/{components → dist/components}/select/select.js +0 -0
- /package/{components → dist/components}/select/select.types.d.ts +0 -0
- /package/{components → dist/components}/select/select.types.d.ts.map +0 -0
- /package/{components → dist/components}/select-zone/index.d.ts +0 -0
- /package/{components → dist/components}/select-zone/index.d.ts.map +0 -0
- /package/{components → dist/components}/select-zone/select-zone.d.ts +0 -0
- /package/{components → dist/components}/select-zone/select-zone.d.ts.map +0 -0
- /package/{components → dist/components}/select-zone/select-zone.js +0 -0
- /package/{components → dist/components}/select-zone/select-zone.types.d.ts +0 -0
- /package/{components → dist/components}/select-zone/select-zone.types.d.ts.map +0 -0
- /package/{components → dist/components}/skeleton/index.d.ts +0 -0
- /package/{components → dist/components}/skeleton/index.d.ts.map +0 -0
- /package/{components → dist/components}/skeleton/skeleton.d.ts +0 -0
- /package/{components → dist/components}/skeleton/skeleton.d.ts.map +0 -0
- /package/{components → dist/components}/skeleton/skeleton.js +0 -0
- /package/{components → dist/components}/slider/slider.d.ts +0 -0
- /package/{components → dist/components}/slider/slider.d.ts.map +0 -0
- /package/{components → dist/components}/slider/slider.js +0 -0
- /package/{components → dist/components}/slider/slider.types.d.ts +0 -0
- /package/{components → dist/components}/slider/slider.types.d.ts.map +0 -0
- /package/{components → dist/components}/splitter/index.d.ts +0 -0
- /package/{components → dist/components}/splitter/index.d.ts.map +0 -0
- /package/{components → dist/components}/splitter/splitter.d.ts +0 -0
- /package/{components → dist/components}/splitter/splitter.d.ts.map +0 -0
- /package/{components → dist/components}/splitter/splitter.js +0 -0
- /package/{components → dist/components}/splitter/splitter.types.d.ts +0 -0
- /package/{components → dist/components}/splitter/splitter.types.d.ts.map +0 -0
- /package/{components → dist/components}/steps/index.d.ts +0 -0
- /package/{components → dist/components}/steps/index.d.ts.map +0 -0
- /package/{components → dist/components}/steps/steps.d.ts +0 -0
- /package/{components → dist/components}/steps/steps.d.ts.map +0 -0
- /package/{components → dist/components}/steps/steps.js +0 -0
- /package/{components → dist/components}/swap/index.d.ts +0 -0
- /package/{components → dist/components}/swap/index.d.ts.map +0 -0
- /package/{components → dist/components}/swap/swap.d.ts +0 -0
- /package/{components → dist/components}/swap/swap.d.ts.map +0 -0
- /package/{components → dist/components}/swap/swap.js +0 -0
- /package/{components → dist/components}/switch/index.d.ts +0 -0
- /package/{components → dist/components}/switch/index.d.ts.map +0 -0
- /package/{components → dist/components}/switch/switch.d.ts +0 -0
- /package/{components → dist/components}/switch/switch.d.ts.map +0 -0
- /package/{components → dist/components}/switch/switch.js +0 -0
- /package/{components → dist/components}/switch/switch.types.d.ts +0 -0
- /package/{components → dist/components}/switch/switch.types.d.ts.map +0 -0
- /package/{components → dist/components}/tab/index.d.ts +0 -0
- /package/{components → dist/components}/tab/index.d.ts.map +0 -0
- /package/{components → dist/components}/tab/tab.d.ts +0 -0
- /package/{components → dist/components}/tab/tab.d.ts.map +0 -0
- /package/{components → dist/components}/tab/tab.js +0 -0
- /package/{components → dist/components}/tab/tab.types.d.ts +0 -0
- /package/{components → dist/components}/tab/tab.types.d.ts.map +0 -0
- /package/{components → dist/components}/table/index.d.ts +0 -0
- /package/{components → dist/components}/table/index.d.ts.map +0 -0
- /package/{components → dist/components}/table/index.js +0 -0
- /package/{components → dist/components}/table/table.d.ts +0 -0
- /package/{components → dist/components}/table/table.d.ts.map +0 -0
- /package/{components → dist/components}/table/table.js +0 -0
- /package/{components → dist/components}/table/table.types.d.ts +0 -0
- /package/{components → dist/components}/table/table.types.d.ts.map +0 -0
- /package/{components → dist/components}/text-rotate/index.d.ts +0 -0
- /package/{components → dist/components}/text-rotate/index.d.ts.map +0 -0
- /package/{components → dist/components}/text-rotate/text-rotate.d.ts +0 -0
- /package/{components → dist/components}/text-rotate/text-rotate.d.ts.map +0 -0
- /package/{components → dist/components}/text-rotate/text-rotate.js +0 -0
- /package/{components → dist/components}/text-rotate/text-rotate.js.map +0 -0
- /package/{components → dist/components}/timeline/index.d.ts +0 -0
- /package/{components → dist/components}/timeline/index.d.ts.map +0 -0
- /package/{components → dist/components}/timeline/timeline.d.ts +0 -0
- /package/{components → dist/components}/timeline/timeline.d.ts.map +0 -0
- /package/{components → dist/components}/timeline/timeline.js +0 -0
- /package/{components → dist/components}/timeline/timeline.types.d.ts +0 -0
- /package/{components → dist/components}/timeline/timeline.types.d.ts.map +0 -0
- /package/{components → dist/components}/toast/icons/ErrorIcon.d.ts +0 -0
- /package/{components → dist/components}/toast/icons/ErrorIcon.d.ts.map +0 -0
- /package/{components → dist/components}/toast/icons/ErrorIcon.js +0 -0
- /package/{components → dist/components}/toast/icons/IconCircle.d.ts +0 -0
- /package/{components → dist/components}/toast/icons/IconCircle.d.ts.map +0 -0
- /package/{components → dist/components}/toast/icons/IconCircle.js +0 -0
- /package/{components → dist/components}/toast/icons/InfoIcon.d.ts +0 -0
- /package/{components → dist/components}/toast/icons/InfoIcon.d.ts.map +0 -0
- /package/{components → dist/components}/toast/icons/InfoIcon.js +0 -0
- /package/{components → dist/components}/toast/icons/LoaderIcon.d.ts +0 -0
- /package/{components → dist/components}/toast/icons/LoaderIcon.d.ts.map +0 -0
- /package/{components → dist/components}/toast/icons/LoaderIcon.js +0 -0
- /package/{components → dist/components}/toast/icons/SuccessIcon.d.ts +0 -0
- /package/{components → dist/components}/toast/icons/SuccessIcon.d.ts.map +0 -0
- /package/{components → dist/components}/toast/icons/SuccessIcon.js +0 -0
- /package/{components → dist/components}/toast/icons/WarningIcon.d.ts +0 -0
- /package/{components → dist/components}/toast/icons/WarningIcon.d.ts.map +0 -0
- /package/{components → dist/components}/toast/icons/WarningIcon.js +0 -0
- /package/{components → dist/components}/toast/icons/index.d.ts +0 -0
- /package/{components → dist/components}/toast/icons/index.d.ts.map +0 -0
- /package/{components → dist/components}/toast/index.d.ts +0 -0
- /package/{components → dist/components}/toast/index.d.ts.map +0 -0
- /package/{components → dist/components}/toast/toast.d.ts +0 -0
- /package/{components → dist/components}/toast/toast.d.ts.map +0 -0
- /package/{components → dist/components}/toast/toast.js +0 -0
- /package/{components → dist/components}/toast/toast.store.d.ts +0 -0
- /package/{components → dist/components}/toast/toast.store.d.ts.map +0 -0
- /package/{components → dist/components}/toast/toast.store.js +0 -0
- /package/{components → dist/components}/toast/toast.type.d.ts +0 -0
- /package/{components → dist/components}/toast/toast.type.d.ts.map +0 -0
- /package/{components → dist/components}/tooltip/index.d.ts +0 -0
- /package/{components → dist/components}/tooltip/index.d.ts.map +0 -0
- /package/{components → dist/components}/tooltip/tooltip.d.ts +0 -0
- /package/{components → dist/components}/tooltip/tooltip.d.ts.map +0 -0
- /package/{components → dist/components}/tooltip/tooltip.js +0 -0
- /package/{components → dist/components}/tooltip/tooltip.types.d.ts +0 -0
- /package/{components → dist/components}/tooltip/tooltip.types.d.ts.map +0 -0
- /package/{components → dist/components}/tour/index.d.ts +0 -0
- /package/{components → dist/components}/tour/index.d.ts.map +0 -0
- /package/{components → dist/components}/tour/tour.d.ts +0 -0
- /package/{components → dist/components}/tour/tour.types.d.ts +0 -0
- /package/{components → dist/components}/tour/tour.types.d.ts.map +0 -0
- /package/{components → dist/components}/upload/index.d.ts +0 -0
- /package/{components → dist/components}/upload/index.d.ts.map +0 -0
- /package/{components → dist/components}/upload/upload.d.ts +0 -0
- /package/{components → dist/components}/upload/upload.d.ts.map +0 -0
- /package/{components → dist/components}/upload/upload.js +0 -0
- /package/{components → dist/components}/upload/upload.types.d.ts +0 -0
- /package/{components → dist/components}/upload/upload.types.d.ts.map +0 -0
- /package/{components → dist/components}/z-index/index.d.ts +0 -0
- /package/{components → dist/components}/z-index/index.d.ts.map +0 -0
- /package/{components → dist/components}/z-index/z-index.context.d.ts +0 -0
- /package/{components → dist/components}/z-index/z-index.context.d.ts.map +0 -0
- /package/{components → dist/components}/z-index/z-index.context.js +0 -0
- /package/{components → dist/components}/z-index/z-index.d.ts +0 -0
- /package/{components → dist/components}/z-index/z-index.d.ts.map +0 -0
- /package/{components → dist/components}/z-index/z-index.js +0 -0
- /package/{components → dist/components}/z-index/z-index.store.d.ts +0 -0
- /package/{components → dist/components}/z-index/z-index.store.d.ts.map +0 -0
- /package/{components → dist/components}/z-index/z-index.store.js +0 -0
- /package/{components → dist/components}/z-index/z-index.types.d.ts +0 -0
- /package/{components → dist/components}/z-index/z-index.types.d.ts.map +0 -0
- /package/{components → dist/components}/z-index/z-index.types.js +0 -0
- /package/{lib.d.ts → dist/lib.d.ts} +0 -0
- /package/{lib.d.ts.map → dist/lib.d.ts.map} +0 -0
- /package/{lib.js → dist/lib.js} +0 -0
- /package/{type.d.ts → dist/type.d.ts} +0 -0
- /package/{type.d.ts.map → dist/type.d.ts.map} +0 -0
- /package/{utils → dist/utils}/cn.d.ts +0 -0
- /package/{utils → dist/utils}/cn.d.ts.map +0 -0
- /package/{utils → dist/utils}/cn.js +0 -0
- /package/{utils → dist/utils}/element-tracker.js +0 -0
- /package/{utils → dist/utils}/helper.d.ts +0 -0
- /package/{utils → dist/utils}/helper.d.ts.map +0 -0
- /package/{utils → dist/utils}/helper.js +0 -0
- /package/{utils → dist/utils}/hoc.js +0 -0
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
## COMPONENT IDENTITY
|
|
2
|
+
- **Import**: `import { ChatBubble } from 'solid-tom-ui';`
|
|
3
|
+
- **Export**: `ChatBubble` (named export)
|
|
4
|
+
- **Framework**: SolidJS
|
|
5
|
+
- **Purpose**: Chat message bubble — NOT a `ParentComponent`; all content passed via props
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## TYPE SIGNATURE
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
type ChatBubbleProps = {
|
|
13
|
+
bubble: SolidComponent; // REQUIRED — main message content
|
|
14
|
+
align?: 'start' | 'end'; // message side; no default applied in component
|
|
15
|
+
color?: BaseColorProps; // bubble background color
|
|
16
|
+
avatar?: SolidComponent; // avatar displayed beside the bubble
|
|
17
|
+
header?: SolidComponent; // content above the bubble (name, timestamp, etc.)
|
|
18
|
+
footer?: SolidComponent; // intended for status below bubble — see BUG note
|
|
19
|
+
class?: {
|
|
20
|
+
avatar?: string; // extra classes on .chat-image wrapper
|
|
21
|
+
bubble?: string; // extra classes on .chat-bubble wrapper
|
|
22
|
+
header?: string; // extra classes on .chat-header wrapper
|
|
23
|
+
footer?: string; // extra classes on .chat-footer wrapper
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
// BaseColorProps:
|
|
28
|
+
type BaseColorProps =
|
|
29
|
+
| 'default' | 'neutral' | 'primary' | 'secondary' | 'accent'
|
|
30
|
+
| 'info' | 'success' | 'warning' | 'error';
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## PROP REFERENCE
|
|
36
|
+
|
|
37
|
+
| Prop | Type | Required | Description |
|
|
38
|
+
|----------------|------------------|----------|-----------------------------------------------------------------------------------------------|
|
|
39
|
+
| `bubble` | `SolidComponent` | ✅ YES | Main message body — rendered inside `.chat-bubble` div |
|
|
40
|
+
| `align` | `'start' \| 'end'` | ❌ NO | `'start'` = left side (received); `'end'` = right side (sent). No default — omitting applies no alignment class |
|
|
41
|
+
| `color` | `BaseColorProps` | ❌ NO | Background color of the bubble |
|
|
42
|
+
| `avatar` | `SolidComponent` | ❌ NO | Rendered inside `.chat-image` — only shown when truthy (via `<Show>`) |
|
|
43
|
+
| `header` | `SolidComponent` | ❌ NO | Rendered inside `.chat-header` above the bubble — only shown when truthy |
|
|
44
|
+
| `footer` | `SolidComponent` | ❌ NO | **⚠️ BUG**: renders `bubble` content instead of `footer` — see bug section below |
|
|
45
|
+
| `class.avatar` | `string` | ❌ NO | Extra classes on `.chat-image` wrapper div |
|
|
46
|
+
| `class.bubble` | `string` | ❌ NO | Extra classes on `.chat-bubble` wrapper div |
|
|
47
|
+
| `class.header` | `string` | ❌ NO | Extra classes on `.chat-header` wrapper div |
|
|
48
|
+
| `class.footer` | `string` | ❌ NO | Extra classes on `.chat-footer` wrapper div |
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## ⚠️ KNOWN BUG — `footer` renders `bubble` content
|
|
53
|
+
|
|
54
|
+
In the current source (`chatBubble.tsx` line 43), the `.chat-footer` div renders `props.bubble` instead of `props.footer`:
|
|
55
|
+
|
|
56
|
+
```tsx
|
|
57
|
+
// Source code (line 43) — BUG:
|
|
58
|
+
<div class={cn('chat-footer', props.class?.footer)}>{props.bubble as Element}</div>
|
|
59
|
+
// ^^^^^^ should be props.footer
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**Impact for agents:**
|
|
63
|
+
- The `footer` prop controls **visibility only** (via `<Show when={props.footer}>`) — if `footer` is truthy, the `.chat-footer` div renders with `bubble` content inside
|
|
64
|
+
- The actual `footer` JSX value is **never rendered**
|
|
65
|
+
- Do NOT rely on `footer` prop to display delivery status, timestamps, or any footer-specific content — it will show the bubble text instead
|
|
66
|
+
- Until fixed, avoid using `footer` for any meaningful content
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## COLOR REFERENCE
|
|
71
|
+
|
|
72
|
+
| Value | DaisyUI class |
|
|
73
|
+
|---------------|---------------------------|
|
|
74
|
+
| `'default'` | *(no class)* |
|
|
75
|
+
| `'neutral'` | `chat-bubble-neutral` |
|
|
76
|
+
| `'primary'` | `chat-bubble-primary` |
|
|
77
|
+
| `'secondary'` | `chat-bubble-secondary` |
|
|
78
|
+
| `'accent'` | `chat-bubble-accent` |
|
|
79
|
+
| `'info'` | `chat-bubble-info` |
|
|
80
|
+
| `'success'` | `chat-bubble-success` |
|
|
81
|
+
| `'warning'` | `chat-bubble-warning` |
|
|
82
|
+
| `'error'` | `chat-bubble-error` |
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## INTERNAL DOM STRUCTURE
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
<div class="chat chat-start|chat-end">
|
|
90
|
+
│
|
|
91
|
+
├── <Show when={avatar}>
|
|
92
|
+
│ <div class="chat-image [class.avatar]">
|
|
93
|
+
│ {avatar}
|
|
94
|
+
│ </div>
|
|
95
|
+
│ </Show>
|
|
96
|
+
│
|
|
97
|
+
├── <Show when={header}>
|
|
98
|
+
│ <div class="chat-header [class.header]">
|
|
99
|
+
│ {header}
|
|
100
|
+
│ </div>
|
|
101
|
+
│ </Show>
|
|
102
|
+
│
|
|
103
|
+
├── <Show when={bubble}>
|
|
104
|
+
│ <div class="chat-bubble chat-bubble-{color} [class.bubble]">
|
|
105
|
+
│ {bubble}
|
|
106
|
+
│ </div>
|
|
107
|
+
│ </Show>
|
|
108
|
+
│
|
|
109
|
+
└── <Show when={footer}>
|
|
110
|
+
<div class="chat-footer [class.footer]">
|
|
111
|
+
{bubble} ← ⚠️ BUG: renders bubble, not footer
|
|
112
|
+
</div>
|
|
113
|
+
</Show>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
All four sections (`avatar`, `header`, `bubble`, `footer`) are independently conditional via `<Show>`.
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## ALIGN BEHAVIOR
|
|
121
|
+
|
|
122
|
+
| `align` | DaisyUI class | Visual placement | Typical use |
|
|
123
|
+
|-------------|----------------|------------------------|--------------------------|
|
|
124
|
+
| `'start'` | `chat-start` | Left side of container | Received / incoming msg |
|
|
125
|
+
| `'end'` | `chat-end` | Right side of container | Sent / outgoing msg |
|
|
126
|
+
| *(omitted)* | *(none)* | Browser default | Avoid — renders unstyled |
|
|
127
|
+
|
|
128
|
+
Always pass `align` explicitly. Omitting it leaves the chat div without a positioning class.
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## AVATAR INTEGRATION
|
|
133
|
+
|
|
134
|
+
`avatar` accepts any `SolidComponent`. Typically used with the `Avatar` component from `@/components/avatar/avatar`:
|
|
135
|
+
|
|
136
|
+
```tsx
|
|
137
|
+
import { Avatar } from 'solid-tom-ui';
|
|
138
|
+
|
|
139
|
+
// Image avatar
|
|
140
|
+
<ChatBubble
|
|
141
|
+
align="start"
|
|
142
|
+
avatar={<Avatar image="/profile.webp" width={40} />}
|
|
143
|
+
bubble={<span>Hello!</span>}
|
|
144
|
+
/>
|
|
145
|
+
|
|
146
|
+
// Placeholder avatar (initials)
|
|
147
|
+
<ChatBubble
|
|
148
|
+
align="end"
|
|
149
|
+
avatar={
|
|
150
|
+
<Avatar
|
|
151
|
+
width={36}
|
|
152
|
+
placeholder={
|
|
153
|
+
<div class="bg-primary text-primary-content flex h-9 w-9 items-center justify-center rounded-full">
|
|
154
|
+
<span class="text-sm font-bold">JD</span>
|
|
155
|
+
</div>
|
|
156
|
+
}
|
|
157
|
+
/>
|
|
158
|
+
}
|
|
159
|
+
bubble={<span>Message from JD</span>}
|
|
160
|
+
/>
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## USAGE PATTERNS
|
|
166
|
+
|
|
167
|
+
### Pattern 1 — Minimal (bubble only)
|
|
168
|
+
```tsx
|
|
169
|
+
<ChatBubble
|
|
170
|
+
align="start"
|
|
171
|
+
color="neutral"
|
|
172
|
+
bubble={<span>Hi there!</span>}
|
|
173
|
+
/>
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Pattern 2 — With avatar
|
|
177
|
+
```tsx
|
|
178
|
+
<ChatBubble
|
|
179
|
+
align="start"
|
|
180
|
+
color="neutral"
|
|
181
|
+
avatar={<Avatar image="/user.webp" width={40} />}
|
|
182
|
+
bubble={<span>Hello! How can I help?</span>}
|
|
183
|
+
/>
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Pattern 3 — With header (name + timestamp)
|
|
187
|
+
```tsx
|
|
188
|
+
<ChatBubble
|
|
189
|
+
align="start"
|
|
190
|
+
color="info"
|
|
191
|
+
avatar={<Avatar image="/user.webp" width={40} />}
|
|
192
|
+
header={
|
|
193
|
+
<div class="flex items-center gap-2">
|
|
194
|
+
<span class="font-bold">Alice</span>
|
|
195
|
+
<time class="text-xs opacity-50">12:45</time>
|
|
196
|
+
</div>
|
|
197
|
+
}
|
|
198
|
+
bubble={<span>Did you see the latest update?</span>}
|
|
199
|
+
/>
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### Pattern 4 — Rich bubble content (multiline)
|
|
203
|
+
```tsx
|
|
204
|
+
<ChatBubble
|
|
205
|
+
align="end"
|
|
206
|
+
color="primary"
|
|
207
|
+
bubble={
|
|
208
|
+
<div>
|
|
209
|
+
<p>Good morning!</p>
|
|
210
|
+
<p class="mt-1">Sure, I'll take a look right now.</p>
|
|
211
|
+
</div>
|
|
212
|
+
}
|
|
213
|
+
/>
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### Pattern 5 — Full conversation layout
|
|
217
|
+
```tsx
|
|
218
|
+
<div class="bg-base-200 max-w-xl space-y-2 rounded-lg p-4">
|
|
219
|
+
<ChatBubble
|
|
220
|
+
align="start"
|
|
221
|
+
color="neutral"
|
|
222
|
+
avatar={<Avatar image="/customer.webp" width={36} />}
|
|
223
|
+
header={<span class="text-sm font-bold">Customer</span>}
|
|
224
|
+
bubble={<span>Hi, I have a question about my order.</span>}
|
|
225
|
+
/>
|
|
226
|
+
<ChatBubble
|
|
227
|
+
align="end"
|
|
228
|
+
color="info"
|
|
229
|
+
avatar={
|
|
230
|
+
<Avatar
|
|
231
|
+
width={36}
|
|
232
|
+
placeholder={
|
|
233
|
+
<div class="bg-info text-info-content flex h-9 w-9 items-center justify-center rounded-full">
|
|
234
|
+
<span class="text-sm">CS</span>
|
|
235
|
+
</div>
|
|
236
|
+
}
|
|
237
|
+
/>
|
|
238
|
+
}
|
|
239
|
+
header={<span class="text-sm font-bold">Support</span>}
|
|
240
|
+
bubble={<span>Hello! What's your order number?</span>}
|
|
241
|
+
/>
|
|
242
|
+
</div>
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Pattern 6 — Rendering a list of messages from data
|
|
246
|
+
```tsx
|
|
247
|
+
type Message = {
|
|
248
|
+
id: string;
|
|
249
|
+
text: string;
|
|
250
|
+
sender: 'me' | 'other';
|
|
251
|
+
senderName: string;
|
|
252
|
+
time: string;
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
<For each={messages()}>
|
|
256
|
+
{msg => (
|
|
257
|
+
<ChatBubble
|
|
258
|
+
align={msg.sender === 'me' ? 'end' : 'start'}
|
|
259
|
+
color={msg.sender === 'me' ? 'primary' : 'neutral'}
|
|
260
|
+
header={
|
|
261
|
+
<div class="flex items-center gap-2">
|
|
262
|
+
<span class="font-bold">{msg.senderName}</span>
|
|
263
|
+
<time class="text-xs opacity-50">{msg.time}</time>
|
|
264
|
+
</div>
|
|
265
|
+
}
|
|
266
|
+
bubble={<span>{msg.text}</span>}
|
|
267
|
+
/>
|
|
268
|
+
)}
|
|
269
|
+
</For>
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
## BEHAVIOR NOTES FOR AGENTS
|
|
275
|
+
|
|
276
|
+
1. **`bubble` is the only required prop** — but always pass `align` explicitly to control message side. Without `align`, the bubble renders without a positioning class.
|
|
277
|
+
|
|
278
|
+
2. **All optional sections are independently conditional** — `avatar`, `header`, `footer` each use `<Show when={prop}>`. Falsy values (`undefined`, `null`, `false`, empty string) cause their section to be unmounted entirely.
|
|
279
|
+
|
|
280
|
+
3. **`bubble` accepts any JSX** — string, `<span>`, `<div>` with multiline content, images, etc. The `.chat-bubble` div wraps whatever is passed.
|
|
281
|
+
|
|
282
|
+
4. **`footer` prop is broken** — see bug section. The footer visibility toggle works (via `<Show>`), but the content rendered is `bubble`, not `footer`. Do not use `footer` in production UI until fixed.
|
|
283
|
+
|
|
284
|
+
5. **Component renders inside a `<>` fragment** — the root `<div class="chat">` is not the component root; it's wrapped in a fragment. This has no practical impact but means the component emits no additional wrapper element.
|
|
285
|
+
|
|
286
|
+
6. **Convention for conversation UIs** — wrap multiple `ChatBubble` components in a `<div class="space-y-2">` container. Use `max-w-xl` or similar to constrain chat width.
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
## COMMON MISTAKES TO AVOID
|
|
291
|
+
|
|
292
|
+
| Mistake | Correct approach |
|
|
293
|
+
|---|---|
|
|
294
|
+
| Omitting `align` prop | Always pass `align="start"` or `align="end"` explicitly |
|
|
295
|
+
| Using `footer` prop expecting custom footer content | `footer` has a bug — it renders `bubble` content instead; avoid until fixed |
|
|
296
|
+
| Passing `align` as a reactive signal without accessor | Pass signal accessor: `align={message.isOwn ? 'end' : 'start'}` |
|
|
297
|
+
| Putting children inside `<ChatBubble>` | Component is NOT a `ParentComponent` — use `bubble` prop instead |
|
|
298
|
+
| Omitting `color` and expecting styled bubble | Without `color`, bubble uses DaisyUI default (no color class) |
|
|
299
|
+
| Forgetting `space-y-2` wrapper for conversation | Multiple bubbles need spacing — wrap in `<div class="space-y-2">` |
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
## FULL EXAMPLE — Complete chat UI
|
|
304
|
+
|
|
305
|
+
```tsx
|
|
306
|
+
import { ChatBubble } from 'solid-tom-ui';
|
|
307
|
+
import { Avatar } from 'solid-tom-ui';
|
|
308
|
+
import { For } from 'solid-js';
|
|
309
|
+
|
|
310
|
+
const messages = [
|
|
311
|
+
{ id: '1', sender: 'other', name: 'Alice', time: '12:44', text: 'Hey! Are you free today?' },
|
|
312
|
+
{ id: '2', sender: 'me', name: 'You', time: '12:45', text: 'Yes, what's up?' },
|
|
313
|
+
{ id: '3', sender: 'other', name: 'Alice', time: '12:45', text: 'Want to grab lunch?' },
|
|
314
|
+
{ id: '4', sender: 'me', name: 'You', time: '12:46', text: 'Sure! Where do you want to go?' },
|
|
315
|
+
];
|
|
316
|
+
|
|
317
|
+
<div class="bg-base-200 max-w-xl space-y-2 rounded-xl p-4">
|
|
318
|
+
<For each={messages}>
|
|
319
|
+
{msg => (
|
|
320
|
+
<ChatBubble
|
|
321
|
+
align={msg.sender === 'me' ? 'end' : 'start'}
|
|
322
|
+
color={msg.sender === 'me' ? 'primary' : 'neutral'}
|
|
323
|
+
avatar={<Avatar image="/avatar.webp" width={36} />}
|
|
324
|
+
header={
|
|
325
|
+
<div class="flex items-center gap-2">
|
|
326
|
+
<span class="font-bold text-sm">{msg.name}</span>
|
|
327
|
+
<time class="text-xs opacity-50">{msg.time}</time>
|
|
328
|
+
</div>
|
|
329
|
+
}
|
|
330
|
+
bubble={<span>{msg.text}</span>}
|
|
331
|
+
/>
|
|
332
|
+
)}
|
|
333
|
+
</For>
|
|
334
|
+
</div>
|
|
335
|
+
```
|
|
336
|
+
---
|
|
337
|
+
|
|
338
|
+
## Component Conventions
|
|
339
|
+
|
|
340
|
+
> **CSS encoding**: internal CSS classes use short encoded names (e.g. `cb01`, `cb02`) per project convention.
|
|
341
|
+
|
|
342
|
+
> **Unique IDs**: if this component needs to generate HTML `id` attributes, always use `createUniqueId()` from `solid-js` — never `Math.random()` or `Date.now()`.
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
## COMPONENT IDENTITY
|
|
2
|
+
- **Import**: `import { Checkbox } from 'solid-tom-ui';`
|
|
3
|
+
- **Export**: `Checkbox` (named export)
|
|
4
|
+
- **Framework**: SolidJS
|
|
5
|
+
- **Purpose**: Single `<input type="checkbox">` — **uncontrolled**: initial state via `defaultChecked`, internal DOM state drives truth thereafter
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## TYPE SIGNATURE
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
type CheckboxProps = {
|
|
13
|
+
defaultChecked: boolean; // REQUIRED — sets initial checked state via ref
|
|
14
|
+
id?: string; // auto-generated via createUniqueId() if omitted
|
|
15
|
+
name?: string; // for form submission grouping
|
|
16
|
+
value?: string; // form submission value (overridden when indeterminate)
|
|
17
|
+
indeterminate?: boolean; // renders dash/minus visual state; blocks toggling
|
|
18
|
+
disabled?: boolean; // prevents interaction
|
|
19
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
20
|
+
color?: 'default' | 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error';
|
|
21
|
+
class?: string; // extra classes on <input>
|
|
22
|
+
onChange?: (checked: boolean | null) => void;
|
|
23
|
+
};
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## DEFAULT VALUES (via `mergeProps`)
|
|
29
|
+
|
|
30
|
+
| Prop | Default |
|
|
31
|
+
|----------------|--------------------------|
|
|
32
|
+
| `size` | `'xs'` |
|
|
33
|
+
| `color` | `'primary'` |
|
|
34
|
+
| `id` | `createUniqueId()` — auto-generated unique string |
|
|
35
|
+
| `defaultChecked` | `false` |
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## PROP REFERENCE
|
|
40
|
+
|
|
41
|
+
| Prop | Type | Required | Description |
|
|
42
|
+
|------------------|-----------------------------------------------------------------------|----------|-------------------------------------------------------------------------------------------|
|
|
43
|
+
| `defaultChecked` | `boolean` | ✅ YES | Sets initial `checked` state via DOM ref on mount — does NOT reactively update after mount |
|
|
44
|
+
| `id` | `string` | ❌ NO | `id` on `<input>` — auto-generated if omitted; used with external `<label for="...">` |
|
|
45
|
+
| `name` | `string` | ❌ NO | `name` attribute for native form grouping/submission |
|
|
46
|
+
| `value` | `string` | ❌ NO | `value` submitted with form data. Overridden to `'inteterminate'` when `indeterminate` is true |
|
|
47
|
+
| `indeterminate` | `boolean` | ❌ NO | Shows dash/minus visual; blocks user toggling; sets `data-indeterminate="true"` on input |
|
|
48
|
+
| `disabled` | `boolean` | ❌ NO | Disables the input; prevents `onChange` from firing |
|
|
49
|
+
| `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | ❌ NO | Visual size of the checkbox |
|
|
50
|
+
| `color` | `'default' \| 'neutral' \| 'primary' \| 'secondary' \| 'accent' \| 'info' \| 'success' \| 'warning' \| 'error'` | ❌ NO | Checkbox fill color when checked |
|
|
51
|
+
| `class` | `string` | ❌ NO | Extra Tailwind classes appended directly to `<input>` |
|
|
52
|
+
| `onChange` | `(checked: boolean \| null) => void` | ❌ NO | Fires on change with `e.target.checked` value. NOT fired when `indeterminate` or `disabled` |
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## SIZE REFERENCE
|
|
57
|
+
|
|
58
|
+
| Value | CSS `--size` | Pixel size |
|
|
59
|
+
|-------|-------------|------------|
|
|
60
|
+
| `'xs'`| `14px` | 14 × 14px |
|
|
61
|
+
| `'sm'`| `16px` | 16 × 16px |
|
|
62
|
+
| `'md'`| `18px` | 18 × 18px |
|
|
63
|
+
| `'lg'`| `20px` | 20 × 20px |
|
|
64
|
+
| `'xl'`| `22px` | 22 × 22px |
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## COLOR REFERENCE
|
|
69
|
+
|
|
70
|
+
| Value | DaisyUI class | Fill color when checked |
|
|
71
|
+
|---------------|----------------------|------------------------------|
|
|
72
|
+
| `'default'` | *(no class)* | Default DaisyUI checkbox color |
|
|
73
|
+
| `'neutral'` | `checkbox-neutral` | Neutral |
|
|
74
|
+
| `'primary'` | `checkbox-primary` | Primary (default) |
|
|
75
|
+
| `'secondary'` | `checkbox-secondary` | Secondary |
|
|
76
|
+
| `'accent'` | `checkbox-accent` | Accent |
|
|
77
|
+
| `'info'` | `checkbox-info` | Info |
|
|
78
|
+
| `'success'` | `checkbox-success` | Success |
|
|
79
|
+
| `'warning'` | `checkbox-warning` | Warning |
|
|
80
|
+
| `'error'` | `checkbox-error` | Error |
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## UNCONTROLLED BEHAVIOR — Critical for agents
|
|
85
|
+
|
|
86
|
+
This component is **uncontrolled** by design:
|
|
87
|
+
|
|
88
|
+
- `defaultChecked` sets `ref.checked = value` once at mount via a `ref` callback
|
|
89
|
+
- After mount, the DOM input's `checked` state is **the source of truth**
|
|
90
|
+
- There is **no reactive signal** tracking checked state internally
|
|
91
|
+
- Changing `defaultChecked` after mount does **nothing** — the DOM state is not updated
|
|
92
|
+
- To read current checked state, use `onChange` callback or query the DOM via `ref`
|
|
93
|
+
|
|
94
|
+
```tsx
|
|
95
|
+
// ✅ Correct: read state through onChange
|
|
96
|
+
const [checked, setChecked] = createSignal(false);
|
|
97
|
+
|
|
98
|
+
<Checkbox
|
|
99
|
+
defaultChecked={false}
|
|
100
|
+
onChange={val => setChecked(val)}
|
|
101
|
+
/>
|
|
102
|
+
|
|
103
|
+
// ❌ Wrong: changing defaultChecked after mount has no effect
|
|
104
|
+
const [init, setInit] = createSignal(false);
|
|
105
|
+
<Checkbox defaultChecked={init()} /> // reactive update ignored after first render
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## INDETERMINATE STATE
|
|
111
|
+
|
|
112
|
+
When `indeterminate={true}`:
|
|
113
|
+
- Renders a **dash/minus** visual (clip-path polygon in CSS)
|
|
114
|
+
- `data-indeterminate="true"` is set on the `<input>`
|
|
115
|
+
- `value` prop is overridden to `'inteterminate'` (note: typo in source — single 'r')
|
|
116
|
+
- `onClick` calls `e.preventDefault()` — **user cannot toggle** the checkbox
|
|
117
|
+
- `onChange` is **never fired** (click is blocked)
|
|
118
|
+
- Useful for "select all" parent checkboxes when only some children are selected
|
|
119
|
+
|
|
120
|
+
```tsx
|
|
121
|
+
// Indeterminate "select all" pattern
|
|
122
|
+
const allChecked = () => items().every(i => i.checked);
|
|
123
|
+
const someChecked = () => items().some(i => i.checked);
|
|
124
|
+
|
|
125
|
+
<Checkbox
|
|
126
|
+
defaultChecked={allChecked()}
|
|
127
|
+
indeterminate={someChecked() && !allChecked()}
|
|
128
|
+
onChange={val => items().forEach(i => i.setChecked(val))}
|
|
129
|
+
/>
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
> ⚠️ Because `indeterminate` blocks user toggling, the state change must be driven externally (e.g. by updating items and re-rendering).
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## ADDING A LABEL
|
|
137
|
+
|
|
138
|
+
`Checkbox` renders only an `<input>` — no label wrapper is included. Use a native `<label>` element:
|
|
139
|
+
|
|
140
|
+
### Label to the right (most common)
|
|
141
|
+
```tsx
|
|
142
|
+
<label class="flex cursor-pointer items-center gap-2">
|
|
143
|
+
<Checkbox defaultChecked={false} color="primary" size="md" />
|
|
144
|
+
<span>Accept terms</span>
|
|
145
|
+
</label>
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Label to the left
|
|
149
|
+
```tsx
|
|
150
|
+
<label class="flex cursor-pointer items-center gap-2">
|
|
151
|
+
<span>Accept terms</span>
|
|
152
|
+
<Checkbox defaultChecked={false} color="primary" size="md" />
|
|
153
|
+
</label>
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### Label below
|
|
157
|
+
```tsx
|
|
158
|
+
<label class="flex w-fit cursor-pointer flex-col items-center gap-1">
|
|
159
|
+
<Checkbox defaultChecked={false} color="primary" size="md" />
|
|
160
|
+
<span class="text-sm">Agree</span>
|
|
161
|
+
</label>
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### External label via `id`
|
|
165
|
+
```tsx
|
|
166
|
+
<label for="terms-cb" class="cursor-pointer text-sm">Accept terms</label>
|
|
167
|
+
<Checkbox id="terms-cb" defaultChecked={false} color="primary" />
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
> ℹ️ Always add `cursor-pointer` to `<label>` for correct UX.
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## FORM USAGE
|
|
175
|
+
|
|
176
|
+
Use `name` and `value` props for native HTML form submission:
|
|
177
|
+
|
|
178
|
+
```tsx
|
|
179
|
+
<form onSubmit={e => {
|
|
180
|
+
e.preventDefault();
|
|
181
|
+
const data = new FormData(e.currentTarget);
|
|
182
|
+
console.log(Object.fromEntries(data.entries()));
|
|
183
|
+
}}>
|
|
184
|
+
<label class="flex cursor-pointer items-center gap-2">
|
|
185
|
+
<Checkbox name="interests" value="technology" defaultChecked={false} />
|
|
186
|
+
<span>Technology</span>
|
|
187
|
+
</label>
|
|
188
|
+
<label class="flex cursor-pointer items-center gap-2">
|
|
189
|
+
<Checkbox name="interests" value="design" defaultChecked={false} />
|
|
190
|
+
<span>Design</span>
|
|
191
|
+
</label>
|
|
192
|
+
<button type="submit">Submit</button>
|
|
193
|
+
</form>
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
> ⚠️ When `indeterminate={true}`, `value` is automatically overridden to `'inteterminate'` regardless of what was passed.
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## INTERNAL DOM STRUCTURE
|
|
201
|
+
|
|
202
|
+
```
|
|
203
|
+
<input
|
|
204
|
+
type="checkbox"
|
|
205
|
+
id="{id | auto}"
|
|
206
|
+
class="checkbox checkbox-{size} checkbox-{color} [class]"
|
|
207
|
+
disabled={disabled}
|
|
208
|
+
name="{name}" ← only if name prop provided
|
|
209
|
+
data-indeterminate="true" ← only if indeterminate={true}
|
|
210
|
+
value="{value | 'inteterminate'}"
|
|
211
|
+
onClick={...} ← preventDefault when indeterminate or disabled
|
|
212
|
+
onChange={...} ← fires p.onChange with e.target.checked
|
|
213
|
+
/>
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## BEHAVIOR NOTES FOR AGENTS
|
|
219
|
+
|
|
220
|
+
1. **Uncontrolled — `defaultChecked` is mount-only** — do not pass a reactive signal to `defaultChecked` expecting it to control the checkbox. Use `onChange` to lift state up.
|
|
221
|
+
|
|
222
|
+
2. **`id` is auto-generated** — every `Checkbox` without an explicit `id` gets a unique ID from SolidJS `createUniqueId()`. No collision risk, but the value is not predictable. Pass explicit `id` when you need `<label for="...">` linkage.
|
|
223
|
+
|
|
224
|
+
3. **`indeterminate` blocks both click and `onChange`** — `onClick` calls `e.preventDefault()`, so `onChange` never fires. The indeterminate state must be managed entirely by the parent.
|
|
225
|
+
|
|
226
|
+
4. **`disabled` and `indeterminate` together** — both conditions independently call `e.preventDefault()` in the same `onClick` handler. Either alone is sufficient to block toggling.
|
|
227
|
+
|
|
228
|
+
5. **`name` is conditionally spread** — if `name` is `undefined`, the attribute is NOT rendered on the DOM (using `{...(p.name && { name: p.name })}`). This avoids empty `name=""` on the input.
|
|
229
|
+
|
|
230
|
+
6. **`class` appends to generated classes** — CVA generates `checkbox checkbox-{size} checkbox-{color}`, then `p.class` is appended via `cn()`. Use for shape overrides (`rounded-full`), border tweaks, shadows, etc.
|
|
231
|
+
|
|
232
|
+
7. **`onChange` receives `boolean | null`** — the signature accepts `null` for future indeterminate support, but current implementation always passes `e.target.checked` (boolean). Handle both types defensively.
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## COMMON MISTAKES TO AVOID
|
|
237
|
+
|
|
238
|
+
| Mistake | Correct approach |
|
|
239
|
+
|---|---|
|
|
240
|
+
| Treating `defaultChecked` as reactive | It's mount-only — use `onChange` to track state in a signal |
|
|
241
|
+
| Expecting `onChange` to fire when `indeterminate={true}` | `onClick` is blocked — `onChange` never fires in indeterminate state |
|
|
242
|
+
| Omitting `cursor-pointer` on wrapping `<label>` | Always add `cursor-pointer` to `<label>` for correct UX |
|
|
243
|
+
| Passing `value="inteterminate"` manually | When `indeterminate={true}`, value is auto-set — no need to pass it |
|
|
244
|
+
| Using `color="default"` expecting a specific color | `'default'` applies no color class — checkbox uses browser/DaisyUI base style |
|
|
245
|
+
| Relying on `id` being stable without explicit prop | Auto-generated IDs are unique but unpredictable — pass explicit `id` when needed for `<label for>` |
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
## FULL EXAMPLE — All features
|
|
250
|
+
|
|
251
|
+
```tsx
|
|
252
|
+
import { Checkbox } from 'solid-tom-ui';
|
|
253
|
+
import { createSignal } from 'solid-js';
|
|
254
|
+
|
|
255
|
+
// 1. Basic with label
|
|
256
|
+
<label class="flex cursor-pointer items-center gap-2">
|
|
257
|
+
<Checkbox defaultChecked={false} color="primary" size="md" />
|
|
258
|
+
<span>Accept terms and conditions</span>
|
|
259
|
+
</label>
|
|
260
|
+
|
|
261
|
+
// 2. Controlled state via onChange
|
|
262
|
+
const [agreed, setAgreed] = createSignal(false);
|
|
263
|
+
|
|
264
|
+
<label class="flex cursor-pointer items-center gap-2">
|
|
265
|
+
<Checkbox
|
|
266
|
+
defaultChecked={false}
|
|
267
|
+
color="success"
|
|
268
|
+
size="sm"
|
|
269
|
+
onChange={val => setAgreed(val)}
|
|
270
|
+
/>
|
|
271
|
+
<span>I agree ({agreed() ? 'Yes' : 'No'})</span>
|
|
272
|
+
</label>
|
|
273
|
+
|
|
274
|
+
// 3. Indeterminate — select all pattern
|
|
275
|
+
const [items, setItems] = createSignal([
|
|
276
|
+
{ label: 'Item A', checked: true },
|
|
277
|
+
{ label: 'Item B', checked: false },
|
|
278
|
+
]);
|
|
279
|
+
const allChecked = () => items().every(i => i.checked);
|
|
280
|
+
const someChecked = () => items().some(i => i.checked);
|
|
281
|
+
|
|
282
|
+
<label class="flex cursor-pointer items-center gap-2">
|
|
283
|
+
<Checkbox
|
|
284
|
+
defaultChecked={allChecked()}
|
|
285
|
+
indeterminate={someChecked() && !allChecked()}
|
|
286
|
+
color="primary"
|
|
287
|
+
size="md"
|
|
288
|
+
/>
|
|
289
|
+
<span class="font-semibold">Select all</span>
|
|
290
|
+
</label>
|
|
291
|
+
|
|
292
|
+
// 4. Disabled
|
|
293
|
+
<label class="flex cursor-pointer items-center gap-2 opacity-50">
|
|
294
|
+
<Checkbox defaultChecked={true} color="neutral" size="md" disabled />
|
|
295
|
+
<span>Cannot change</span>
|
|
296
|
+
</label>
|
|
297
|
+
|
|
298
|
+
// 5. Form with name + value
|
|
299
|
+
<form onSubmit={e => { e.preventDefault(); console.log([...new FormData(e.currentTarget)]); }}>
|
|
300
|
+
<label class="flex cursor-pointer items-center gap-2">
|
|
301
|
+
<Checkbox name="lang" value="typescript" defaultChecked={true} size="sm" />
|
|
302
|
+
<span>TypeScript</span>
|
|
303
|
+
</label>
|
|
304
|
+
<label class="flex cursor-pointer items-center gap-2">
|
|
305
|
+
<Checkbox name="lang" value="rust" defaultChecked={false} size="sm" />
|
|
306
|
+
<span>Rust</span>
|
|
307
|
+
</label>
|
|
308
|
+
<button type="submit" class="btn btn-sm btn-primary mt-2">Submit</button>
|
|
309
|
+
</form>
|
|
310
|
+
|
|
311
|
+
// 6. Custom styling
|
|
312
|
+
<label class="flex cursor-pointer items-center gap-2">
|
|
313
|
+
<Checkbox
|
|
314
|
+
defaultChecked={true}
|
|
315
|
+
color="accent"
|
|
316
|
+
size="lg"
|
|
317
|
+
class="rounded-full shadow-lg"
|
|
318
|
+
/>
|
|
319
|
+
<span>Rounded pill checkbox</span>
|
|
320
|
+
</label>
|
|
321
|
+
```
|
|
322
|
+
---
|
|
323
|
+
|
|
324
|
+
## Component Conventions
|
|
325
|
+
|
|
326
|
+
> **CSS encoding**: internal CSS classes use short encoded names (e.g. `cx01`, `cx02`) per project convention.
|