@aivex/ui 1.2.0-dev.59 → 1.2.0-dev.60
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 +64 -19
- package/dist/DESIGN.md +1 -1
- package/dist/components/Accordion/Accordion.cjs +2 -0
- package/dist/components/Accordion/Accordion.cjs.map +1 -0
- package/dist/components/Accordion/Accordion.d.cts +111 -0
- package/dist/components/Accordion/Accordion.d.ts +111 -0
- package/dist/components/Accordion/Accordion.js +75 -0
- package/dist/components/Accordion/Accordion.js.map +1 -0
- package/dist/components/Accordion/index.d.cts +2 -0
- package/dist/components/Accordion/index.d.ts +2 -0
- package/dist/components/Avatar/Avatar.cjs +1 -1
- package/dist/components/Avatar/Avatar.cjs.map +1 -1
- package/dist/components/Avatar/Avatar.js +11 -11
- package/dist/components/Avatar/Avatar.js.map +1 -1
- package/dist/components/Badge/Badge.cjs +1 -1
- package/dist/components/Badge/Badge.js +13 -13
- package/dist/components/BreadCrumb/BreadCrumb.cjs +1 -1
- package/dist/components/BreadCrumb/BreadCrumb.cjs.map +1 -1
- package/dist/components/BreadCrumb/BreadCrumb.js +13 -15
- package/dist/components/BreadCrumb/BreadCrumb.js.map +1 -1
- package/dist/components/Button/Button.cjs +1 -1
- package/dist/components/Button/Button.cjs.map +1 -1
- package/dist/components/Button/Button.d.cts +6 -5
- package/dist/components/Button/Button.d.ts +6 -5
- package/dist/components/Button/Button.js +36 -33
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Calendar/Calendar.cjs +1 -1
- package/dist/components/Calendar/Calendar.js +27 -27
- package/dist/components/Card/Card.cjs +1 -1
- package/dist/components/Card/Card.cjs.map +1 -1
- package/dist/components/Card/Card.d.cts +9 -8
- package/dist/components/Card/Card.d.ts +9 -8
- package/dist/components/Card/Card.js +25 -22
- package/dist/components/Card/Card.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.cjs +1 -1
- package/dist/components/Checkbox/Checkbox.cjs.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.cts +17 -18
- package/dist/components/Checkbox/Checkbox.d.ts +17 -18
- package/dist/components/Checkbox/Checkbox.js +31 -42
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Checkbox/ChipsCheckbox.cjs +1 -1
- package/dist/components/Checkbox/ChipsCheckbox.cjs.map +1 -1
- package/dist/components/Checkbox/ChipsCheckbox.d.cts +10 -8
- package/dist/components/Checkbox/ChipsCheckbox.d.ts +10 -8
- package/dist/components/Checkbox/ChipsCheckbox.js +19 -37
- package/dist/components/Checkbox/ChipsCheckbox.js.map +1 -1
- package/dist/components/Coachmark/Coachmark.cjs +1 -1
- package/dist/components/Coachmark/Coachmark.cjs.map +1 -1
- package/dist/components/Coachmark/Coachmark.d.cts +29 -25
- package/dist/components/Coachmark/Coachmark.d.ts +29 -25
- package/dist/components/Coachmark/Coachmark.js +91 -83
- package/dist/components/Coachmark/Coachmark.js.map +1 -1
- package/dist/components/Coachmark/index.d.cts +1 -1
- package/dist/components/Coachmark/index.d.ts +1 -1
- package/dist/components/Comment/CommentInput.cjs +1 -1
- package/dist/components/Comment/CommentInput.js +7 -7
- package/dist/components/Comment/MentionInput.cjs +1 -1
- package/dist/components/Comment/MentionInput.cjs.map +1 -1
- package/dist/components/Comment/MentionInput.js +3 -1
- package/dist/components/Comment/MentionInput.js.map +1 -1
- package/dist/components/Comment/useMentionSuggestion.cjs +1 -1
- package/dist/components/Comment/useMentionSuggestion.cjs.map +1 -1
- package/dist/components/Comment/useMentionSuggestion.js +1 -1
- package/dist/components/Comment/useMentionSuggestion.js.map +1 -1
- package/dist/components/ContextMenu/ContextMenu.cjs +2 -0
- package/dist/components/ContextMenu/ContextMenu.cjs.map +1 -0
- package/dist/components/ContextMenu/ContextMenu.d.cts +72 -0
- package/dist/components/ContextMenu/ContextMenu.d.ts +72 -0
- package/dist/components/ContextMenu/ContextMenu.js +56 -0
- package/dist/components/ContextMenu/ContextMenu.js.map +1 -0
- package/dist/components/ContextMenu/index.d.cts +2 -0
- package/dist/components/ContextMenu/index.d.ts +2 -0
- package/dist/components/DataGrid/DataGrid.cjs +1 -1
- package/dist/components/DataGrid/DataGrid.cjs.map +1 -1
- package/dist/components/DataGrid/DataGrid.js +33 -33
- 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 +1 -1
- package/dist/components/DataGrid/DataGridColumnSettings.d.ts +1 -1
- package/dist/components/DataGrid/DataGridColumnSettings.js +30 -31
- package/dist/components/DataGrid/DataGridColumnSettings.js.map +1 -1
- package/dist/components/DataGrid/DataGridPrimitives.cjs +1 -1
- package/dist/components/DataGrid/DataGridPrimitives.cjs.map +1 -1
- package/dist/components/DataGrid/DataGridPrimitives.d.cts +10 -12
- package/dist/components/DataGrid/DataGridPrimitives.d.ts +10 -12
- package/dist/components/DataGrid/DataGridPrimitives.js +43 -37
- package/dist/components/DataGrid/DataGridPrimitives.js.map +1 -1
- package/dist/components/Dialog/Dialog.cjs +1 -1
- package/dist/components/Dialog/Dialog.cjs.map +1 -1
- package/dist/components/Dialog/Dialog.d.cts +15 -5
- package/dist/components/Dialog/Dialog.d.ts +15 -5
- package/dist/components/Dialog/Dialog.js +61 -49
- package/dist/components/Dialog/Dialog.js.map +1 -1
- package/dist/components/Divider/Divider.cjs +1 -1
- package/dist/components/Divider/Divider.cjs.map +1 -1
- package/dist/components/Divider/Divider.js +6 -6
- package/dist/components/Drawer/Drawer.cjs +1 -1
- package/dist/components/Drawer/Drawer.cjs.map +1 -1
- package/dist/components/Drawer/Drawer.d.cts +34 -22
- package/dist/components/Drawer/Drawer.d.ts +34 -22
- package/dist/components/Drawer/Drawer.js +80 -72
- package/dist/components/Drawer/Drawer.js.map +1 -1
- package/dist/components/EmptyState/EmptyState.cjs +2 -0
- package/dist/components/EmptyState/EmptyState.cjs.map +1 -0
- package/dist/components/EmptyState/EmptyState.d.cts +61 -0
- package/dist/components/EmptyState/EmptyState.d.ts +61 -0
- package/dist/components/EmptyState/EmptyState.js +50 -0
- package/dist/components/EmptyState/EmptyState.js.map +1 -0
- package/dist/components/EmptyState/index.d.cts +2 -0
- package/dist/components/EmptyState/index.d.ts +2 -0
- package/dist/components/Field/Field.cjs +1 -1
- package/dist/components/Field/Field.cjs.map +1 -1
- package/dist/components/Field/Field.d.cts +45 -34
- package/dist/components/Field/Field.d.ts +45 -34
- package/dist/components/Field/Field.js +46 -65
- package/dist/components/Field/Field.js.map +1 -1
- package/dist/components/Field/FieldStateContext.cjs +2 -0
- package/dist/components/Field/FieldStateContext.cjs.map +1 -0
- package/dist/components/Field/FieldStateContext.d.cts +12 -0
- package/dist/components/Field/FieldStateContext.d.ts +12 -0
- package/dist/components/Field/FieldStateContext.js +14 -0
- package/dist/components/Field/FieldStateContext.js.map +1 -0
- package/dist/components/HoverCard/HoverCard.cjs +2 -0
- package/dist/components/HoverCard/HoverCard.cjs.map +1 -0
- package/dist/components/HoverCard/HoverCard.d.cts +61 -0
- package/dist/components/HoverCard/HoverCard.d.ts +61 -0
- package/dist/components/HoverCard/HoverCard.js +44 -0
- package/dist/components/HoverCard/HoverCard.js.map +1 -0
- package/dist/components/HoverCard/index.d.cts +2 -0
- package/dist/components/HoverCard/index.d.ts +2 -0
- package/dist/components/Icon/index.cjs +1 -1
- package/dist/components/Icon/index.cjs.map +1 -1
- package/dist/components/Icon/index.js +12 -12
- package/dist/components/Icon/index.js.map +1 -1
- package/dist/components/IconButton/IconButton.cjs +1 -1
- package/dist/components/IconButton/IconButton.cjs.map +1 -1
- package/dist/components/IconButton/IconButton.d.cts +6 -5
- package/dist/components/IconButton/IconButton.d.ts +6 -5
- package/dist/components/IconButton/IconButton.js +31 -28
- package/dist/components/IconButton/IconButton.js.map +1 -1
- package/dist/components/InputBase/InputBase.cjs +1 -1
- package/dist/components/InputBase/InputBase.cjs.map +1 -1
- package/dist/components/InputBase/InputBase.js +8 -8
- package/dist/components/Logo/index.cjs +1 -1
- package/dist/components/Logo/index.cjs.map +1 -1
- package/dist/components/Logo/index.d.cts +21 -2
- package/dist/components/Logo/index.d.ts +21 -2
- package/dist/components/Logo/index.js +487 -2
- package/dist/components/Logo/index.js.map +1 -1
- package/dist/components/Menu/Menu.cjs +1 -1
- package/dist/components/Menu/Menu.cjs.map +1 -1
- package/dist/components/Menu/Menu.d.cts +80 -43
- package/dist/components/Menu/Menu.d.ts +80 -43
- package/dist/components/Menu/Menu.js +144 -122
- package/dist/components/Menu/Menu.js.map +1 -1
- package/dist/components/Messagebox/Messagebox.cjs +1 -1
- package/dist/components/Messagebox/Messagebox.cjs.map +1 -1
- package/dist/components/Messagebox/Messagebox.js +27 -27
- package/dist/components/Modal/Modal.cjs +1 -1
- package/dist/components/Modal/Modal.cjs.map +1 -1
- package/dist/components/Modal/Modal.d.cts +22 -9
- package/dist/components/Modal/Modal.d.ts +22 -9
- package/dist/components/Modal/Modal.js +95 -98
- package/dist/components/Modal/Modal.js.map +1 -1
- package/dist/components/Modal/ModalBase.cjs +1 -1
- package/dist/components/Modal/ModalBase.cjs.map +1 -1
- package/dist/components/Modal/ModalBase.d.cts +32 -23
- package/dist/components/Modal/ModalBase.d.ts +32 -23
- package/dist/components/Modal/ModalBase.js +35 -23
- package/dist/components/Modal/ModalBase.js.map +1 -1
- package/dist/components/Nav/Nav.cjs +1 -1
- package/dist/components/Nav/Nav.js +19 -19
- package/dist/components/NumberField/NumberField.cjs +2 -0
- package/dist/components/NumberField/NumberField.cjs.map +1 -0
- package/dist/components/NumberField/NumberField.d.cts +79 -0
- package/dist/components/NumberField/NumberField.d.ts +79 -0
- package/dist/components/NumberField/NumberField.js +65 -0
- package/dist/components/NumberField/NumberField.js.map +1 -0
- package/dist/components/NumberField/index.d.cts +2 -0
- package/dist/components/NumberField/index.d.ts +2 -0
- package/dist/components/Overlay/Overlay.cjs +1 -1
- package/dist/components/Overlay/Overlay.js +6 -6
- package/dist/components/Pagination/Pagination.cjs +1 -1
- package/dist/components/Pagination/Pagination.js +20 -20
- package/dist/components/Panel/Panel.cjs +1 -1
- package/dist/components/Panel/Panel.js +25 -25
- package/dist/components/Popover/Popover.cjs +1 -1
- package/dist/components/Popover/Popover.cjs.map +1 -1
- package/dist/components/Popover/Popover.d.cts +32 -28
- package/dist/components/Popover/Popover.d.ts +32 -28
- package/dist/components/Popover/Popover.js +50 -46
- package/dist/components/Popover/Popover.js.map +1 -1
- package/dist/components/Popover/index.d.cts +1 -1
- package/dist/components/Popover/index.d.ts +1 -1
- package/dist/components/Radio/Radio.cjs +1 -1
- package/dist/components/Radio/Radio.cjs.map +1 -1
- package/dist/components/Radio/Radio.d.cts +47 -18
- package/dist/components/Radio/Radio.d.ts +47 -18
- package/dist/components/Radio/Radio.js +43 -33
- package/dist/components/Radio/Radio.js.map +1 -1
- package/dist/components/Radio/index.d.cts +2 -2
- package/dist/components/Radio/index.d.ts +2 -2
- package/dist/components/ScrollArea/ScrollArea.cjs +1 -1
- package/dist/components/ScrollArea/ScrollArea.cjs.map +1 -1
- package/dist/components/ScrollArea/ScrollArea.d.cts +25 -8
- package/dist/components/ScrollArea/ScrollArea.d.ts +25 -8
- package/dist/components/ScrollArea/ScrollArea.js +50 -30
- package/dist/components/ScrollArea/ScrollArea.js.map +1 -1
- package/dist/components/ScrollArea/index.d.cts +1 -1
- package/dist/components/ScrollArea/index.d.ts +1 -1
- package/dist/components/Segmented/Segmented.cjs +1 -1
- package/dist/components/Segmented/Segmented.cjs.map +1 -1
- package/dist/components/Segmented/Segmented.d.cts +20 -5
- package/dist/components/Segmented/Segmented.d.ts +20 -5
- package/dist/components/Segmented/Segmented.js +18 -18
- package/dist/components/Segmented/Segmented.js.map +1 -1
- package/dist/components/SelectBox/SelectBox.cjs +1 -1
- package/dist/components/SelectBox/SelectBox.cjs.map +1 -1
- package/dist/components/SelectBox/SelectBox.d.cts +13 -15
- package/dist/components/SelectBox/SelectBox.d.ts +13 -15
- package/dist/components/SelectBox/SelectBox.js +64 -56
- package/dist/components/SelectBox/SelectBox.js.map +1 -1
- package/dist/components/SelectButton/SelectButton.cjs +1 -1
- package/dist/components/SelectButton/SelectButton.cjs.map +1 -1
- package/dist/components/SelectButton/SelectButton.d.cts +13 -10
- package/dist/components/SelectButton/SelectButton.d.ts +13 -10
- package/dist/components/SelectButton/SelectButton.js +6 -6
- package/dist/components/SelectButton/SelectButton.js.map +1 -1
- package/dist/components/ShapeEditor/_components/ContextMenu.cjs +1 -1
- package/dist/components/ShapeEditor/_components/ContextMenu.cjs.map +1 -1
- package/dist/components/ShapeEditor/_components/ContextMenu.d.cts +2 -2
- package/dist/components/ShapeEditor/_components/ContextMenu.d.ts +2 -2
- package/dist/components/ShapeEditor/_components/ContextMenu.js +32 -32
- package/dist/components/ShapeEditor/_components/ContextMenu.js.map +1 -1
- package/dist/components/ShapeEditor/_components/Minimap.cjs +1 -1
- package/dist/components/ShapeEditor/_components/Minimap.cjs.map +1 -1
- package/dist/components/ShapeEditor/_components/Minimap.js +7 -10
- package/dist/components/ShapeEditor/_components/Minimap.js.map +1 -1
- package/dist/components/Skeleton/Skeleton.cjs +1 -1
- package/dist/components/Skeleton/Skeleton.cjs.map +1 -1
- package/dist/components/Skeleton/Skeleton.d.cts +4 -4
- package/dist/components/Skeleton/Skeleton.d.ts +4 -4
- package/dist/components/Skeleton/Skeleton.js +12 -9
- package/dist/components/Skeleton/Skeleton.js.map +1 -1
- package/dist/components/Slider/Slider.cjs +1 -1
- package/dist/components/Slider/Slider.cjs.map +1 -1
- package/dist/components/Slider/Slider.d.cts +21 -8
- package/dist/components/Slider/Slider.d.ts +21 -8
- package/dist/components/Slider/Slider.js +37 -32
- package/dist/components/Slider/Slider.js.map +1 -1
- package/dist/components/Switch/Switch.cjs +1 -1
- package/dist/components/Switch/Switch.cjs.map +1 -1
- package/dist/components/Switch/Switch.d.cts +6 -4
- package/dist/components/Switch/Switch.d.ts +6 -4
- package/dist/components/Switch/Switch.js +26 -23
- package/dist/components/Switch/Switch.js.map +1 -1
- package/dist/components/Tab/Tab.cjs +1 -1
- package/dist/components/Tab/Tab.cjs.map +1 -1
- package/dist/components/Tab/Tab.d.cts +47 -16
- package/dist/components/Tab/Tab.d.ts +47 -16
- package/dist/components/Tab/Tab.js +17 -13
- package/dist/components/Tab/Tab.js.map +1 -1
- package/dist/components/Tag/Tag.cjs +1 -1
- package/dist/components/Tag/Tag.cjs.map +1 -1
- package/dist/components/Tag/Tag.js +16 -16
- package/dist/components/Tagbox/Tagbox.cjs +1 -1
- package/dist/components/Tagbox/Tagbox.cjs.map +1 -1
- package/dist/components/Tagbox/Tagbox.d.cts +8 -10
- package/dist/components/Tagbox/Tagbox.d.ts +8 -10
- package/dist/components/Tagbox/Tagbox.js +63 -61
- package/dist/components/Tagbox/Tagbox.js.map +1 -1
- package/dist/components/Textarea/Textarea.cjs +1 -1
- package/dist/components/Textarea/Textarea.cjs.map +1 -1
- package/dist/components/Textarea/Textarea.d.cts +4 -6
- package/dist/components/Textarea/Textarea.d.ts +4 -6
- package/dist/components/Textarea/Textarea.js +44 -40
- package/dist/components/Textarea/Textarea.js.map +1 -1
- package/dist/components/Textbox/Textbox.cjs +1 -1
- package/dist/components/Textbox/Textbox.cjs.map +1 -1
- package/dist/components/Textbox/Textbox.d.cts +4 -6
- package/dist/components/Textbox/Textbox.d.ts +4 -6
- package/dist/components/Textbox/Textbox.js +46 -44
- package/dist/components/Textbox/Textbox.js.map +1 -1
- package/dist/components/Toast/Toast.cjs +1 -1
- package/dist/components/Toast/Toast.cjs.map +1 -1
- package/dist/components/Toast/Toast.d.cts +1 -1
- package/dist/components/Toast/Toast.d.ts +1 -1
- package/dist/components/Toast/Toast.js +18 -18
- package/dist/components/Toast/Toast.js.map +1 -1
- package/dist/components/ToggleButton/ToggleButton.cjs +1 -1
- package/dist/components/ToggleButton/ToggleButton.cjs.map +1 -1
- package/dist/components/ToggleButton/ToggleButton.js +13 -13
- package/dist/components/Tooltip/Tooltip.cjs +1 -1
- package/dist/components/Tooltip/Tooltip.cjs.map +1 -1
- package/dist/components/Tooltip/Tooltip.d.cts +2 -2
- package/dist/components/Tooltip/Tooltip.d.ts +2 -2
- package/dist/components/Tooltip/Tooltip.js +37 -26
- package/dist/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/TruncatedText/TruncatedText.cjs +1 -1
- package/dist/components/TruncatedText/TruncatedText.cjs.map +1 -1
- package/dist/components/TruncatedText/TruncatedText.js +64 -51
- package/dist/components/TruncatedText/TruncatedText.js.map +1 -1
- package/dist/components/Typography/Typography.cjs +1 -1
- package/dist/components/Typography/Typography.cjs.map +1 -1
- package/dist/components/Typography/Typography.js +5 -5
- package/dist/components/UploadArea/UploadArea.cjs +1 -1
- package/dist/components/UploadArea/UploadArea.js +6 -6
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +63 -58
- package/dist/llms-full.txt +877 -290
- package/dist/llms.txt +16 -11
- package/dist/styles.css +1 -1
- package/dist/utils/PortalEventBoundary.cjs +2 -0
- package/dist/utils/PortalEventBoundary.cjs.map +1 -0
- package/dist/utils/PortalEventBoundary.d.cts +13 -0
- package/dist/utils/PortalEventBoundary.d.ts +13 -0
- package/dist/utils/PortalEventBoundary.js +12 -0
- package/dist/utils/PortalEventBoundary.js.map +1 -0
- package/dist/utils/Primitive.cjs +2 -0
- package/dist/utils/Primitive.cjs.map +1 -0
- package/dist/utils/Primitive.d.cts +9 -0
- package/dist/utils/Primitive.d.ts +9 -0
- package/dist/utils/Primitive.js +15 -0
- package/dist/utils/Primitive.js.map +1 -0
- package/dist/utils/popupArrow.cjs +2 -0
- package/dist/utils/popupArrow.cjs.map +1 -0
- package/dist/utils/popupArrow.d.cts +14 -0
- package/dist/utils/popupArrow.d.ts +14 -0
- package/dist/utils/popupArrow.js +26 -0
- package/dist/utils/popupArrow.js.map +1 -0
- package/dist/utils/popupPositioning.cjs +2 -0
- package/dist/utils/popupPositioning.cjs.map +1 -0
- package/dist/utils/popupPositioning.d.cts +11 -0
- package/dist/utils/popupPositioning.d.ts +11 -0
- package/dist/utils/popupPositioning.js +25 -0
- package/dist/utils/popupPositioning.js.map +1 -0
- package/dist/utils/useComposedRefs.cjs +2 -0
- package/dist/utils/useComposedRefs.cjs.map +1 -0
- package/dist/utils/useComposedRefs.d.cts +6 -0
- package/dist/utils/useComposedRefs.d.ts +6 -0
- package/dist/utils/useComposedRefs.js +22 -0
- package/dist/utils/useComposedRefs.js.map +1 -0
- package/dist/utils/useControllableState.cjs.map +1 -1
- package/dist/utils/useControllableState.d.cts +1 -1
- package/dist/utils/useControllableState.d.ts +1 -1
- package/dist/utils/useControllableState.js.map +1 -1
- package/dist/utils/useModalFocus.cjs +2 -0
- package/dist/utils/useModalFocus.cjs.map +1 -0
- package/dist/utils/useModalFocus.d.cts +31 -0
- package/dist/utils/useModalFocus.d.ts +31 -0
- package/dist/utils/useModalFocus.js +28 -0
- package/dist/utils/useModalFocus.js.map +1 -0
- package/package.json +2 -16
- package/dist/utils/useModalAutoFocus.cjs +0 -2
- package/dist/utils/useModalAutoFocus.cjs.map +0 -1
- package/dist/utils/useModalAutoFocus.d.cts +0 -11
- package/dist/utils/useModalAutoFocus.d.ts +0 -11
- package/dist/utils/useModalAutoFocus.js +0 -22
- package/dist/utils/useModalAutoFocus.js.map +0 -1
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { InputHTMLAttributes, ReactNode, Ref } from "react";
|
|
2
|
+
declare const alignClassName: {
|
|
3
|
+
readonly left: "aivex:text-left";
|
|
4
|
+
readonly center: "aivex:text-center";
|
|
5
|
+
readonly right: "aivex:text-right";
|
|
6
|
+
};
|
|
7
|
+
export interface NumberFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "value" | "defaultValue" | "onChange" | "min" | "max" | "step" | "type"> {
|
|
8
|
+
/** 현재 값(제어). 비어 있으면 null */
|
|
9
|
+
value?: number | null;
|
|
10
|
+
/** 초기 값(비제어) */
|
|
11
|
+
defaultValue?: number;
|
|
12
|
+
/** 값이 바뀔 때(타이핑·방향키·휠) 호출된다. 입력을 비우면 null */
|
|
13
|
+
onValueChange?: (value: number | null) => void;
|
|
14
|
+
/** 값이 확정될 때(blur, 방향키를 뗄 때) 호출된다. 서버 저장처럼 무거운 작업은 여기서 한다. */
|
|
15
|
+
onValueCommitted?: (value: number | null) => void;
|
|
16
|
+
/** 최솟값. 벗어난 입력은 blur 때 이 값으로 맞춘다. */
|
|
17
|
+
min?: number;
|
|
18
|
+
/** 최댓값. 벗어난 입력은 blur 때 이 값으로 맞춘다. */
|
|
19
|
+
max?: number;
|
|
20
|
+
/**
|
|
21
|
+
* 방향키(↑↓) 한 번에 바뀌는 양. Shift를 누르면 `largeStep`만큼 바뀐다.
|
|
22
|
+
* @default 1
|
|
23
|
+
*/
|
|
24
|
+
step?: number;
|
|
25
|
+
/** Shift+방향키로 바뀌는 양 */
|
|
26
|
+
largeStep?: number;
|
|
27
|
+
/** 표시 형식(Intl.NumberFormat 옵션). 예: `{ maximumFractionDigits: 2 }`, `{ style: "percent" }` */
|
|
28
|
+
format?: Intl.NumberFormatOptions;
|
|
29
|
+
/** 숫자 표기 로캘. 생략하면 브라우저 로캘 */
|
|
30
|
+
locale?: Intl.LocalesArgument;
|
|
31
|
+
/**
|
|
32
|
+
* 높이 sm 32px·md 40px
|
|
33
|
+
* @default "md"
|
|
34
|
+
*/
|
|
35
|
+
size?: "sm" | "md";
|
|
36
|
+
/** 에러 상태. Field 안에서는 Field의 invalid로도 켜진다 */
|
|
37
|
+
error?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* 숫자 정렬
|
|
40
|
+
* @default "left"
|
|
41
|
+
*/
|
|
42
|
+
align?: keyof typeof alignClassName;
|
|
43
|
+
/** 인풋 좌측 슬롯 */
|
|
44
|
+
startContent?: ReactNode;
|
|
45
|
+
/** 인풋 우측 슬롯(단위 등) */
|
|
46
|
+
endContent?: ReactNode;
|
|
47
|
+
/** 보이는 input 요소 ref(폼 제출용 숨은 input이 아니다) */
|
|
48
|
+
ref?: Ref<HTMLInputElement>;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* 숫자만 받는 한 줄 입력. 방향키(↑↓)로 `step`만큼 올리고 내리며, 범위(min·max)를 벗어난
|
|
52
|
+
* 입력은 blur 때 맞추고 `format`대로 다시 표시한다.
|
|
53
|
+
*
|
|
54
|
+
* 임계값·개수·비율처럼 숫자 하나를 직접 입력받을 때 쓴다. 범위 안에서 대략 고르는 값이면
|
|
55
|
+
* Slider, 일반 텍스트면 Textbox를 쓴다. 제어는 value + onValueChange(숫자 또는 null),
|
|
56
|
+
* 비제어는 defaultValue. 라벨·설명·에러는 Field 안에 넣으면 자동으로 연결되고, 라벨이 없으면
|
|
57
|
+
* aria-label을 지정한다.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```tsx
|
|
61
|
+
* import { Field, FieldLabel, NumberField } from "@aivex/ui";
|
|
62
|
+
*
|
|
63
|
+
* const [threshold, setThreshold] = useState<number | null>(0.5);
|
|
64
|
+
*
|
|
65
|
+
* <Field>
|
|
66
|
+
* <FieldLabel>신뢰도 임계값</FieldLabel>
|
|
67
|
+
* <NumberField
|
|
68
|
+
* value={threshold}
|
|
69
|
+
* onValueChange={setThreshold}
|
|
70
|
+
* min={0}
|
|
71
|
+
* max={1}
|
|
72
|
+
* step={0.01}
|
|
73
|
+
* format={{ minimumFractionDigits: 2, maximumFractionDigits: 2 }}
|
|
74
|
+
* />
|
|
75
|
+
* </Field>
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
declare function NumberField({ value, defaultValue, onValueChange, onValueCommitted, min, max, step, largeStep, format, locale, size, error, align, startContent, endContent, disabled, readOnly, required, name, id, className, onFocus, onBlur, ref, ...props }: NumberFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
79
|
+
export { NumberField };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { InputHTMLAttributes, ReactNode, Ref } from "react";
|
|
2
|
+
declare const alignClassName: {
|
|
3
|
+
readonly left: "aivex:text-left";
|
|
4
|
+
readonly center: "aivex:text-center";
|
|
5
|
+
readonly right: "aivex:text-right";
|
|
6
|
+
};
|
|
7
|
+
export interface NumberFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "value" | "defaultValue" | "onChange" | "min" | "max" | "step" | "type"> {
|
|
8
|
+
/** 현재 값(제어). 비어 있으면 null */
|
|
9
|
+
value?: number | null;
|
|
10
|
+
/** 초기 값(비제어) */
|
|
11
|
+
defaultValue?: number;
|
|
12
|
+
/** 값이 바뀔 때(타이핑·방향키·휠) 호출된다. 입력을 비우면 null */
|
|
13
|
+
onValueChange?: (value: number | null) => void;
|
|
14
|
+
/** 값이 확정될 때(blur, 방향키를 뗄 때) 호출된다. 서버 저장처럼 무거운 작업은 여기서 한다. */
|
|
15
|
+
onValueCommitted?: (value: number | null) => void;
|
|
16
|
+
/** 최솟값. 벗어난 입력은 blur 때 이 값으로 맞춘다. */
|
|
17
|
+
min?: number;
|
|
18
|
+
/** 최댓값. 벗어난 입력은 blur 때 이 값으로 맞춘다. */
|
|
19
|
+
max?: number;
|
|
20
|
+
/**
|
|
21
|
+
* 방향키(↑↓) 한 번에 바뀌는 양. Shift를 누르면 `largeStep`만큼 바뀐다.
|
|
22
|
+
* @default 1
|
|
23
|
+
*/
|
|
24
|
+
step?: number;
|
|
25
|
+
/** Shift+방향키로 바뀌는 양 */
|
|
26
|
+
largeStep?: number;
|
|
27
|
+
/** 표시 형식(Intl.NumberFormat 옵션). 예: `{ maximumFractionDigits: 2 }`, `{ style: "percent" }` */
|
|
28
|
+
format?: Intl.NumberFormatOptions;
|
|
29
|
+
/** 숫자 표기 로캘. 생략하면 브라우저 로캘 */
|
|
30
|
+
locale?: Intl.LocalesArgument;
|
|
31
|
+
/**
|
|
32
|
+
* 높이 sm 32px·md 40px
|
|
33
|
+
* @default "md"
|
|
34
|
+
*/
|
|
35
|
+
size?: "sm" | "md";
|
|
36
|
+
/** 에러 상태. Field 안에서는 Field의 invalid로도 켜진다 */
|
|
37
|
+
error?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* 숫자 정렬
|
|
40
|
+
* @default "left"
|
|
41
|
+
*/
|
|
42
|
+
align?: keyof typeof alignClassName;
|
|
43
|
+
/** 인풋 좌측 슬롯 */
|
|
44
|
+
startContent?: ReactNode;
|
|
45
|
+
/** 인풋 우측 슬롯(단위 등) */
|
|
46
|
+
endContent?: ReactNode;
|
|
47
|
+
/** 보이는 input 요소 ref(폼 제출용 숨은 input이 아니다) */
|
|
48
|
+
ref?: Ref<HTMLInputElement>;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* 숫자만 받는 한 줄 입력. 방향키(↑↓)로 `step`만큼 올리고 내리며, 범위(min·max)를 벗어난
|
|
52
|
+
* 입력은 blur 때 맞추고 `format`대로 다시 표시한다.
|
|
53
|
+
*
|
|
54
|
+
* 임계값·개수·비율처럼 숫자 하나를 직접 입력받을 때 쓴다. 범위 안에서 대략 고르는 값이면
|
|
55
|
+
* Slider, 일반 텍스트면 Textbox를 쓴다. 제어는 value + onValueChange(숫자 또는 null),
|
|
56
|
+
* 비제어는 defaultValue. 라벨·설명·에러는 Field 안에 넣으면 자동으로 연결되고, 라벨이 없으면
|
|
57
|
+
* aria-label을 지정한다.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```tsx
|
|
61
|
+
* import { Field, FieldLabel, NumberField } from "@aivex/ui";
|
|
62
|
+
*
|
|
63
|
+
* const [threshold, setThreshold] = useState<number | null>(0.5);
|
|
64
|
+
*
|
|
65
|
+
* <Field>
|
|
66
|
+
* <FieldLabel>신뢰도 임계값</FieldLabel>
|
|
67
|
+
* <NumberField
|
|
68
|
+
* value={threshold}
|
|
69
|
+
* onValueChange={setThreshold}
|
|
70
|
+
* min={0}
|
|
71
|
+
* max={1}
|
|
72
|
+
* step={0.01}
|
|
73
|
+
* format={{ minimumFractionDigits: 2, maximumFractionDigits: 2 }}
|
|
74
|
+
* />
|
|
75
|
+
* </Field>
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
declare function NumberField({ value, defaultValue, onValueChange, onValueCommitted, min, max, step, largeStep, format, locale, size, error, align, startContent, endContent, disabled, readOnly, required, name, id, className, onFocus, onBlur, ref, ...props }: NumberFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
79
|
+
export { NumberField };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import { cn as e } from "../../utils.js";
|
|
4
|
+
import { useControllableState as t } from "../../utils/useControllableState.js";
|
|
5
|
+
import { resolveInputError as n, useInputFocus as r } from "../InputBase/useInputState.js";
|
|
6
|
+
import { useFieldState as i } from "../Field/FieldStateContext.js";
|
|
7
|
+
import { InputBase as a } from "../InputBase/InputBase.js";
|
|
8
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
9
|
+
import { NumberField as s } from "@base-ui/react/number-field";
|
|
10
|
+
//#region src/components/NumberField/NumberField.tsx
|
|
11
|
+
var c = {
|
|
12
|
+
left: "aivex:text-left",
|
|
13
|
+
center: "aivex:text-center",
|
|
14
|
+
right: "aivex:text-right"
|
|
15
|
+
};
|
|
16
|
+
function l({ value: l, defaultValue: u, onValueChange: d, onValueCommitted: f, min: p, max: m, step: h, largeStep: g, format: _, locale: v, size: y = "md", error: b, align: x = "left", startContent: S, endContent: C, disabled: w, readOnly: T, required: E, name: D, id: O, className: k, onFocus: A, onBlur: j, ref: M, ...N }) {
|
|
17
|
+
let P = r({
|
|
18
|
+
onFocus: A,
|
|
19
|
+
onBlur: j
|
|
20
|
+
}), F = i(), [I, L] = t({
|
|
21
|
+
value: l,
|
|
22
|
+
defaultValue: u ?? null,
|
|
23
|
+
onChange: d
|
|
24
|
+
}), R = n(b, N["aria-invalid"]) || F.invalid, z = !!w || F.disabled, B = {
|
|
25
|
+
id: O,
|
|
26
|
+
name: D,
|
|
27
|
+
min: p,
|
|
28
|
+
max: m,
|
|
29
|
+
step: h,
|
|
30
|
+
largeStep: g,
|
|
31
|
+
format: _,
|
|
32
|
+
locale: v,
|
|
33
|
+
disabled: w,
|
|
34
|
+
readOnly: T,
|
|
35
|
+
required: E,
|
|
36
|
+
onValueChange: (e) => L(e),
|
|
37
|
+
onValueCommitted: f ? (e) => f(e) : void 0
|
|
38
|
+
};
|
|
39
|
+
return /* @__PURE__ */ o(s.Root, {
|
|
40
|
+
...B,
|
|
41
|
+
...l === void 0 ? { defaultValue: u } : { value: l },
|
|
42
|
+
className: "aivex:w-full",
|
|
43
|
+
children: /* @__PURE__ */ o(a, {
|
|
44
|
+
error: R,
|
|
45
|
+
disabled: z,
|
|
46
|
+
focused: P.focused,
|
|
47
|
+
filled: I !== null,
|
|
48
|
+
size: y,
|
|
49
|
+
layout: "inline",
|
|
50
|
+
startContent: S,
|
|
51
|
+
endContent: C,
|
|
52
|
+
children: /* @__PURE__ */ o(s.Input, {
|
|
53
|
+
ref: M,
|
|
54
|
+
className: e("aivex:m-0 aivex:w-full aivex:min-w-0 aivex:appearance-none aivex:border-0 aivex:bg-transparent aivex:p-0 aivex:text-text-primary aivex:placeholder:text-text-tertiary aivex:outline-none aivex:tabular-nums", y === "sm" ? "aivex:text-body-md-regular" : "aivex:text-body-lg-regular", c[x], k),
|
|
55
|
+
onFocus: P.onFocus,
|
|
56
|
+
onBlur: P.onBlur,
|
|
57
|
+
...N
|
|
58
|
+
})
|
|
59
|
+
})
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
63
|
+
export { l as NumberField };
|
|
64
|
+
|
|
65
|
+
//# sourceMappingURL=NumberField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NumberField.js","names":[],"sources":["../../../src/components/NumberField/NumberField.tsx"],"sourcesContent":["\"use client\";\n\nimport { NumberField as NumberFieldPrimitive } from \"@base-ui/react/number-field\";\nimport type { InputHTMLAttributes, ReactNode, Ref } from \"react\";\nimport { useFieldState } from \"@/components/Field/FieldStateContext\";\nimport { InputBase } from \"@/components/InputBase\";\nimport { resolveInputError, useInputFocus } from \"@/components/InputBase/useInputState\";\nimport { cn } from \"@/utils/cn\";\nimport { useControllableState } from \"@/utils/useControllableState\";\n\ntype NumberFieldRootProps = NumberFieldPrimitive.Root.Props;\n\nconst alignClassName = {\n left: \"aivex:text-left\",\n center: \"aivex:text-center\",\n right: \"aivex:text-right\",\n} as const;\n\nexport interface NumberFieldProps\n extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"size\" | \"value\" | \"defaultValue\" | \"onChange\" | \"min\" | \"max\" | \"step\" | \"type\"\n > {\n /** 현재 값(제어). 비어 있으면 null */\n value?: number | null;\n /** 초기 값(비제어) */\n defaultValue?: number;\n /** 값이 바뀔 때(타이핑·방향키·휠) 호출된다. 입력을 비우면 null */\n onValueChange?: (value: number | null) => void;\n /** 값이 확정될 때(blur, 방향키를 뗄 때) 호출된다. 서버 저장처럼 무거운 작업은 여기서 한다. */\n onValueCommitted?: (value: number | null) => void;\n /** 최솟값. 벗어난 입력은 blur 때 이 값으로 맞춘다. */\n min?: number;\n /** 최댓값. 벗어난 입력은 blur 때 이 값으로 맞춘다. */\n max?: number;\n /**\n * 방향키(↑↓) 한 번에 바뀌는 양. Shift를 누르면 `largeStep`만큼 바뀐다.\n * @default 1\n */\n step?: number;\n /** Shift+방향키로 바뀌는 양 */\n largeStep?: number;\n /** 표시 형식(Intl.NumberFormat 옵션). 예: `{ maximumFractionDigits: 2 }`, `{ style: \"percent\" }` */\n format?: Intl.NumberFormatOptions;\n /** 숫자 표기 로캘. 생략하면 브라우저 로캘 */\n locale?: Intl.LocalesArgument;\n /**\n * 높이 sm 32px·md 40px\n * @default \"md\"\n */\n size?: \"sm\" | \"md\";\n /** 에러 상태. Field 안에서는 Field의 invalid로도 켜진다 */\n error?: boolean;\n /**\n * 숫자 정렬\n * @default \"left\"\n */\n align?: keyof typeof alignClassName;\n /** 인풋 좌측 슬롯 */\n startContent?: ReactNode;\n /** 인풋 우측 슬롯(단위 등) */\n endContent?: ReactNode;\n /** 보이는 input 요소 ref(폼 제출용 숨은 input이 아니다) */\n ref?: Ref<HTMLInputElement>;\n}\n\n/**\n * 숫자만 받는 한 줄 입력. 방향키(↑↓)로 `step`만큼 올리고 내리며, 범위(min·max)를 벗어난\n * 입력은 blur 때 맞추고 `format`대로 다시 표시한다.\n *\n * 임계값·개수·비율처럼 숫자 하나를 직접 입력받을 때 쓴다. 범위 안에서 대략 고르는 값이면\n * Slider, 일반 텍스트면 Textbox를 쓴다. 제어는 value + onValueChange(숫자 또는 null),\n * 비제어는 defaultValue. 라벨·설명·에러는 Field 안에 넣으면 자동으로 연결되고, 라벨이 없으면\n * aria-label을 지정한다.\n *\n * @example\n * ```tsx\n * import { Field, FieldLabel, NumberField } from \"@aivex/ui\";\n *\n * const [threshold, setThreshold] = useState<number | null>(0.5);\n *\n * <Field>\n * <FieldLabel>신뢰도 임계값</FieldLabel>\n * <NumberField\n * value={threshold}\n * onValueChange={setThreshold}\n * min={0}\n * max={1}\n * step={0.01}\n * format={{ minimumFractionDigits: 2, maximumFractionDigits: 2 }}\n * />\n * </Field>\n * ```\n */\nfunction NumberField({\n value,\n defaultValue,\n onValueChange,\n onValueCommitted,\n min,\n max,\n step,\n largeStep,\n format,\n locale,\n size = \"md\",\n error,\n align = \"left\",\n startContent,\n endContent,\n disabled,\n readOnly,\n required,\n name,\n id,\n className,\n onFocus,\n onBlur,\n ref,\n ...props\n}: NumberFieldProps) {\n const focus = useInputFocus({ onFocus, onBlur });\n const field = useFieldState();\n const [currentValue, setCurrentValue] = useControllableState<number | null>({\n value,\n defaultValue: defaultValue ?? null,\n onChange: onValueChange,\n });\n // Field의 invalid·disabled는 Base UI가 input에 직접 전달한다. 테두리 박스는 여기서 맞춘다.\n const isError = resolveInputError(error, props[\"aria-invalid\"]) || field.invalid;\n const isDisabled = Boolean(disabled) || field.disabled;\n\n const rootProps: NumberFieldRootProps = {\n id,\n name,\n min,\n max,\n step,\n largeStep,\n format,\n locale,\n disabled,\n readOnly,\n required,\n onValueChange: (next) => setCurrentValue(next),\n onValueCommitted: onValueCommitted ? (next) => onValueCommitted(next) : undefined,\n };\n\n return (\n <NumberFieldPrimitive.Root\n {...rootProps}\n // 제어·비제어를 섞지 않도록 넘어온 쪽만 전달한다.\n {...(value !== undefined ? { value } : { defaultValue })}\n className=\"aivex:w-full\"\n >\n <InputBase\n error={isError}\n disabled={isDisabled}\n focused={focus.focused}\n filled={currentValue !== null}\n size={size}\n layout=\"inline\"\n startContent={startContent}\n endContent={endContent}\n >\n <NumberFieldPrimitive.Input\n ref={ref}\n className={cn(\n \"aivex:m-0 aivex:w-full aivex:min-w-0 aivex:appearance-none aivex:border-0 aivex:bg-transparent aivex:p-0 aivex:text-text-primary aivex:placeholder:text-text-tertiary aivex:outline-none aivex:tabular-nums\",\n size === \"sm\" ? \"aivex:text-body-md-regular\" : \"aivex:text-body-lg-regular\",\n alignClassName[align],\n className,\n )}\n onFocus={focus.onFocus}\n onBlur={focus.onBlur}\n {...props}\n />\n </InputBase>\n </NumberFieldPrimitive.Root>\n );\n}\n\nexport { NumberField };\n"],"mappings":";;;;;;;;;;AAYA,IAAM,IAAiB;CACrB,MAAM;CACN,QAAQ;CACR,OAAO;CACR;AA8ED,SAAS,EAAY,EACnB,UACA,iBACA,kBACA,qBACA,QACA,QACA,SACA,cACA,WACA,WACA,UAAO,MACP,UACA,WAAQ,QACR,iBACA,eACA,aACA,aACA,aACA,SACA,OACA,cACA,YACA,WACA,QACA,GAAG,KACgB;CACnB,IAAM,IAAQ,EAAc;EAAE;EAAS;EAAQ,CAAC,EAC1C,IAAQ,GAAe,EACvB,CAAC,GAAc,KAAmB,EAAoC;EAC1E;EACA,cAAc,KAAgB;EAC9B,UAAU;EACX,CAAC,EAEI,IAAU,EAAkB,GAAO,EAAM,gBAAgB,IAAI,EAAM,SACnE,IAAa,EAAQ,KAAa,EAAM,UAExC,IAAkC;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,gBAAgB,MAAS,EAAgB,EAAK;EAC9C,kBAAkB,KAAoB,MAAS,EAAiB,EAAK,GAAG,KAAA;EACzE;AAED,QACE,kBAAC,EAAqB,MAAtB;EACE,GAAI;EAEJ,GAAK,MAAU,KAAA,IAAwB,EAAE,iBAAc,GAA5B,EAAE,UAAO;EACpC,WAAU;YAEV,kBAAC,GAAD;GACE,OAAO;GACP,UAAU;GACV,SAAS,EAAM;GACf,QAAQ,MAAiB;GACnB;GACN,QAAO;GACO;GACF;aAEZ,kBAAC,EAAqB,OAAtB;IACO;IACL,WAAW,EACT,+MACA,MAAS,OAAO,+BAA+B,8BAC/C,EAAe,IACf,EACD;IACD,SAAS,EAAM;IACf,QAAQ,EAAM;IACd,GAAI;IACJ,CAAA;GACQ,CAAA;EACc,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../utils.cjs`);let t=require(`
|
|
1
|
+
"use client";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../utils.cjs`);let t=require(`react/jsx-runtime`),n=require(`class-variance-authority`);var r=`aivex:fixed aivex:inset-0 aivex:z-(--aivex-z-overlay)`,i=`aivex:bg-dim`,a=(0,n.cva)(r,{variants:{variant:{dim:i,frost:`aivex:backdrop-blur-sm aivex:bg-white/30`}},defaultVariants:{variant:`dim`}});function o({className:n,variant:r,ref:i,...o}){return(0,t.jsx)(`div`,{ref:i,"aria-hidden":`true`,className:e.cn(a({variant:r??`dim`}),n),...o})}exports.Overlay=o,exports.overlayBaseClassName=r,exports.overlayDimClassName=i,exports.overlayVariants=a;
|
|
2
2
|
//# sourceMappingURL=Overlay.cjs.map
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../../utils.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
import { cva as n } from "class-variance-authority";
|
|
5
5
|
//#region src/components/Overlay/Overlay.tsx
|
|
6
|
-
var r = "aivex:fixed aivex:inset-0 aivex:z-(--aivex-z-overlay)", i = "aivex:bg-dim", a =
|
|
6
|
+
var r = "aivex:fixed aivex:inset-0 aivex:z-(--aivex-z-overlay)", i = "aivex:bg-dim", a = n(r, {
|
|
7
7
|
variants: { variant: {
|
|
8
8
|
dim: i,
|
|
9
9
|
frost: "aivex:backdrop-blur-sm aivex:bg-white/30"
|
|
10
10
|
} },
|
|
11
11
|
defaultVariants: { variant: "dim" }
|
|
12
12
|
});
|
|
13
|
-
function o({ className:
|
|
14
|
-
return /* @__PURE__ */
|
|
13
|
+
function o({ className: n, variant: r, ref: i, ...o }) {
|
|
14
|
+
return /* @__PURE__ */ t("div", {
|
|
15
15
|
ref: i,
|
|
16
16
|
"aria-hidden": "true",
|
|
17
|
-
className: e(a({ variant: r ?? "dim" }),
|
|
17
|
+
className: e(a({ variant: r ?? "dim" }), n),
|
|
18
18
|
...o
|
|
19
19
|
});
|
|
20
20
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";"use client";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(
|
|
1
|
+
"use client";"use client";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../Icon/index.cjs`),t=require(`../../utils.cjs`),n=require(`../InteractionLayer/InteractionLayer.cjs`),r=require(`../SelectBox/SelectBox.cjs`);let i=require(`react`),a=require(`react/jsx-runtime`);function o({onClick:e,disabled:t,"aria-label":r,children:i}){return(0,a.jsxs)(`button`,{type:`button`,"aria-label":r,disabled:t,onClick:e,className:`aivex:relative aivex:overflow-hidden aivex:group aivex:flex aivex:h-8 aivex:w-8 aivex:items-center aivex:justify-center aivex:rounded-sm aivex:text-text-secondary aivex:disabled:opacity-disable aivex:disabled:pointer-events-none aivex:transition-colors`,children:[(0,a.jsx)(n.InteractionLayer,{variant:`default`}),i]})}function s({page:e,label:r,isActive:i,disabled:o,onClick:s}){return(0,a.jsxs)(`button`,{type:`button`,"aria-label":r,"aria-current":i?`page`:void 0,disabled:o,onClick:s,className:t.cn(`aivex:relative aivex:overflow-hidden aivex:group aivex:flex aivex:h-8 aivex:px-xs aivex:items-center aivex:justify-center aivex:rounded-full aivex:transition-colors aivex:disabled:opacity-disable aivex:disabled:pointer-events-none`,i?`aivex:bg-bg-brand-subtle aivex:text-text-brand`:`aivex:text-text-secondary`),children:[(0,a.jsx)(n.InteractionLayer,{variant:i?`strong`:`default`}),(0,a.jsx)(`span`,{className:`aivex:relative aivex:min-w-6 aivex:text-center aivex:text-label-lg`,children:e})]})}var c={navigation:`Pagination`,first:`First page`,previousGroup:`Previous page group`,nextGroup:`Next page group`,last:`Last page`,page:e=>`Page ${e}`,pageSize:`Rows per page`};function l({className:n,totalPages:l,page:u,pageSize:d,disabled:f,pageSizeOptions:p,onPageChange:m,onPageSizeChange:h,labels:g,ref:_,...v}){let y=(0,i.useRef)(void 0);l!=null&&(y.current=l);let b=l??y.current;if(b==null)return null;let x=Math.max(1,b),S={...c,...g},C=Math.min(Math.max(1,u),x),w=Math.floor((C-1)/10),T=w*10+1,E=Math.min(T+9,x),D=Array.from({length:E-T+1},(e,t)=>T+t),O=w===0,k=E===x,A=e=>{m(e)},j=e=>{h?.(Number(e))};return(0,a.jsxs)(`nav`,{ref:_,"aria-label":S.navigation,className:t.cn(`aivex:flex aivex:items-center`,n),...v,children:[(0,a.jsx)(`div`,{className:`aivex:flex-1`}),(0,a.jsxs)(`div`,{className:`aivex:flex aivex:items-center aivex:gap-6 aivex:shrink-0`,children:[(0,a.jsxs)(`div`,{className:`aivex:flex aivex:gap-2`,children:[(0,a.jsx)(o,{"aria-label":S.first,disabled:f||O,onClick:()=>A(1),children:(0,a.jsx)(e.DirectionDoubleLeftIcon,{size:16})}),(0,a.jsx)(o,{"aria-label":S.previousGroup,disabled:f||O,onClick:()=>A(T-10),children:(0,a.jsx)(e.DirectionLeftIcon,{size:16})})]}),(0,a.jsx)(`div`,{className:`aivex:flex aivex:gap-2`,children:D.map(e=>(0,a.jsx)(s,{page:e,label:S.page(e),isActive:e===C,disabled:f,onClick:()=>A(e)},e))}),(0,a.jsxs)(`div`,{className:`aivex:flex aivex:gap-2`,children:[(0,a.jsx)(o,{"aria-label":S.nextGroup,disabled:f||k,onClick:()=>A(E+1),children:(0,a.jsx)(e.DirectionRightIcon,{size:16})}),(0,a.jsx)(o,{"aria-label":S.last,disabled:f||k,onClick:()=>A(x),children:(0,a.jsx)(e.DirectionDoubleRightIcon,{size:16})})]})]}),(0,a.jsx)(`div`,{className:`aivex:flex-1 aivex:flex aivex:items-center aivex:justify-end`,children:p&&(0,a.jsx)(r.SelectBox,{"aria-label":S.pageSize,size:`sm`,className:`aivex:w-[116px] aivex:shrink-0`,value:String(d),disabled:f,groups:[{options:p.map(({value:e,label:t})=>({value:String(e),label:t}))}],onValueChange:j})})]})}exports.Pagination=l;
|
|
2
2
|
//# sourceMappingURL=Pagination.cjs.map
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { DirectionDoubleLeftIcon as e, DirectionDoubleRightIcon as t, DirectionLeftIcon as n, DirectionRightIcon as r } from "../Icon/index.js";
|
|
4
|
+
import { cn as i } from "../../utils.js";
|
|
5
|
+
import { InteractionLayer as a } from "../InteractionLayer/InteractionLayer.js";
|
|
6
6
|
import { SelectBox as o } from "../SelectBox/SelectBox.js";
|
|
7
7
|
import { useRef as s } from "react";
|
|
8
8
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
9
9
|
//#region src/components/Pagination/Pagination.tsx
|
|
10
|
-
function u({ onClick: e, disabled:
|
|
10
|
+
function u({ onClick: e, disabled: t, "aria-label": n, children: r }) {
|
|
11
11
|
return /* @__PURE__ */ l("button", {
|
|
12
12
|
type: "button",
|
|
13
|
-
"aria-label":
|
|
14
|
-
disabled:
|
|
13
|
+
"aria-label": n,
|
|
14
|
+
disabled: t,
|
|
15
15
|
onClick: e,
|
|
16
16
|
className: "aivex:relative aivex:overflow-hidden aivex:group aivex:flex aivex:h-8 aivex:w-8 aivex:items-center aivex:justify-center aivex:rounded-sm aivex:text-text-secondary aivex:disabled:opacity-disable aivex:disabled:pointer-events-none aivex:transition-colors",
|
|
17
|
-
children: [/* @__PURE__ */ c(
|
|
17
|
+
children: [/* @__PURE__ */ c(a, { variant: "default" }), r]
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
-
function d({ page:
|
|
20
|
+
function d({ page: e, label: t, isActive: n, disabled: r, onClick: o }) {
|
|
21
21
|
return /* @__PURE__ */ l("button", {
|
|
22
22
|
type: "button",
|
|
23
|
-
"aria-label":
|
|
24
|
-
"aria-current":
|
|
25
|
-
disabled:
|
|
23
|
+
"aria-label": t,
|
|
24
|
+
"aria-current": n ? "page" : void 0,
|
|
25
|
+
disabled: r,
|
|
26
26
|
onClick: o,
|
|
27
|
-
className:
|
|
28
|
-
children: [/* @__PURE__ */ c(
|
|
27
|
+
className: i("aivex:relative aivex:overflow-hidden aivex:group aivex:flex aivex:h-8 aivex:px-xs aivex:items-center aivex:justify-center aivex:rounded-full aivex:transition-colors aivex:disabled:opacity-disable aivex:disabled:pointer-events-none", n ? "aivex:bg-bg-brand-subtle aivex:text-text-brand" : "aivex:text-text-secondary"),
|
|
28
|
+
children: [/* @__PURE__ */ c(a, { variant: n ? "strong" : "default" }), /* @__PURE__ */ c("span", {
|
|
29
29
|
className: "aivex:relative aivex:min-w-6 aivex:text-center aivex:text-label-lg",
|
|
30
|
-
children:
|
|
30
|
+
children: e
|
|
31
31
|
})]
|
|
32
32
|
});
|
|
33
33
|
}
|
|
@@ -40,7 +40,7 @@ var f = {
|
|
|
40
40
|
page: (e) => `Page ${e}`,
|
|
41
41
|
pageSize: "Rows per page"
|
|
42
42
|
};
|
|
43
|
-
function p({ className:
|
|
43
|
+
function p({ className: a, totalPages: p, page: m, pageSize: h, disabled: g, pageSizeOptions: _, onPageChange: v, onPageSizeChange: y, labels: b, ref: x, ...S }) {
|
|
44
44
|
let C = s(void 0);
|
|
45
45
|
p != null && (C.current = p);
|
|
46
46
|
let w = p ?? C.current;
|
|
@@ -56,7 +56,7 @@ function p({ className: t, totalPages: p, page: m, pageSize: h, disabled: g, pag
|
|
|
56
56
|
return /* @__PURE__ */ l("nav", {
|
|
57
57
|
ref: x,
|
|
58
58
|
"aria-label": E.navigation,
|
|
59
|
-
className:
|
|
59
|
+
className: i("aivex:flex aivex:items-center", a),
|
|
60
60
|
...S,
|
|
61
61
|
children: [
|
|
62
62
|
/* @__PURE__ */ c("div", { className: "aivex:flex-1" }),
|
|
@@ -69,12 +69,12 @@ function p({ className: t, totalPages: p, page: m, pageSize: h, disabled: g, pag
|
|
|
69
69
|
"aria-label": E.first,
|
|
70
70
|
disabled: g || M,
|
|
71
71
|
onClick: () => P(1),
|
|
72
|
-
children: /* @__PURE__ */ c(
|
|
72
|
+
children: /* @__PURE__ */ c(e, { size: 16 })
|
|
73
73
|
}), /* @__PURE__ */ c(u, {
|
|
74
74
|
"aria-label": E.previousGroup,
|
|
75
75
|
disabled: g || M,
|
|
76
76
|
onClick: () => P(k - 10),
|
|
77
|
-
children: /* @__PURE__ */ c(
|
|
77
|
+
children: /* @__PURE__ */ c(n, { size: 16 })
|
|
78
78
|
})]
|
|
79
79
|
}),
|
|
80
80
|
/* @__PURE__ */ c("div", {
|
|
@@ -93,12 +93,12 @@ function p({ className: t, totalPages: p, page: m, pageSize: h, disabled: g, pag
|
|
|
93
93
|
"aria-label": E.nextGroup,
|
|
94
94
|
disabled: g || N,
|
|
95
95
|
onClick: () => P(A + 1),
|
|
96
|
-
children: /* @__PURE__ */ c(
|
|
96
|
+
children: /* @__PURE__ */ c(r, { size: 16 })
|
|
97
97
|
}), /* @__PURE__ */ c(u, {
|
|
98
98
|
"aria-label": E.last,
|
|
99
99
|
disabled: g || N,
|
|
100
100
|
onClick: () => P(T),
|
|
101
|
-
children: /* @__PURE__ */ c(
|
|
101
|
+
children: /* @__PURE__ */ c(t, { size: 16 })
|
|
102
102
|
})]
|
|
103
103
|
})
|
|
104
104
|
]
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../utils.cjs`),t=require(`../../utils/sheet.cjs`);let n=require(`
|
|
1
|
+
"use client";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../utils.cjs`),t=require(`../../utils/sheet.cjs`);let n=require(`react`),r=require(`react/jsx-runtime`),i=require(`class-variance-authority`);var a=(0,n.createContext)(void 0),o=(0,i.cva)(`aivex:flex aivex:h-full aivex:min-h-0 aivex:shrink-0 aivex:flex-col aivex:border-border-subtle aivex:bg-bg-primary`,{variants:{side:{left:`aivex:border-r`,right:`aivex:border-l`}},defaultVariants:{side:`right`}});function s({children:t,side:i=`right`,width:s=420,"aria-label":c,className:l,style:u,ref:d}){let f=(0,n.useId)();return(0,r.jsx)(a.Provider,{value:f,children:(0,r.jsx)(`aside`,{ref:d,"aria-label":c,"aria-labelledby":c?void 0:f,"data-side":i,className:e.cn(o({side:i}),l),style:{width:s,...u},children:t})})}function c({children:i,description:o,action:s,className:c}){let l=(0,n.useContext)(a);return(0,r.jsxs)(`div`,{className:e.cn(t.sheetHeaderClassName,c),children:[(0,r.jsxs)(`div`,{className:`aivex:flex aivex:min-w-0 aivex:flex-1 aivex:flex-col aivex:gap-2xs`,children:[(0,r.jsx)(`h2`,{id:l,className:t.sheetTitleClassName,children:i}),o?(0,r.jsx)(`p`,{className:`aivex:m-0 aivex:text-body-sm-regular aivex:text-text-secondary`,children:o}):null]}),s?(0,r.jsx)(`div`,{className:t.sheetActionsClassName,children:s}):null]})}function l({children:t,title:n,action:i,fill:a=!1,className:o}){return(0,r.jsxs)(`section`,{className:e.cn(`aivex:flex aivex:flex-col aivex:gap-md aivex:px-xl aivex:py-lg`,`aivex:[&+section]:border-t aivex:[&+section]:border-border-subtle`,a?`aivex:min-h-0 aivex:flex-1`:`aivex:shrink-0`,o),children:[n||i?(0,r.jsxs)(`div`,{className:`aivex:flex aivex:min-h-8 aivex:shrink-0 aivex:items-center aivex:justify-between aivex:gap-md`,children:[(0,r.jsx)(`h3`,{className:`aivex:m-0 aivex:min-w-0 aivex:truncate aivex:text-body-md-medium aivex:text-text-primary`,children:n}),i?(0,r.jsx)(`div`,{className:`aivex:flex aivex:shrink-0 aivex:items-center aivex:gap-xs`,children:i}):null]}):null,a?(0,r.jsx)(`div`,{className:`aivex:flex aivex:min-h-0 aivex:flex-1 aivex:flex-col aivex:overflow-y-auto`,children:t}):t]})}function u({children:n,padded:i=!0,className:a}){return(0,r.jsx)(`div`,{className:e.cn(t.sheetBodyClassName,i&&`aivex:p-xl`,a),children:n})}function d({children:t,className:n}){return(0,r.jsx)(`div`,{className:e.cn(`aivex:mt-auto aivex:flex aivex:shrink-0 aivex:flex-col aivex:gap-md aivex:border-t aivex:border-border-subtle aivex:px-xl aivex:py-lg`,n),children:t})}var f=Object.assign(s,{Header:c,Section:l,Body:u,Footer:d});exports.Panel=f;
|
|
2
2
|
//# sourceMappingURL=Panel.cjs.map
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../../utils.js";
|
|
3
3
|
import { sheetActionsClassName as t, sheetBodyClassName as n, sheetHeaderClassName as r, sheetTitleClassName as i } from "../../utils/sheet.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { createContext as a, useContext as o, useId as s } from "react";
|
|
5
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
|
+
import { cva as u } from "class-variance-authority";
|
|
7
7
|
//#region src/components/Panel/Panel.tsx
|
|
8
|
-
var d =
|
|
8
|
+
var d = a(void 0), f = u("aivex:flex aivex:h-full aivex:min-h-0 aivex:shrink-0 aivex:flex-col aivex:border-border-subtle aivex:bg-bg-primary", {
|
|
9
9
|
variants: { side: {
|
|
10
10
|
left: "aivex:border-r",
|
|
11
11
|
right: "aivex:border-l"
|
|
12
12
|
} },
|
|
13
13
|
defaultVariants: { side: "right" }
|
|
14
14
|
});
|
|
15
|
-
function p({ children: t, side: n = "right", width: r = 420, "aria-label": i, className: a, style: o, ref:
|
|
16
|
-
let u =
|
|
17
|
-
return /* @__PURE__ */
|
|
15
|
+
function p({ children: t, side: n = "right", width: r = 420, "aria-label": i, className: a, style: o, ref: l }) {
|
|
16
|
+
let u = s();
|
|
17
|
+
return /* @__PURE__ */ c(d.Provider, {
|
|
18
18
|
value: u,
|
|
19
|
-
children: /* @__PURE__ */
|
|
20
|
-
ref:
|
|
19
|
+
children: /* @__PURE__ */ c("aside", {
|
|
20
|
+
ref: l,
|
|
21
21
|
"aria-label": i,
|
|
22
22
|
"aria-labelledby": i ? void 0 : u,
|
|
23
23
|
"data-side": n,
|
|
@@ -30,52 +30,52 @@ function p({ children: t, side: n = "right", width: r = 420, "aria-label": i, cl
|
|
|
30
30
|
})
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
|
-
function m({ children: n, description: a, action:
|
|
34
|
-
let f =
|
|
35
|
-
return /* @__PURE__ */
|
|
36
|
-
className: e(r,
|
|
37
|
-
children: [/* @__PURE__ */
|
|
33
|
+
function m({ children: n, description: a, action: s, className: u }) {
|
|
34
|
+
let f = o(d);
|
|
35
|
+
return /* @__PURE__ */ l("div", {
|
|
36
|
+
className: e(r, u),
|
|
37
|
+
children: [/* @__PURE__ */ l("div", {
|
|
38
38
|
className: "aivex:flex aivex:min-w-0 aivex:flex-1 aivex:flex-col aivex:gap-2xs",
|
|
39
|
-
children: [/* @__PURE__ */
|
|
39
|
+
children: [/* @__PURE__ */ c("h2", {
|
|
40
40
|
id: f,
|
|
41
41
|
className: i,
|
|
42
42
|
children: n
|
|
43
|
-
}), a ? /* @__PURE__ */
|
|
43
|
+
}), a ? /* @__PURE__ */ c("p", {
|
|
44
44
|
className: "aivex:m-0 aivex:text-body-sm-regular aivex:text-text-secondary",
|
|
45
45
|
children: a
|
|
46
46
|
}) : null]
|
|
47
|
-
}),
|
|
47
|
+
}), s ? /* @__PURE__ */ c("div", {
|
|
48
48
|
className: t,
|
|
49
|
-
children:
|
|
49
|
+
children: s
|
|
50
50
|
}) : null]
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
function h({ children: t, title: n, action: r, fill: i = !1, className: a }) {
|
|
54
|
-
return /* @__PURE__ */
|
|
54
|
+
return /* @__PURE__ */ l("section", {
|
|
55
55
|
className: e("aivex:flex aivex:flex-col aivex:gap-md aivex:px-xl aivex:py-lg", "aivex:[&+section]:border-t aivex:[&+section]:border-border-subtle", i ? "aivex:min-h-0 aivex:flex-1" : "aivex:shrink-0", a),
|
|
56
|
-
children: [n || r ? /* @__PURE__ */
|
|
56
|
+
children: [n || r ? /* @__PURE__ */ l("div", {
|
|
57
57
|
className: "aivex:flex aivex:min-h-8 aivex:shrink-0 aivex:items-center aivex:justify-between aivex:gap-md",
|
|
58
|
-
children: [/* @__PURE__ */
|
|
58
|
+
children: [/* @__PURE__ */ c("h3", {
|
|
59
59
|
className: "aivex:m-0 aivex:min-w-0 aivex:truncate aivex:text-body-md-medium aivex:text-text-primary",
|
|
60
60
|
children: n
|
|
61
|
-
}), r ? /* @__PURE__ */
|
|
61
|
+
}), r ? /* @__PURE__ */ c("div", {
|
|
62
62
|
className: "aivex:flex aivex:shrink-0 aivex:items-center aivex:gap-xs",
|
|
63
63
|
children: r
|
|
64
64
|
}) : null]
|
|
65
|
-
}) : null, i ? /* @__PURE__ */
|
|
65
|
+
}) : null, i ? /* @__PURE__ */ c("div", {
|
|
66
66
|
className: "aivex:flex aivex:min-h-0 aivex:flex-1 aivex:flex-col aivex:overflow-y-auto",
|
|
67
67
|
children: t
|
|
68
68
|
}) : t]
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
71
|
function g({ children: t, padded: r = !0, className: i }) {
|
|
72
|
-
return /* @__PURE__ */
|
|
72
|
+
return /* @__PURE__ */ c("div", {
|
|
73
73
|
className: e(n, r && "aivex:p-xl", i),
|
|
74
74
|
children: t
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
77
|
function _({ children: t, className: n }) {
|
|
78
|
-
return /* @__PURE__ */
|
|
78
|
+
return /* @__PURE__ */ c("div", {
|
|
79
79
|
className: e("aivex:mt-auto aivex:flex aivex:shrink-0 aivex:flex-col aivex:gap-md aivex:border-t aivex:border-border-subtle aivex:px-xl aivex:py-lg", n),
|
|
80
80
|
children: t
|
|
81
81
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";"use client";
|
|
1
|
+
"use client";"use client";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../utils.cjs`),t=require(`../../utils/PortalEventBoundary.cjs`),n=require(`../../utils/popupPositioning.cjs`);let r=require(`react/jsx-runtime`),i=require(`@base-ui/react/popover`);var a=e.cn(`aivex:flex aivex:flex-col aivex:gap-lg aivex:max-h-[448px] aivex:p-xl`,`aivex:rounded-xl aivex:shadow-md`,`aivex:outline-none`,`aivex:data-[open]:animate-in aivex:data-[closed]:animate-out`,`aivex:data-[closed]:fade-out-0 aivex:data-[open]:fade-in-0`,`aivex:data-[closed]:zoom-out-95 aivex:data-[open]:zoom-in-95`),o=`aivex:z-(--aivex-z-dropdown) aivex:outline-none`,s=e.cn(a,`aivex:w-[277px]`,`aivex:bg-bg-primary aivex:text-text-primary aivex:border aivex:border-border-subtle aivex:overflow-clip`);function c(e){return(0,r.jsx)(i.Popover.Root,{...e})}function l({ref:e,...t}){return(0,r.jsx)(i.Popover.Trigger,{ref:e,...t})}function u({ref:e,...t}){return(0,r.jsx)(i.Popover.Close,{ref:e,...t})}function d({className:a,container:c,keepMounted:l,ref:u,...d}){let[{sideOffset:f=8,align:p=`start`,...m},h]=n.splitPositioningProps(d);return(0,r.jsx)(t.PortalEventBoundary,{children:(0,r.jsx)(i.Popover.Portal,{container:c,keepMounted:l,children:(0,r.jsx)(i.Popover.Positioner,{sideOffset:f,align:p,className:o,...m,children:(0,r.jsx)(i.Popover.Popup,{ref:u,className:e.cn(s,a),...h})})})})}function f({className:t,ref:n,...i}){return(0,r.jsx)(`div`,{ref:n,className:e.cn(`aivex:w-full aivex:px-xs aivex:text-body-md-medium aivex:text-text-primary aivex:truncate`,t),...i})}function p({className:t,ref:n,...i}){return(0,r.jsx)(`div`,{ref:n,className:e.cn(`aivex:flex aivex:min-h-0 aivex:w-full aivex:flex-1 aivex:flex-col aivex:gap-md aivex:overflow-y-auto`,t),...i})}function m({className:t,start:n,children:i,ref:a,...o}){return(0,r.jsxs)(`div`,{ref:a,className:e.cn(`aivex:flex aivex:w-full aivex:items-center aivex:justify-end aivex:gap-md`,t),...o,children:[n&&(0,r.jsx)(`div`,{className:`aivex:flex aivex:min-w-0 aivex:flex-1 aivex:flex-col aivex:items-start aivex:justify-center`,children:n}),i]})}var h=Object.assign(c,{Trigger:l,Close:u,Content:d,Title:f,Body:p,Footer:m});exports.Popover=h,exports.popoverContentBaseClassName=a,exports.popoverPositionerClassName=o;
|
|
2
2
|
//# sourceMappingURL=Popover.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.cjs","names":[],"sources":["../../../src/components/Popover/Popover.tsx"],"sourcesContent":["\"use client\";\n\nimport
|
|
1
|
+
{"version":3,"file":"Popover.cjs","names":[],"sources":["../../../src/components/Popover/Popover.tsx"],"sourcesContent":["\"use client\";\n\nimport { Popover as PopoverPrimitive } from \"@base-ui/react/popover\";\nimport type { ComponentPropsWithoutRef, ReactNode, Ref } from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { PortalEventBoundary } from \"@/utils/PortalEventBoundary\";\nimport { type PopupPositioningProps, splitPositioningProps } from \"@/utils/popupPositioning\";\n\n// ─── Content shell ─────────────────────────────────────────────────────────────\n\n/**\n * Popover 계열 카드의 공통 골격 — 세로 레이아웃·최대 높이·패딩·열림/닫힘\n * 애니메이션. Popover와 Coachmark가 함께 쓰고 폭·표면(배경·테두리)만 각자 정한다.\n */\nconst popoverContentBaseClassName = cn(\n \"aivex:flex aivex:flex-col aivex:gap-lg aivex:max-h-[448px] aivex:p-xl\",\n \"aivex:rounded-xl aivex:shadow-md\",\n \"aivex:outline-none\",\n \"aivex:data-[open]:animate-in aivex:data-[closed]:animate-out\",\n \"aivex:data-[closed]:fade-out-0 aivex:data-[open]:fade-in-0\",\n \"aivex:data-[closed]:zoom-out-95 aivex:data-[open]:zoom-in-95\",\n);\n\n/** 위치를 잡는 바깥 요소(Positioner)의 클래스 — 쌓임 순서는 여기서 정한다. */\nconst popoverPositionerClassName = \"aivex:z-(--aivex-z-dropdown) aivex:outline-none\";\n\n// 폭 277px은 Figma Popover-Dropdown 사양이다(Coachmark의 Popover-Bubble은 280px).\nconst contentClassName = cn(\n popoverContentBaseClassName,\n \"aivex:w-[277px]\",\n // 포털로 body에 붙으므로 글자색을 호스트 body에서 상속받지 않게 배경과 짝으로 지정한다.\n \"aivex:bg-bg-primary aivex:text-text-primary aivex:border aivex:border-border-subtle aivex:overflow-clip\",\n);\n\n// ─── Root ─────────────────────────────────────────────────────────────────────\n\n/** Popover 루트 props — open·defaultOpen·onOpenChange(open, details)·modal. */\ntype PopoverRootProps = PopoverPrimitive.Root.Props;\n\nfunction PopoverRoot(props: PopoverRootProps) {\n return <PopoverPrimitive.Root {...props} />;\n}\n\n// ─── Trigger ──────────────────────────────────────────────────────────────────\n\n/** Popover.Trigger props — button 속성 + `render`. */\ntype PopoverTriggerProps = PopoverPrimitive.Trigger.Props & {\n ref?: Ref<HTMLButtonElement>;\n};\n\n/** `render`로 ToggleButton 등 임의의 버튼을 트리거로 쓴다. 버튼이 아닌 요소면 `nativeButton={false}`를 준다. */\nfunction PopoverTrigger({ ref, ...props }: PopoverTriggerProps) {\n return <PopoverPrimitive.Trigger ref={ref} {...props} />;\n}\n\n// ─── Close ────────────────────────────────────────────────────────────────────\n\n/** Popover.Close props — button 속성 + `render`. */\ntype PopoverCloseProps = PopoverPrimitive.Close.Props & {\n ref?: Ref<HTMLButtonElement>;\n};\n\n/** `render`로 하단 버튼을 넘기면 그 버튼을 눌렀을 때 팝오버가 닫힌다. */\nfunction PopoverClose({ ref, ...props }: PopoverCloseProps) {\n return <PopoverPrimitive.Close ref={ref} {...props} />;\n}\n\n// ─── Content ──────────────────────────────────────────────────────────────────\n\n/**\n * Popover.Content props — 카드(div) 속성, 위치 props(side·align·sideOffset·anchor 등),\n * 포커스 이동(initialFocus·finalFocus), 포털 대상.\n */\ntype PopoverContentProps = Omit<PopoverPrimitive.Popup.Props, \"className\"> &\n PopupPositioningProps & {\n className?: string;\n /** 포털 대상. 생략하면 document.body — Shadow DOM 안에서는 그 루트 안의 요소를 넘긴다. */\n container?: PopoverPrimitive.Portal.Props[\"container\"];\n /**\n * 닫혀 있을 때도 DOM에 남겨 둔다.\n * @default false\n */\n keepMounted?: boolean;\n ref?: Ref<HTMLDivElement>;\n };\n\n/**\n * 포털로 띄우는 277px 폭 카드. 기본 sideOffset 8, align \"start\".\n * 안에 Popover.Title·Body·Footer를 순서대로 둔다.\n * 트리거가 아닌 요소를 기준으로 띄우려면 `anchor`에 그 요소나 ref를 넘긴다.\n */\nfunction PopoverContent({ className, container, keepMounted, ref, ...props }: PopoverContentProps) {\n const [{ sideOffset = 8, align = \"start\", ...positioning }, popupProps] =\n splitPositioningProps(props);\n\n return (\n <PortalEventBoundary>\n <PopoverPrimitive.Portal container={container} keepMounted={keepMounted}>\n <PopoverPrimitive.Positioner\n sideOffset={sideOffset}\n align={align}\n className={popoverPositionerClassName}\n {...positioning}\n >\n <PopoverPrimitive.Popup\n ref={ref}\n className={cn(contentClassName, className)}\n {...popupProps}\n />\n </PopoverPrimitive.Positioner>\n </PopoverPrimitive.Portal>\n </PortalEventBoundary>\n );\n}\n\n// ─── Title ────────────────────────────────────────────────────────────────────\n\n/** Popover.Title props — div 속성. */\ntype PopoverTitleProps = ComponentPropsWithoutRef<\"div\"> & {\n ref?: Ref<HTMLDivElement>;\n};\n\n/** 카드 상단 한 줄 제목(넘치면 말줄임). 시각적 제목이며 aria 연결은 하지 않는다. */\nfunction PopoverTitle({ className, ref, ...props }: PopoverTitleProps) {\n return (\n <div\n ref={ref}\n className={cn(\n \"aivex:w-full aivex:px-xs aivex:text-body-md-medium aivex:text-text-primary aivex:truncate\",\n className,\n )}\n {...props}\n />\n );\n}\n\n// ─── Body (ItemArea) ────────────────────────────────────────────────────────────\n\n/** Popover.Body props — div 속성. */\ntype PopoverBodyProps = ComponentPropsWithoutRef<\"div\"> & {\n ref?: Ref<HTMLDivElement>;\n};\n\n/** 검색창·목록 등 자유롭게 들어가는 스크롤 영역입니다. */\nfunction PopoverBody({ className, ref, ...props }: PopoverBodyProps) {\n return (\n <div\n ref={ref}\n className={cn(\n \"aivex:flex aivex:min-h-0 aivex:w-full aivex:flex-1 aivex:flex-col aivex:gap-md aivex:overflow-y-auto\",\n className,\n )}\n {...props}\n />\n );\n}\n\n// ─── Footer (BtnContainer) ──────────────────────────────────────────────────────\n\n/** Popover.Footer props — div 속성 + 좌측 슬롯. */\ninterface PopoverFooterProps extends ComponentPropsWithoutRef<\"div\"> {\n /** 좌측에 넓게 붙는 영역(예: 옵션 tertiary 버튼). 지정 시 나머지 버튼은 우측 정렬됩니다. */\n start?: ReactNode;\n ref?: Ref<HTMLDivElement>;\n}\n\n/** 하단 버튼 줄 — children은 우측 정렬, start는 좌측에 붙는다. */\nfunction PopoverFooter({ className, start, children, ref, ...props }: PopoverFooterProps) {\n return (\n <div\n ref={ref}\n className={cn(\n \"aivex:flex aivex:w-full aivex:items-center aivex:justify-end aivex:gap-md\",\n className,\n )}\n {...props}\n >\n {start && (\n <div className=\"aivex:flex aivex:min-w-0 aivex:flex-1 aivex:flex-col aivex:items-start aivex:justify-center\">\n {start}\n </div>\n )}\n {children}\n </div>\n );\n}\n\n// ─── Compound export ──────────────────────────────────────────────────────────\n\n/**\n * 트리거 옆에 뜨는 비모달 카드(필터·옵션 선택 등)를 만드는 컴파운드 컴포넌트.\n *\n * 버튼을 눌러 검색·체크 목록·적용 버튼 같은 상호작용 내용을 띄울 때 쓴다. 호버로 짧은 설명만\n * 보이면 Tooltip, 화면을 막고 작업을 받아야 하면 Modal을 쓴다. open/onOpenChange로 제어하거나\n * 비제어로 쓰며, 바깥 클릭·Esc로 닫힌다. 버튼으로 닫으려면 Popover.Close의 render로 그 버튼을 넘긴다.\n *\n * @example\n * ```tsx\n * import { Button, Popover, ToggleButton } from \"@aivex/ui\";\n *\n * <Popover>\n * <Popover.Trigger render={<ToggleButton>필터</ToggleButton>} />\n * <Popover.Content>\n * <Popover.Title>상태 필터</Popover.Title>\n * <Popover.Body>…</Popover.Body>\n * <Popover.Footer start={<Button variant=\"ghost\">초기화</Button>}>\n * <Popover.Close render={<Button variant=\"solid\" color=\"secondary\">취소</Button>} />\n * <Button onClick={apply}>적용하기</Button>\n * </Popover.Footer>\n * </Popover.Content>\n * </Popover>\n * ```\n */\nconst Popover = Object.assign(PopoverRoot, {\n Trigger: PopoverTrigger,\n Close: PopoverClose,\n Content: PopoverContent,\n Title: PopoverTitle,\n Body: PopoverBody,\n Footer: PopoverFooter,\n});\n\nexport type {\n PopoverBodyProps,\n PopoverCloseProps,\n PopoverContentProps,\n PopoverFooterProps,\n PopoverRootProps,\n PopoverTitleProps,\n PopoverTriggerProps,\n};\nexport { Popover, popoverContentBaseClassName, popoverPositionerClassName };\n"],"mappings":"mRAcA,IAAM,EAA8B,EAAA,GAClC,wEACA,mCACA,qBACA,+DACA,6DACA,+DACD,CAGK,EAA6B,kDAG7B,EAAmB,EAAA,GACvB,EACA,kBAEA,0GACD,CAOD,SAAS,EAAY,EAAyB,CAC5C,OAAO,EAAA,EAAA,KAAC,EAAA,QAAiB,KAAlB,CAAuB,GAAI,EAAS,CAAA,CAW7C,SAAS,EAAe,CAAE,MAAK,GAAG,GAA8B,CAC9D,OAAO,EAAA,EAAA,KAAC,EAAA,QAAiB,QAAlB,CAA+B,MAAK,GAAI,EAAS,CAAA,CAW1D,SAAS,EAAa,CAAE,MAAK,GAAG,GAA4B,CAC1D,OAAO,EAAA,EAAA,KAAC,EAAA,QAAiB,MAAlB,CAA6B,MAAK,GAAI,EAAS,CAAA,CA2BxD,SAAS,EAAe,CAAE,YAAW,YAAW,cAAa,MAAK,GAAG,GAA8B,CACjG,GAAM,CAAC,CAAE,aAAa,EAAG,QAAQ,QAAS,GAAG,GAAe,GAC1D,EAAA,sBAAsB,EAAM,CAE9B,OACE,EAAA,EAAA,KAAC,EAAA,oBAAD,CAAA,UACE,EAAA,EAAA,KAAC,EAAA,QAAiB,OAAlB,CAAoC,YAAwB,wBAC1D,EAAA,EAAA,KAAC,EAAA,QAAiB,WAAlB,CACc,aACL,QACP,UAAW,EACX,GAAI,YAEJ,EAAA,EAAA,KAAC,EAAA,QAAiB,MAAlB,CACO,MACL,UAAW,EAAA,GAAG,EAAkB,EAAU,CAC1C,GAAI,EACJ,CAAA,CAC0B,CAAA,CACN,CAAA,CACN,CAAA,CAY1B,SAAS,EAAa,CAAE,YAAW,MAAK,GAAG,GAA4B,CACrE,OACE,EAAA,EAAA,KAAC,MAAD,CACO,MACL,UAAW,EAAA,GACT,4FACA,EACD,CACD,GAAI,EACJ,CAAA,CAYN,SAAS,EAAY,CAAE,YAAW,MAAK,GAAG,GAA2B,CACnE,OACE,EAAA,EAAA,KAAC,MAAD,CACO,MACL,UAAW,EAAA,GACT,uGACA,EACD,CACD,GAAI,EACJ,CAAA,CAcN,SAAS,EAAc,CAAE,YAAW,QAAO,WAAU,MAAK,GAAG,GAA6B,CACxF,OACE,EAAA,EAAA,MAAC,MAAD,CACO,MACL,UAAW,EAAA,GACT,4EACA,EACD,CACD,GAAI,WANN,CAQG,IACC,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,uGACZ,EACG,CAAA,CAEP,EACG,GA8BV,IAAM,EAAU,OAAO,OAAO,EAAa,CACzC,QAAS,EACT,MAAO,EACP,QAAS,EACT,MAAO,EACP,KAAM,EACN,OAAQ,EACT,CAAC"}
|