@aivex/ui 1.2.0-dev.55 → 1.2.0-dev.56
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 +57 -1
- package/dist/DESIGN.md +241 -0
- package/dist/comment.cjs +1 -1
- package/dist/comment.js +1 -1
- package/dist/components/Avatar/Avatar.cjs.map +1 -1
- package/dist/components/Avatar/Avatar.d.cts +42 -0
- package/dist/components/Avatar/Avatar.d.ts +24 -0
- package/dist/components/Avatar/Avatar.js.map +1 -1
- package/dist/components/Avatar/index.d.cts +2 -0
- package/dist/components/Avatar/index.d.ts +2 -2
- package/dist/components/Badge/Badge.cjs.map +1 -1
- package/dist/components/Badge/Badge.d.cts +93 -0
- package/dist/components/Badge/Badge.d.ts +58 -0
- package/dist/components/Badge/Badge.js.map +1 -1
- package/dist/components/Badge/index.d.cts +2 -0
- package/dist/components/Badge/index.d.ts +2 -2
- package/dist/components/BreadCrumb/BreadCrumb.cjs.map +1 -1
- package/dist/components/BreadCrumb/BreadCrumb.d.cts +57 -0
- package/dist/components/BreadCrumb/BreadCrumb.d.ts +32 -2
- package/dist/components/BreadCrumb/BreadCrumb.js.map +1 -1
- package/dist/components/BreadCrumb/index.d.cts +2 -0
- package/dist/components/BreadCrumb/index.d.ts +2 -2
- package/dist/components/Button/Button.cjs +1 -1
- package/dist/components/Button/Button.cjs.map +1 -1
- package/dist/components/Button/Button.d.cts +50 -0
- package/dist/components/Button/Button.d.ts +31 -1
- package/dist/components/Button/Button.js +25 -24
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button/index.d.cts +2 -0
- package/dist/components/Button/index.d.ts +2 -2
- package/dist/components/Calendar/Calendar.cjs +1 -1
- package/dist/components/Calendar/Calendar.cjs.map +1 -1
- package/dist/components/Calendar/Calendar.d.cts +81 -0
- package/dist/components/Calendar/Calendar.d.ts +48 -5
- package/dist/components/Calendar/Calendar.js +104 -57
- package/dist/components/Calendar/Calendar.js.map +1 -1
- package/dist/components/Calendar/date.cjs +1 -1
- package/dist/components/Calendar/date.cjs.map +1 -1
- package/dist/components/Calendar/date.d.cts +35 -0
- package/dist/components/Calendar/date.d.ts +10 -0
- package/dist/components/Calendar/date.js +22 -1
- package/dist/components/Calendar/date.js.map +1 -1
- package/dist/components/Calendar/index.d.cts +2 -0
- package/dist/components/Calendar/index.d.ts +2 -2
- package/dist/components/Card/Card.cjs.map +1 -1
- package/dist/components/Card/Card.d.cts +46 -0
- package/dist/components/Card/Card.d.ts +30 -3
- package/dist/components/Card/Card.js.map +1 -1
- package/dist/components/Card/index.d.cts +2 -0
- package/dist/components/Card/index.d.ts +2 -2
- package/dist/components/Checkbox/Checkbox.cjs +1 -1
- package/dist/components/Checkbox/Checkbox.cjs.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.cts +37 -0
- package/dist/components/Checkbox/Checkbox.d.ts +24 -0
- package/dist/components/Checkbox/Checkbox.js +24 -23
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Checkbox/ChipsCheckbox.cjs.map +1 -1
- package/dist/components/Checkbox/ChipsCheckbox.d.cts +24 -0
- package/dist/components/Checkbox/ChipsCheckbox.d.ts +15 -0
- package/dist/components/Checkbox/ChipsCheckbox.js.map +1 -1
- package/dist/components/Checkbox/index.d.cts +4 -0
- package/dist/components/Checkbox/index.d.ts +4 -4
- package/dist/components/Coachmark/Coachmark.cjs.map +1 -1
- package/dist/components/Coachmark/Coachmark.d.cts +87 -0
- package/dist/components/Coachmark/Coachmark.d.ts +39 -8
- package/dist/components/Coachmark/Coachmark.js.map +1 -1
- package/dist/components/Coachmark/index.d.cts +2 -0
- package/dist/components/Coachmark/index.d.ts +2 -2
- package/dist/components/Comment/CommentInput.cjs +1 -1
- package/dist/components/Comment/CommentInput.cjs.map +1 -1
- package/dist/components/Comment/CommentInput.d.cts +75 -0
- package/dist/components/Comment/CommentInput.d.ts +46 -6
- package/dist/components/Comment/CommentInput.js +15 -14
- package/dist/components/Comment/CommentInput.js.map +1 -1
- package/dist/components/Comment/CommentPin.cjs +1 -1
- package/dist/components/Comment/CommentPin.cjs.map +1 -1
- package/dist/components/Comment/CommentPin.d.cts +48 -0
- package/dist/components/Comment/CommentPin.d.ts +35 -4
- package/dist/components/Comment/CommentPin.js +29 -20
- package/dist/components/Comment/CommentPin.js.map +1 -1
- package/dist/components/Comment/MentionInput.cjs +1 -1
- package/dist/components/Comment/MentionInput.cjs.map +1 -1
- package/dist/components/Comment/MentionInput.d.cts +45 -0
- package/dist/components/Comment/MentionInput.d.ts +19 -4
- package/dist/components/Comment/MentionInput.js +51 -38
- package/dist/components/Comment/MentionInput.js.map +1 -1
- package/dist/components/Comment/MentionList.cjs +1 -1
- package/dist/components/Comment/MentionList.cjs.map +1 -1
- package/dist/components/Comment/MentionList.d.cts +19 -0
- package/dist/components/Comment/MentionList.d.ts +3 -3
- package/dist/components/Comment/MentionList.js +1 -1
- package/dist/components/Comment/MentionList.js.map +1 -1
- package/dist/components/Comment/index.d.cts +4 -0
- package/dist/components/Comment/index.d.ts +4 -4
- package/dist/components/Comment/mentionContent.d.cts +5 -0
- package/dist/components/Comment/types.d.cts +16 -0
- package/dist/components/Comment/types.d.ts +6 -2
- package/dist/components/Comment/useMentionSuggestion.cjs +1 -1
- package/dist/components/Comment/useMentionSuggestion.cjs.map +1 -1
- package/dist/components/Comment/useMentionSuggestion.d.cts +19 -0
- package/dist/components/Comment/useMentionSuggestion.d.ts +6 -2
- package/dist/components/Comment/useMentionSuggestion.js +72 -62
- package/dist/components/Comment/useMentionSuggestion.js.map +1 -1
- package/dist/components/DataGrid/DataGrid.cjs +1 -1
- package/dist/components/DataGrid/DataGrid.cjs.map +1 -1
- package/dist/components/DataGrid/DataGrid.d.cts +136 -0
- package/dist/components/DataGrid/DataGrid.d.ts +77 -5
- package/dist/components/DataGrid/DataGrid.js +109 -106
- package/dist/components/DataGrid/DataGrid.js.map +1 -1
- package/dist/components/DataGrid/DataGridColumnSettings.cjs +1 -1
- package/dist/components/DataGrid/DataGridColumnSettings.cjs.map +1 -1
- package/dist/components/DataGrid/DataGridColumnSettings.d.cts +41 -0
- package/dist/components/DataGrid/DataGridColumnSettings.d.ts +21 -3
- package/dist/components/DataGrid/DataGridColumnSettings.js +8 -5
- package/dist/components/DataGrid/DataGridColumnSettings.js.map +1 -1
- package/dist/components/DataGrid/DataGridPrimitives.cjs.map +1 -1
- package/dist/components/DataGrid/DataGridPrimitives.d.cts +167 -0
- package/dist/components/DataGrid/DataGridPrimitives.d.ts +81 -1
- package/dist/components/DataGrid/DataGridPrimitives.js.map +1 -1
- package/dist/components/DataGrid/DataGridRows.d.cts +66 -0
- package/dist/components/DataGrid/index.d.cts +8 -0
- package/dist/components/DataGrid/index.d.ts +6 -6
- package/dist/components/Dialog/Dialog.cjs.map +1 -1
- package/dist/components/Dialog/Dialog.d.cts +66 -0
- package/dist/components/Dialog/Dialog.d.ts +47 -1
- package/dist/components/Dialog/Dialog.js.map +1 -1
- package/dist/components/Dialog/index.d.cts +2 -0
- package/dist/components/Dialog/index.d.ts +2 -2
- package/dist/components/Divider/Divider.cjs.map +1 -1
- package/dist/components/Divider/Divider.d.cts +30 -0
- package/dist/components/Divider/Divider.d.ts +19 -0
- package/dist/components/Divider/Divider.js.map +1 -1
- package/dist/components/Divider/index.d.cts +2 -0
- package/dist/components/Divider/index.d.ts +2 -2
- package/dist/components/DraggableScroll/DraggableScroll.cjs.map +1 -1
- package/dist/components/DraggableScroll/DraggableScroll.d.cts +47 -0
- package/dist/components/DraggableScroll/DraggableScroll.d.ts +32 -1
- package/dist/components/DraggableScroll/DraggableScroll.js.map +1 -1
- package/dist/components/DraggableScroll/index.d.cts +2 -0
- package/dist/components/DraggableScroll/index.d.ts +2 -2
- package/dist/components/Drawer/Drawer.cjs.map +1 -1
- package/dist/components/Drawer/Drawer.d.cts +149 -0
- package/dist/components/Drawer/Drawer.d.ts +64 -5
- package/dist/components/Drawer/Drawer.js.map +1 -1
- package/dist/components/Drawer/index.d.cts +2 -0
- package/dist/components/Drawer/index.d.ts +2 -2
- package/dist/components/Field/Field.cjs +1 -1
- package/dist/components/Field/Field.cjs.map +1 -1
- package/dist/components/Field/Field.d.cts +100 -0
- package/dist/components/Field/Field.d.ts +59 -5
- package/dist/components/Field/Field.js +49 -42
- package/dist/components/Field/Field.js.map +1 -1
- package/dist/components/Field/index.d.cts +1 -0
- package/dist/components/Field/index.d.ts +1 -1
- package/dist/components/FilterModal/FilterModal.cjs +1 -1
- package/dist/components/FilterModal/FilterModal.cjs.map +1 -1
- package/dist/components/FilterModal/FilterModal.d.cts +83 -0
- package/dist/components/FilterModal/FilterModal.d.ts +52 -1
- package/dist/components/FilterModal/FilterModal.js +5 -4
- package/dist/components/FilterModal/FilterModal.js.map +1 -1
- package/dist/components/FilterModal/index.d.cts +2 -0
- package/dist/components/FilterModal/index.d.ts +2 -2
- package/dist/components/Icon/index.cjs.map +1 -1
- package/dist/components/Icon/index.d.cts +2077 -0
- package/dist/components/Icon/index.d.ts +41 -0
- package/dist/components/Icon/index.js.map +1 -1
- package/dist/components/Icon/svgA11y.d.cts +10 -0
- package/dist/components/Icon/uniqueSvgIds.d.cts +8 -0
- package/dist/components/IconButton/IconButton.cjs +1 -1
- package/dist/components/IconButton/IconButton.cjs.map +1 -1
- package/dist/components/IconButton/IconButton.d.cts +45 -0
- package/dist/components/IconButton/IconButton.d.ts +31 -3
- package/dist/components/IconButton/IconButton.js +25 -24
- package/dist/components/IconButton/IconButton.js.map +1 -1
- package/dist/components/IconButton/index.d.cts +2 -0
- package/dist/components/IconButton/index.d.ts +2 -2
- package/dist/components/Illustration/Illustration.cjs +2 -0
- package/dist/components/Illustration/Illustration.cjs.map +1 -0
- package/dist/components/Illustration/Illustration.d.cts +37 -0
- package/dist/components/Illustration/Illustration.d.ts +37 -0
- package/dist/components/Illustration/Illustration.js +40 -0
- package/dist/components/Illustration/Illustration.js.map +1 -0
- package/dist/components/Illustration/assets/box-dark.webp.cjs +2 -0
- package/dist/components/Illustration/assets/box-dark.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/box-dark.webp.js +7 -0
- package/dist/components/Illustration/assets/box-dark.webp.js.map +1 -0
- package/dist/components/Illustration/assets/box-light.webp.cjs +2 -0
- package/dist/components/Illustration/assets/box-light.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/box-light.webp.js +7 -0
- package/dist/components/Illustration/assets/box-light.webp.js.map +1 -0
- package/dist/components/Illustration/assets/equipment-dark.webp.cjs +2 -0
- package/dist/components/Illustration/assets/equipment-dark.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/equipment-dark.webp.js +7 -0
- package/dist/components/Illustration/assets/equipment-dark.webp.js.map +1 -0
- package/dist/components/Illustration/assets/equipment-light.webp.cjs +2 -0
- package/dist/components/Illustration/assets/equipment-light.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/equipment-light.webp.js +7 -0
- package/dist/components/Illustration/assets/equipment-light.webp.js.map +1 -0
- package/dist/components/Illustration/assets/failed-dark.webp.cjs +2 -0
- package/dist/components/Illustration/assets/failed-dark.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/failed-dark.webp.js +7 -0
- package/dist/components/Illustration/assets/failed-dark.webp.js.map +1 -0
- package/dist/components/Illustration/assets/failed-light.webp.cjs +2 -0
- package/dist/components/Illustration/assets/failed-light.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/failed-light.webp.js +7 -0
- package/dist/components/Illustration/assets/failed-light.webp.js.map +1 -0
- package/dist/components/Illustration/assets/file-dark.webp.cjs +2 -0
- package/dist/components/Illustration/assets/file-dark.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/file-dark.webp.js +7 -0
- package/dist/components/Illustration/assets/file-dark.webp.js.map +1 -0
- package/dist/components/Illustration/assets/file-light.webp.cjs +2 -0
- package/dist/components/Illustration/assets/file-light.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/file-light.webp.js +7 -0
- package/dist/components/Illustration/assets/file-light.webp.js.map +1 -0
- package/dist/components/Illustration/assets/images-dark.webp.cjs +2 -0
- package/dist/components/Illustration/assets/images-dark.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/images-dark.webp.js +7 -0
- package/dist/components/Illustration/assets/images-dark.webp.js.map +1 -0
- package/dist/components/Illustration/assets/images-light.webp.cjs +2 -0
- package/dist/components/Illustration/assets/images-light.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/images-light.webp.js +7 -0
- package/dist/components/Illustration/assets/images-light.webp.js.map +1 -0
- package/dist/components/Illustration/assets/letter-dark.webp.cjs +2 -0
- package/dist/components/Illustration/assets/letter-dark.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/letter-dark.webp.js +7 -0
- package/dist/components/Illustration/assets/letter-dark.webp.js.map +1 -0
- package/dist/components/Illustration/assets/letter-light.webp.cjs +2 -0
- package/dist/components/Illustration/assets/letter-light.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/letter-light.webp.js +7 -0
- package/dist/components/Illustration/assets/letter-light.webp.js.map +1 -0
- package/dist/components/Illustration/assets/message-dark.webp.cjs +2 -0
- package/dist/components/Illustration/assets/message-dark.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/message-dark.webp.js +7 -0
- package/dist/components/Illustration/assets/message-dark.webp.js.map +1 -0
- package/dist/components/Illustration/assets/message-light.webp.cjs +2 -0
- package/dist/components/Illustration/assets/message-light.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/message-light.webp.js +7 -0
- package/dist/components/Illustration/assets/message-light.webp.js.map +1 -0
- package/dist/components/Illustration/assets/network-dark.webp.cjs +2 -0
- package/dist/components/Illustration/assets/network-dark.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/network-dark.webp.js +7 -0
- package/dist/components/Illustration/assets/network-dark.webp.js.map +1 -0
- package/dist/components/Illustration/assets/network-light.webp.cjs +2 -0
- package/dist/components/Illustration/assets/network-light.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/network-light.webp.js +7 -0
- package/dist/components/Illustration/assets/network-light.webp.js.map +1 -0
- package/dist/components/Illustration/assets/no-data-dark.webp.cjs +2 -0
- package/dist/components/Illustration/assets/no-data-dark.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/no-data-dark.webp.js +7 -0
- package/dist/components/Illustration/assets/no-data-dark.webp.js.map +1 -0
- package/dist/components/Illustration/assets/no-data-light.webp.cjs +2 -0
- package/dist/components/Illustration/assets/no-data-light.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/no-data-light.webp.js +7 -0
- package/dist/components/Illustration/assets/no-data-light.webp.js.map +1 -0
- package/dist/components/Illustration/assets/paper-dark.webp.cjs +2 -0
- package/dist/components/Illustration/assets/paper-dark.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/paper-dark.webp.js +7 -0
- package/dist/components/Illustration/assets/paper-dark.webp.js.map +1 -0
- package/dist/components/Illustration/assets/paper-light.webp.cjs +2 -0
- package/dist/components/Illustration/assets/paper-light.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/paper-light.webp.js +7 -0
- package/dist/components/Illustration/assets/paper-light.webp.js.map +1 -0
- package/dist/components/Illustration/assets/success-dark.webp.cjs +2 -0
- package/dist/components/Illustration/assets/success-dark.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/success-dark.webp.js +7 -0
- package/dist/components/Illustration/assets/success-dark.webp.js.map +1 -0
- package/dist/components/Illustration/assets/success-light.webp.cjs +2 -0
- package/dist/components/Illustration/assets/success-light.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/success-light.webp.js +7 -0
- package/dist/components/Illustration/assets/success-light.webp.js.map +1 -0
- package/dist/components/Illustration/assets/warning-dark.webp.cjs +2 -0
- package/dist/components/Illustration/assets/warning-dark.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/warning-dark.webp.js +7 -0
- package/dist/components/Illustration/assets/warning-dark.webp.js.map +1 -0
- package/dist/components/Illustration/assets/warning-light.webp.cjs +2 -0
- package/dist/components/Illustration/assets/warning-light.webp.cjs.map +1 -0
- package/dist/components/Illustration/assets/warning-light.webp.js +7 -0
- package/dist/components/Illustration/assets/warning-light.webp.js.map +1 -0
- package/dist/components/Illustration/illustrations.cjs +2 -0
- package/dist/components/Illustration/illustrations.cjs.map +1 -0
- package/dist/components/Illustration/illustrations.d.cts +81 -0
- package/dist/components/Illustration/illustrations.d.ts +81 -0
- package/dist/components/Illustration/illustrations.js +104 -0
- package/dist/components/Illustration/illustrations.js.map +1 -0
- package/dist/components/Illustration/index.d.cts +1 -0
- package/dist/components/Illustration/index.d.ts +1 -0
- package/dist/components/InputBase/InputBase.cjs.map +1 -1
- package/dist/components/InputBase/InputBase.d.cts +59 -0
- package/dist/components/InputBase/InputBase.d.ts +30 -0
- package/dist/components/InputBase/InputBase.js.map +1 -1
- package/dist/components/InputBase/index.d.cts +1 -0
- package/dist/components/InputBase/index.d.ts +1 -1
- package/dist/components/InputBase/useInputState.d.cts +19 -0
- package/dist/components/InteractionLayer/InteractionLayer.cjs.map +1 -1
- package/dist/components/InteractionLayer/InteractionLayer.d.cts +43 -0
- package/dist/components/InteractionLayer/InteractionLayer.d.ts +34 -0
- package/dist/components/InteractionLayer/InteractionLayer.js.map +1 -1
- package/dist/components/InteractionLayer/index.d.cts +1 -0
- package/dist/components/InteractionLayer/index.d.ts +1 -1
- package/dist/components/Logo/index.cjs.map +1 -1
- package/dist/components/Logo/index.d.cts +73 -0
- package/dist/components/Logo/index.d.ts +27 -1
- package/dist/components/Logo/index.js.map +1 -1
- package/dist/components/Menu/Menu.cjs.map +1 -1
- package/dist/components/Menu/Menu.d.cts +146 -0
- package/dist/components/Menu/Menu.d.ts +62 -0
- package/dist/components/Menu/Menu.js.map +1 -1
- package/dist/components/Menu/index.d.cts +2 -0
- package/dist/components/Menu/index.d.ts +2 -2
- package/dist/components/Messagebox/Messagebox.cjs.map +1 -1
- package/dist/components/Messagebox/Messagebox.d.cts +50 -0
- package/dist/components/Messagebox/Messagebox.d.ts +33 -3
- package/dist/components/Messagebox/Messagebox.js.map +1 -1
- package/dist/components/Messagebox/index.d.cts +2 -0
- package/dist/components/Messagebox/index.d.ts +2 -2
- package/dist/components/Modal/Modal.cjs +1 -1
- package/dist/components/Modal/Modal.cjs.map +1 -1
- package/dist/components/Modal/Modal.d.cts +137 -0
- package/dist/components/Modal/Modal.d.ts +95 -2
- package/dist/components/Modal/Modal.js +0 -1
- package/dist/components/Modal/Modal.js.map +1 -1
- package/dist/components/Modal/ModalBase.cjs.map +1 -1
- package/dist/components/Modal/ModalBase.d.cts +71 -0
- package/dist/components/Modal/ModalBase.d.ts +39 -1
- package/dist/components/Modal/ModalBase.js.map +1 -1
- package/dist/components/Modal/index.d.cts +4 -0
- package/dist/components/Modal/index.d.ts +4 -4
- package/dist/components/Nav/Nav.cjs.map +1 -1
- package/dist/components/Nav/Nav.d.cts +69 -0
- package/dist/components/Nav/Nav.d.ts +46 -0
- package/dist/components/Nav/Nav.js.map +1 -1
- package/dist/components/Nav/index.d.cts +2 -0
- package/dist/components/Nav/index.d.ts +2 -2
- package/dist/components/Overlay/Overlay.cjs.map +1 -1
- package/dist/components/Overlay/Overlay.d.cts +36 -0
- package/dist/components/Overlay/Overlay.d.ts +20 -2
- package/dist/components/Overlay/Overlay.js.map +1 -1
- package/dist/components/Overlay/index.d.cts +2 -0
- package/dist/components/Overlay/index.d.ts +2 -2
- package/dist/components/Pagination/Pagination.cjs +1 -1
- package/dist/components/Pagination/Pagination.cjs.map +1 -1
- package/dist/components/Pagination/Pagination.d.cts +68 -0
- package/dist/components/Pagination/Pagination.d.ts +43 -1
- package/dist/components/Pagination/Pagination.js +55 -41
- package/dist/components/Pagination/Pagination.js.map +1 -1
- package/dist/components/Pagination/index.d.cts +2 -0
- package/dist/components/Pagination/index.d.ts +2 -2
- package/dist/components/Panel/Panel.cjs.map +1 -1
- package/dist/components/Panel/Panel.d.cts +124 -0
- package/dist/components/Panel/Panel.d.ts +45 -3
- package/dist/components/Panel/Panel.js.map +1 -1
- package/dist/components/Panel/index.d.cts +2 -0
- package/dist/components/Panel/index.d.ts +2 -2
- package/dist/components/Popover/Popover.cjs.map +1 -1
- package/dist/components/Popover/Popover.d.cts +96 -0
- package/dist/components/Popover/Popover.d.ts +42 -0
- package/dist/components/Popover/Popover.js.map +1 -1
- package/dist/components/Popover/index.d.cts +2 -0
- package/dist/components/Popover/index.d.ts +2 -2
- package/dist/components/ProgressBar/ProgressBar.cjs.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.d.cts +45 -0
- package/dist/components/ProgressBar/ProgressBar.d.ts +32 -0
- package/dist/components/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/components/ProgressBar/index.d.cts +2 -0
- package/dist/components/ProgressBar/index.d.ts +2 -2
- package/dist/components/Radio/Radio.cjs.map +1 -1
- package/dist/components/Radio/Radio.d.cts +32 -0
- package/dist/components/Radio/Radio.d.ts +21 -0
- package/dist/components/Radio/Radio.js.map +1 -1
- package/dist/components/Radio/index.d.cts +2 -0
- package/dist/components/Radio/index.d.ts +2 -2
- package/dist/components/ScrollArea/ScrollArea.cjs.map +1 -1
- package/dist/components/ScrollArea/ScrollArea.d.cts +42 -0
- package/dist/components/ScrollArea/ScrollArea.d.ts +24 -0
- package/dist/components/ScrollArea/ScrollArea.js.map +1 -1
- package/dist/components/ScrollArea/index.d.cts +2 -0
- package/dist/components/ScrollArea/index.d.ts +2 -2
- package/dist/components/Segmented/Segmented.cjs.map +1 -1
- package/dist/components/Segmented/Segmented.d.cts +41 -0
- package/dist/components/Segmented/Segmented.d.ts +26 -0
- package/dist/components/Segmented/Segmented.js.map +1 -1
- package/dist/components/Segmented/index.d.cts +2 -0
- package/dist/components/Segmented/index.d.ts +2 -2
- package/dist/components/SelectBox/SelectBox.cjs +1 -1
- package/dist/components/SelectBox/SelectBox.cjs.map +1 -1
- package/dist/components/SelectBox/SelectBox.d.cts +95 -0
- package/dist/components/SelectBox/SelectBox.d.ts +55 -3
- package/dist/components/SelectBox/SelectBox.js +17 -12
- package/dist/components/SelectBox/SelectBox.js.map +1 -1
- package/dist/components/SelectBox/index.d.cts +2 -0
- package/dist/components/SelectBox/index.d.ts +2 -2
- package/dist/components/SelectButton/SelectButton.cjs +1 -1
- package/dist/components/SelectButton/SelectButton.cjs.map +1 -1
- package/dist/components/SelectButton/SelectButton.d.cts +54 -0
- package/dist/components/SelectButton/SelectButton.d.ts +37 -1
- package/dist/components/SelectButton/SelectButton.js +31 -31
- package/dist/components/SelectButton/SelectButton.js.map +1 -1
- package/dist/components/SelectButton/index.d.cts +2 -0
- package/dist/components/SelectButton/index.d.ts +2 -2
- package/dist/components/ShapeEditor/ShapeEditor.cjs +1 -1
- package/dist/components/ShapeEditor/ShapeEditor.cjs.map +1 -1
- package/dist/components/ShapeEditor/ShapeEditor.d.cts +40 -0
- package/dist/components/ShapeEditor/ShapeEditor.d.ts +36 -3
- package/dist/components/ShapeEditor/ShapeEditor.js +1 -1
- package/dist/components/ShapeEditor/ShapeEditor.js.map +1 -1
- package/dist/components/ShapeEditor/ShapeViewer.cjs +1 -1
- package/dist/components/ShapeEditor/ShapeViewer.cjs.map +1 -1
- package/dist/components/ShapeEditor/ShapeViewer.d.cts +92 -0
- package/dist/components/ShapeEditor/ShapeViewer.d.ts +55 -5
- package/dist/components/ShapeEditor/ShapeViewer.js +47 -41
- package/dist/components/ShapeEditor/ShapeViewer.js.map +1 -1
- package/dist/components/ShapeEditor/_components/AssistantOverlay.d.cts +17 -0
- package/dist/components/ShapeEditor/_components/AssistantOverlay.d.ts +2 -2
- package/dist/components/ShapeEditor/_components/ContextMenu.d.cts +13 -0
- package/dist/components/ShapeEditor/_components/ContextMenu.d.ts +1 -1
- package/dist/components/ShapeEditor/_components/CursorGuide.d.cts +8 -0
- package/dist/components/ShapeEditor/_components/ImageStateOverlay.d.cts +17 -0
- package/dist/components/ShapeEditor/_components/ImageStateOverlay.d.ts +1 -1
- package/dist/components/ShapeEditor/_components/Minimap.d.cts +46 -0
- package/dist/components/ShapeEditor/_components/Minimap.d.ts +6 -6
- package/dist/components/ShapeEditor/_components/MinimapShape.d.cts +6 -0
- package/dist/components/ShapeEditor/_components/MinimapShape.d.ts +1 -1
- package/dist/components/ShapeEditor/_components/RegionOverlay.d.cts +21 -0
- package/dist/components/ShapeEditor/_components/RegionOverlay.d.ts +1 -1
- package/dist/components/ShapeEditor/_components/SelectionInfo.d.cts +20 -0
- package/dist/components/ShapeEditor/_components/SelectionInfo.d.ts +3 -3
- package/dist/components/ShapeEditor/_components/SettingsPanel.cjs.map +1 -1
- package/dist/components/ShapeEditor/_components/SettingsPanel.d.cts +28 -0
- package/dist/components/ShapeEditor/_components/SettingsPanel.d.ts +5 -5
- package/dist/components/ShapeEditor/_components/SettingsPanel.js.map +1 -1
- package/dist/components/ShapeEditor/_constants.cjs +1 -1
- package/dist/components/ShapeEditor/_constants.cjs.map +1 -1
- package/dist/components/ShapeEditor/_constants.d.cts +15 -0
- package/dist/components/ShapeEditor/_constants.d.ts +0 -21
- package/dist/components/ShapeEditor/_constants.js +1 -1
- package/dist/components/ShapeEditor/_constants.js.map +1 -1
- package/dist/components/ShapeEditor/_model/brush.d.cts +3 -0
- package/dist/components/ShapeEditor/_model/brush.d.ts +1 -1
- package/dist/components/ShapeEditor/_model/clipboard.d.cts +22 -0
- package/dist/components/ShapeEditor/_model/clipboard.d.ts +1 -1
- package/dist/components/ShapeEditor/_model/cursors.d.cts +23 -0
- package/dist/components/ShapeEditor/_model/cursors.d.ts +2 -2
- package/dist/components/ShapeEditor/_model/geometry.cjs.map +1 -1
- package/dist/components/ShapeEditor/_model/geometry.d.cts +182 -0
- package/dist/components/ShapeEditor/_model/geometry.d.ts +17 -1
- package/dist/components/ShapeEditor/_model/geometry.js.map +1 -1
- package/dist/components/ShapeEditor/_model/imageDiagnosis.cjs +1 -1
- package/dist/components/ShapeEditor/_model/imageDiagnosis.cjs.map +1 -1
- package/dist/components/ShapeEditor/_model/imageDiagnosis.d.cts +38 -0
- package/dist/components/ShapeEditor/_model/imageDiagnosis.d.ts +4 -1
- package/dist/components/ShapeEditor/_model/imageDiagnosis.js +29 -20
- package/dist/components/ShapeEditor/_model/imageDiagnosis.js.map +1 -1
- package/dist/components/ShapeEditor/_model/imageLoad.d.cts +29 -0
- package/dist/components/ShapeEditor/_model/imageSignature.d.cts +18 -0
- package/dist/components/ShapeEditor/_model/imageTiles.d.cts +11 -0
- package/dist/components/ShapeEditor/_model/keymap.cjs.map +1 -1
- package/dist/components/ShapeEditor/_model/keymap.d.cts +17 -0
- package/dist/components/ShapeEditor/_model/keymap.d.ts +2 -0
- package/dist/components/ShapeEditor/_model/keymap.js.map +1 -1
- package/dist/components/ShapeEditor/_model/overlays.d.cts +108 -0
- package/dist/components/ShapeEditor/_model/overlays.d.ts +1 -1
- package/dist/components/ShapeEditor/_model/pinIcon.d.cts +13 -0
- package/dist/components/ShapeEditor/_model/polygonFill.d.cts +2 -0
- package/dist/components/ShapeEditor/_model/polygonFill.d.ts +1 -1
- package/dist/components/ShapeEditor/_model/props.d.cts +13 -0
- package/dist/components/ShapeEditor/_model/props.d.ts +8 -8
- package/dist/components/ShapeEditor/_model/scalarMask.d.cts +21 -0
- package/dist/components/ShapeEditor/_model/scalarMask.d.ts +1 -1
- package/dist/components/ShapeEditor/_model/shapeHitTest.d.cts +14 -0
- package/dist/components/ShapeEditor/_model/shapeHitTest.d.ts +2 -2
- package/dist/components/ShapeEditor/_model/shapeRenderStyle.d.cts +16 -0
- package/dist/components/ShapeEditor/_model/shapeRenderStyle.d.ts +1 -1
- package/dist/components/ShapeEditor/_model/strings.cjs.map +1 -1
- package/dist/components/ShapeEditor/_model/strings.d.cts +62 -0
- package/dist/components/ShapeEditor/_model/strings.d.ts +2 -1
- package/dist/components/ShapeEditor/_model/strings.js.map +1 -1
- package/dist/components/ShapeEditor/_model/tools.cjs.map +1 -1
- package/dist/components/ShapeEditor/_model/tools.d.cts +29 -0
- package/dist/components/ShapeEditor/_model/tools.d.ts +4 -2
- package/dist/components/ShapeEditor/_model/tools.js.map +1 -1
- package/dist/components/ShapeEditor/_model/types/assistant.d.cts +37 -0
- package/dist/components/ShapeEditor/_model/types/assistant.d.ts +3 -1
- package/dist/components/ShapeEditor/_model/types/handle.d.cts +124 -0
- package/dist/components/ShapeEditor/_model/types/handle.d.ts +30 -4
- package/dist/components/ShapeEditor/_model/types/props.d.cts +430 -0
- package/dist/components/ShapeEditor/_model/types/props.d.ts +83 -20
- package/dist/components/ShapeEditor/_model/viewSettings.cjs.map +1 -1
- package/dist/components/ShapeEditor/_model/viewSettings.d.cts +73 -0
- package/dist/components/ShapeEditor/_model/viewSettings.d.ts +13 -1
- package/dist/components/ShapeEditor/_model/viewSettings.js.map +1 -1
- package/dist/components/ShapeEditor/_model/viewerPatch.d.cts +60 -0
- package/dist/components/ShapeEditor/_model/viewerPatch.d.ts +1 -1
- package/dist/components/ShapeEditor/_model/viewport.d.cts +36 -0
- package/dist/components/ShapeEditor/_model/viewport.d.ts +1 -1
- package/dist/components/ShapeEditor/_renderers/PixiRenderer.cjs +1 -1
- package/dist/components/ShapeEditor/_renderers/PixiRenderer.cjs.map +1 -1
- package/dist/components/ShapeEditor/_renderers/PixiRenderer.d.cts +121 -0
- package/dist/components/ShapeEditor/_renderers/PixiRenderer.d.ts +5 -5
- package/dist/components/ShapeEditor/_renderers/PixiRenderer.js +1 -1
- package/dist/components/ShapeEditor/_renderers/PixiRenderer.js.map +1 -1
- package/dist/components/ShapeEditor/_renderers/imageLayer.d.cts +35 -0
- package/dist/components/ShapeEditor/_renderers/overlayLayer.d.cts +36 -0
- package/dist/components/ShapeEditor/_renderers/overlayLayer.d.ts +2 -2
- package/dist/components/ShapeEditor/_renderers/previewLayer.cjs +1 -1
- package/dist/components/ShapeEditor/_renderers/previewLayer.cjs.map +1 -1
- package/dist/components/ShapeEditor/_renderers/previewLayer.d.cts +34 -0
- package/dist/components/ShapeEditor/_renderers/previewLayer.d.ts +5 -3
- package/dist/components/ShapeEditor/_renderers/previewLayer.js +3 -0
- package/dist/components/ShapeEditor/_renderers/previewLayer.js.map +1 -1
- package/dist/components/ShapeEditor/_renderers/shapeLayer.d.cts +49 -0
- package/dist/components/ShapeEditor/_renderers/shapeLayer.d.ts +3 -3
- package/dist/components/ShapeEditor/_renderers/shapePainter.d.cts +27 -0
- package/dist/components/ShapeEditor/_renderers/shapePainter.d.ts +1 -1
- package/dist/components/ShapeEditor/_renderers/transformDriver.d.cts +55 -0
- package/dist/components/ShapeEditor/_renderers/transformDriver.d.ts +3 -3
- package/dist/components/ShapeEditor/_renderers/transformSession.d.cts +74 -0
- package/dist/components/ShapeEditor/_renderers/transformSession.d.ts +1 -1
- package/dist/components/ShapeEditor/_renderers/transformerLayer.d.cts +69 -0
- package/dist/components/ShapeEditor/_renderers/transformerLayer.d.ts +2 -2
- package/dist/components/ShapeEditor/_renderers/types.d.cts +129 -0
- package/dist/components/ShapeEditor/_renderers/types.d.ts +6 -6
- package/dist/components/ShapeEditor/_state/buildContextMenuItems.d.cts +26 -0
- package/dist/components/ShapeEditor/_state/buildContextMenuItems.d.ts +5 -5
- package/dist/components/ShapeEditor/_state/buildHotkeyActions.d.cts +42 -0
- package/dist/components/ShapeEditor/_state/buildHotkeyActions.d.ts +7 -7
- package/dist/components/ShapeEditor/_state/createInteractionController.d.cts +73 -0
- package/dist/components/ShapeEditor/_state/createInteractionController.d.ts +9 -9
- package/dist/components/ShapeEditor/_state/drawSessionState.d.cts +6 -0
- package/dist/components/ShapeEditor/_state/drawSessionState.d.ts +2 -2
- package/dist/components/ShapeEditor/_state/useAssistant.d.cts +48 -0
- package/dist/components/ShapeEditor/_state/useAssistant.d.ts +3 -3
- package/dist/components/ShapeEditor/_state/useDrawSession.d.cts +61 -0
- package/dist/components/ShapeEditor/_state/useDrawSession.d.ts +5 -5
- package/dist/components/ShapeEditor/_state/useEditorDocument.d.cts +23 -0
- package/dist/components/ShapeEditor/_state/useEditorDocument.d.ts +1 -1
- package/dist/components/ShapeEditor/_state/useEditorHandle.d.cts +34 -0
- package/dist/components/ShapeEditor/_state/useEditorHandle.d.ts +9 -9
- package/dist/components/ShapeEditor/_state/useEditorHotkeys.cjs +1 -1
- package/dist/components/ShapeEditor/_state/useEditorHotkeys.cjs.map +1 -1
- package/dist/components/ShapeEditor/_state/useEditorHotkeys.d.cts +25 -0
- package/dist/components/ShapeEditor/_state/useEditorHotkeys.d.ts +1 -1
- package/dist/components/ShapeEditor/_state/useEditorHotkeys.js +15 -15
- package/dist/components/ShapeEditor/_state/useEditorHotkeys.js.map +1 -1
- package/dist/components/ShapeEditor/_state/useEditorView.d.cts +15 -0
- package/dist/components/ShapeEditor/_state/useEditorView.d.ts +1 -1
- package/dist/components/ShapeEditor/_state/useEngineLifecycle.cjs +1 -1
- package/dist/components/ShapeEditor/_state/useEngineLifecycle.cjs.map +1 -1
- package/dist/components/ShapeEditor/_state/useEngineLifecycle.d.cts +89 -0
- package/dist/components/ShapeEditor/_state/useEngineLifecycle.d.ts +6 -6
- package/dist/components/ShapeEditor/_state/useEngineLifecycle.js +23 -20
- package/dist/components/ShapeEditor/_state/useEngineLifecycle.js.map +1 -1
- package/dist/components/ShapeEditor/_state/useLatestRef.d.cts +7 -0
- package/dist/components/ShapeEditor/_state/useMinimapNavigation.d.cts +27 -0
- package/dist/components/ShapeEditor/_state/useMinimapNavigation.d.ts +1 -1
- package/dist/components/ShapeEditor/_state/useMinimapSync.d.cts +26 -0
- package/dist/components/ShapeEditor/_state/useMinimapSync.d.ts +3 -3
- package/dist/components/ShapeEditor/_state/useSelectionActions.d.cts +31 -0
- package/dist/components/ShapeEditor/_state/useSelectionActions.d.ts +2 -2
- package/dist/components/ShapeEditor/_state/useSelectionInfoOverlay.d.cts +32 -0
- package/dist/components/ShapeEditor/_state/useSelectionInfoOverlay.d.ts +4 -4
- package/dist/components/ShapeEditor/_state/useSelectionModel.d.cts +24 -0
- package/dist/components/ShapeEditor/_state/useSelectionModel.d.ts +4 -4
- package/dist/components/ShapeEditor/_state/useViewportControls.d.cts +23 -0
- package/dist/components/ShapeEditor/_state/useViewportControls.d.ts +3 -3
- package/dist/components/ShapeEditor/index.d.cts +13 -0
- package/dist/components/ShapeEditor/index.d.ts +13 -8
- package/dist/components/Shortcut/Shortcut.cjs.map +1 -1
- package/dist/components/Shortcut/Shortcut.d.cts +24 -0
- package/dist/components/Shortcut/Shortcut.d.ts +16 -0
- package/dist/components/Shortcut/Shortcut.js.map +1 -1
- package/dist/components/Shortcut/index.d.cts +2 -0
- package/dist/components/Shortcut/index.d.ts +2 -2
- package/dist/components/Skeleton/Skeleton.cjs.map +1 -1
- package/dist/components/Skeleton/Skeleton.d.cts +26 -0
- package/dist/components/Skeleton/Skeleton.d.ts +19 -0
- package/dist/components/Skeleton/Skeleton.js.map +1 -1
- package/dist/components/Skeleton/index.d.cts +2 -0
- package/dist/components/Skeleton/index.d.ts +2 -2
- package/dist/components/Slider/Slider.cjs +1 -1
- package/dist/components/Slider/Slider.cjs.map +1 -1
- package/dist/components/Slider/Slider.d.cts +45 -0
- package/dist/components/Slider/Slider.d.ts +33 -1
- package/dist/components/Slider/Slider.js +18 -14
- package/dist/components/Slider/Slider.js.map +1 -1
- package/dist/components/Slider/index.d.cts +2 -0
- package/dist/components/Slider/index.d.ts +2 -2
- package/dist/components/Spinner/Spinner.cjs.map +1 -1
- package/dist/components/Spinner/Spinner.d.cts +32 -0
- package/dist/components/Spinner/Spinner.d.ts +18 -1
- package/dist/components/Spinner/Spinner.js.map +1 -1
- package/dist/components/Spinner/index.d.cts +2 -0
- package/dist/components/Spinner/index.d.ts +2 -2
- package/dist/components/Switch/Switch.cjs +1 -1
- package/dist/components/Switch/Switch.cjs.map +1 -1
- package/dist/components/Switch/Switch.d.cts +29 -0
- package/dist/components/Switch/Switch.d.ts +16 -0
- package/dist/components/Switch/Switch.js +1 -1
- package/dist/components/Switch/Switch.js.map +1 -1
- package/dist/components/Switch/index.d.cts +2 -0
- package/dist/components/Switch/index.d.ts +2 -2
- package/dist/components/Tab/Tab.cjs.map +1 -1
- package/dist/components/Tab/Tab.d.cts +45 -0
- package/dist/components/Tab/Tab.d.ts +26 -0
- package/dist/components/Tab/Tab.js.map +1 -1
- package/dist/components/Tab/index.d.cts +2 -0
- package/dist/components/Tab/index.d.ts +2 -2
- package/dist/components/Tag/Tag.cjs.map +1 -1
- package/dist/components/Tag/Tag.d.cts +50 -0
- package/dist/components/Tag/Tag.d.ts +32 -1
- package/dist/components/Tag/Tag.js.map +1 -1
- package/dist/components/Tag/index.d.cts +2 -0
- package/dist/components/Tag/index.d.ts +2 -2
- package/dist/components/Tagbox/Tagbox.cjs +1 -1
- package/dist/components/Tagbox/Tagbox.cjs.map +1 -1
- package/dist/components/Tagbox/Tagbox.d.cts +67 -0
- package/dist/components/Tagbox/Tagbox.d.ts +46 -3
- package/dist/components/Tagbox/Tagbox.js +5 -3
- package/dist/components/Tagbox/Tagbox.js.map +1 -1
- package/dist/components/Tagbox/index.d.cts +2 -0
- package/dist/components/Tagbox/index.d.ts +2 -2
- package/dist/components/Textarea/Textarea.cjs +1 -1
- package/dist/components/Textarea/Textarea.cjs.map +1 -1
- package/dist/components/Textarea/Textarea.d.cts +51 -0
- package/dist/components/Textarea/Textarea.d.ts +32 -3
- package/dist/components/Textarea/Textarea.js +20 -19
- package/dist/components/Textarea/Textarea.js.map +1 -1
- package/dist/components/Textarea/index.d.cts +2 -0
- package/dist/components/Textarea/index.d.ts +2 -2
- package/dist/components/Textbox/Textbox.cjs.map +1 -1
- package/dist/components/Textbox/Textbox.d.cts +49 -0
- package/dist/components/Textbox/Textbox.d.ts +30 -1
- package/dist/components/Textbox/Textbox.js.map +1 -1
- package/dist/components/Textbox/index.d.cts +2 -0
- package/dist/components/Textbox/index.d.ts +2 -2
- package/dist/components/Toast/Toast.cjs +1 -1
- package/dist/components/Toast/Toast.cjs.map +1 -1
- package/dist/components/Toast/Toast.d.cts +99 -0
- package/dist/components/Toast/Toast.d.ts +72 -4
- package/dist/components/Toast/Toast.js +3 -2
- package/dist/components/Toast/Toast.js.map +1 -1
- package/dist/components/Toast/index.d.cts +2 -0
- package/dist/components/Toast/index.d.ts +2 -2
- package/dist/components/ToggleButton/ToggleButton.cjs.map +1 -1
- package/dist/components/ToggleButton/ToggleButton.d.cts +41 -0
- package/dist/components/ToggleButton/ToggleButton.d.ts +21 -0
- package/dist/components/ToggleButton/ToggleButton.js.map +1 -1
- package/dist/components/ToggleButton/index.d.cts +2 -0
- package/dist/components/ToggleButton/index.d.ts +2 -2
- package/dist/components/Tooltip/Tooltip.cjs.map +1 -1
- package/dist/components/Tooltip/Tooltip.d.cts +40 -0
- package/dist/components/Tooltip/Tooltip.d.ts +27 -0
- package/dist/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/Tooltip/index.d.cts +2 -0
- package/dist/components/Tooltip/index.d.ts +2 -2
- package/dist/components/TruncatedText/TruncatedText.cjs.map +1 -1
- package/dist/components/TruncatedText/TruncatedText.d.cts +44 -0
- package/dist/components/TruncatedText/TruncatedText.d.ts +22 -0
- package/dist/components/TruncatedText/TruncatedText.js.map +1 -1
- package/dist/components/TruncatedText/index.d.cts +2 -0
- package/dist/components/TruncatedText/index.d.ts +2 -2
- package/dist/components/Typography/Typography.cjs.map +1 -1
- package/dist/components/Typography/Typography.d.cts +33 -0
- package/dist/components/Typography/Typography.d.ts +21 -0
- package/dist/components/Typography/Typography.js.map +1 -1
- package/dist/components/Typography/index.d.cts +2 -0
- package/dist/components/Typography/index.d.ts +2 -2
- package/dist/components/UploadArea/UploadArea.cjs +1 -1
- package/dist/components/UploadArea/UploadArea.cjs.map +1 -1
- package/dist/components/UploadArea/UploadArea.d.cts +82 -0
- package/dist/components/UploadArea/UploadArea.d.ts +66 -1
- package/dist/components/UploadArea/UploadArea.js +55 -34
- package/dist/components/UploadArea/UploadArea.js.map +1 -1
- package/dist/components/UploadArea/index.d.cts +2 -0
- package/dist/components/UploadArea/index.d.ts +2 -2
- package/dist/illustration.cjs +1 -0
- package/dist/illustration.js +3 -0
- package/dist/index.d.cts +52 -0
- package/dist/index.d.ts +52 -52
- package/dist/llms-full.txt +5993 -0
- package/dist/llms.txt +118 -0
- package/dist/shape-editor.cjs +2 -1
- package/dist/shape-editor.cjs.map +1 -0
- package/dist/shape-editor.js +8 -3
- package/dist/shape-editor.js.map +1 -0
- package/dist/styles.css +2 -2
- package/dist/tailwind.css +434 -0
- package/dist/utils/cn.d.cts +12 -0
- package/dist/utils/cn.d.ts +10 -0
- package/dist/utils/keyboard.d.cts +3 -0
- package/dist/utils/sheet.d.cts +17 -0
- package/dist/utils/useControllableState.d.cts +17 -0
- package/dist/utils/useModalAutoFocus.d.cts +11 -0
- package/dist/utils/useResizableWidth.d.cts +30 -0
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.js.map +1 -1
- package/package.json +54 -17
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { ChangeEventHandler, InputHTMLAttributes, ReactNode, Ref } from "react";
|
|
2
|
+
export interface TextboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size"> {
|
|
3
|
+
/**
|
|
4
|
+
* 높이 sm 32px·md 40px
|
|
5
|
+
* @default "md"
|
|
6
|
+
*/
|
|
7
|
+
size?: "sm" | "md";
|
|
8
|
+
/** 에러 상태. Field의 invalid가 주입하는 aria-invalid로도 켜진다 */
|
|
9
|
+
error?: boolean;
|
|
10
|
+
/** 입력값 전체 삭제 버튼 표시 여부 */
|
|
11
|
+
clearable?: boolean;
|
|
12
|
+
/** 인풋 좌측 슬롯 */
|
|
13
|
+
startContent?: ReactNode;
|
|
14
|
+
/** 인풋 우측 슬롯 (clearable=true 이고 값이 있으면 삭제 버튼이 추가됨) */
|
|
15
|
+
endContent?: ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* clearable 삭제 버튼의 aria-label
|
|
18
|
+
* @default "입력값 삭제"
|
|
19
|
+
*/
|
|
20
|
+
clearAriaLabel?: string;
|
|
21
|
+
/** 입력값이 바뀔 때(타이핑·clearable 삭제 모두) 새 문자열로 호출된다. */
|
|
22
|
+
onValueChange?: (value: string) => void;
|
|
23
|
+
/** 네이티브 change 이벤트. clearable 삭제는 이벤트가 없으므로 `onValueChange`로만 알린다. */
|
|
24
|
+
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
25
|
+
/** 내부 input 요소 ref */
|
|
26
|
+
ref?: Ref<HTMLInputElement>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* 한 줄 텍스트를 입력하는 기본 텍스트 인풋.
|
|
30
|
+
* 제어는 value + onValueChange(문자열)를 권장한다. onChange는 네이티브 이벤트라 clearable 삭제 버튼으로 지울 때는
|
|
31
|
+
* 호출되지 않는다. 비제어는 defaultValue. 여러 줄은 Textarea, 태그 목록 입력은 Tagbox.
|
|
32
|
+
* 라벨·설명·에러는 Field + FieldControl로 연결하고, 라벨이 없으면 aria-label을 지정한다.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* import { Field, FieldControl, FieldLabel, Textbox } from "@aivex/ui";
|
|
37
|
+
*
|
|
38
|
+
* const [name, setName] = useState("");
|
|
39
|
+
*
|
|
40
|
+
* <Field>
|
|
41
|
+
* <FieldLabel>이름</FieldLabel>
|
|
42
|
+
* <FieldControl>
|
|
43
|
+
* <Textbox value={name} onValueChange={setName} clearable placeholder="이름을 입력하세요" />
|
|
44
|
+
* </FieldControl>
|
|
45
|
+
* </Field>
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
declare function Textbox({ className, error, disabled, clearable, clearAriaLabel, startContent, endContent, size, id, ref, value, defaultValue, onValueChange, onChange, onFocus, onBlur, ...props }: TextboxProps): import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
export { Textbox };
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import type { ChangeEventHandler, InputHTMLAttributes, ReactNode, Ref } from "react";
|
|
2
2
|
export interface TextboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size"> {
|
|
3
|
+
/**
|
|
4
|
+
* 높이 sm 32px·md 40px
|
|
5
|
+
* @default "md"
|
|
6
|
+
*/
|
|
3
7
|
size?: "sm" | "md";
|
|
8
|
+
/** 에러 상태. Field의 invalid가 주입하는 aria-invalid로도 켜진다 */
|
|
4
9
|
error?: boolean;
|
|
5
10
|
/** 입력값 전체 삭제 버튼 표시 여부 */
|
|
6
11
|
clearable?: boolean;
|
|
@@ -8,13 +13,37 @@ export interface TextboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>
|
|
|
8
13
|
startContent?: ReactNode;
|
|
9
14
|
/** 인풋 우측 슬롯 (clearable=true 이고 값이 있으면 삭제 버튼이 추가됨) */
|
|
10
15
|
endContent?: ReactNode;
|
|
11
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* clearable 삭제 버튼의 aria-label
|
|
18
|
+
* @default "입력값 삭제"
|
|
19
|
+
*/
|
|
12
20
|
clearAriaLabel?: string;
|
|
13
21
|
/** 입력값이 바뀔 때(타이핑·clearable 삭제 모두) 새 문자열로 호출된다. */
|
|
14
22
|
onValueChange?: (value: string) => void;
|
|
15
23
|
/** 네이티브 change 이벤트. clearable 삭제는 이벤트가 없으므로 `onValueChange`로만 알린다. */
|
|
16
24
|
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
25
|
+
/** 내부 input 요소 ref */
|
|
17
26
|
ref?: Ref<HTMLInputElement>;
|
|
18
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* 한 줄 텍스트를 입력하는 기본 텍스트 인풋.
|
|
30
|
+
* 제어는 value + onValueChange(문자열)를 권장한다. onChange는 네이티브 이벤트라 clearable 삭제 버튼으로 지울 때는
|
|
31
|
+
* 호출되지 않는다. 비제어는 defaultValue. 여러 줄은 Textarea, 태그 목록 입력은 Tagbox.
|
|
32
|
+
* 라벨·설명·에러는 Field + FieldControl로 연결하고, 라벨이 없으면 aria-label을 지정한다.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* import { Field, FieldControl, FieldLabel, Textbox } from "@aivex/ui";
|
|
37
|
+
*
|
|
38
|
+
* const [name, setName] = useState("");
|
|
39
|
+
*
|
|
40
|
+
* <Field>
|
|
41
|
+
* <FieldLabel>이름</FieldLabel>
|
|
42
|
+
* <FieldControl>
|
|
43
|
+
* <Textbox value={name} onValueChange={setName} clearable placeholder="이름을 입력하세요" />
|
|
44
|
+
* </FieldControl>
|
|
45
|
+
* </Field>
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
19
48
|
declare function Textbox({ className, error, disabled, clearable, clearAriaLabel, startContent, endContent, size, id, ref, value, defaultValue, onValueChange, onChange, onFocus, onBlur, ...props }: TextboxProps): import("react/jsx-runtime").JSX.Element;
|
|
20
49
|
export { Textbox };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textbox.js","names":[],"sources":["../../../src/components/Textbox/Textbox.tsx"],"sourcesContent":["import { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport type { ChangeEventHandler, InputHTMLAttributes, ReactNode, Ref } from \"react\";\nimport { useRef } from \"react\";\nimport { CloseIcon } from \"@/components/Icon\";\nimport { IconButton } from \"@/components/IconButton\";\nimport { InputBase } from \"@/components/InputBase\";\nimport { resolveInputError, useInputFocus } from \"@/components/InputBase/useInputState\";\nimport { cn } from \"@/utils/cn\";\nimport { useControllableState } from \"@/utils/useControllableState\";\n\nexport interface TextboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, \"size\"> {\n size?: \"sm\" | \"md\";\n error?: boolean;\n /** 입력값 전체 삭제 버튼 표시 여부 */\n clearable?: boolean;\n /** 인풋 좌측 슬롯 */\n startContent?: ReactNode;\n /** 인풋 우측 슬롯 (clearable=true 이고 값이 있으면 삭제 버튼이 추가됨) */\n endContent?: ReactNode;\n
|
|
1
|
+
{"version":3,"file":"Textbox.js","names":[],"sources":["../../../src/components/Textbox/Textbox.tsx"],"sourcesContent":["import { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport type { ChangeEventHandler, InputHTMLAttributes, ReactNode, Ref } from \"react\";\nimport { useRef } from \"react\";\nimport { CloseIcon } from \"@/components/Icon\";\nimport { IconButton } from \"@/components/IconButton\";\nimport { InputBase } from \"@/components/InputBase\";\nimport { resolveInputError, useInputFocus } from \"@/components/InputBase/useInputState\";\nimport { cn } from \"@/utils/cn\";\nimport { useControllableState } from \"@/utils/useControllableState\";\n\nexport interface TextboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, \"size\"> {\n /**\n * 높이 sm 32px·md 40px\n * @default \"md\"\n */\n size?: \"sm\" | \"md\";\n /** 에러 상태. Field의 invalid가 주입하는 aria-invalid로도 켜진다 */\n error?: boolean;\n /** 입력값 전체 삭제 버튼 표시 여부 */\n clearable?: boolean;\n /** 인풋 좌측 슬롯 */\n startContent?: ReactNode;\n /** 인풋 우측 슬롯 (clearable=true 이고 값이 있으면 삭제 버튼이 추가됨) */\n endContent?: ReactNode;\n /**\n * clearable 삭제 버튼의 aria-label\n * @default \"입력값 삭제\"\n */\n clearAriaLabel?: string;\n /** 입력값이 바뀔 때(타이핑·clearable 삭제 모두) 새 문자열로 호출된다. */\n onValueChange?: (value: string) => void;\n /** 네이티브 change 이벤트. clearable 삭제는 이벤트가 없으므로 `onValueChange`로만 알린다. */\n onChange?: ChangeEventHandler<HTMLInputElement>;\n /** 내부 input 요소 ref */\n ref?: Ref<HTMLInputElement>;\n}\n\n/**\n * 한 줄 텍스트를 입력하는 기본 텍스트 인풋.\n * 제어는 value + onValueChange(문자열)를 권장한다. onChange는 네이티브 이벤트라 clearable 삭제 버튼으로 지울 때는\n * 호출되지 않는다. 비제어는 defaultValue. 여러 줄은 Textarea, 태그 목록 입력은 Tagbox.\n * 라벨·설명·에러는 Field + FieldControl로 연결하고, 라벨이 없으면 aria-label을 지정한다.\n *\n * @example\n * ```tsx\n * import { Field, FieldControl, FieldLabel, Textbox } from \"@aivex/ui\";\n *\n * const [name, setName] = useState(\"\");\n *\n * <Field>\n * <FieldLabel>이름</FieldLabel>\n * <FieldControl>\n * <Textbox value={name} onValueChange={setName} clearable placeholder=\"이름을 입력하세요\" />\n * </FieldControl>\n * </Field>\n * ```\n */\nfunction Textbox({\n className,\n error,\n disabled,\n clearable,\n clearAriaLabel = \"입력값 삭제\",\n startContent,\n endContent,\n size = \"md\",\n id,\n ref,\n value,\n defaultValue,\n onValueChange,\n onChange,\n onFocus,\n onBlur,\n ...props\n}: TextboxProps) {\n const focus = useInputFocus({ onFocus, onBlur });\n const inputRef = useRef<HTMLInputElement | null>(null);\n const isControlled = value !== undefined;\n const [currentValue, setCurrentValue] = useControllableState({\n value: isControlled ? String(value ?? \"\") : undefined,\n defaultValue:\n typeof defaultValue === \"string\" ? defaultValue : (defaultValue?.toString() ?? \"\"),\n onChange: onValueChange,\n });\n const showClearButton = clearable && currentValue.length > 0;\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n setCurrentValue(e.target.value);\n onChange?.(e);\n };\n\n const composedRef = useComposedRefs(ref, inputRef);\n\n const handleClear = () => {\n setCurrentValue(\"\");\n // 버튼이 언마운트되며 포커스가 붕 뜨지 않게 — 지운 뒤엔 이어서 입력한다.\n inputRef.current?.focus();\n };\n\n const resolvedEndContent = (\n <>\n {endContent}\n {showClearButton && (\n <IconButton\n size={size === \"sm\" ? \"xs\" : \"sm\"}\n onClick={handleClear}\n onMouseDown={(event) => event.preventDefault()}\n tabIndex={-1}\n className=\"aivex:shrink-0\"\n aria-label={clearAriaLabel}\n >\n <CloseIcon size={size === \"sm\" ? 14 : 16} />\n </IconButton>\n )}\n </>\n );\n\n const hasEndContent = endContent || showClearButton;\n\n // Field 등에서 주입한 aria-invalid도 에러 상태로 인식해 단일 소스로 동작하게 한다.\n const isError = resolveInputError(error, props[\"aria-invalid\"]);\n\n return (\n <InputBase\n error={isError}\n disabled={disabled}\n focused={focus.focused}\n filled={currentValue.length > 0}\n size={size}\n layout=\"inline\"\n startContent={startContent}\n endContent={hasEndContent ? resolvedEndContent : undefined}\n >\n <input\n ref={composedRef}\n id={id}\n disabled={disabled}\n value={clearable ? currentValue : value}\n defaultValue={clearable ? undefined : defaultValue}\n onChange={clearable || isControlled || onValueChange ? handleChange : onChange}\n className={cn(\n \"aivex:m-0 aivex:w-full aivex:min-w-0 aivex:appearance-none aivex:border-0 aivex:bg-transparent aivex:p-0 aivex:text-text-primary aivex:placeholder:text-text-tertiary aivex:outline-none\",\n size === \"sm\" ? \"aivex:text-body-md-regular\" : \"aivex:text-body-lg-regular\",\n className,\n )}\n onFocus={focus.onFocus}\n onBlur={focus.onBlur}\n {...props}\n />\n </InputBase>\n );\n}\n\nexport { Textbox };\n"],"mappings":";;;;;;;;;;;AAyDA,SAAS,EAAQ,EACf,cACA,UACA,aACA,cACA,oBAAiB,UACjB,iBACA,eACA,UAAO,MACP,OACA,QACA,UACA,iBACA,kBACA,aACA,YACA,WACA,GAAG,KACY;CACf,IAAM,IAAQ,EAAc;EAAE;EAAS;EAAQ,CAAC,EAC1C,IAAW,EAAgC,KAAK,EAChD,IAAe,MAAU,KAAA,GACzB,CAAC,GAAc,KAAmB,EAAqB;EAC3D,OAAO,IAAe,OAAO,KAAS,GAAG,GAAG,KAAA;EAC5C,cACE,OAAO,KAAiB,WAAW,IAAgB,GAAc,UAAU,IAAI;EACjF,UAAU;EACX,CAAC,EACI,IAAkB,KAAa,EAAa,SAAS,GAErD,KAAgB,MAA2C;AAE/D,EADA,EAAgB,EAAE,OAAO,MAAM,EAC/B,IAAW,EAAE;IAGT,IAAc,EAAgB,GAAK,EAAS,EAQ5C,IACJ,kBAAA,GAAA,EAAA,UAAA,CACG,GACA,KACC,kBAAC,GAAD;EACE,MAAM,MAAS,OAAO,OAAO;EAC7B,eAZkB;AAGxB,GAFA,EAAgB,GAAG,EAEnB,EAAS,SAAS,OAAO;;EAUnB,cAAc,MAAU,EAAM,gBAAgB;EAC9C,UAAU;EACV,WAAU;EACV,cAAY;YAEZ,kBAAC,GAAD,EAAW,MAAM,MAAS,OAAO,KAAK,IAAM,CAAA;EACjC,CAAA,CAEd,EAAA,CAAA,EAGC,IAAgB,KAAc;AAKpC,QACE,kBAAC,GAAD;EACE,OAJY,EAAkB,GAAO,EAAM,gBAAgB;EAKjD;EACV,SAAS,EAAM;EACf,QAAQ,EAAa,SAAS;EACxB;EACN,QAAO;EACO;EACd,YAAY,IAAgB,IAAqB,KAAA;YAEjD,kBAAC,SAAD;GACE,KAAK;GACD;GACM;GACV,OAAO,IAAY,IAAe;GAClC,cAAc,IAAY,KAAA,IAAY;GACtC,UAAU,KAAa,KAAgB,IAAgB,IAAe;GACtE,WAAW,EACT,4LACA,MAAS,OAAO,+BAA+B,8BAC/C,EACD;GACD,SAAS,EAAM;GACf,QAAQ,EAAM;GACd,GAAI;GACJ,CAAA;EACQ,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { TextboxProps } from "./Textbox";
|
|
2
|
-
export { Textbox } from "./Textbox";
|
|
1
|
+
export type { TextboxProps } from "./Textbox.js";
|
|
2
|
+
export { Textbox } from "./Textbox.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../utils.cjs`),t=require(`../Icon/index.cjs`),n=require(`../Button/Button.cjs`),r=require(`../IconButton/IconButton.cjs`);let i=require(`class-variance-authority`),a=require(`react/jsx-runtime`),o=require(`sonner`);var s=(0,i.cva)(`aivex:inline-flex aivex:min-h-10 aivex:w-fit aivex:items-center aivex:justify-center aivex:gap-md aivex:rounded-xs aivex:bg-static-gray aivex:px-xl aivex:py-xs`,{variants:{variant:{default:``,success:``,danger:``}},defaultVariants:{variant:`default`}});function c({className:i,variant:o,open:c=!0,message:l,action:u,onClose:d,closeAriaLabel:f=`닫기`,ref:p,...m}){if(!c)return null;let{children:h,...g}=u??{};return(0,a.jsxs)(`div`,{ref:p,role
|
|
1
|
+
"use client";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../utils.cjs`),t=require(`../Icon/index.cjs`),n=require(`../Button/Button.cjs`),r=require(`../IconButton/IconButton.cjs`);let i=require(`class-variance-authority`),a=require(`react/jsx-runtime`),o=require(`sonner`);var s=(0,i.cva)(`aivex:inline-flex aivex:min-h-10 aivex:w-fit aivex:items-center aivex:justify-center aivex:gap-md aivex:rounded-xs aivex:bg-static-gray aivex:px-xl aivex:py-xs`,{variants:{variant:{default:``,success:``,danger:``}},defaultVariants:{variant:`default`}});function c({className:i,variant:o,open:c=!0,message:l,action:u,onClose:d,closeAriaLabel:f=`닫기`,ref:p,...m}){if(!c)return null;let{children:h,...g}=u??{};return(0,a.jsxs)(`div`,{ref:p,role:o===`danger`?`alert`:`status`,"aria-live":o===`danger`?`assertive`:`polite`,"data-variant":o??`default`,className:e.cn(s({variant:o??`default`}),i),...m,children:[(0,a.jsx)(`p`,{className:`aivex:max-w-[720px] aivex:text-center aivex:text-body-lg-regular aivex:text-static-white`,children:l}),u&&(0,a.jsx)(n.Button,{variant:`ghost`,color:`primary`,size:`md`,className:`aivex:shrink-0`,...g,children:h}),d&&(0,a.jsx)(r.IconButton,{"aria-label":f,color:`white`,size:`sm`,className:`aivex:shrink-0`,onClick:d,children:(0,a.jsx)(t.CloseIcon,{size:20})})]})}function l({position:t=`bottom-center`,duration:n=4e3,visibleToasts:r=3,gap:i=8,style:c,toastOptions:l,...u}){let d=t.endsWith(`center`);return(0,a.jsx)(o.Toaster,{position:t,duration:n,visibleToasts:r,gap:i,style:{"--width":`720px`,...c},toastOptions:{...l,unstyled:!0,className:e.cn(s({variant:`default`}),d&&`aivex:inset-x-0 aivex:mx-auto`,l?.className),classNames:{title:`aivex:max-w-[720px] aivex:text-center aivex:text-body-lg-regular aivex:text-static-white`,description:`aivex:mt-xs aivex:max-w-[720px] aivex:text-center aivex:text-body-md-regular aivex:text-static-white aivex:opacity-80`,actionButton:`aivex:inline-flex aivex:h-8 aivex:shrink-0 aivex:cursor-pointer aivex:items-center aivex:justify-center aivex:gap-2xs aivex:rounded-md aivex:px-md aivex:text-label-lg aivex:text-text-brand aivex:transition-colors aivex:hover:bg-static-white/8`,cancelButton:`aivex:inline-flex aivex:h-8 aivex:shrink-0 aivex:cursor-pointer aivex:items-center aivex:justify-center aivex:gap-2xs aivex:rounded-md aivex:px-md aivex:text-label-lg aivex:text-static-white aivex:transition-colors aivex:hover:bg-static-white/8`,closeButton:`aivex:order-last aivex:inline-flex aivex:size-2xl aivex:shrink-0 aivex:cursor-pointer aivex:items-center aivex:justify-center aivex:rounded-xs aivex:text-static-white aivex:transition-colors aivex:hover:bg-static-white/8`,...l?.classNames}},...u})}exports.Toast=c,exports.ToastToaster=l,exports.toastVariants=s;
|
|
2
2
|
//# sourceMappingURL=Toast.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.cjs","names":[],"sources":["../../../src/components/Toast/Toast.tsx"],"sourcesContent":["import { cva, type VariantProps } from \"class-variance-authority\";\nimport type { CSSProperties, HTMLAttributes, ReactNode, Ref } from \"react\";\nimport { type ExternalToast, Toaster as SonnerToaster, type ToasterProps, toast } from \"sonner\";\nimport { Button, type ButtonProps } from \"@/components/Button\";\nimport { CloseIcon } from \"@/components/Icon\";\nimport { IconButton } from \"@/components/IconButton\";\nimport { cn } from \"@/utils/cn\";\n\n// py는 xs(4px) — 액션 버튼(32px)이 들어가도 전체 높이가 40px로 유지된다.\nconst toastVariants = cva(\n \"aivex:inline-flex aivex:min-h-10 aivex:w-fit aivex:items-center aivex:justify-center aivex:gap-md aivex:rounded-xs aivex:bg-static-gray aivex:px-xl aivex:py-xs\",\n {\n variants: {\n variant: {\n default: \"\",\n success: \"\",\n danger: \"\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\n
|
|
1
|
+
{"version":3,"file":"Toast.cjs","names":[],"sources":["../../../src/components/Toast/Toast.tsx"],"sourcesContent":["import { cva, type VariantProps } from \"class-variance-authority\";\nimport type { CSSProperties, HTMLAttributes, ReactNode, Ref } from \"react\";\nimport { type ExternalToast, Toaster as SonnerToaster, type ToasterProps, toast } from \"sonner\";\nimport { Button, type ButtonProps } from \"@/components/Button\";\nimport { CloseIcon } from \"@/components/Icon\";\nimport { IconButton } from \"@/components/IconButton\";\nimport { cn } from \"@/utils/cn\";\n\n// py는 xs(4px) — 액션 버튼(32px)이 들어가도 전체 높이가 40px로 유지된다.\n/** 토스트 표면 클래스(cva) — 같은 모양의 커스텀 토스트를 만들 때 쓴다. */\nconst toastVariants = cva(\n \"aivex:inline-flex aivex:min-h-10 aivex:w-fit aivex:items-center aivex:justify-center aivex:gap-md aivex:rounded-xs aivex:bg-static-gray aivex:px-xl aivex:py-xs\",\n {\n variants: {\n variant: {\n default: \"\",\n success: \"\",\n danger: \"\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\n/**\n * Toast의 의미 톤 — default·success·danger. 시각적으로는 같은 어두운 표면이고,\n * danger는 스크린리더가 즉시 읽도록 role=\"alert\"로 알린다. 루트에 `data-variant`가 붙는다.\n */\nexport type ToastVariant = NonNullable<VariantProps<typeof toastVariants>[\"variant\"]>;\n\n/** 액션 버튼은 라벨을 children으로 받고, 스타일은 Toast가 고정한다. */\nexport interface ToastActionProps\n extends Omit<\n ButtonProps,\n \"asChild\" | \"children\" | \"className\" | \"color\" | \"ref\" | \"size\" | \"style\" | \"variant\"\n > {\n /** 버튼 라벨 */\n children: ReactNode;\n}\n\nexport interface ToastProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * 의미 톤. 기본 \"default\".\n * @default \"default\"\n */\n variant?: ToastVariant;\n /**\n * false면 아무것도 렌더하지 않는다.\n * @default true\n */\n open?: boolean;\n /** 표시할 메시지(필수). 최대 720px 폭에서 가운데 정렬로 줄바꿈된다. */\n message: string;\n /** 메시지 우측 액션 버튼(예: 실행 취소). */\n action?: ToastActionProps;\n /** 지정하면 우측 끝에 닫기(X) 버튼을 렌더한다. */\n onClose?: () => void;\n /**\n * 닫기 버튼 aria-label. 기본 \"닫기\".\n * @default \"닫기\"\n */\n closeAriaLabel?: string;\n ref?: Ref<HTMLDivElement>;\n}\n\n/** ToastToaster props — sonner `Toaster` props 그대로(position·duration·visibleToasts·gap 등). */\nexport type ToastToasterProps = ToasterProps;\n/** `toast(message, options)`의 옵션 — sonner `ExternalToast` 그대로(description·action·closeButton·duration 등). */\nexport type ToastOptions = ExternalToast;\n\n/**\n * 토스트 모양만 그리는 정적 프리미티브 — 위치·자동 사라짐·쌓임 관리가 없다.\n *\n * 일반적인 알림은 이 컴포넌트 대신 `toast(\"메시지\")` 함수를 호출한다(ToastToaster가 앱에\n * 마운트돼 있어야 함). Toast는 직접 위치·표시를 제어해야 하는 특수한 경우나 미리보기용이다.\n * 계속 보여야 하는 화면 내 안내는 Messagebox를 쓴다. role=\"status\"·aria-live=\"polite\"로 읽힌다.\n *\n * @example\n * ```tsx\n * import { Toast } from \"@aivex/ui\";\n *\n * <Toast\n * message=\"파일을 삭제했습니다\"\n * action={{ children: \"실행 취소\", onClick: undo }}\n * onClose={() => setOpen(false)}\n * open={open}\n * />\n * ```\n */\nfunction Toast({\n className,\n variant,\n open = true,\n message,\n action,\n onClose,\n closeAriaLabel = \"닫기\",\n ref,\n ...props\n}: ToastProps) {\n if (!open) return null;\n\n const { children: actionLabel, ...actionProps } = action ?? {};\n\n return (\n <div\n ref={ref}\n // 실패 알림은 읽던 내용을 끊고 바로 알린다. 나머지는 끝난 뒤에 읽는다.\n role={variant === \"danger\" ? \"alert\" : \"status\"}\n aria-live={variant === \"danger\" ? \"assertive\" : \"polite\"}\n data-variant={variant ?? \"default\"}\n className={cn(toastVariants({ variant: variant ?? \"default\" }), className)}\n {...props}\n >\n <p className=\"aivex:max-w-[720px] aivex:text-center aivex:text-body-lg-regular aivex:text-static-white\">\n {message}\n </p>\n {action && (\n <Button\n variant=\"ghost\"\n color=\"primary\"\n size=\"md\"\n className=\"aivex:shrink-0\"\n {...actionProps}\n >\n {actionLabel}\n </Button>\n )}\n {onClose && (\n <IconButton\n aria-label={closeAriaLabel}\n color=\"white\"\n size=\"sm\"\n className=\"aivex:shrink-0\"\n onClick={onClose}\n >\n <CloseIcon size={20} />\n </IconButton>\n )}\n </div>\n );\n}\n\n/**\n * `toast()` 호출을 받아 화면에 토스트를 쌓아 보여 주는 컨테이너(sonner Toaster 래퍼).\n *\n * 앱 루트(레이아웃)에 한 번만 마운트한다 — 없으면 `toast()`를 호출해도 아무것도 보이지 않는다.\n * 그 뒤 어디서든 `@aivex/ui`의 `toast()`를 호출한다(sonner를 직접 import하지 않는다).\n * 기본값: position \"bottom-center\", duration 4000ms, visibleToasts 3, gap 8.\n *\n * @example\n * ```tsx\n * import { Button, ToastToaster, toast } from \"@aivex/ui\";\n *\n * // 앱 루트\n * <>\n * <App />\n * <ToastToaster />\n * </>\n *\n * // 어디서든\n * <Button onClick={() => toast(\"저장했습니다\")}>저장</Button>\n * <Button\n * onClick={() =>\n * toast(\"파일을 삭제했습니다\", {\n * action: { label: \"실행 취소\", onClick: undo },\n * closeButton: true,\n * })\n * }\n * >\n * 삭제\n * </Button>\n * ```\n */\nfunction ToastToaster({\n position = \"bottom-center\",\n duration = 4000,\n visibleToasts = 3,\n gap = 8,\n style,\n toastOptions,\n ...props\n}: ToastToasterProps) {\n const horizontallyCentered = position.endsWith(\"center\");\n\n return (\n <SonnerToaster\n position={position}\n duration={duration}\n visibleToasts={visibleToasts}\n gap={gap}\n // 토스트는 내용만큼 넓어진다(w-fit). 그런데 sonner는 감싸는 목록에\n // --width(기본 356px)를 박고 width: var(--width)를 걸어서, 자식의\n // fit-content가 356px에 갇혀 긴 문구가 접혔다. 목록 폭을 본문 최대\n // 폭(title의 max-w-720)까지 열어 두어, 토스트가 720px까지는 한 줄로\n // 늘어나고 그 뒤에야 접히게 한다.\n // (목록은 fixed + 자식이 absolute라 fit-content로 두면 0px로 무너진다.)\n style={{ \"--width\": \"720px\", ...style } as CSSProperties}\n toastOptions={{\n ...toastOptions,\n unstyled: true,\n // 토스트는 내용만큼 넓고(w-fit) 목록은 그보다 넓다 — sonner가 토스트를\n // 목록 왼쪽 끝(left:0)에 절대배치하므로 그대로 두면 왼쪽으로 치우친다.\n // 세로 위치는 sonner가 transform으로 잡으므로 건드리지 않고, 좌우만\n // inset-x-0 + mx-auto로 가운데 맞춘다.\n className: cn(\n toastVariants({ variant: \"default\" }),\n horizontallyCentered && \"aivex:inset-x-0 aivex:mx-auto\",\n toastOptions?.className,\n ),\n classNames: {\n title:\n \"aivex:max-w-[720px] aivex:text-center aivex:text-body-lg-regular aivex:text-static-white\",\n description:\n \"aivex:mt-xs aivex:max-w-[720px] aivex:text-center aivex:text-body-md-regular aivex:text-static-white aivex:opacity-80\",\n // 스탠드얼론 Toast의 Button(ghost/primary/md)·IconButton(white/sm)과 같은 서식.\n actionButton:\n \"aivex:inline-flex aivex:h-8 aivex:shrink-0 aivex:cursor-pointer aivex:items-center aivex:justify-center aivex:gap-2xs aivex:rounded-md aivex:px-md aivex:text-label-lg aivex:text-text-brand aivex:transition-colors aivex:hover:bg-static-white/8\",\n cancelButton:\n \"aivex:inline-flex aivex:h-8 aivex:shrink-0 aivex:cursor-pointer aivex:items-center aivex:justify-center aivex:gap-2xs aivex:rounded-md aivex:px-md aivex:text-label-lg aivex:text-static-white aivex:transition-colors aivex:hover:bg-static-white/8\",\n // sonner는 닫기 버튼을 DOM 맨 앞에 렌더한다. 시안은 우측 끝이라 order로 옮긴다.\n closeButton:\n \"aivex:order-last aivex:inline-flex aivex:size-2xl aivex:shrink-0 aivex:cursor-pointer aivex:items-center aivex:justify-center aivex:rounded-xs aivex:text-static-white aivex:transition-colors aivex:hover:bg-static-white/8\",\n ...toastOptions?.classNames,\n },\n }}\n {...props}\n />\n );\n}\n\nexport { Toast, ToastToaster, toast, toastVariants };\n"],"mappings":"wSAUA,IAAM,GAAA,EAAA,EAAA,KACJ,kKACA,CACE,SAAU,CACR,QAAS,CACP,QAAS,GACT,QAAS,GACT,OAAQ,GACT,CACF,CACD,gBAAiB,CACf,QAAS,UACV,CACF,CACF,CAmED,SAAS,EAAM,CACb,YACA,UACA,OAAO,GACP,UACA,SACA,UACA,iBAAiB,KACjB,MACA,GAAG,GACU,CACb,GAAI,CAAC,EAAM,OAAO,KAElB,GAAM,CAAE,SAAU,EAAa,GAAG,GAAgB,GAAU,EAAE,CAE9D,OACE,EAAA,EAAA,MAAC,MAAD,CACO,MAEL,KAAM,IAAY,SAAW,QAAU,SACvC,YAAW,IAAY,SAAW,YAAc,SAChD,eAAc,GAAW,UACzB,UAAW,EAAA,GAAG,EAAc,CAAE,QAAS,GAAW,UAAW,CAAC,CAAE,EAAU,CAC1E,GAAI,WAPN,EASE,EAAA,EAAA,KAAC,IAAD,CAAG,UAAU,oGACV,EACC,CAAA,CACH,IACC,EAAA,EAAA,KAAC,EAAA,OAAD,CACE,QAAQ,QACR,MAAM,UACN,KAAK,KACL,UAAU,iBACV,GAAI,WAEH,EACM,CAAA,CAEV,IACC,EAAA,EAAA,KAAC,EAAA,WAAD,CACE,aAAY,EACZ,MAAM,QACN,KAAK,KACL,UAAU,iBACV,QAAS,YAET,EAAA,EAAA,KAAC,EAAA,UAAD,CAAW,KAAM,GAAM,CAAA,CACZ,CAAA,CAEX,GAmCV,SAAS,EAAa,CACpB,WAAW,gBACX,WAAW,IACX,gBAAgB,EAChB,MAAM,EACN,QACA,eACA,GAAG,GACiB,CACpB,IAAM,EAAuB,EAAS,SAAS,SAAS,CAExD,OACE,EAAA,EAAA,KAAC,EAAA,QAAD,CACY,WACA,WACK,gBACV,MAOL,MAAO,CAAE,UAAW,QAAS,GAAG,EAAO,CACvC,aAAc,CACZ,GAAG,EACH,SAAU,GAKV,UAAW,EAAA,GACT,EAAc,CAAE,QAAS,UAAW,CAAC,CACrC,GAAwB,gCACxB,GAAc,UACf,CACD,WAAY,CACV,MACE,2FACF,YACE,wHAEF,aACE,qPACF,aACE,uPAEF,YACE,+NACF,GAAG,GAAc,WAClB,CACF,CACD,GAAI,EACJ,CAAA"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import type { HTMLAttributes, ReactNode, Ref } from "react";
|
|
3
|
+
import { type ExternalToast, type ToasterProps, toast } from "sonner";
|
|
4
|
+
import { type ButtonProps } from "../Button/index.cjs";
|
|
5
|
+
/** 토스트 표면 클래스(cva) — 같은 모양의 커스텀 토스트를 만들 때 쓴다. */
|
|
6
|
+
declare const toastVariants: (props?: ({
|
|
7
|
+
variant?: "danger" | "default" | "success" | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
+
/**
|
|
10
|
+
* Toast의 의미 톤 — default·success·danger. 시각적으로는 같은 어두운 표면이고,
|
|
11
|
+
* danger는 스크린리더가 즉시 읽도록 role="alert"로 알린다. 루트에 `data-variant`가 붙는다.
|
|
12
|
+
*/
|
|
13
|
+
export type ToastVariant = NonNullable<VariantProps<typeof toastVariants>["variant"]>;
|
|
14
|
+
/** 액션 버튼은 라벨을 children으로 받고, 스타일은 Toast가 고정한다. */
|
|
15
|
+
export interface ToastActionProps extends Omit<ButtonProps, "asChild" | "children" | "className" | "color" | "ref" | "size" | "style" | "variant"> {
|
|
16
|
+
/** 버튼 라벨 */
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
}
|
|
19
|
+
export interface ToastProps extends HTMLAttributes<HTMLDivElement> {
|
|
20
|
+
/**
|
|
21
|
+
* 의미 톤. 기본 "default".
|
|
22
|
+
* @default "default"
|
|
23
|
+
*/
|
|
24
|
+
variant?: ToastVariant;
|
|
25
|
+
/**
|
|
26
|
+
* false면 아무것도 렌더하지 않는다.
|
|
27
|
+
* @default true
|
|
28
|
+
*/
|
|
29
|
+
open?: boolean;
|
|
30
|
+
/** 표시할 메시지(필수). 최대 720px 폭에서 가운데 정렬로 줄바꿈된다. */
|
|
31
|
+
message: string;
|
|
32
|
+
/** 메시지 우측 액션 버튼(예: 실행 취소). */
|
|
33
|
+
action?: ToastActionProps;
|
|
34
|
+
/** 지정하면 우측 끝에 닫기(X) 버튼을 렌더한다. */
|
|
35
|
+
onClose?: () => void;
|
|
36
|
+
/**
|
|
37
|
+
* 닫기 버튼 aria-label. 기본 "닫기".
|
|
38
|
+
* @default "닫기"
|
|
39
|
+
*/
|
|
40
|
+
closeAriaLabel?: string;
|
|
41
|
+
ref?: Ref<HTMLDivElement>;
|
|
42
|
+
}
|
|
43
|
+
/** ToastToaster props — sonner `Toaster` props 그대로(position·duration·visibleToasts·gap 등). */
|
|
44
|
+
export type ToastToasterProps = ToasterProps;
|
|
45
|
+
/** `toast(message, options)`의 옵션 — sonner `ExternalToast` 그대로(description·action·closeButton·duration 등). */
|
|
46
|
+
export type ToastOptions = ExternalToast;
|
|
47
|
+
/**
|
|
48
|
+
* 토스트 모양만 그리는 정적 프리미티브 — 위치·자동 사라짐·쌓임 관리가 없다.
|
|
49
|
+
*
|
|
50
|
+
* 일반적인 알림은 이 컴포넌트 대신 `toast("메시지")` 함수를 호출한다(ToastToaster가 앱에
|
|
51
|
+
* 마운트돼 있어야 함). Toast는 직접 위치·표시를 제어해야 하는 특수한 경우나 미리보기용이다.
|
|
52
|
+
* 계속 보여야 하는 화면 내 안내는 Messagebox를 쓴다. role="status"·aria-live="polite"로 읽힌다.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```tsx
|
|
56
|
+
* import { Toast } from "@aivex/ui";
|
|
57
|
+
*
|
|
58
|
+
* <Toast
|
|
59
|
+
* message="파일을 삭제했습니다"
|
|
60
|
+
* action={{ children: "실행 취소", onClick: undo }}
|
|
61
|
+
* onClose={() => setOpen(false)}
|
|
62
|
+
* open={open}
|
|
63
|
+
* />
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
declare function Toast({ className, variant, open, message, action, onClose, closeAriaLabel, ref, ...props }: ToastProps): import("react/jsx-runtime").JSX.Element | null;
|
|
67
|
+
/**
|
|
68
|
+
* `toast()` 호출을 받아 화면에 토스트를 쌓아 보여 주는 컨테이너(sonner Toaster 래퍼).
|
|
69
|
+
*
|
|
70
|
+
* 앱 루트(레이아웃)에 한 번만 마운트한다 — 없으면 `toast()`를 호출해도 아무것도 보이지 않는다.
|
|
71
|
+
* 그 뒤 어디서든 `@aivex/ui`의 `toast()`를 호출한다(sonner를 직접 import하지 않는다).
|
|
72
|
+
* 기본값: position "bottom-center", duration 4000ms, visibleToasts 3, gap 8.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```tsx
|
|
76
|
+
* import { Button, ToastToaster, toast } from "@aivex/ui";
|
|
77
|
+
*
|
|
78
|
+
* // 앱 루트
|
|
79
|
+
* <>
|
|
80
|
+
* <App />
|
|
81
|
+
* <ToastToaster />
|
|
82
|
+
* </>
|
|
83
|
+
*
|
|
84
|
+
* // 어디서든
|
|
85
|
+
* <Button onClick={() => toast("저장했습니다")}>저장</Button>
|
|
86
|
+
* <Button
|
|
87
|
+
* onClick={() =>
|
|
88
|
+
* toast("파일을 삭제했습니다", {
|
|
89
|
+
* action: { label: "실행 취소", onClick: undo },
|
|
90
|
+
* closeButton: true,
|
|
91
|
+
* })
|
|
92
|
+
* }
|
|
93
|
+
* >
|
|
94
|
+
* 삭제
|
|
95
|
+
* </Button>
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
declare function ToastToaster({ position, duration, visibleToasts, gap, style, toastOptions, ...props }: ToastToasterProps): import("react/jsx-runtime").JSX.Element;
|
|
99
|
+
export { Toast, ToastToaster, toast, toastVariants };
|
|
@@ -1,31 +1,99 @@
|
|
|
1
1
|
import { type VariantProps } from "class-variance-authority";
|
|
2
2
|
import type { HTMLAttributes, ReactNode, Ref } from "react";
|
|
3
3
|
import { type ExternalToast, type ToasterProps, toast } from "sonner";
|
|
4
|
-
import { type ButtonProps } from "
|
|
4
|
+
import { type ButtonProps } from "../Button/index.js";
|
|
5
|
+
/** 토스트 표면 클래스(cva) — 같은 모양의 커스텀 토스트를 만들 때 쓴다. */
|
|
5
6
|
declare const toastVariants: (props?: ({
|
|
6
7
|
variant?: "danger" | "default" | "success" | null | undefined;
|
|
7
8
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Toast의 의미 톤 — default·success·danger. 시각적으로는 같은 어두운 표면이고,
|
|
11
|
+
* danger는 스크린리더가 즉시 읽도록 role="alert"로 알린다. 루트에 `data-variant`가 붙는다.
|
|
12
|
+
*/
|
|
9
13
|
export type ToastVariant = NonNullable<VariantProps<typeof toastVariants>["variant"]>;
|
|
10
14
|
/** 액션 버튼은 라벨을 children으로 받고, 스타일은 Toast가 고정한다. */
|
|
11
15
|
export interface ToastActionProps extends Omit<ButtonProps, "asChild" | "children" | "className" | "color" | "ref" | "size" | "style" | "variant"> {
|
|
16
|
+
/** 버튼 라벨 */
|
|
12
17
|
children: ReactNode;
|
|
13
18
|
}
|
|
14
19
|
export interface ToastProps extends HTMLAttributes<HTMLDivElement> {
|
|
15
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* 의미 톤. 기본 "default".
|
|
22
|
+
* @default "default"
|
|
23
|
+
*/
|
|
16
24
|
variant?: ToastVariant;
|
|
25
|
+
/**
|
|
26
|
+
* false면 아무것도 렌더하지 않는다.
|
|
27
|
+
* @default true
|
|
28
|
+
*/
|
|
17
29
|
open?: boolean;
|
|
30
|
+
/** 표시할 메시지(필수). 최대 720px 폭에서 가운데 정렬로 줄바꿈된다. */
|
|
18
31
|
message: string;
|
|
19
32
|
/** 메시지 우측 액션 버튼(예: 실행 취소). */
|
|
20
33
|
action?: ToastActionProps;
|
|
21
34
|
/** 지정하면 우측 끝에 닫기(X) 버튼을 렌더한다. */
|
|
22
35
|
onClose?: () => void;
|
|
23
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* 닫기 버튼 aria-label. 기본 "닫기".
|
|
38
|
+
* @default "닫기"
|
|
39
|
+
*/
|
|
24
40
|
closeAriaLabel?: string;
|
|
25
41
|
ref?: Ref<HTMLDivElement>;
|
|
26
42
|
}
|
|
43
|
+
/** ToastToaster props — sonner `Toaster` props 그대로(position·duration·visibleToasts·gap 등). */
|
|
27
44
|
export type ToastToasterProps = ToasterProps;
|
|
45
|
+
/** `toast(message, options)`의 옵션 — sonner `ExternalToast` 그대로(description·action·closeButton·duration 등). */
|
|
28
46
|
export type ToastOptions = ExternalToast;
|
|
47
|
+
/**
|
|
48
|
+
* 토스트 모양만 그리는 정적 프리미티브 — 위치·자동 사라짐·쌓임 관리가 없다.
|
|
49
|
+
*
|
|
50
|
+
* 일반적인 알림은 이 컴포넌트 대신 `toast("메시지")` 함수를 호출한다(ToastToaster가 앱에
|
|
51
|
+
* 마운트돼 있어야 함). Toast는 직접 위치·표시를 제어해야 하는 특수한 경우나 미리보기용이다.
|
|
52
|
+
* 계속 보여야 하는 화면 내 안내는 Messagebox를 쓴다. role="status"·aria-live="polite"로 읽힌다.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```tsx
|
|
56
|
+
* import { Toast } from "@aivex/ui";
|
|
57
|
+
*
|
|
58
|
+
* <Toast
|
|
59
|
+
* message="파일을 삭제했습니다"
|
|
60
|
+
* action={{ children: "실행 취소", onClick: undo }}
|
|
61
|
+
* onClose={() => setOpen(false)}
|
|
62
|
+
* open={open}
|
|
63
|
+
* />
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
29
66
|
declare function Toast({ className, variant, open, message, action, onClose, closeAriaLabel, ref, ...props }: ToastProps): import("react/jsx-runtime").JSX.Element | null;
|
|
67
|
+
/**
|
|
68
|
+
* `toast()` 호출을 받아 화면에 토스트를 쌓아 보여 주는 컨테이너(sonner Toaster 래퍼).
|
|
69
|
+
*
|
|
70
|
+
* 앱 루트(레이아웃)에 한 번만 마운트한다 — 없으면 `toast()`를 호출해도 아무것도 보이지 않는다.
|
|
71
|
+
* 그 뒤 어디서든 `@aivex/ui`의 `toast()`를 호출한다(sonner를 직접 import하지 않는다).
|
|
72
|
+
* 기본값: position "bottom-center", duration 4000ms, visibleToasts 3, gap 8.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```tsx
|
|
76
|
+
* import { Button, ToastToaster, toast } from "@aivex/ui";
|
|
77
|
+
*
|
|
78
|
+
* // 앱 루트
|
|
79
|
+
* <>
|
|
80
|
+
* <App />
|
|
81
|
+
* <ToastToaster />
|
|
82
|
+
* </>
|
|
83
|
+
*
|
|
84
|
+
* // 어디서든
|
|
85
|
+
* <Button onClick={() => toast("저장했습니다")}>저장</Button>
|
|
86
|
+
* <Button
|
|
87
|
+
* onClick={() =>
|
|
88
|
+
* toast("파일을 삭제했습니다", {
|
|
89
|
+
* action: { label: "실행 취소", onClick: undo },
|
|
90
|
+
* closeButton: true,
|
|
91
|
+
* })
|
|
92
|
+
* }
|
|
93
|
+
* >
|
|
94
|
+
* 삭제
|
|
95
|
+
* </Button>
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
30
98
|
declare function ToastToaster({ position, duration, visibleToasts, gap, style, toastOptions, ...props }: ToastToasterProps): import("react/jsx-runtime").JSX.Element;
|
|
31
99
|
export { Toast, ToastToaster, toast, toastVariants };
|
|
@@ -20,8 +20,9 @@ function u({ className: i, variant: s, open: c = !0, message: u, action: d, onCl
|
|
|
20
20
|
let { children: g, ..._ } = d ?? {};
|
|
21
21
|
return /* @__PURE__ */ o("div", {
|
|
22
22
|
ref: m,
|
|
23
|
-
role: "status",
|
|
24
|
-
"aria-live": "polite",
|
|
23
|
+
role: s === "danger" ? "alert" : "status",
|
|
24
|
+
"aria-live": s === "danger" ? "assertive" : "polite",
|
|
25
|
+
"data-variant": s ?? "default",
|
|
25
26
|
className: e(l({ variant: s ?? "default" }), i),
|
|
26
27
|
...h,
|
|
27
28
|
children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.js","names":[],"sources":["../../../src/components/Toast/Toast.tsx"],"sourcesContent":["import { cva, type VariantProps } from \"class-variance-authority\";\nimport type { CSSProperties, HTMLAttributes, ReactNode, Ref } from \"react\";\nimport { type ExternalToast, Toaster as SonnerToaster, type ToasterProps, toast } from \"sonner\";\nimport { Button, type ButtonProps } from \"@/components/Button\";\nimport { CloseIcon } from \"@/components/Icon\";\nimport { IconButton } from \"@/components/IconButton\";\nimport { cn } from \"@/utils/cn\";\n\n// py는 xs(4px) — 액션 버튼(32px)이 들어가도 전체 높이가 40px로 유지된다.\nconst toastVariants = cva(\n \"aivex:inline-flex aivex:min-h-10 aivex:w-fit aivex:items-center aivex:justify-center aivex:gap-md aivex:rounded-xs aivex:bg-static-gray aivex:px-xl aivex:py-xs\",\n {\n variants: {\n variant: {\n default: \"\",\n success: \"\",\n danger: \"\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\n
|
|
1
|
+
{"version":3,"file":"Toast.js","names":[],"sources":["../../../src/components/Toast/Toast.tsx"],"sourcesContent":["import { cva, type VariantProps } from \"class-variance-authority\";\nimport type { CSSProperties, HTMLAttributes, ReactNode, Ref } from \"react\";\nimport { type ExternalToast, Toaster as SonnerToaster, type ToasterProps, toast } from \"sonner\";\nimport { Button, type ButtonProps } from \"@/components/Button\";\nimport { CloseIcon } from \"@/components/Icon\";\nimport { IconButton } from \"@/components/IconButton\";\nimport { cn } from \"@/utils/cn\";\n\n// py는 xs(4px) — 액션 버튼(32px)이 들어가도 전체 높이가 40px로 유지된다.\n/** 토스트 표면 클래스(cva) — 같은 모양의 커스텀 토스트를 만들 때 쓴다. */\nconst toastVariants = cva(\n \"aivex:inline-flex aivex:min-h-10 aivex:w-fit aivex:items-center aivex:justify-center aivex:gap-md aivex:rounded-xs aivex:bg-static-gray aivex:px-xl aivex:py-xs\",\n {\n variants: {\n variant: {\n default: \"\",\n success: \"\",\n danger: \"\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\n/**\n * Toast의 의미 톤 — default·success·danger. 시각적으로는 같은 어두운 표면이고,\n * danger는 스크린리더가 즉시 읽도록 role=\"alert\"로 알린다. 루트에 `data-variant`가 붙는다.\n */\nexport type ToastVariant = NonNullable<VariantProps<typeof toastVariants>[\"variant\"]>;\n\n/** 액션 버튼은 라벨을 children으로 받고, 스타일은 Toast가 고정한다. */\nexport interface ToastActionProps\n extends Omit<\n ButtonProps,\n \"asChild\" | \"children\" | \"className\" | \"color\" | \"ref\" | \"size\" | \"style\" | \"variant\"\n > {\n /** 버튼 라벨 */\n children: ReactNode;\n}\n\nexport interface ToastProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * 의미 톤. 기본 \"default\".\n * @default \"default\"\n */\n variant?: ToastVariant;\n /**\n * false면 아무것도 렌더하지 않는다.\n * @default true\n */\n open?: boolean;\n /** 표시할 메시지(필수). 최대 720px 폭에서 가운데 정렬로 줄바꿈된다. */\n message: string;\n /** 메시지 우측 액션 버튼(예: 실행 취소). */\n action?: ToastActionProps;\n /** 지정하면 우측 끝에 닫기(X) 버튼을 렌더한다. */\n onClose?: () => void;\n /**\n * 닫기 버튼 aria-label. 기본 \"닫기\".\n * @default \"닫기\"\n */\n closeAriaLabel?: string;\n ref?: Ref<HTMLDivElement>;\n}\n\n/** ToastToaster props — sonner `Toaster` props 그대로(position·duration·visibleToasts·gap 등). */\nexport type ToastToasterProps = ToasterProps;\n/** `toast(message, options)`의 옵션 — sonner `ExternalToast` 그대로(description·action·closeButton·duration 등). */\nexport type ToastOptions = ExternalToast;\n\n/**\n * 토스트 모양만 그리는 정적 프리미티브 — 위치·자동 사라짐·쌓임 관리가 없다.\n *\n * 일반적인 알림은 이 컴포넌트 대신 `toast(\"메시지\")` 함수를 호출한다(ToastToaster가 앱에\n * 마운트돼 있어야 함). Toast는 직접 위치·표시를 제어해야 하는 특수한 경우나 미리보기용이다.\n * 계속 보여야 하는 화면 내 안내는 Messagebox를 쓴다. role=\"status\"·aria-live=\"polite\"로 읽힌다.\n *\n * @example\n * ```tsx\n * import { Toast } from \"@aivex/ui\";\n *\n * <Toast\n * message=\"파일을 삭제했습니다\"\n * action={{ children: \"실행 취소\", onClick: undo }}\n * onClose={() => setOpen(false)}\n * open={open}\n * />\n * ```\n */\nfunction Toast({\n className,\n variant,\n open = true,\n message,\n action,\n onClose,\n closeAriaLabel = \"닫기\",\n ref,\n ...props\n}: ToastProps) {\n if (!open) return null;\n\n const { children: actionLabel, ...actionProps } = action ?? {};\n\n return (\n <div\n ref={ref}\n // 실패 알림은 읽던 내용을 끊고 바로 알린다. 나머지는 끝난 뒤에 읽는다.\n role={variant === \"danger\" ? \"alert\" : \"status\"}\n aria-live={variant === \"danger\" ? \"assertive\" : \"polite\"}\n data-variant={variant ?? \"default\"}\n className={cn(toastVariants({ variant: variant ?? \"default\" }), className)}\n {...props}\n >\n <p className=\"aivex:max-w-[720px] aivex:text-center aivex:text-body-lg-regular aivex:text-static-white\">\n {message}\n </p>\n {action && (\n <Button\n variant=\"ghost\"\n color=\"primary\"\n size=\"md\"\n className=\"aivex:shrink-0\"\n {...actionProps}\n >\n {actionLabel}\n </Button>\n )}\n {onClose && (\n <IconButton\n aria-label={closeAriaLabel}\n color=\"white\"\n size=\"sm\"\n className=\"aivex:shrink-0\"\n onClick={onClose}\n >\n <CloseIcon size={20} />\n </IconButton>\n )}\n </div>\n );\n}\n\n/**\n * `toast()` 호출을 받아 화면에 토스트를 쌓아 보여 주는 컨테이너(sonner Toaster 래퍼).\n *\n * 앱 루트(레이아웃)에 한 번만 마운트한다 — 없으면 `toast()`를 호출해도 아무것도 보이지 않는다.\n * 그 뒤 어디서든 `@aivex/ui`의 `toast()`를 호출한다(sonner를 직접 import하지 않는다).\n * 기본값: position \"bottom-center\", duration 4000ms, visibleToasts 3, gap 8.\n *\n * @example\n * ```tsx\n * import { Button, ToastToaster, toast } from \"@aivex/ui\";\n *\n * // 앱 루트\n * <>\n * <App />\n * <ToastToaster />\n * </>\n *\n * // 어디서든\n * <Button onClick={() => toast(\"저장했습니다\")}>저장</Button>\n * <Button\n * onClick={() =>\n * toast(\"파일을 삭제했습니다\", {\n * action: { label: \"실행 취소\", onClick: undo },\n * closeButton: true,\n * })\n * }\n * >\n * 삭제\n * </Button>\n * ```\n */\nfunction ToastToaster({\n position = \"bottom-center\",\n duration = 4000,\n visibleToasts = 3,\n gap = 8,\n style,\n toastOptions,\n ...props\n}: ToastToasterProps) {\n const horizontallyCentered = position.endsWith(\"center\");\n\n return (\n <SonnerToaster\n position={position}\n duration={duration}\n visibleToasts={visibleToasts}\n gap={gap}\n // 토스트는 내용만큼 넓어진다(w-fit). 그런데 sonner는 감싸는 목록에\n // --width(기본 356px)를 박고 width: var(--width)를 걸어서, 자식의\n // fit-content가 356px에 갇혀 긴 문구가 접혔다. 목록 폭을 본문 최대\n // 폭(title의 max-w-720)까지 열어 두어, 토스트가 720px까지는 한 줄로\n // 늘어나고 그 뒤에야 접히게 한다.\n // (목록은 fixed + 자식이 absolute라 fit-content로 두면 0px로 무너진다.)\n style={{ \"--width\": \"720px\", ...style } as CSSProperties}\n toastOptions={{\n ...toastOptions,\n unstyled: true,\n // 토스트는 내용만큼 넓고(w-fit) 목록은 그보다 넓다 — sonner가 토스트를\n // 목록 왼쪽 끝(left:0)에 절대배치하므로 그대로 두면 왼쪽으로 치우친다.\n // 세로 위치는 sonner가 transform으로 잡으므로 건드리지 않고, 좌우만\n // inset-x-0 + mx-auto로 가운데 맞춘다.\n className: cn(\n toastVariants({ variant: \"default\" }),\n horizontallyCentered && \"aivex:inset-x-0 aivex:mx-auto\",\n toastOptions?.className,\n ),\n classNames: {\n title:\n \"aivex:max-w-[720px] aivex:text-center aivex:text-body-lg-regular aivex:text-static-white\",\n description:\n \"aivex:mt-xs aivex:max-w-[720px] aivex:text-center aivex:text-body-md-regular aivex:text-static-white aivex:opacity-80\",\n // 스탠드얼론 Toast의 Button(ghost/primary/md)·IconButton(white/sm)과 같은 서식.\n actionButton:\n \"aivex:inline-flex aivex:h-8 aivex:shrink-0 aivex:cursor-pointer aivex:items-center aivex:justify-center aivex:gap-2xs aivex:rounded-md aivex:px-md aivex:text-label-lg aivex:text-text-brand aivex:transition-colors aivex:hover:bg-static-white/8\",\n cancelButton:\n \"aivex:inline-flex aivex:h-8 aivex:shrink-0 aivex:cursor-pointer aivex:items-center aivex:justify-center aivex:gap-2xs aivex:rounded-md aivex:px-md aivex:text-label-lg aivex:text-static-white aivex:transition-colors aivex:hover:bg-static-white/8\",\n // sonner는 닫기 버튼을 DOM 맨 앞에 렌더한다. 시안은 우측 끝이라 order로 옮긴다.\n closeButton:\n \"aivex:order-last aivex:inline-flex aivex:size-2xl aivex:shrink-0 aivex:cursor-pointer aivex:items-center aivex:justify-center aivex:rounded-xs aivex:text-static-white aivex:transition-colors aivex:hover:bg-static-white/8\",\n ...toastOptions?.classNames,\n },\n }}\n {...props}\n />\n );\n}\n\nexport { Toast, ToastToaster, toast, toastVariants };\n"],"mappings":";;;;;;;;;AAUA,IAAM,IAAgB,EACpB,mKACA;CACE,UAAU,EACR,SAAS;EACP,SAAS;EACT,SAAS;EACT,QAAQ;EACT,EACF;CACD,iBAAiB,EACf,SAAS,WACV;CACF,CACF;AAmED,SAAS,EAAM,EACb,cACA,YACA,UAAO,IACP,YACA,WACA,YACA,oBAAiB,MACjB,QACA,GAAG,KACU;AACb,KAAI,CAAC,EAAM,QAAO;CAElB,IAAM,EAAE,UAAU,GAAa,GAAG,MAAgB,KAAU,EAAE;AAE9D,QACE,kBAAC,OAAD;EACO;EAEL,MAAM,MAAY,WAAW,UAAU;EACvC,aAAW,MAAY,WAAW,cAAc;EAChD,gBAAc,KAAW;EACzB,WAAW,EAAG,EAAc,EAAE,SAAS,KAAW,WAAW,CAAC,EAAE,EAAU;EAC1E,GAAI;YAPN;GASE,kBAAC,KAAD;IAAG,WAAU;cACV;IACC,CAAA;GACH,KACC,kBAAC,GAAD;IACE,SAAQ;IACR,OAAM;IACN,MAAK;IACL,WAAU;IACV,GAAI;cAEH;IACM,CAAA;GAEV,KACC,kBAAC,GAAD;IACE,cAAY;IACZ,OAAM;IACN,MAAK;IACL,WAAU;IACV,SAAS;cAET,kBAAC,GAAD,EAAW,MAAM,IAAM,CAAA;IACZ,CAAA;GAEX;;;AAmCV,SAAS,EAAa,EACpB,cAAW,iBACX,cAAW,KACX,mBAAgB,GAChB,SAAM,GACN,UACA,iBACA,GAAG,KACiB;CACpB,IAAM,IAAuB,EAAS,SAAS,SAAS;AAExD,QACE,kBAAC,GAAD;EACY;EACA;EACK;EACV;EAOL,OAAO;GAAE,WAAW;GAAS,GAAG;GAAO;EACvC,cAAc;GACZ,GAAG;GACH,UAAU;GAKV,WAAW,EACT,EAAc,EAAE,SAAS,WAAW,CAAC,EACrC,KAAwB,iCACxB,GAAc,UACf;GACD,YAAY;IACV,OACE;IACF,aACE;IAEF,cACE;IACF,cACE;IAEF,aACE;IACF,GAAG,GAAc;IAClB;GACF;EACD,GAAI;EACJ,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { ToastActionProps, ToastOptions, ToastProps, ToastToasterProps, ToastVariant, } from "./Toast";
|
|
2
|
-
export { Toast, ToastToaster, toast, toastVariants } from "./Toast";
|
|
1
|
+
export type { ToastActionProps, ToastOptions, ToastProps, ToastToasterProps, ToastVariant, } from "./Toast.js";
|
|
2
|
+
export { Toast, ToastToaster, toast, toastVariants } from "./Toast.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleButton.cjs","names":[],"sources":["../../../src/components/ToggleButton/ToggleButton.tsx"],"sourcesContent":["import { cva, type VariantProps } from \"class-variance-authority\";\nimport type { ButtonHTMLAttributes, ReactNode, Ref } from \"react\";\nimport { InteractionLayer } from \"@/components/InteractionLayer\";\nimport { cn } from \"@/utils/cn\";\nimport { useControllableState } from \"@/utils/useControllableState\";\n\nconst toggleButtonVariants = cva(\n \"aivex:relative aivex:overflow-hidden aivex:group aivex:inline-flex aivex:items-center aivex:justify-center aivex:border aivex:transition-colors aivex:cursor-pointer aivex:select-none aivex:focus-visible:outline-none aivex:focus-visible:ring-2 aivex:focus-visible:ring-border-brand aivex:disabled:pointer-events-none aivex:disabled:opacity-disable\",\n {\n variants: {\n shape: {\n rectangle: \"\",\n rounded: \"aivex:rounded-full\",\n },\n // Button과 동일하게 아이콘 전용은 icon-* 사이즈로 통합\n size: {\n sm: \"aivex:h-6 aivex:gap-none aivex:text-label-md\",\n md: \"aivex:h-8 aivex:gap-2xs aivex:text-label-lg\",\n \"icon-sm\": \"aivex:h-6 aivex:w-6 aivex:px-0\",\n \"icon-md\": \"aivex:h-8 aivex:w-8 aivex:px-0\",\n },\n // Outline: 테두리 있음(기존) / Ghost: 테두리 없음\n variant: {\n outline: \"\",\n ghost: \"aivex:border-transparent\",\n },\n active: {\n true: \"aivex:bg-bg-brand-subtle aivex:text-text-brand\",\n false: \"aivex:bg-bg-primary aivex:text-text-primary\",\n },\n },\n compoundVariants: [\n // Outline 배리언트의 테두리 색상 (Ghost는 border-transparent 유지)\n {\n variant: \"outline\",\n active: false,\n className: \"aivex:border-border-default\",\n },\n {\n variant: \"outline\",\n active: true,\n className: \"aivex:border-border-brand-subtle\",\n },\n // rectangle 라운딩 (텍스트/아이콘 사이즈 공통)\n {\n shape: \"rectangle\",\n size: [\"sm\", \"icon-sm\"],\n className: \"aivex:rounded-sm\",\n },\n {\n shape: \"rectangle\",\n size: [\"md\", \"icon-md\"],\n className: \"aivex:rounded-md\",\n },\n // 텍스트 사이즈의 가로 패딩 (icon-* 는 size 자체가 px-0)\n {\n shape: \"rectangle\",\n size: \"sm\",\n className: \"aivex:px-sm\",\n },\n {\n shape: \"rectangle\",\n size: \"md\",\n className: \"aivex:px-md\",\n },\n {\n shape: \"rounded\",\n size: \"sm\",\n className: \"aivex:px-md\",\n },\n {\n shape: \"rounded\",\n size: \"md\",\n className: \"aivex:px-lg\",\n },\n ],\n defaultVariants: {\n shape: \"rounded\",\n size: \"md\",\n variant: \"outline\",\n active: false,\n },\n },\n);\n\nexport interface ToggleButtonProps\n extends ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof toggleButtonVariants> {\n startContent?: ReactNode;\n endContent?: ReactNode;\n children?: ReactNode;\n ref?: Ref<HTMLButtonElement>;\n /** 비제어 모드의 초기 활성 상태. */\n defaultActive?: boolean;\n /** 클릭으로 활성 상태가 바뀔 때 새 값으로 호출된다. 제어 모드(`active`)에서도 호출된다. */\n onActiveChange?: (active: boolean) => void;\n}\n\nfunction ToggleButton({\n className,\n shape,\n size,\n variant,\n active,\n defaultActive,\n onActiveChange,\n startContent,\n endContent,\n children,\n ref,\n onClick,\n type = \"button\",\n ...props\n}: ToggleButtonProps) {\n // cva가 active를 boolean | null로 열어 두므로 null은 비제어로 본다.\n const [currentActive, setActive] = useControllableState<boolean>({\n value: active ?? undefined,\n defaultValue: Boolean(defaultActive),\n onChange: onActiveChange,\n });\n\n const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n setActive(!currentActive);\n onClick?.(e);\n };\n\n return (\n <button\n ref={ref}\n type={type}\n aria-pressed={currentActive}\n className={cn(\n toggleButtonVariants({ shape, size, variant, active: currentActive }),\n className,\n )}\n onClick={handleClick}\n {...props}\n >\n <InteractionLayer />\n {startContent || endContent ? (\n <>\n {startContent && (\n <span className=\"aivex:flex aivex:shrink-0 aivex:items-center aivex:justify-center\">\n {startContent}\n </span>\n )}\n <span className=\"aivex:min-w-0 aivex:truncate aivex:px-2xs\">{children}</span>\n {endContent && (\n <span className=\"aivex:flex aivex:shrink-0 aivex:items-center aivex:justify-center\">\n {endContent}\n </span>\n )}\n </>\n ) : (\n children\n )}\n </button>\n );\n}\n\nexport { ToggleButton, toggleButtonVariants };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ToggleButton.cjs","names":[],"sources":["../../../src/components/ToggleButton/ToggleButton.tsx"],"sourcesContent":["import { cva, type VariantProps } from \"class-variance-authority\";\nimport type { ButtonHTMLAttributes, ReactNode, Ref } from \"react\";\nimport { InteractionLayer } from \"@/components/InteractionLayer\";\nimport { cn } from \"@/utils/cn\";\nimport { useControllableState } from \"@/utils/useControllableState\";\n\n/** 토글 버튼의 모양·크기·변형·활성 클래스를 만드는 cva 변형. */\nconst toggleButtonVariants = cva(\n \"aivex:relative aivex:overflow-hidden aivex:group aivex:inline-flex aivex:items-center aivex:justify-center aivex:border aivex:transition-colors aivex:cursor-pointer aivex:select-none aivex:focus-visible:outline-none aivex:focus-visible:ring-2 aivex:focus-visible:ring-border-brand aivex:disabled:pointer-events-none aivex:disabled:opacity-disable\",\n {\n variants: {\n shape: {\n rectangle: \"\",\n rounded: \"aivex:rounded-full\",\n },\n // Button과 동일하게 아이콘 전용은 icon-* 사이즈로 통합\n size: {\n sm: \"aivex:h-6 aivex:gap-none aivex:text-label-md\",\n md: \"aivex:h-8 aivex:gap-2xs aivex:text-label-lg\",\n \"icon-sm\": \"aivex:h-6 aivex:w-6 aivex:px-0\",\n \"icon-md\": \"aivex:h-8 aivex:w-8 aivex:px-0\",\n },\n // Outline: 테두리 있음(기존) / Ghost: 테두리 없음\n variant: {\n outline: \"\",\n ghost: \"aivex:border-transparent\",\n },\n active: {\n true: \"aivex:bg-bg-brand-subtle aivex:text-text-brand\",\n false: \"aivex:bg-bg-primary aivex:text-text-primary\",\n },\n },\n compoundVariants: [\n // Outline 배리언트의 테두리 색상 (Ghost는 border-transparent 유지)\n {\n variant: \"outline\",\n active: false,\n className: \"aivex:border-border-default\",\n },\n {\n variant: \"outline\",\n active: true,\n className: \"aivex:border-border-brand-subtle\",\n },\n // rectangle 라운딩 (텍스트/아이콘 사이즈 공통)\n {\n shape: \"rectangle\",\n size: [\"sm\", \"icon-sm\"],\n className: \"aivex:rounded-sm\",\n },\n {\n shape: \"rectangle\",\n size: [\"md\", \"icon-md\"],\n className: \"aivex:rounded-md\",\n },\n // 텍스트 사이즈의 가로 패딩 (icon-* 는 size 자체가 px-0)\n {\n shape: \"rectangle\",\n size: \"sm\",\n className: \"aivex:px-sm\",\n },\n {\n shape: \"rectangle\",\n size: \"md\",\n className: \"aivex:px-md\",\n },\n {\n shape: \"rounded\",\n size: \"sm\",\n className: \"aivex:px-md\",\n },\n {\n shape: \"rounded\",\n size: \"md\",\n className: \"aivex:px-lg\",\n },\n ],\n defaultVariants: {\n shape: \"rounded\",\n size: \"md\",\n variant: \"outline\",\n active: false,\n },\n },\n);\n\nexport interface ToggleButtonProps\n extends ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof toggleButtonVariants> {\n /** 라벨 앞 슬롯(아이콘 등) */\n startContent?: ReactNode;\n /** 라벨 뒤 슬롯(아이콘 등) */\n endContent?: ReactNode;\n /** 버튼 라벨. 아이콘 전용(size icon-sm·icon-md)이면 aria-label을 함께 지정한다 */\n children?: ReactNode;\n /** button 요소 ref */\n ref?: Ref<HTMLButtonElement>;\n /** 비제어 모드의 초기 활성 상태. */\n defaultActive?: boolean;\n /** 클릭으로 활성 상태가 바뀔 때 새 값으로 호출된다. 제어 모드(`active`)에서도 호출된다. */\n onActiveChange?: (active: boolean) => void;\n}\n\n/**\n * 눌림(on/off) 상태를 가지는 토글 버튼(`aria-pressed`).\n * 각각 독립적으로 켜고 끄는 필터 칩·다중 선택에 쓴다. 하나만 고르는 그룹은 Segmented·Radio,\n * 즉시 반영되는 설정 on/off는 Switch. 제어는 `active` + onActiveChange(boolean), 비제어는 defaultActive.\n * 클릭 시 상태 토글 후 onClick도 함께 호출된다. 기본은 shape `\"rounded\"`·size `\"md\"`·variant `\"outline\"`\n * (`\"ghost\"`는 테두리 없음), size는 텍스트용 `\"sm\"`·`\"md\"`와 아이콘 전용 `\"icon-sm\"`·`\"icon-md\"`.\n *\n * @example\n * ```tsx\n * import { ToggleButton } from \"@aivex/ui\";\n *\n * <ToggleButton active={onlyMine} onActiveChange={setOnlyMine} size=\"sm\">\n * 내 작업만\n * </ToggleButton>\n * ```\n */\nfunction ToggleButton({\n className,\n shape,\n size,\n variant,\n active,\n defaultActive,\n onActiveChange,\n startContent,\n endContent,\n children,\n ref,\n onClick,\n type = \"button\",\n ...props\n}: ToggleButtonProps) {\n // cva가 active를 boolean | null로 열어 두므로 null은 비제어로 본다.\n const [currentActive, setActive] = useControllableState<boolean>({\n value: active ?? undefined,\n defaultValue: Boolean(defaultActive),\n onChange: onActiveChange,\n });\n\n const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n setActive(!currentActive);\n onClick?.(e);\n };\n\n return (\n <button\n ref={ref}\n type={type}\n aria-pressed={currentActive}\n className={cn(\n toggleButtonVariants({ shape, size, variant, active: currentActive }),\n className,\n )}\n onClick={handleClick}\n {...props}\n >\n <InteractionLayer />\n {startContent || endContent ? (\n <>\n {startContent && (\n <span className=\"aivex:flex aivex:shrink-0 aivex:items-center aivex:justify-center\">\n {startContent}\n </span>\n )}\n <span className=\"aivex:min-w-0 aivex:truncate aivex:px-2xs\">{children}</span>\n {endContent && (\n <span className=\"aivex:flex aivex:shrink-0 aivex:items-center aivex:justify-center\">\n {endContent}\n </span>\n )}\n </>\n ) : (\n children\n )}\n </button>\n );\n}\n\nexport { ToggleButton, toggleButtonVariants };\n"],"mappings":"iRAOA,IAAM,GAAA,EAAA,EAAA,KACJ,6VACA,CACE,SAAU,CACR,MAAO,CACL,UAAW,GACX,QAAS,qBACV,CAED,KAAM,CACJ,GAAI,+CACJ,GAAI,8CACJ,UAAW,iCACX,UAAW,iCACZ,CAED,QAAS,CACP,QAAS,GACT,MAAO,2BACR,CACD,OAAQ,CACN,KAAM,iDACN,MAAO,8CACR,CACF,CACD,iBAAkB,CAEhB,CACE,QAAS,UACT,OAAQ,GACR,UAAW,8BACZ,CACD,CACE,QAAS,UACT,OAAQ,GACR,UAAW,mCACZ,CAED,CACE,MAAO,YACP,KAAM,CAAC,KAAM,UAAU,CACvB,UAAW,mBACZ,CACD,CACE,MAAO,YACP,KAAM,CAAC,KAAM,UAAU,CACvB,UAAW,mBACZ,CAED,CACE,MAAO,YACP,KAAM,KACN,UAAW,cACZ,CACD,CACE,MAAO,YACP,KAAM,KACN,UAAW,cACZ,CACD,CACE,MAAO,UACP,KAAM,KACN,UAAW,cACZ,CACD,CACE,MAAO,UACP,KAAM,KACN,UAAW,cACZ,CACF,CACD,gBAAiB,CACf,MAAO,UACP,KAAM,KACN,QAAS,UACT,OAAQ,GACT,CACF,CACF,CAmCD,SAAS,EAAa,CACpB,YACA,QACA,OACA,UACA,SACA,gBACA,iBACA,eACA,aACA,WACA,MACA,UACA,OAAO,SACP,GAAG,GACiB,CAEpB,GAAM,CAAC,EAAe,GAAa,EAAA,qBAA8B,CAC/D,MAAO,GAAU,IAAA,GACjB,aAAc,EAAQ,EACtB,SAAU,EACX,CAAC,CAOF,OACE,EAAA,EAAA,MAAC,SAAD,CACO,MACC,OACN,eAAc,EACd,UAAW,EAAA,GACT,EAAqB,CAAE,QAAO,OAAM,UAAS,OAAQ,EAAe,CAAC,CACrE,EACD,CACD,QAdiB,GAA2C,CAC9D,EAAU,CAAC,EAAc,CACzB,IAAU,EAAE,EAaV,GAAI,WATN,EAWE,EAAA,EAAA,KAAC,EAAA,iBAAD,EAAoB,CAAA,CACnB,GAAgB,GACf,EAAA,EAAA,MAAA,EAAA,SAAA,CAAA,SAAA,CACG,IACC,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,6EACb,EACI,CAAA,EAET,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,4CAA6C,WAAgB,CAAA,CAC5E,IACC,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,6EACb,EACI,CAAA,CAER,CAAA,CAAA,CAEH,EAEK"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import type { ButtonHTMLAttributes, ReactNode, Ref } from "react";
|
|
3
|
+
/** 토글 버튼의 모양·크기·변형·활성 클래스를 만드는 cva 변형. */
|
|
4
|
+
declare const toggleButtonVariants: (props?: ({
|
|
5
|
+
shape?: "rectangle" | "rounded" | null | undefined;
|
|
6
|
+
size?: "icon-md" | "icon-sm" | "md" | "sm" | null | undefined;
|
|
7
|
+
variant?: "ghost" | "outline" | null | undefined;
|
|
8
|
+
active?: boolean | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
|
+
export interface ToggleButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof toggleButtonVariants> {
|
|
11
|
+
/** 라벨 앞 슬롯(아이콘 등) */
|
|
12
|
+
startContent?: ReactNode;
|
|
13
|
+
/** 라벨 뒤 슬롯(아이콘 등) */
|
|
14
|
+
endContent?: ReactNode;
|
|
15
|
+
/** 버튼 라벨. 아이콘 전용(size icon-sm·icon-md)이면 aria-label을 함께 지정한다 */
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
/** button 요소 ref */
|
|
18
|
+
ref?: Ref<HTMLButtonElement>;
|
|
19
|
+
/** 비제어 모드의 초기 활성 상태. */
|
|
20
|
+
defaultActive?: boolean;
|
|
21
|
+
/** 클릭으로 활성 상태가 바뀔 때 새 값으로 호출된다. 제어 모드(`active`)에서도 호출된다. */
|
|
22
|
+
onActiveChange?: (active: boolean) => void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 눌림(on/off) 상태를 가지는 토글 버튼(`aria-pressed`).
|
|
26
|
+
* 각각 독립적으로 켜고 끄는 필터 칩·다중 선택에 쓴다. 하나만 고르는 그룹은 Segmented·Radio,
|
|
27
|
+
* 즉시 반영되는 설정 on/off는 Switch. 제어는 `active` + onActiveChange(boolean), 비제어는 defaultActive.
|
|
28
|
+
* 클릭 시 상태 토글 후 onClick도 함께 호출된다. 기본은 shape `"rounded"`·size `"md"`·variant `"outline"`
|
|
29
|
+
* (`"ghost"`는 테두리 없음), size는 텍스트용 `"sm"`·`"md"`와 아이콘 전용 `"icon-sm"`·`"icon-md"`.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* import { ToggleButton } from "@aivex/ui";
|
|
34
|
+
*
|
|
35
|
+
* <ToggleButton active={onlyMine} onActiveChange={setOnlyMine} size="sm">
|
|
36
|
+
* 내 작업만
|
|
37
|
+
* </ToggleButton>
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
declare function ToggleButton({ className, shape, size, variant, active, defaultActive, onActiveChange, startContent, endContent, children, ref, onClick, type, ...props }: ToggleButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
export { ToggleButton, toggleButtonVariants };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type VariantProps } from "class-variance-authority";
|
|
2
2
|
import type { ButtonHTMLAttributes, ReactNode, Ref } from "react";
|
|
3
|
+
/** 토글 버튼의 모양·크기·변형·활성 클래스를 만드는 cva 변형. */
|
|
3
4
|
declare const toggleButtonVariants: (props?: ({
|
|
4
5
|
shape?: "rectangle" | "rounded" | null | undefined;
|
|
5
6
|
size?: "icon-md" | "icon-sm" | "md" | "sm" | null | undefined;
|
|
@@ -7,14 +8,34 @@ declare const toggleButtonVariants: (props?: ({
|
|
|
7
8
|
active?: boolean | null | undefined;
|
|
8
9
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
10
|
export interface ToggleButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof toggleButtonVariants> {
|
|
11
|
+
/** 라벨 앞 슬롯(아이콘 등) */
|
|
10
12
|
startContent?: ReactNode;
|
|
13
|
+
/** 라벨 뒤 슬롯(아이콘 등) */
|
|
11
14
|
endContent?: ReactNode;
|
|
15
|
+
/** 버튼 라벨. 아이콘 전용(size icon-sm·icon-md)이면 aria-label을 함께 지정한다 */
|
|
12
16
|
children?: ReactNode;
|
|
17
|
+
/** button 요소 ref */
|
|
13
18
|
ref?: Ref<HTMLButtonElement>;
|
|
14
19
|
/** 비제어 모드의 초기 활성 상태. */
|
|
15
20
|
defaultActive?: boolean;
|
|
16
21
|
/** 클릭으로 활성 상태가 바뀔 때 새 값으로 호출된다. 제어 모드(`active`)에서도 호출된다. */
|
|
17
22
|
onActiveChange?: (active: boolean) => void;
|
|
18
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* 눌림(on/off) 상태를 가지는 토글 버튼(`aria-pressed`).
|
|
26
|
+
* 각각 독립적으로 켜고 끄는 필터 칩·다중 선택에 쓴다. 하나만 고르는 그룹은 Segmented·Radio,
|
|
27
|
+
* 즉시 반영되는 설정 on/off는 Switch. 제어는 `active` + onActiveChange(boolean), 비제어는 defaultActive.
|
|
28
|
+
* 클릭 시 상태 토글 후 onClick도 함께 호출된다. 기본은 shape `"rounded"`·size `"md"`·variant `"outline"`
|
|
29
|
+
* (`"ghost"`는 테두리 없음), size는 텍스트용 `"sm"`·`"md"`와 아이콘 전용 `"icon-sm"`·`"icon-md"`.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* import { ToggleButton } from "@aivex/ui";
|
|
34
|
+
*
|
|
35
|
+
* <ToggleButton active={onlyMine} onActiveChange={setOnlyMine} size="sm">
|
|
36
|
+
* 내 작업만
|
|
37
|
+
* </ToggleButton>
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
19
40
|
declare function ToggleButton({ className, shape, size, variant, active, defaultActive, onActiveChange, startContent, endContent, children, ref, onClick, type, ...props }: ToggleButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
20
41
|
export { ToggleButton, toggleButtonVariants };
|