@aivex/ui 1.2.0-dev.54 → 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 +1 -1
- 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 +119 -12
- package/dist/components/Drawer/Drawer.js +87 -29
- 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 +21 -3
- 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 +1 -1
- 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 +119 -8
- package/dist/components/Panel/Panel.js +83 -46
- 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/tokens/tokens.css +1 -1
- 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.cjs +2 -0
- package/dist/utils/sheet.cjs.map +1 -0
- package/dist/utils/sheet.d.cts +17 -0
- package/dist/utils/sheet.d.ts +17 -0
- package/dist/utils/sheet.js +7 -0
- package/dist/utils/sheet.js.map +1 -0
- package/dist/utils/useControllableState.d.cts +17 -0
- package/dist/utils/useModalAutoFocus.d.cts +11 -0
- package/dist/utils/useResizableWidth.cjs +2 -0
- package/dist/utils/useResizableWidth.cjs.map +1 -0
- package/dist/utils/useResizableWidth.d.cts +30 -0
- package/dist/utils/useResizableWidth.d.ts +30 -0
- package/dist/utils/useResizableWidth.js +32 -0
- package/dist/utils/useResizableWidth.js.map +1 -0
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.js.map +1 -1
- package/package.json +54 -17
|
@@ -1,44 +1,102 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../../utils.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
3
|
+
import { CloseIcon as t } from "../Icon/index.js";
|
|
4
|
+
import { overlayVariants as n } from "../Overlay/Overlay.js";
|
|
5
|
+
import { useModalAutoFocus as r } from "../../utils/useModalAutoFocus.js";
|
|
6
|
+
import { sheetActionsClassName as i, sheetBodyClassName as a, sheetHeaderClassName as o, sheetTitleClassName as s } from "../../utils/sheet.js";
|
|
7
|
+
import { useResizableWidth as c } from "../../utils/useResizableWidth.js";
|
|
8
|
+
import { cva as l } from "class-variance-authority";
|
|
9
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
10
|
+
import * as f from "@radix-ui/react-dialog";
|
|
7
11
|
//#region src/components/Drawer/Drawer.tsx
|
|
8
|
-
var
|
|
12
|
+
var p = l(["aivex:panel-content aivex:fixed aivex:top-0 aivex:z-(--aivex-z-modal) aivex:flex aivex:h-dvh aivex:flex-col aivex:overflow-hidden", "aivex:max-w-[calc(100vw-32px)] aivex:bg-bg-primary aivex:shadow-xl aivex:outline-none"], {
|
|
9
13
|
variants: { side: {
|
|
10
|
-
left: "aivex:left-0
|
|
11
|
-
right: "aivex:right-0
|
|
14
|
+
left: "aivex:left-0",
|
|
15
|
+
right: "aivex:right-0"
|
|
12
16
|
} },
|
|
13
17
|
defaultVariants: { side: "right" }
|
|
14
18
|
});
|
|
15
|
-
function
|
|
16
|
-
let
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
function m({ open: t, defaultOpen: i, onOpenChange: a, title: o, children: s, side: l = "right", width: m = 420, modal: h = !1, dim: g = h, resizable: _ = !1, minWidth: v = 320, maxWidth: y, resizeAriaLabel: b = "Resize drawer", className: x, style: S, onExitComplete: C, onOpenAutoFocus: w, onCloseAutoFocus: T, onEscapeKeyDown: E, onKeyDown: D, onInteractOutside: O, ref: k }) {
|
|
20
|
+
let A = r(w, T), j = c({
|
|
21
|
+
side: l,
|
|
22
|
+
minWidth: v,
|
|
23
|
+
maxWidth: y
|
|
24
|
+
}), M = {
|
|
25
|
+
width: m,
|
|
26
|
+
...S,
|
|
27
|
+
..._ && j.width !== null ? { width: j.width } : null
|
|
28
|
+
};
|
|
29
|
+
return /* @__PURE__ */ u(f.Root, {
|
|
30
|
+
modal: h,
|
|
31
|
+
open: t,
|
|
32
|
+
defaultOpen: i,
|
|
33
|
+
onOpenChange: a,
|
|
34
|
+
children: /* @__PURE__ */ d(f.Portal, { children: [h && g ? /* @__PURE__ */ u(f.Overlay, { className: e("aivex:panel-overlay", n({ variant: "dim" })) }) : null, /* @__PURE__ */ d(f.Content, {
|
|
35
|
+
ref: k,
|
|
23
36
|
"aria-describedby": void 0,
|
|
24
|
-
"data-side":
|
|
25
|
-
className: e(
|
|
26
|
-
style:
|
|
37
|
+
"data-side": l,
|
|
38
|
+
className: e(p({ side: l }), x),
|
|
39
|
+
style: M,
|
|
27
40
|
onAnimationEnd: (e) => {
|
|
28
|
-
|
|
41
|
+
e.target === e.currentTarget && e.currentTarget.dataset.state === "closed" && C?.();
|
|
29
42
|
},
|
|
30
|
-
...
|
|
31
|
-
onEscapeKeyDown:
|
|
32
|
-
onKeyDown:
|
|
33
|
-
onInteractOutside:
|
|
34
|
-
children: [
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
43
|
+
...A,
|
|
44
|
+
onEscapeKeyDown: E,
|
|
45
|
+
onKeyDown: D,
|
|
46
|
+
onInteractOutside: O,
|
|
47
|
+
children: [
|
|
48
|
+
o === void 0 ? null : /* @__PURE__ */ u(f.Title, {
|
|
49
|
+
className: "aivex:sr-only",
|
|
50
|
+
children: o
|
|
51
|
+
}),
|
|
52
|
+
_ ? /* @__PURE__ */ u("div", {
|
|
53
|
+
role: "separator",
|
|
54
|
+
tabIndex: 0,
|
|
55
|
+
"aria-orientation": "vertical",
|
|
56
|
+
"aria-valuemin": v,
|
|
57
|
+
"aria-valuenow": j.width ?? void 0,
|
|
58
|
+
"aria-label": b,
|
|
59
|
+
...j.handlers,
|
|
60
|
+
className: e("aivex:absolute aivex:inset-y-0 aivex:z-10 aivex:w-1.5 aivex:cursor-ew-resize aivex:touch-none aivex:select-none", "aivex:transition-colors aivex:hover:bg-border-brand aivex:focus-visible:bg-border-brand aivex:focus-visible:outline-none", l === "right" ? "aivex:left-0" : "aivex:right-0")
|
|
61
|
+
}) : null,
|
|
62
|
+
s
|
|
63
|
+
]
|
|
64
|
+
})] })
|
|
39
65
|
});
|
|
40
66
|
}
|
|
67
|
+
function h({ children: n, action: r, closeAriaLabel: a = "Close drawer", className: c }) {
|
|
68
|
+
return /* @__PURE__ */ d("div", {
|
|
69
|
+
className: e(o, c),
|
|
70
|
+
children: [/* @__PURE__ */ u(f.Title, {
|
|
71
|
+
className: e(s, "aivex:flex-1"),
|
|
72
|
+
children: n
|
|
73
|
+
}), /* @__PURE__ */ d("div", {
|
|
74
|
+
className: i,
|
|
75
|
+
children: [r, /* @__PURE__ */ u(f.Close, {
|
|
76
|
+
asChild: !0,
|
|
77
|
+
children: /* @__PURE__ */ u("button", {
|
|
78
|
+
type: "button",
|
|
79
|
+
className: e("aivex:flex aivex:h-6 aivex:w-6 aivex:shrink-0 aivex:cursor-pointer aivex:items-center aivex:justify-center aivex:rounded-sm", "aivex:text-icon-secondary aivex:transition-colors", "aivex:hover:bg-bg-tertiary aivex:hover:text-icon-primary", "aivex:focus-visible:outline-none aivex:focus-visible:ring-2 aivex:focus-visible:ring-border-brand"),
|
|
80
|
+
"aria-label": a,
|
|
81
|
+
children: /* @__PURE__ */ u(t, { size: 20 })
|
|
82
|
+
})
|
|
83
|
+
})]
|
|
84
|
+
})]
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
function g({ children: t, padded: n = !0, className: r }) {
|
|
88
|
+
return /* @__PURE__ */ u("div", {
|
|
89
|
+
className: e(a, n && "aivex:p-xl", r),
|
|
90
|
+
children: t
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
var _ = Object.assign(m, {
|
|
94
|
+
Header: h,
|
|
95
|
+
Body: g,
|
|
96
|
+
Title: f.Title,
|
|
97
|
+
Close: f.Close
|
|
98
|
+
});
|
|
41
99
|
//#endregion
|
|
42
|
-
export {
|
|
100
|
+
export { _ as Drawer };
|
|
43
101
|
|
|
44
102
|
//# sourceMappingURL=Drawer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.js","names":[],"sources":["../../../src/components/Drawer/Drawer.tsx"],"sourcesContent":["import * as RadixDialog from \"@radix-ui/react-dialog\";\nimport { cva } from \"class-variance-authority\";\nimport type { ComponentPropsWithoutRef, CSSProperties, ReactNode, Ref } from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { useModalAutoFocus } from \"@/utils/useModalAutoFocus\";\n\ntype DialogContentProps = ComponentPropsWithoutRef<typeof RadixDialog.Content>;\n\n/**\n * 화면 가장자리에서 미끄러져 나오는 시트의 공통 표면 — 위치·슬라이드 애니메이션\n * (styles.css의 panel-content, data-side 기준)·기본 표면. Drawer와 Panel이 함께 쓴다.\n */\nconst drawerVariants = cva(\n [\n \"aivex:panel-content aivex:fixed aivex:top-0 aivex:z-(--aivex-z-modal) aivex:flex aivex:h-dvh aivex:flex-col aivex:overflow-hidden\",\n \"aivex:border-border-subtle aivex:bg-bg-primary aivex:shadow-xl aivex:outline-none\",\n ],\n {\n variants: {\n side: {\n left: \"aivex:left-0 aivex:border-r\",\n right: \"aivex:right-0 aivex:border-l\",\n },\n },\n defaultVariants: {\n side: \"right\",\n },\n },\n);\n\nexport interface DrawerProps {\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n /**\n * 접근성 제목 — 화면에는 그리지 않는다. 눈에 보이는 헤더는 소비자가\n * children으로 직접 구성한다.\n */\n title: string;\n children: ReactNode;\n side?: \"left\" | \"right\";\n /**\n * 모달 여부. 기본 false — 드로어를 연 채로 뒤 화면을 계속 쓰는 패턴이\n * 기본값이다(딤·포커스 트랩 없음). true면 Radix 모달 동작을 그대로 따른다.\n */\n modal?: boolean;\n /** 폭·레이아웃 등 표면 커스텀. 위치·애니메이션·기본 표면은 드로어가 소유한다. */\n className?: string;\n style?: CSSProperties;\n /**\n * 닫힘 애니메이션이 끝났을 때 통지 — open=false 전환 후 이 시점에\n * 언마운트하면 슬라이드 아웃이 잘리지 않는다.\n */\n onExitComplete?: () => void;\n onOpenAutoFocus?: DialogContentProps[\"onOpenAutoFocus\"];\n onCloseAutoFocus?: DialogContentProps[\"onCloseAutoFocus\"];\n onKeyDown?: DialogContentProps[\"onKeyDown\"];\n onEscapeKeyDown?: DialogContentProps[\"onEscapeKeyDown\"];\n onInteractOutside?: DialogContentProps[\"onInteractOutside\"];\n ref?: Ref<HTMLDivElement>;\n}\n\nfunction Drawer({\n open,\n onOpenChange,\n title,\n children,\n side = \"right\",\n modal = false,\n className,\n style,\n onExitComplete,\n onOpenAutoFocus,\n onCloseAutoFocus,\n onEscapeKeyDown,\n onKeyDown,\n onInteractOutside,\n ref,\n}: DrawerProps) {\n const autoFocus = useModalAutoFocus(onOpenAutoFocus, onCloseAutoFocus);\n return (\n <RadixDialog.Root modal={modal} open={open} onOpenChange={onOpenChange}>\n <RadixDialog.Portal>\n <RadixDialog.Content\n ref={ref}\n aria-describedby={undefined}\n data-side={side}\n className={cn(drawerVariants({ side }), className)}\n style={style}\n onAnimationEnd={(event) => {\n if (!open && event.target === event.currentTarget) onExitComplete?.();\n }}\n {...autoFocus}\n onEscapeKeyDown={onEscapeKeyDown}\n onKeyDown={onKeyDown}\n onInteractOutside={onInteractOutside}\n >\n <RadixDialog.Title className=\"aivex:sr-only\">{title}</RadixDialog.Title>\n {children}\n </RadixDialog.Content>\n </RadixDialog.Portal>\n </RadixDialog.Root>\n );\n}\n\nexport { Drawer, drawerVariants };\n"],"mappings":";;;;;;;AAYA,IAAM,IAAiB,EACrB,CACE,qIACA,oFACD,EACD;CACE,UAAU,EACR,MAAM;EACJ,MAAM;EACN,OAAO;EACR,EACF;CACD,iBAAiB,EACf,MAAM,SACP;CACF,CACF;AAiCD,SAAS,EAAO,EACd,SACA,iBACA,UACA,aACA,UAAO,SACP,WAAQ,IACR,cACA,UACA,mBACA,oBACA,qBACA,oBACA,cACA,sBACA,UACc;CACd,IAAM,IAAY,EAAkB,GAAiB,EAAiB;AACtE,QACE,kBAAC,EAAY,MAAb;EAAyB;EAAa;EAAoB;YACxD,kBAAC,EAAY,QAAb,EAAA,UACE,kBAAC,EAAY,SAAb;GACO;GACL,oBAAkB,KAAA;GAClB,aAAW;GACX,WAAW,EAAG,EAAe,EAAE,SAAM,CAAC,EAAE,EAAU;GAC3C;GACP,iBAAiB,MAAU;AACzB,IAAI,CAAC,KAAQ,EAAM,WAAW,EAAM,iBAAe,KAAkB;;GAEvE,GAAI;GACa;GACN;GACQ;aAZrB,CAcE,kBAAC,EAAY,OAAb;IAAmB,WAAU;cAAiB;IAA0B,CAAA,EACvE,EACmB;MACH,CAAA;EACJ,CAAA"}
|
|
1
|
+
{"version":3,"file":"Drawer.js","names":[],"sources":["../../../src/components/Drawer/Drawer.tsx"],"sourcesContent":["import * as RadixDialog from \"@radix-ui/react-dialog\";\nimport { cva } from \"class-variance-authority\";\nimport type { ComponentPropsWithoutRef, CSSProperties, ReactNode, Ref } from \"react\";\nimport { CloseIcon } from \"@/components/Icon\";\nimport { overlayVariants } from \"@/components/Overlay/Overlay\";\nimport { cn } from \"@/utils/cn\";\nimport {\n SHEET_DEFAULT_WIDTH,\n sheetActionsClassName,\n sheetBodyClassName,\n sheetBodyPaddingClassName,\n sheetHeaderClassName,\n sheetTitleClassName,\n} from \"@/utils/sheet\";\nimport { useModalAutoFocus } from \"@/utils/useModalAutoFocus\";\nimport { useResizableWidth } from \"@/utils/useResizableWidth\";\n\ntype DialogContentProps = ComponentPropsWithoutRef<typeof RadixDialog.Content>;\n\n/**\n * 화면 가장자리에서 미끄러져 나오는 시트의 표면 — 위치·슬라이드 애니메이션\n * (styles.css의 panel-content, data-side 기준)·기본 표면. Figma Drawer처럼 테두리 없이\n * 그림자(elevation/xl)로 떠 보인다.\n */\nconst drawerVariants = cva(\n [\n \"aivex:panel-content aivex:fixed aivex:top-0 aivex:z-(--aivex-z-modal) aivex:flex aivex:h-dvh aivex:flex-col aivex:overflow-hidden\",\n \"aivex:max-w-[calc(100vw-32px)] aivex:bg-bg-primary aivex:shadow-xl aivex:outline-none\",\n ],\n {\n variants: {\n side: {\n left: \"aivex:left-0\",\n right: \"aivex:right-0\",\n },\n },\n defaultVariants: {\n side: \"right\",\n },\n },\n);\n\n/**\n * 화면 가장자리의 사이드 시트. 기본은 비모달(뒤 화면을 계속 쓰는 상세·알림 패널),\n * `modal`이면 딤 깔린 모달 시트가 된다. 표준 헤더는 Drawer.Header, 본문은 Drawer.Body로 둔다.\n */\nexport interface DrawerProps {\n /** 열림 상태(제어). onOpenChange와 함께 쓴다. */\n open?: boolean;\n /** 초기 열림 상태(비제어). */\n defaultOpen?: boolean;\n /** 열림 상태가 바뀔 때 호출 — 닫기 버튼·Esc(모달이면 바깥 클릭도) 모두 false로 알린다. */\n onOpenChange?: (open: boolean) => void;\n /**\n * 접근성 제목 — 화면에는 그리지 않는다. Drawer.Header(또는 Drawer.Title)와\n * 함께 쓰지 않는다 — 제목이 둘이 된다. 둘 다 없으면 Radix가 개발 모드에서 경고한다.\n */\n title?: string;\n /** 시트 내용 — 보통 Drawer.Header + Drawer.Body. */\n children: ReactNode;\n /**\n * 시트가 나오는 화면 가장자리.\n * @default \"right\"\n */\n side?: \"left\" | \"right\";\n /**\n * 폭. 숫자는 px, 문자열은 CSS 길이(\"90vw\" 등). 기본 420px(Figma). 폭은 늘\n * 화면 폭 - 32px로 제한된다. style.width가 있으면 그쪽이 이긴다.\n * @default 420\n */\n width?: number | string;\n /**\n * 모달 여부. 기본 false — 드로어를 연 채로 뒤 화면을 계속 쓰는 패턴이\n * 기본값이다(딤·포커스 트랩 없음). true면 Radix 모달 동작을 그대로 따른다\n * (딤·포커스 트랩·바깥 클릭 닫기).\n * @default false\n */\n modal?: boolean;\n /**\n * 딤 배경 표시. 기본은 modal 값을 따른다(모달이면 딤). 모달일 때만 그린다 —\n * 비모달은 뒤 화면을 가리지 않는다.\n * @default modal\n */\n dim?: boolean;\n /**\n * 안쪽 모서리를 끌어(또는 핸들에 포커스하고 방향키로) 폭을 바꾼다. 조절한 폭은\n * 드로어가 마운트돼 있는 동안 유지되고, 그 전까지는 width(또는 style.width)를 쓴다.\n * @default false\n */\n resizable?: boolean;\n /**\n * resizable일 때 최소 폭(px). 기본 320.\n * @default 320\n */\n minWidth?: number;\n /** resizable일 때 최대 폭(px). 생략하면 화면 폭 - 48px — 뒤 화면을 조금 남긴다. */\n maxWidth?: number;\n /**\n * 폭 조절 핸들의 접근성 이름.\n * @default \"Resize drawer\"\n */\n resizeAriaLabel?: string;\n /** 표면 커스텀. 위치·애니메이션·기본 표면은 드로어가 소유한다. 폭은 width로 정한다. */\n className?: string;\n /** 표면 인라인 스타일. style.width는 width prop보다 우선한다. */\n style?: CSSProperties;\n /**\n * 닫힘 애니메이션이 끝났을 때 통지 — open=false 전환 후 이 시점에\n * 언마운트하면 슬라이드 아웃이 잘리지 않는다.\n */\n onExitComplete?: () => void;\n /** 열릴 때 자동 포커스 직전 호출 — preventDefault()로 기본 포커스 이동을 막는다. */\n onOpenAutoFocus?: DialogContentProps[\"onOpenAutoFocus\"];\n /** 닫힐 때 포커스 복원 직전 호출 — preventDefault()로 기본 복원을 막는다. */\n onCloseAutoFocus?: DialogContentProps[\"onCloseAutoFocus\"];\n /** 시트 표면의 keydown 핸들러. */\n onKeyDown?: DialogContentProps[\"onKeyDown\"];\n /** Esc 키 입력 시 호출 — preventDefault()로 닫힘을 막는다. */\n onEscapeKeyDown?: DialogContentProps[\"onEscapeKeyDown\"];\n /** 바깥 클릭·포커스 이동 시 호출 — preventDefault()로 닫힘을 막는다. */\n onInteractOutside?: DialogContentProps[\"onInteractOutside\"];\n ref?: Ref<HTMLDivElement>;\n}\n\nfunction DrawerRoot({\n open,\n defaultOpen,\n onOpenChange,\n title,\n children,\n side = \"right\",\n width = SHEET_DEFAULT_WIDTH,\n modal = false,\n dim = modal,\n resizable = false,\n minWidth = 320,\n maxWidth,\n resizeAriaLabel = \"Resize drawer\",\n className,\n style,\n onExitComplete,\n onOpenAutoFocus,\n onCloseAutoFocus,\n onEscapeKeyDown,\n onKeyDown,\n onInteractOutside,\n ref,\n}: DrawerProps) {\n const autoFocus = useModalAutoFocus(onOpenAutoFocus, onCloseAutoFocus);\n const resize = useResizableWidth({ side, minWidth, maxWidth });\n const surfaceStyle: CSSProperties = {\n width,\n ...style,\n ...(resizable && resize.width !== null ? { width: resize.width } : null),\n };\n return (\n <RadixDialog.Root\n modal={modal}\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n >\n <RadixDialog.Portal>\n {modal && dim ? (\n <RadixDialog.Overlay\n className={cn(\"aivex:panel-overlay\", overlayVariants({ variant: \"dim\" }))}\n />\n ) : null}\n <RadixDialog.Content\n ref={ref}\n aria-describedby={undefined}\n data-side={side}\n className={cn(drawerVariants({ side }), className)}\n style={surfaceStyle}\n onAnimationEnd={(event) => {\n // open prop이 아니라 실제 상태로 판정한다 — defaultOpen(비제어)이면 open이 늘 undefined다.\n if (event.target !== event.currentTarget) return;\n if (event.currentTarget.dataset.state === \"closed\") onExitComplete?.();\n }}\n {...autoFocus}\n onEscapeKeyDown={onEscapeKeyDown}\n onKeyDown={onKeyDown}\n onInteractOutside={onInteractOutside}\n >\n {title !== undefined ? (\n <RadixDialog.Title className=\"aivex:sr-only\">{title}</RadixDialog.Title>\n ) : null}\n {resizable ? (\n // biome-ignore lint/a11y/useSemanticElements: 포커스·드래그를 받는 폭 조절 핸들이라 hr로 표현할 수 없다\n <div\n role=\"separator\"\n tabIndex={0}\n aria-orientation=\"vertical\"\n aria-valuemin={minWidth}\n aria-valuenow={resize.width ?? undefined}\n aria-label={resizeAriaLabel}\n {...resize.handlers}\n className={cn(\n \"aivex:absolute aivex:inset-y-0 aivex:z-10 aivex:w-1.5 aivex:cursor-ew-resize aivex:touch-none aivex:select-none\",\n \"aivex:transition-colors aivex:hover:bg-border-brand aivex:focus-visible:bg-border-brand aivex:focus-visible:outline-none\",\n side === \"right\" ? \"aivex:left-0\" : \"aivex:right-0\",\n )}\n />\n ) : null}\n {children}\n </RadixDialog.Content>\n </RadixDialog.Portal>\n </RadixDialog.Root>\n );\n}\n\nexport interface DrawerHeaderProps {\n /** 눈에 보이는 제목 — 드로어의 접근성 제목도 된다. */\n children: ReactNode;\n /** 닫기 버튼 왼쪽에 두는 보조 동작(설정 버튼 등). */\n action?: ReactNode;\n /**\n * 닫기 버튼의 접근성 이름.\n * @default \"Close drawer\"\n */\n closeAriaLabel?: string;\n className?: string;\n}\n\n/** 표준 헤더 — 제목·보조 동작·닫기 버튼. 높이 50px, 아래 구분선(Figma Header). */\nfunction DrawerHeader({\n children,\n action,\n closeAriaLabel = \"Close drawer\",\n className,\n}: DrawerHeaderProps) {\n return (\n <div className={cn(sheetHeaderClassName, className)}>\n <RadixDialog.Title className={cn(sheetTitleClassName, \"aivex:flex-1\")}>\n {children}\n </RadixDialog.Title>\n <div className={sheetActionsClassName}>\n {action}\n <RadixDialog.Close asChild>\n <button\n type=\"button\"\n className={cn(\n \"aivex:flex aivex:h-6 aivex:w-6 aivex:shrink-0 aivex:cursor-pointer aivex:items-center aivex:justify-center aivex:rounded-sm\",\n \"aivex:text-icon-secondary aivex:transition-colors\",\n \"aivex:hover:bg-bg-tertiary aivex:hover:text-icon-primary\",\n \"aivex:focus-visible:outline-none aivex:focus-visible:ring-2 aivex:focus-visible:ring-border-brand\",\n )}\n aria-label={closeAriaLabel}\n >\n <CloseIcon size={20} />\n </button>\n </RadixDialog.Close>\n </div>\n </div>\n );\n}\n\nexport interface DrawerBodyProps {\n /** 본문 내용 */\n children: ReactNode;\n /**\n * 사방 16px 여백(Figma Body). 기본 true. 탭·목록처럼 가장자리까지 붙는 내용은\n * false로 끈다.\n * @default true\n */\n padded?: boolean;\n className?: string;\n}\n\n/** 헤더 아래 남은 높이를 채우는 본문 영역 — 넘치면 이 안에서 세로 스크롤한다. */\nfunction DrawerBody({ children, padded = true, className }: DrawerBodyProps) {\n return (\n <div className={cn(sheetBodyClassName, padded && sheetBodyPaddingClassName, className)}>\n {children}\n </div>\n );\n}\n\n/**\n * 화면 가장자리에서 미끄러져 나와 화면 위에 덮이는 오버레이 사이드 시트.\n *\n * 목록에서 항목을 눌러 상세·설정을 옆에 띄울 때 쓴다. 레이아웃 안에 자리를 차지하며 본문과\n * 나란히 늘 보이는 사이드 영역은 Panel, 화면 중앙 카드는 Modal을 쓴다. 기본은 비모달(딤·포커스\n * 트랩 없이 뒤 화면을 계속 조작)이며 `modal`을 켜면 딤 깔린 모달 시트가 된다. 접근성 제목이\n * 필요하다 — Drawer.Header(보이는 제목) 또는 `title` prop(숨김 제목) 중 하나만 쓴다.\n *\n * @example\n * ```tsx\n * import { Drawer, IconButton, SettingIcon } from \"@aivex/ui\";\n *\n * <Drawer open={open} onOpenChange={setOpen} side=\"right\" width={420}>\n * <Drawer.Header\n * action={\n * <IconButton size=\"sm\" aria-label=\"설정 열기\">\n * <SettingIcon size={20} />\n * </IconButton>\n * }\n * >\n * 상세 정보\n * </Drawer.Header>\n * <Drawer.Body>…</Drawer.Body>\n * </Drawer>\n * ```\n */\nconst Drawer = Object.assign(DrawerRoot, {\n /** 표준 헤더 — 보이는 제목(접근성 제목 겸)·보조 동작·닫기 버튼. */\n Header: DrawerHeader,\n /** 헤더 아래 남은 높이를 채우고 넘치면 스크롤하는 본문. */\n Body: DrawerBody,\n /** Drawer.Header 없이 직접 헤더를 만들 때 쓰는 접근성 제목(Radix Dialog.Title). */\n Title: RadixDialog.Title,\n /** 감싼 요소를 누르면 드로어가 닫힌다(Radix Dialog.Close). asChild로 버튼을 감싼다. */\n Close: RadixDialog.Close,\n});\n\nexport { Drawer };\n"],"mappings":";;;;;;;;;;;AAwBA,IAAM,IAAiB,EACrB,CACE,qIACA,wFACD,EACD;CACE,UAAU,EACR,MAAM;EACJ,MAAM;EACN,OAAO;EACR,EACF;CACD,iBAAiB,EACf,MAAM,SACP;CACF,CACF;AAoFD,SAAS,EAAW,EAClB,SACA,gBACA,iBACA,UACA,aACA,UAAO,SACP,WAAA,KACA,WAAQ,IACR,SAAM,GACN,eAAY,IACZ,cAAW,KACX,aACA,qBAAkB,iBAClB,cACA,UACA,mBACA,oBACA,qBACA,oBACA,cACA,sBACA,UACc;CACd,IAAM,IAAY,EAAkB,GAAiB,EAAiB,EAChE,IAAS,EAAkB;EAAE;EAAM;EAAU;EAAU,CAAC,EACxD,IAA8B;EAClC;EACA,GAAG;EACH,GAAI,KAAa,EAAO,UAAU,OAAO,EAAE,OAAO,EAAO,OAAO,GAAG;EACpE;AACD,QACE,kBAAC,EAAY,MAAb;EACS;EACD;EACO;EACC;YAEd,kBAAC,EAAY,QAAb,EAAA,UAAA,CACG,KAAS,IACR,kBAAC,EAAY,SAAb,EACE,WAAW,EAAG,uBAAuB,EAAgB,EAAE,SAAS,OAAO,CAAC,CAAC,EACzE,CAAA,GACA,MACJ,kBAAC,EAAY,SAAb;GACO;GACL,oBAAkB,KAAA;GAClB,aAAW;GACX,WAAW,EAAG,EAAe,EAAE,SAAM,CAAC,EAAE,EAAU;GAClD,OAAO;GACP,iBAAiB,MAAU;AAErB,MAAM,WAAW,EAAM,iBACvB,EAAM,cAAc,QAAQ,UAAU,YAAU,KAAkB;;GAExE,GAAI;GACa;GACN;GACQ;aAdrB;IAgBG,MAAU,KAAA,IAEP,OADF,kBAAC,EAAY,OAAb;KAAmB,WAAU;eAAiB;KAA0B,CAAA;IAEzE,IAEC,kBAAC,OAAD;KACE,MAAK;KACL,UAAU;KACV,oBAAiB;KACjB,iBAAe;KACf,iBAAe,EAAO,SAAS,KAAA;KAC/B,cAAY;KACZ,GAAI,EAAO;KACX,WAAW,EACT,mHACA,4HACA,MAAS,UAAU,iBAAiB,gBACrC;KACD,CAAA,GACA;IACH;IACmB;KACH,EAAA,CAAA;EACJ,CAAA;;AAkBvB,SAAS,EAAa,EACpB,aACA,WACA,oBAAiB,gBACjB,gBACoB;AACpB,QACE,kBAAC,OAAD;EAAK,WAAW,EAAG,GAAsB,EAAU;YAAnD,CACE,kBAAC,EAAY,OAAb;GAAmB,WAAW,EAAG,GAAqB,eAAe;GAClE;GACiB,CAAA,EACpB,kBAAC,OAAD;GAAK,WAAW;aAAhB,CACG,GACD,kBAAC,EAAY,OAAb;IAAmB,SAAA;cACjB,kBAAC,UAAD;KACE,MAAK;KACL,WAAW,EACT,+HACA,qDACA,4DACA,oGACD;KACD,cAAY;eAEZ,kBAAC,GAAD,EAAW,MAAM,IAAM,CAAA;KAChB,CAAA;IACS,CAAA,CAChB;KACF;;;AAiBV,SAAS,EAAW,EAAE,aAAU,YAAS,IAAM,gBAA8B;AAC3E,QACE,kBAAC,OAAD;EAAK,WAAW,EAAG,GAAoB,KAAA,cAAqC,EAAU;EACnF;EACG,CAAA;;AA8BV,IAAM,IAAS,OAAO,OAAO,GAAY;CAEvC,QAAQ;CAER,MAAM;CAEN,OAAO,EAAY;CAEnB,OAAO,EAAY;CACpB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { DrawerProps } from "./Drawer";
|
|
2
|
-
export { Drawer } from "./Drawer";
|
|
1
|
+
export type { DrawerBodyProps, DrawerHeaderProps, DrawerProps } from "./Drawer.js";
|
|
2
|
+
export { Drawer } from "./Drawer.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";"use client";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../utils.cjs`);let t=require(`class-variance-authority`),n=require(`react`),r=require(`react/jsx-runtime`),i=require(`@radix-ui/react-slot`);var a=(0,n.createContext)(null);function o(){let e=(0,n.useContext)(a);if(!e)throw Error(`Field 하위 컴포넌트는 <Field> 내부에서 사용해야 합니다.`);return e}var s=(0,t.cva)(`aivex:flex aivex:w-full`,{variants:{orientation:{vertical:`aivex:flex-col aivex:gap-xs`,horizontal:`aivex:flex-row aivex:items-center aivex:gap-sm aivex:has-[[data-slot=field-content]]:items-start`}},defaultVariants:{orientation:`vertical`}});function c({className:t,orientation:i,fieldId:o,invalid:c=!1,disabled:l=!1,ref:u,...d}){let f=(0,n.useId)(),p=o??f,m={controlId:p,descriptionId:`${p}-description`,errorId:`${p}-error`,invalid:c,disabled:l};return(0,r.jsx)(a.Provider,{value:
|
|
1
|
+
"use client";"use client";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../utils.cjs`);let t=require(`class-variance-authority`),n=require(`react`),r=require(`react/jsx-runtime`),i=require(`@radix-ui/react-slot`);var a=(0,n.createContext)(null);function o(){let e=(0,n.useContext)(a);if(!e)throw Error(`Field 하위 컴포넌트는 <Field> 내부에서 사용해야 합니다.`);return e}var s=(0,t.cva)(`aivex:flex aivex:w-full`,{variants:{orientation:{vertical:`aivex:flex-col aivex:gap-xs`,horizontal:`aivex:flex-row aivex:items-center aivex:gap-sm aivex:has-[[data-slot=field-content]]:items-start`}},defaultVariants:{orientation:`vertical`}});function c({className:t,orientation:i,fieldId:o,invalid:c=!1,disabled:l=!1,ref:u,...d}){let f=(0,n.useId)(),p=o??f,[m,h]=(0,n.useState)(0),[g,_]=(0,n.useState)(0),v=(0,n.useCallback)(()=>(h(e=>e+1),()=>h(e=>e-1)),[]),y=(0,n.useCallback)(()=>(_(e=>e+1),()=>_(e=>e-1)),[]),b={controlId:p,descriptionId:`${p}-description`,errorId:`${p}-error`,invalid:c,disabled:l,hasDescription:m>0,hasError:g>0,registerDescription:v,registerError:y};return(0,r.jsx)(a.Provider,{value:b,children:(0,r.jsx)(`div`,{ref:u,className:e.cn(s({orientation:i}),t),"data-invalid":c||void 0,"data-disabled":l||void 0,...d})})}function l({className:t,ref:n,...i}){let{controlId:a,invalid:s,disabled:c}=o();return(0,r.jsx)(`label`,{ref:n,htmlFor:a,className:e.cn(`aivex:text-label-md aivex:text-text-secondary aivex:cursor-pointer aivex:select-none`,c&&`aivex:cursor-not-allowed aivex:text-text-disabled`,!c&&s&&`aivex:text-text-danger`,t),...i})}function u({className:t,ref:n,...i}){return(0,r.jsx)(`div`,{ref:n,"data-slot":`field-content`,className:e.cn(`aivex:flex aivex:min-w-0 aivex:flex-1 aivex:flex-col aivex:gap-2xs`,t),...i})}function d(e,t){return!t||!(0,n.isValidElement)(e)||e.props.disabled!==void 0?e:(0,n.cloneElement)(e,{disabled:!0})}function f({children:e}){let{controlId:t,descriptionId:n,errorId:a,invalid:s,disabled:c,hasDescription:l,hasError:u}=o();return(0,r.jsx)(i.Slot,{id:t,"aria-describedby":[l&&n,s&&u&&a].filter(Boolean).join(` `)||void 0,"aria-invalid":s||void 0,children:d(e,c)})}function p({className:t,ref:i,...a}){let{descriptionId:s,disabled:c,registerDescription:l}=o();return(0,n.useEffect)(l,[l]),(0,r.jsx)(`p`,{ref:i,id:s,className:e.cn(`aivex:text-caption-md aivex:text-text-secondary`,c&&`aivex:text-text-disabled`,t),...a})}function m({className:t,children:i,ref:a,...s}){let{errorId:c,invalid:l,registerError:u}=o(),d=l&&!!i;return(0,n.useEffect)(()=>d?u():void 0,[d,u]),d?(0,r.jsx)(`p`,{ref:a,id:c,role:`alert`,className:e.cn(`aivex:text-caption-md aivex:text-text-danger`,t),...s,children:i}):null}exports.Field=c,exports.FieldContent=u,exports.FieldControl=f,exports.FieldDescription=p,exports.FieldError=m,exports.FieldLabel=l,exports.fieldVariants=s;
|
|
2
2
|
//# sourceMappingURL=Field.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.cjs","names":[],"sources":["../../../src/components/Field/Field.tsx"],"sourcesContent":["\"use client\";\n\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport {\n createContext,\n type HTMLAttributes,\n type LabelHTMLAttributes,\n type ReactNode,\n type Ref,\n useContext,\n useId,\n} from \"react\";\nimport { cn } from \"@/utils/cn\";\n\ninterface FieldContextValue {\n /** 컨트롤과 라벨을 연결하는 id */\n controlId: string;\n descriptionId: string;\n errorId: string;\n invalid: boolean;\n disabled: boolean;\n}\n\nconst FieldContext = createContext<FieldContextValue | null>(null);\n\nfunction useFieldContext() {\n const context = useContext(FieldContext);\n if (!context) {\n throw new Error(\"Field 하위 컴포넌트는 <Field> 내부에서 사용해야 합니다.\");\n }\n return context;\n}\n\nconst fieldVariants = cva(\"aivex:flex aivex:w-full\", {\n variants: {\n orientation: {\n /** 라벨이 위, 컨트롤이 아래 (Textbox 등) */\n vertical: \"aivex:flex-col aivex:gap-xs\",\n /**\n * 컨트롤이 좌측, 라벨/설명이 우측 (Checkbox/Radio/Switch 등).\n * 기본은 중앙 정렬(단일 라벨), FieldContent(라벨+설명) 포함 시 상단 정렬.\n */\n horizontal:\n \"aivex:flex-row aivex:items-center aivex:gap-sm aivex:has-[[data-slot=field-content]]:items-start\",\n },\n },\n defaultVariants: { orientation: \"vertical\" },\n});\n\nexport interface FieldProps\n extends HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof fieldVariants> {\n /** 외부에서 id를 지정. 없으면 자동 생성 */\n fieldId?: string;\n invalid?: boolean;\n disabled?: boolean;\n ref?: Ref<HTMLDivElement>;\n}\n\n/**\n * 폼 필드 래퍼. 라벨/설명/에러를 어떤 컨트롤(Textbox, Checkbox 등)과도\n * 조합할 수 있게 하는 합성 프리미티브. react-hook-form 등 특정 폼 라이브러리에\n * 종속되지 않으며, 컨텍스트로 id/aria를 자동 연결한다.\n */\nfunction Field({\n className,\n orientation,\n fieldId,\n invalid = false,\n disabled = false,\n ref,\n ...props\n}: FieldProps) {\n const generatedId = useId();\n const controlId = fieldId ?? generatedId;\n\n const value: FieldContextValue = {\n controlId,\n descriptionId: `${controlId}-description`,\n errorId: `${controlId}-error`,\n invalid,\n disabled,\n };\n\n return (\n <FieldContext.Provider value={value}>\n <div\n ref={ref}\n className={cn(fieldVariants({ orientation }), className)}\n data-invalid={invalid || undefined}\n data-disabled={disabled || undefined}\n {...props}\n />\n </FieldContext.Provider>\n );\n}\n\nexport interface FieldLabelProps extends LabelHTMLAttributes<HTMLLabelElement> {\n ref?: Ref<HTMLLabelElement>;\n}\n\nfunction FieldLabel({ className, ref, ...props }: FieldLabelProps) {\n const { controlId, invalid, disabled } = useFieldContext();\n\n return (\n // biome-ignore lint/a11y/noLabelWithoutControl: htmlFor={controlId}로 FieldControl의 컨트롤과 연결됨\n <label\n ref={ref}\n htmlFor={controlId}\n className={cn(\n \"aivex:text-label-md aivex:text-text-secondary aivex:cursor-pointer aivex:select-none\",\n disabled && \"aivex:cursor-not-allowed aivex:text-text-disabled\",\n !disabled && invalid && \"aivex:text-text-danger\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport interface FieldContentProps extends HTMLAttributes<HTMLDivElement> {\n ref?: Ref<HTMLDivElement>;\n}\n\n/**\n * 가로 배치(Checkbox 등)에서 라벨과 설명을 세로로 묶는 그룹.\n */\nfunction FieldContent({ className, ref, ...props }: FieldContentProps) {\n return (\n <div\n ref={ref}\n data-slot=\"field-content\"\n className={cn(\n \"aivex:flex aivex:min-w-0 aivex:flex-1 aivex:flex-col aivex:gap-2xs\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport interface FieldControlProps {\n children: ReactNode;\n}\n\n/**\n * 컨트롤(단일 요소)을 감싸 id/aria를 자동 주입한다.\n * 자식은 id/aria-* 를 내부 input 으로 전달하는 컴포넌트여야 한다(Textbox, Checkbox 등).\n */\nfunction FieldControl({ children }: FieldControlProps) {\n const { controlId, descriptionId, errorId, invalid } = useFieldContext();\n\n return (\n <Slot\n id={controlId}\n aria-describedby={invalid ? `${descriptionId} ${errorId}` : descriptionId}\n aria-invalid={invalid || undefined}\n >\n {children}\n </Slot>\n );\n}\n\nexport interface FieldDescriptionProps extends HTMLAttributes<HTMLParagraphElement> {\n ref?: Ref<HTMLParagraphElement>;\n}\n\nfunction FieldDescription({ className, ref, ...props }: FieldDescriptionProps) {\n const { descriptionId, disabled } = useFieldContext();\n\n return (\n <p\n ref={ref}\n id={descriptionId}\n className={cn(\n \"aivex:text-caption-md aivex:text-text-secondary\",\n disabled && \"aivex:text-text-disabled\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport interface FieldErrorProps extends HTMLAttributes<HTMLParagraphElement> {\n ref?: Ref<HTMLParagraphElement>;\n}\n\nfunction FieldError({ className, children, ref, ...props }: FieldErrorProps) {\n const { errorId, invalid } = useFieldContext();\n\n if (!invalid && !children) return null;\n\n return (\n <p\n ref={ref}\n id={errorId}\n role=\"alert\"\n className={cn(\"aivex:text-caption-md aivex:text-text-danger\", className)}\n {...props}\n >\n {children}\n </p>\n );\n}\n\nexport {\n Field,\n FieldContent,\n FieldControl,\n FieldDescription,\n FieldError,\n FieldLabel,\n fieldVariants,\n};\n"],"mappings":"2OAwBA,IAAM,GAAA,EAAA,EAAA,eAAuD,KAAK,CAElE,SAAS,GAAkB,CACzB,IAAM,GAAA,EAAA,EAAA,YAAqB,EAAa,CACxC,GAAI,CAAC,EACH,MAAU,MAAM,wCAAwC,CAE1D,OAAO,EAGT,IAAM,GAAA,EAAA,EAAA,KAAoB,0BAA2B,CACnD,SAAU,CACR,YAAa,CAEX,SAAU,8BAKV,WACE,mGACH,CACF,CACD,gBAAiB,CAAE,YAAa,WAAY,CAC7C,CAAC,CAiBF,SAAS,EAAM,CACb,YACA,cACA,UACA,UAAU,GACV,WAAW,GACX,MACA,GAAG,GACU,CACb,IAAM,GAAA,EAAA,EAAA,QAAqB,CACrB,EAAY,GAAW,EAEvB,EAA2B,CAC/B,YACA,cAAe,GAAG,EAAU,cAC5B,QAAS,GAAG,EAAU,QACtB,UACA,WACD,CAED,OACE,EAAA,EAAA,KAAC,EAAa,SAAd,CAA8B,kBAC5B,EAAA,EAAA,KAAC,MAAD,CACO,MACL,UAAW,EAAA,GAAG,EAAc,CAAE,cAAa,CAAC,CAAE,EAAU,CACxD,eAAc,GAAW,IAAA,GACzB,gBAAe,GAAY,IAAA,GAC3B,GAAI,EACJ,CAAA,CACoB,CAAA,CAQ5B,SAAS,EAAW,CAAE,YAAW,MAAK,GAAG,GAA0B,CACjE,GAAM,CAAE,YAAW,UAAS,YAAa,GAAiB,CAE1D,OAEE,EAAA,EAAA,KAAC,QAAD,CACO,MACL,QAAS,EACT,UAAW,EAAA,GACT,uFACA,GAAY,oDACZ,CAAC,GAAY,GAAW,yBACxB,EACD,CACD,GAAI,EACJ,CAAA,CAWN,SAAS,EAAa,CAAE,YAAW,MAAK,GAAG,GAA4B,CACrE,OACE,EAAA,EAAA,KAAC,MAAD,CACO,MACL,YAAU,gBACV,UAAW,EAAA,GACT,qEACA,EACD,CACD,GAAI,EACJ,CAAA,CAYN,SAAS,EAAa,CAAE,YAA+B,CACrD,GAAM,CAAE,YAAW,gBAAe,UAAS,WAAY,GAAiB,CAExE,OACE,EAAA,EAAA,KAAC,EAAA,KAAD,CACE,GAAI,EACJ,mBAAkB,EAAU,GAAG,EAAc,GAAG,IAAY,EAC5D,eAAc,GAAW,IAAA,GAExB,WACI,CAAA,CAQX,SAAS,EAAiB,CAAE,YAAW,MAAK,GAAG,GAAgC,CAC7E,GAAM,CAAE,gBAAe,YAAa,GAAiB,CAErD,OACE,EAAA,EAAA,KAAC,IAAD,CACO,MACL,GAAI,EACJ,UAAW,EAAA,GACT,kDACA,GAAY,2BACZ,EACD,CACD,GAAI,EACJ,CAAA,CAQN,SAAS,EAAW,CAAE,YAAW,WAAU,MAAK,GAAG,GAA0B,CAC3E,GAAM,CAAE,UAAS,WAAY,GAAiB,CAI9C,MAFI,CAAC,GAAW,CAAC,EAAiB,MAGhC,EAAA,EAAA,KAAC,IAAD,CACO,MACL,GAAI,EACJ,KAAK,QACL,UAAW,EAAA,GAAG,+CAAgD,EAAU,CACxE,GAAI,EAEH,WACC,CAAA"}
|
|
1
|
+
{"version":3,"file":"Field.cjs","names":[],"sources":["../../../src/components/Field/Field.tsx"],"sourcesContent":["\"use client\";\n\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport {\n cloneElement,\n createContext,\n type HTMLAttributes,\n isValidElement,\n type LabelHTMLAttributes,\n type ReactNode,\n type Ref,\n useCallback,\n useContext,\n useEffect,\n useId,\n useState,\n} from \"react\";\nimport { cn } from \"@/utils/cn\";\n\ninterface FieldContextValue {\n /** 컨트롤과 라벨을 연결하는 id */\n controlId: string;\n descriptionId: string;\n errorId: string;\n invalid: boolean;\n disabled: boolean;\n /** 렌더된 FieldDescription·FieldError가 있을 때만 컨트롤의 aria-describedby에 그 id를 넣는다. */\n hasDescription: boolean;\n hasError: boolean;\n /** 마운트 시 호출해 존재를 알리고, 반환된 함수로 해제한다. */\n registerDescription: () => () => void;\n registerError: () => () => void;\n}\n\nconst FieldContext = createContext<FieldContextValue | null>(null);\n\nfunction useFieldContext() {\n const context = useContext(FieldContext);\n if (!context) {\n throw new Error(\"Field 하위 컴포넌트는 <Field> 내부에서 사용해야 합니다.\");\n }\n return context;\n}\n\n/** Field 루트의 배치(orientation) 클래스를 만드는 cva 변형. */\nconst fieldVariants = cva(\"aivex:flex aivex:w-full\", {\n variants: {\n orientation: {\n /** 라벨이 위, 컨트롤이 아래 (Textbox 등) */\n vertical: \"aivex:flex-col aivex:gap-xs\",\n /**\n * 컨트롤이 좌측, 라벨/설명이 우측 (Checkbox/Radio/Switch 등).\n * 기본은 중앙 정렬(단일 라벨), FieldContent(라벨+설명) 포함 시 상단 정렬.\n */\n horizontal:\n \"aivex:flex-row aivex:items-center aivex:gap-sm aivex:has-[[data-slot=field-content]]:items-start\",\n },\n },\n defaultVariants: { orientation: \"vertical\" },\n});\n\nexport interface FieldProps\n extends HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof fieldVariants> {\n /** 외부에서 id를 지정. 없으면 자동 생성 */\n fieldId?: string;\n /**\n * 에러 상태. FieldControl이 컨트롤에 `aria-invalid`와 에러 id(`aria-describedby`)를 주입하고,\n * FieldLabel이 위험색으로 바뀐다. Textbox·Textarea·Tagbox·SelectBox는 이 aria-invalid만으로 에러 스타일이 켜진다.\n * @default false\n */\n invalid?: boolean;\n /**\n * 비활성 상태. 라벨·설명을 비활성색으로 바꾸고, FieldControl이 컨트롤에 `disabled`를 전달한다.\n * 컨트롤에 직접 준 `disabled`가 있으면 그 값이 우선한다.\n * @default false\n */\n disabled?: boolean;\n /** 루트 div ref */\n ref?: Ref<HTMLDivElement>;\n}\n\n/**\n * 라벨·설명·에러를 입력 컨트롤과 id/aria로 연결하는 폼 필드 래퍼.\n * 어떤 컨트롤(Textbox, SelectBox, Checkbox 등)과도 조합하는 합성 프리미티브로, react-hook-form 등\n * 특정 폼 라이브러리에 종속되지 않는다. 컨트롤은 반드시 FieldControl로 감싸야 라벨(htmlFor)·aria가 연결된다.\n * `orientation=\"vertical\"`(기본)은 라벨 위·컨트롤 아래, `\"horizontal\"`은 Checkbox/Radio/Switch처럼 컨트롤 좌측·라벨 우측.\n *\n * @example\n * ```tsx\n * import { Field, FieldControl, FieldDescription, FieldError, FieldLabel, Textbox } from \"@aivex/ui\";\n *\n * <Field invalid={!!error}>\n * <FieldLabel>이메일</FieldLabel>\n * <FieldControl>\n * <Textbox value={email} onValueChange={setEmail} placeholder=\"name@company.com\" />\n * </FieldControl>\n * <FieldDescription>회사 이메일을 입력해 주세요.</FieldDescription>\n * <FieldError>{error}</FieldError>\n * </Field>\n * ```\n *\n * @example\n * ```tsx\n * import { Checkbox, Field, FieldContent, FieldControl, FieldDescription, FieldLabel } from \"@aivex/ui\";\n *\n * <Field orientation=\"horizontal\">\n * <FieldControl>\n * <Checkbox defaultChecked />\n * </FieldControl>\n * <FieldContent>\n * <FieldLabel>마케팅 정보 수신 동의</FieldLabel>\n * <FieldDescription>언제든 해지할 수 있습니다.</FieldDescription>\n * </FieldContent>\n * </Field>\n * ```\n */\nfunction Field({\n className,\n orientation,\n fieldId,\n invalid = false,\n disabled = false,\n ref,\n ...props\n}: FieldProps) {\n const generatedId = useId();\n const controlId = fieldId ?? generatedId;\n\n const [descriptionCount, setDescriptionCount] = useState(0);\n const [errorCount, setErrorCount] = useState(0);\n const registerDescription = useCallback(() => {\n setDescriptionCount((count) => count + 1);\n return () => setDescriptionCount((count) => count - 1);\n }, []);\n const registerError = useCallback(() => {\n setErrorCount((count) => count + 1);\n return () => setErrorCount((count) => count - 1);\n }, []);\n const value: FieldContextValue = {\n controlId,\n descriptionId: `${controlId}-description`,\n errorId: `${controlId}-error`,\n invalid,\n disabled,\n hasDescription: descriptionCount > 0,\n hasError: errorCount > 0,\n registerDescription,\n registerError,\n };\n\n return (\n <FieldContext.Provider value={value}>\n <div\n ref={ref}\n className={cn(fieldVariants({ orientation }), className)}\n data-invalid={invalid || undefined}\n data-disabled={disabled || undefined}\n {...props}\n />\n </FieldContext.Provider>\n );\n}\n\nexport interface FieldLabelProps extends LabelHTMLAttributes<HTMLLabelElement> {\n /** label 요소 ref */\n ref?: Ref<HTMLLabelElement>;\n}\n\n/** FieldControl의 컨트롤에 htmlFor로 자동 연결되는 라벨. invalid면 위험색, disabled면 비활성색. */\nfunction FieldLabel({ className, ref, ...props }: FieldLabelProps) {\n const { controlId, invalid, disabled } = useFieldContext();\n\n return (\n // biome-ignore lint/a11y/noLabelWithoutControl: htmlFor={controlId}로 FieldControl의 컨트롤과 연결됨\n <label\n ref={ref}\n htmlFor={controlId}\n className={cn(\n \"aivex:text-label-md aivex:text-text-secondary aivex:cursor-pointer aivex:select-none\",\n disabled && \"aivex:cursor-not-allowed aivex:text-text-disabled\",\n !disabled && invalid && \"aivex:text-text-danger\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport interface FieldContentProps extends HTMLAttributes<HTMLDivElement> {\n /** 루트 div ref */\n ref?: Ref<HTMLDivElement>;\n}\n\n/**\n * 가로 배치(Checkbox 등)에서 라벨과 설명을 세로로 묶는 그룹.\n */\nfunction FieldContent({ className, ref, ...props }: FieldContentProps) {\n return (\n <div\n ref={ref}\n data-slot=\"field-content\"\n className={cn(\n \"aivex:flex aivex:min-w-0 aivex:flex-1 aivex:flex-col aivex:gap-2xs\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Field가 disabled면 컨트롤에도 disabled를 넘긴다. Slot은 자식 props를 우선하므로 `disabled={undefined}`처럼\n * 값 없이 넘어온 prop까지 Field 값을 덮어쓴다. 그래서 자식 값이 undefined일 때만 직접 채운다.\n */\nfunction withFieldDisabled(children: ReactNode, disabled: boolean) {\n if (!disabled || !isValidElement<{ disabled?: boolean }>(children)) return children;\n if (children.props.disabled !== undefined) return children;\n return cloneElement(children, { disabled: true });\n}\n\nexport interface FieldControlProps {\n /** id/aria를 주입받을 단일 컨트롤 요소 */\n children: ReactNode;\n}\n\n/**\n * 컨트롤(단일 요소)을 감싸 id/aria-describedby/aria-invalid와 Field의 disabled를 자동 주입한다.\n * 자식은 id/aria-* 를 내부 input 으로 전달하는 컴포넌트여야 한다(Textbox, Textarea, Tagbox, SelectBox,\n * SelectButton, Checkbox, Radio, Switch 등). DOM 래퍼 없이 자식에 props만 병합한다(Radix Slot).\n */\nfunction FieldControl({ children }: FieldControlProps) {\n const { controlId, descriptionId, errorId, invalid, disabled, hasDescription, hasError } =\n useFieldContext();\n // 없는 요소의 id를 가리키지 않도록 실제로 렌더된 설명·에러만 연결한다.\n const describedBy =\n [hasDescription && descriptionId, invalid && hasError && errorId].filter(Boolean).join(\" \") ||\n undefined;\n\n return (\n <Slot id={controlId} aria-describedby={describedBy} aria-invalid={invalid || undefined}>\n {withFieldDisabled(children, disabled)}\n </Slot>\n );\n}\n\nexport interface FieldDescriptionProps extends HTMLAttributes<HTMLParagraphElement> {\n /** p 요소 ref */\n ref?: Ref<HTMLParagraphElement>;\n}\n\n/** 컨트롤의 보조 설명 문구. 컨트롤의 aria-describedby로 자동 연결된다. */\nfunction FieldDescription({ className, ref, ...props }: FieldDescriptionProps) {\n const { descriptionId, disabled, registerDescription } = useFieldContext();\n useEffect(registerDescription, [registerDescription]);\n\n return (\n <p\n ref={ref}\n id={descriptionId}\n className={cn(\n \"aivex:text-caption-md aivex:text-text-secondary\",\n disabled && \"aivex:text-text-disabled\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport interface FieldErrorProps extends HTMLAttributes<HTMLParagraphElement> {\n /** p 요소 ref */\n ref?: Ref<HTMLParagraphElement>;\n}\n\n/**\n * 에러 메시지(`role=\"alert\"`). Field가 invalid이고 children이 있을 때만 렌더되며, 그때 컨트롤의\n * aria-describedby에 연결된다. 그래서 메시지는 늘 두고 Field의 `invalid`로 보이고 숨긴다.\n */\nfunction FieldError({ className, children, ref, ...props }: FieldErrorProps) {\n const { errorId, invalid, registerError } = useFieldContext();\n // 컨트롤의 aria-describedby가 errorId를 가리키는 조건(invalid)과 맞춘다.\n const visible = invalid && Boolean(children);\n useEffect(() => (visible ? registerError() : undefined), [visible, registerError]);\n\n if (!visible) return null;\n\n return (\n <p\n ref={ref}\n id={errorId}\n role=\"alert\"\n className={cn(\"aivex:text-caption-md aivex:text-text-danger\", className)}\n {...props}\n >\n {children}\n </p>\n );\n}\n\nexport {\n Field,\n FieldContent,\n FieldControl,\n FieldDescription,\n FieldError,\n FieldLabel,\n fieldVariants,\n};\n"],"mappings":"2OAmCA,IAAM,GAAA,EAAA,EAAA,eAAuD,KAAK,CAElE,SAAS,GAAkB,CACzB,IAAM,GAAA,EAAA,EAAA,YAAqB,EAAa,CACxC,GAAI,CAAC,EACH,MAAU,MAAM,wCAAwC,CAE1D,OAAO,EAIT,IAAM,GAAA,EAAA,EAAA,KAAoB,0BAA2B,CACnD,SAAU,CACR,YAAa,CAEX,SAAU,8BAKV,WACE,mGACH,CACF,CACD,gBAAiB,CAAE,YAAa,WAAY,CAC7C,CAAC,CA0DF,SAAS,EAAM,CACb,YACA,cACA,UACA,UAAU,GACV,WAAW,GACX,MACA,GAAG,GACU,CACb,IAAM,GAAA,EAAA,EAAA,QAAqB,CACrB,EAAY,GAAW,EAEvB,CAAC,EAAkB,IAAA,EAAA,EAAA,UAAgC,EAAE,CACrD,CAAC,EAAY,IAAA,EAAA,EAAA,UAA0B,EAAE,CACzC,GAAA,EAAA,EAAA,kBACJ,EAAqB,GAAU,EAAQ,EAAE,KAC5B,EAAqB,GAAU,EAAQ,EAAE,EACrD,EAAE,CAAC,CACA,GAAA,EAAA,EAAA,kBACJ,EAAe,GAAU,EAAQ,EAAE,KACtB,EAAe,GAAU,EAAQ,EAAE,EAC/C,EAAE,CAAC,CACA,EAA2B,CAC/B,YACA,cAAe,GAAG,EAAU,cAC5B,QAAS,GAAG,EAAU,QACtB,UACA,WACA,eAAgB,EAAmB,EACnC,SAAU,EAAa,EACvB,sBACA,gBACD,CAED,OACE,EAAA,EAAA,KAAC,EAAa,SAAd,CAA8B,kBAC5B,EAAA,EAAA,KAAC,MAAD,CACO,MACL,UAAW,EAAA,GAAG,EAAc,CAAE,cAAa,CAAC,CAAE,EAAU,CACxD,eAAc,GAAW,IAAA,GACzB,gBAAe,GAAY,IAAA,GAC3B,GAAI,EACJ,CAAA,CACoB,CAAA,CAU5B,SAAS,EAAW,CAAE,YAAW,MAAK,GAAG,GAA0B,CACjE,GAAM,CAAE,YAAW,UAAS,YAAa,GAAiB,CAE1D,OAEE,EAAA,EAAA,KAAC,QAAD,CACO,MACL,QAAS,EACT,UAAW,EAAA,GACT,uFACA,GAAY,oDACZ,CAAC,GAAY,GAAW,yBACxB,EACD,CACD,GAAI,EACJ,CAAA,CAYN,SAAS,EAAa,CAAE,YAAW,MAAK,GAAG,GAA4B,CACrE,OACE,EAAA,EAAA,KAAC,MAAD,CACO,MACL,YAAU,gBACV,UAAW,EAAA,GACT,qEACA,EACD,CACD,GAAI,EACJ,CAAA,CAQN,SAAS,EAAkB,EAAqB,EAAmB,CAGjE,MAFI,CAAC,GAAY,EAAA,EAAA,EAAA,gBAAwC,EAAS,EAC9D,EAAS,MAAM,WAAa,IAAA,GAAkB,GAClD,EAAA,EAAA,cAAoB,EAAU,CAAE,SAAU,GAAM,CAAC,CAanD,SAAS,EAAa,CAAE,YAA+B,CACrD,GAAM,CAAE,YAAW,gBAAe,UAAS,UAAS,WAAU,iBAAgB,YAC5E,GAAiB,CAMnB,OACE,EAAA,EAAA,KAAC,EAAA,KAAD,CAAM,GAAI,EAAW,mBAJrB,CAAC,GAAkB,EAAe,GAAW,GAAY,EAAQ,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI,EAC3F,IAAA,GAGoD,eAAc,GAAW,IAAA,YAC1E,EAAkB,EAAU,EAAS,CACjC,CAAA,CAUX,SAAS,EAAiB,CAAE,YAAW,MAAK,GAAG,GAAgC,CAC7E,GAAM,CAAE,gBAAe,WAAU,uBAAwB,GAAiB,CAG1E,OAFA,EAAA,EAAA,WAAU,EAAqB,CAAC,EAAoB,CAAC,EAGnD,EAAA,EAAA,KAAC,IAAD,CACO,MACL,GAAI,EACJ,UAAW,EAAA,GACT,kDACA,GAAY,2BACZ,EACD,CACD,GAAI,EACJ,CAAA,CAaN,SAAS,EAAW,CAAE,YAAW,WAAU,MAAK,GAAG,GAA0B,CAC3E,GAAM,CAAE,UAAS,UAAS,iBAAkB,GAAiB,CAEvD,EAAU,GAAW,EAAQ,EAKnC,OAJA,EAAA,EAAA,eAAiB,EAAU,GAAe,CAAG,IAAA,GAAY,CAAC,EAAS,EAAc,CAAC,CAE7E,GAGH,EAAA,EAAA,KAAC,IAAD,CACO,MACL,GAAI,EACJ,KAAK,QACL,UAAW,EAAA,GAAG,+CAAgD,EAAU,CACxE,GAAI,EAEH,WACC,CAAA,CAXe"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import { type HTMLAttributes, type LabelHTMLAttributes, type ReactNode, type Ref } from "react";
|
|
3
|
+
/** Field 루트의 배치(orientation) 클래스를 만드는 cva 변형. */
|
|
4
|
+
declare const fieldVariants: (props?: ({
|
|
5
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
export interface FieldProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof fieldVariants> {
|
|
8
|
+
/** 외부에서 id를 지정. 없으면 자동 생성 */
|
|
9
|
+
fieldId?: string;
|
|
10
|
+
/**
|
|
11
|
+
* 에러 상태. FieldControl이 컨트롤에 `aria-invalid`와 에러 id(`aria-describedby`)를 주입하고,
|
|
12
|
+
* FieldLabel이 위험색으로 바뀐다. Textbox·Textarea·Tagbox·SelectBox는 이 aria-invalid만으로 에러 스타일이 켜진다.
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
15
|
+
invalid?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* 비활성 상태. 라벨·설명을 비활성색으로 바꾸고, FieldControl이 컨트롤에 `disabled`를 전달한다.
|
|
18
|
+
* 컨트롤에 직접 준 `disabled`가 있으면 그 값이 우선한다.
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
/** 루트 div ref */
|
|
23
|
+
ref?: Ref<HTMLDivElement>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 라벨·설명·에러를 입력 컨트롤과 id/aria로 연결하는 폼 필드 래퍼.
|
|
27
|
+
* 어떤 컨트롤(Textbox, SelectBox, Checkbox 등)과도 조합하는 합성 프리미티브로, react-hook-form 등
|
|
28
|
+
* 특정 폼 라이브러리에 종속되지 않는다. 컨트롤은 반드시 FieldControl로 감싸야 라벨(htmlFor)·aria가 연결된다.
|
|
29
|
+
* `orientation="vertical"`(기본)은 라벨 위·컨트롤 아래, `"horizontal"`은 Checkbox/Radio/Switch처럼 컨트롤 좌측·라벨 우측.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* import { Field, FieldControl, FieldDescription, FieldError, FieldLabel, Textbox } from "@aivex/ui";
|
|
34
|
+
*
|
|
35
|
+
* <Field invalid={!!error}>
|
|
36
|
+
* <FieldLabel>이메일</FieldLabel>
|
|
37
|
+
* <FieldControl>
|
|
38
|
+
* <Textbox value={email} onValueChange={setEmail} placeholder="name@company.com" />
|
|
39
|
+
* </FieldControl>
|
|
40
|
+
* <FieldDescription>회사 이메일을 입력해 주세요.</FieldDescription>
|
|
41
|
+
* <FieldError>{error}</FieldError>
|
|
42
|
+
* </Field>
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* import { Checkbox, Field, FieldContent, FieldControl, FieldDescription, FieldLabel } from "@aivex/ui";
|
|
48
|
+
*
|
|
49
|
+
* <Field orientation="horizontal">
|
|
50
|
+
* <FieldControl>
|
|
51
|
+
* <Checkbox defaultChecked />
|
|
52
|
+
* </FieldControl>
|
|
53
|
+
* <FieldContent>
|
|
54
|
+
* <FieldLabel>마케팅 정보 수신 동의</FieldLabel>
|
|
55
|
+
* <FieldDescription>언제든 해지할 수 있습니다.</FieldDescription>
|
|
56
|
+
* </FieldContent>
|
|
57
|
+
* </Field>
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
declare function Field({ className, orientation, fieldId, invalid, disabled, ref, ...props }: FieldProps): import("react/jsx-runtime").JSX.Element;
|
|
61
|
+
export interface FieldLabelProps extends LabelHTMLAttributes<HTMLLabelElement> {
|
|
62
|
+
/** label 요소 ref */
|
|
63
|
+
ref?: Ref<HTMLLabelElement>;
|
|
64
|
+
}
|
|
65
|
+
/** FieldControl의 컨트롤에 htmlFor로 자동 연결되는 라벨. invalid면 위험색, disabled면 비활성색. */
|
|
66
|
+
declare function FieldLabel({ className, ref, ...props }: FieldLabelProps): import("react/jsx-runtime").JSX.Element;
|
|
67
|
+
export interface FieldContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
68
|
+
/** 루트 div ref */
|
|
69
|
+
ref?: Ref<HTMLDivElement>;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* 가로 배치(Checkbox 등)에서 라벨과 설명을 세로로 묶는 그룹.
|
|
73
|
+
*/
|
|
74
|
+
declare function FieldContent({ className, ref, ...props }: FieldContentProps): import("react/jsx-runtime").JSX.Element;
|
|
75
|
+
export interface FieldControlProps {
|
|
76
|
+
/** id/aria를 주입받을 단일 컨트롤 요소 */
|
|
77
|
+
children: ReactNode;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* 컨트롤(단일 요소)을 감싸 id/aria-describedby/aria-invalid와 Field의 disabled를 자동 주입한다.
|
|
81
|
+
* 자식은 id/aria-* 를 내부 input 으로 전달하는 컴포넌트여야 한다(Textbox, Textarea, Tagbox, SelectBox,
|
|
82
|
+
* SelectButton, Checkbox, Radio, Switch 등). DOM 래퍼 없이 자식에 props만 병합한다(Radix Slot).
|
|
83
|
+
*/
|
|
84
|
+
declare function FieldControl({ children }: FieldControlProps): import("react/jsx-runtime").JSX.Element;
|
|
85
|
+
export interface FieldDescriptionProps extends HTMLAttributes<HTMLParagraphElement> {
|
|
86
|
+
/** p 요소 ref */
|
|
87
|
+
ref?: Ref<HTMLParagraphElement>;
|
|
88
|
+
}
|
|
89
|
+
/** 컨트롤의 보조 설명 문구. 컨트롤의 aria-describedby로 자동 연결된다. */
|
|
90
|
+
declare function FieldDescription({ className, ref, ...props }: FieldDescriptionProps): import("react/jsx-runtime").JSX.Element;
|
|
91
|
+
export interface FieldErrorProps extends HTMLAttributes<HTMLParagraphElement> {
|
|
92
|
+
/** p 요소 ref */
|
|
93
|
+
ref?: Ref<HTMLParagraphElement>;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* 에러 메시지(`role="alert"`). Field가 invalid이고 children이 있을 때만 렌더되며, 그때 컨트롤의
|
|
97
|
+
* aria-describedby에 연결된다. 그래서 메시지는 늘 두고 Field의 `invalid`로 보이고 숨긴다.
|
|
98
|
+
*/
|
|
99
|
+
declare function FieldError({ className, children, ref, ...props }: FieldErrorProps): import("react/jsx-runtime").JSX.Element | null;
|
|
100
|
+
export { Field, FieldContent, FieldControl, FieldDescription, FieldError, FieldLabel, fieldVariants, };
|
|
@@ -1,26 +1,71 @@
|
|
|
1
1
|
import { type VariantProps } from "class-variance-authority";
|
|
2
2
|
import { type HTMLAttributes, type LabelHTMLAttributes, type ReactNode, type Ref } from "react";
|
|
3
|
+
/** Field 루트의 배치(orientation) 클래스를 만드는 cva 변형. */
|
|
3
4
|
declare const fieldVariants: (props?: ({
|
|
4
5
|
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
5
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
7
|
export interface FieldProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof fieldVariants> {
|
|
7
8
|
/** 외부에서 id를 지정. 없으면 자동 생성 */
|
|
8
9
|
fieldId?: string;
|
|
10
|
+
/**
|
|
11
|
+
* 에러 상태. FieldControl이 컨트롤에 `aria-invalid`와 에러 id(`aria-describedby`)를 주입하고,
|
|
12
|
+
* FieldLabel이 위험색으로 바뀐다. Textbox·Textarea·Tagbox·SelectBox는 이 aria-invalid만으로 에러 스타일이 켜진다.
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
9
15
|
invalid?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* 비활성 상태. 라벨·설명을 비활성색으로 바꾸고, FieldControl이 컨트롤에 `disabled`를 전달한다.
|
|
18
|
+
* 컨트롤에 직접 준 `disabled`가 있으면 그 값이 우선한다.
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
10
21
|
disabled?: boolean;
|
|
22
|
+
/** 루트 div ref */
|
|
11
23
|
ref?: Ref<HTMLDivElement>;
|
|
12
24
|
}
|
|
13
25
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* 종속되지
|
|
26
|
+
* 라벨·설명·에러를 입력 컨트롤과 id/aria로 연결하는 폼 필드 래퍼.
|
|
27
|
+
* 어떤 컨트롤(Textbox, SelectBox, Checkbox 등)과도 조합하는 합성 프리미티브로, react-hook-form 등
|
|
28
|
+
* 특정 폼 라이브러리에 종속되지 않는다. 컨트롤은 반드시 FieldControl로 감싸야 라벨(htmlFor)·aria가 연결된다.
|
|
29
|
+
* `orientation="vertical"`(기본)은 라벨 위·컨트롤 아래, `"horizontal"`은 Checkbox/Radio/Switch처럼 컨트롤 좌측·라벨 우측.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* import { Field, FieldControl, FieldDescription, FieldError, FieldLabel, Textbox } from "@aivex/ui";
|
|
34
|
+
*
|
|
35
|
+
* <Field invalid={!!error}>
|
|
36
|
+
* <FieldLabel>이메일</FieldLabel>
|
|
37
|
+
* <FieldControl>
|
|
38
|
+
* <Textbox value={email} onValueChange={setEmail} placeholder="name@company.com" />
|
|
39
|
+
* </FieldControl>
|
|
40
|
+
* <FieldDescription>회사 이메일을 입력해 주세요.</FieldDescription>
|
|
41
|
+
* <FieldError>{error}</FieldError>
|
|
42
|
+
* </Field>
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* import { Checkbox, Field, FieldContent, FieldControl, FieldDescription, FieldLabel } from "@aivex/ui";
|
|
48
|
+
*
|
|
49
|
+
* <Field orientation="horizontal">
|
|
50
|
+
* <FieldControl>
|
|
51
|
+
* <Checkbox defaultChecked />
|
|
52
|
+
* </FieldControl>
|
|
53
|
+
* <FieldContent>
|
|
54
|
+
* <FieldLabel>마케팅 정보 수신 동의</FieldLabel>
|
|
55
|
+
* <FieldDescription>언제든 해지할 수 있습니다.</FieldDescription>
|
|
56
|
+
* </FieldContent>
|
|
57
|
+
* </Field>
|
|
58
|
+
* ```
|
|
17
59
|
*/
|
|
18
60
|
declare function Field({ className, orientation, fieldId, invalid, disabled, ref, ...props }: FieldProps): import("react/jsx-runtime").JSX.Element;
|
|
19
61
|
export interface FieldLabelProps extends LabelHTMLAttributes<HTMLLabelElement> {
|
|
62
|
+
/** label 요소 ref */
|
|
20
63
|
ref?: Ref<HTMLLabelElement>;
|
|
21
64
|
}
|
|
65
|
+
/** FieldControl의 컨트롤에 htmlFor로 자동 연결되는 라벨. invalid면 위험색, disabled면 비활성색. */
|
|
22
66
|
declare function FieldLabel({ className, ref, ...props }: FieldLabelProps): import("react/jsx-runtime").JSX.Element;
|
|
23
67
|
export interface FieldContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
68
|
+
/** 루트 div ref */
|
|
24
69
|
ref?: Ref<HTMLDivElement>;
|
|
25
70
|
}
|
|
26
71
|
/**
|
|
@@ -28,19 +73,28 @@ export interface FieldContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
28
73
|
*/
|
|
29
74
|
declare function FieldContent({ className, ref, ...props }: FieldContentProps): import("react/jsx-runtime").JSX.Element;
|
|
30
75
|
export interface FieldControlProps {
|
|
76
|
+
/** id/aria를 주입받을 단일 컨트롤 요소 */
|
|
31
77
|
children: ReactNode;
|
|
32
78
|
}
|
|
33
79
|
/**
|
|
34
|
-
* 컨트롤(단일 요소)을 감싸 id/aria를 자동 주입한다.
|
|
35
|
-
* 자식은 id/aria-* 를 내부 input 으로 전달하는 컴포넌트여야 한다(Textbox,
|
|
80
|
+
* 컨트롤(단일 요소)을 감싸 id/aria-describedby/aria-invalid와 Field의 disabled를 자동 주입한다.
|
|
81
|
+
* 자식은 id/aria-* 를 내부 input 으로 전달하는 컴포넌트여야 한다(Textbox, Textarea, Tagbox, SelectBox,
|
|
82
|
+
* SelectButton, Checkbox, Radio, Switch 등). DOM 래퍼 없이 자식에 props만 병합한다(Radix Slot).
|
|
36
83
|
*/
|
|
37
84
|
declare function FieldControl({ children }: FieldControlProps): import("react/jsx-runtime").JSX.Element;
|
|
38
85
|
export interface FieldDescriptionProps extends HTMLAttributes<HTMLParagraphElement> {
|
|
86
|
+
/** p 요소 ref */
|
|
39
87
|
ref?: Ref<HTMLParagraphElement>;
|
|
40
88
|
}
|
|
89
|
+
/** 컨트롤의 보조 설명 문구. 컨트롤의 aria-describedby로 자동 연결된다. */
|
|
41
90
|
declare function FieldDescription({ className, ref, ...props }: FieldDescriptionProps): import("react/jsx-runtime").JSX.Element;
|
|
42
91
|
export interface FieldErrorProps extends HTMLAttributes<HTMLParagraphElement> {
|
|
92
|
+
/** p 요소 ref */
|
|
43
93
|
ref?: Ref<HTMLParagraphElement>;
|
|
44
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* 에러 메시지(`role="alert"`). Field가 invalid이고 children이 있을 때만 렌더되며, 그때 컨트롤의
|
|
97
|
+
* aria-describedby에 연결된다. 그래서 메시지는 늘 두고 Field의 `invalid`로 보이고 숨긴다.
|
|
98
|
+
*/
|
|
45
99
|
declare function FieldError({ className, children, ref, ...props }: FieldErrorProps): import("react/jsx-runtime").JSX.Element | null;
|
|
46
100
|
export { Field, FieldContent, FieldControl, FieldDescription, FieldError, FieldLabel, fieldVariants, };
|
|
@@ -2,89 +2,96 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
import { cn as e } from "../../utils.js";
|
|
4
4
|
import { cva as t } from "class-variance-authority";
|
|
5
|
-
import {
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { Slot as
|
|
5
|
+
import { cloneElement as n, createContext as r, isValidElement as i, useCallback as a, useContext as o, useEffect as s, useId as c, useState as l } from "react";
|
|
6
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
7
|
+
import { Slot as d } from "@radix-ui/react-slot";
|
|
8
8
|
//#region src/components/Field/Field.tsx
|
|
9
|
-
var
|
|
10
|
-
function
|
|
11
|
-
let e =
|
|
9
|
+
var f = r(null);
|
|
10
|
+
function p() {
|
|
11
|
+
let e = o(f);
|
|
12
12
|
if (!e) throw Error("Field 하위 컴포넌트는 <Field> 내부에서 사용해야 합니다.");
|
|
13
13
|
return e;
|
|
14
14
|
}
|
|
15
|
-
var
|
|
15
|
+
var m = t("aivex:flex aivex:w-full", {
|
|
16
16
|
variants: { orientation: {
|
|
17
17
|
vertical: "aivex:flex-col aivex:gap-xs",
|
|
18
18
|
horizontal: "aivex:flex-row aivex:items-center aivex:gap-sm aivex:has-[[data-slot=field-content]]:items-start"
|
|
19
19
|
} },
|
|
20
20
|
defaultVariants: { orientation: "vertical" }
|
|
21
21
|
});
|
|
22
|
-
function
|
|
23
|
-
let
|
|
24
|
-
controlId:
|
|
25
|
-
descriptionId: `${
|
|
26
|
-
errorId: `${
|
|
27
|
-
invalid:
|
|
28
|
-
disabled:
|
|
22
|
+
function h({ className: t, orientation: n, fieldId: r, invalid: i = !1, disabled: o = !1, ref: s, ...d }) {
|
|
23
|
+
let p = c(), h = r ?? p, [g, _] = l(0), [v, y] = l(0), b = a(() => (_((e) => e + 1), () => _((e) => e - 1)), []), x = a(() => (y((e) => e + 1), () => y((e) => e - 1)), []), S = {
|
|
24
|
+
controlId: h,
|
|
25
|
+
descriptionId: `${h}-description`,
|
|
26
|
+
errorId: `${h}-error`,
|
|
27
|
+
invalid: i,
|
|
28
|
+
disabled: o,
|
|
29
|
+
hasDescription: g > 0,
|
|
30
|
+
hasError: v > 0,
|
|
31
|
+
registerDescription: b,
|
|
32
|
+
registerError: x
|
|
29
33
|
};
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
-
value:
|
|
32
|
-
children: /* @__PURE__ */
|
|
33
|
-
ref:
|
|
34
|
-
className: e(
|
|
35
|
-
"data-invalid":
|
|
36
|
-
"data-disabled":
|
|
34
|
+
return /* @__PURE__ */ u(f.Provider, {
|
|
35
|
+
value: S,
|
|
36
|
+
children: /* @__PURE__ */ u("div", {
|
|
37
|
+
ref: s,
|
|
38
|
+
className: e(m({ orientation: n }), t),
|
|
39
|
+
"data-invalid": i || void 0,
|
|
40
|
+
"data-disabled": o || void 0,
|
|
37
41
|
...d
|
|
38
42
|
})
|
|
39
43
|
});
|
|
40
44
|
}
|
|
41
|
-
function
|
|
42
|
-
let { controlId: i, invalid:
|
|
43
|
-
return /* @__PURE__ */
|
|
45
|
+
function g({ className: t, ref: n, ...r }) {
|
|
46
|
+
let { controlId: i, invalid: a, disabled: o } = p();
|
|
47
|
+
return /* @__PURE__ */ u("label", {
|
|
44
48
|
ref: n,
|
|
45
49
|
htmlFor: i,
|
|
46
|
-
className: e("aivex:text-label-md aivex:text-text-secondary aivex:cursor-pointer aivex:select-none",
|
|
50
|
+
className: e("aivex:text-label-md aivex:text-text-secondary aivex:cursor-pointer aivex:select-none", o && "aivex:cursor-not-allowed aivex:text-text-disabled", !o && a && "aivex:text-text-danger", t),
|
|
47
51
|
...r
|
|
48
52
|
});
|
|
49
53
|
}
|
|
50
|
-
function
|
|
51
|
-
return /* @__PURE__ */
|
|
54
|
+
function _({ className: t, ref: n, ...r }) {
|
|
55
|
+
return /* @__PURE__ */ u("div", {
|
|
52
56
|
ref: n,
|
|
53
57
|
"data-slot": "field-content",
|
|
54
58
|
className: e("aivex:flex aivex:min-w-0 aivex:flex-1 aivex:flex-col aivex:gap-2xs", t),
|
|
55
59
|
...r
|
|
56
60
|
});
|
|
57
61
|
}
|
|
58
|
-
function
|
|
59
|
-
|
|
60
|
-
|
|
62
|
+
function v(e, t) {
|
|
63
|
+
return !t || !i(e) || e.props.disabled !== void 0 ? e : n(e, { disabled: !0 });
|
|
64
|
+
}
|
|
65
|
+
function y({ children: e }) {
|
|
66
|
+
let { controlId: t, descriptionId: n, errorId: r, invalid: i, disabled: a, hasDescription: o, hasError: s } = p();
|
|
67
|
+
return /* @__PURE__ */ u(d, {
|
|
61
68
|
id: t,
|
|
62
|
-
"aria-describedby":
|
|
69
|
+
"aria-describedby": [o && n, i && s && r].filter(Boolean).join(" ") || void 0,
|
|
63
70
|
"aria-invalid": i || void 0,
|
|
64
|
-
children: e
|
|
71
|
+
children: v(e, a)
|
|
65
72
|
});
|
|
66
73
|
}
|
|
67
|
-
function
|
|
68
|
-
let { descriptionId: i, disabled: o } =
|
|
69
|
-
return /* @__PURE__ */
|
|
74
|
+
function b({ className: t, ref: n, ...r }) {
|
|
75
|
+
let { descriptionId: i, disabled: a, registerDescription: o } = p();
|
|
76
|
+
return s(o, [o]), /* @__PURE__ */ u("p", {
|
|
70
77
|
ref: n,
|
|
71
78
|
id: i,
|
|
72
|
-
className: e("aivex:text-caption-md aivex:text-text-secondary",
|
|
79
|
+
className: e("aivex:text-caption-md aivex:text-text-secondary", a && "aivex:text-text-disabled", t),
|
|
73
80
|
...r
|
|
74
81
|
});
|
|
75
82
|
}
|
|
76
|
-
function
|
|
77
|
-
let { errorId:
|
|
78
|
-
return
|
|
83
|
+
function x({ className: t, children: n, ref: r, ...i }) {
|
|
84
|
+
let { errorId: a, invalid: o, registerError: c } = p(), l = o && !!n;
|
|
85
|
+
return s(() => l ? c() : void 0, [l, c]), l ? /* @__PURE__ */ u("p", {
|
|
79
86
|
ref: r,
|
|
80
|
-
id:
|
|
87
|
+
id: a,
|
|
81
88
|
role: "alert",
|
|
82
89
|
className: e("aivex:text-caption-md aivex:text-text-danger", t),
|
|
83
90
|
...i,
|
|
84
91
|
children: n
|
|
85
|
-
});
|
|
92
|
+
}) : null;
|
|
86
93
|
}
|
|
87
94
|
//#endregion
|
|
88
|
-
export {
|
|
95
|
+
export { h as Field, _ as FieldContent, y as FieldControl, b as FieldDescription, x as FieldError, g as FieldLabel, m as fieldVariants };
|
|
89
96
|
|
|
90
97
|
//# sourceMappingURL=Field.js.map
|