@medway-ui/core 1.37.0 → 1.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/COMPONENTS.md +168 -17
- package/COMPONENTS_SUMMARY.md +7 -5
- package/README.md +1 -1
- package/dist/COMPONENTS.md +168 -17
- package/dist/COMPONENTS_SUMMARY.md +7 -5
- package/dist/assets/css/tokens.css +51 -20
- package/dist/assets/js/tokens.d.ts +27 -1
- package/dist/assets/js/tokens.js +1 -2
- package/dist/assets/js/tokens.mjs +1 -2
- package/dist/assets/js/tokens.ts +30 -0
- package/dist/components/Alert.d.ts +1 -2
- package/dist/components/Alert.js +1 -2
- package/dist/components/Alert.mjs +1 -2
- package/dist/components/AlertDialog.d.ts +0 -1
- package/dist/components/AlertDialog.js +1 -2
- package/dist/components/AlertDialog.mjs +1 -2
- package/dist/components/Autocomplete.d.ts +5 -3
- package/dist/components/Autocomplete.js +1 -2
- package/dist/components/Autocomplete.mjs +1 -2
- package/dist/components/Avatar.d.ts +1 -1
- package/dist/components/Avatar.js +1 -2
- package/dist/components/Avatar.mjs +1 -2
- package/dist/components/Badge.d.ts +14 -5
- package/dist/components/Badge.js +1 -2
- package/dist/components/Badge.mjs +1 -2
- package/dist/components/Breadcrumb.d.ts +0 -1
- package/dist/components/Breadcrumb.js +1 -2
- package/dist/components/Breadcrumb.mjs +1 -2
- package/dist/components/Button.d.ts +0 -1
- package/dist/components/Button.js +1 -2
- package/dist/components/Button.mjs +1 -2
- package/dist/components/CardContinue.d.ts +0 -1
- package/dist/components/CardContinue.js +1 -2
- package/dist/components/CardContinue.mjs +1 -2
- package/dist/components/CardLesson.d.ts +0 -1
- package/dist/components/CardLesson.js +1 -2
- package/dist/components/CardLesson.mjs +1 -2
- package/dist/components/CardModule.d.ts +0 -1
- package/dist/components/CardModule.js +1 -2
- package/dist/components/CardModule.mjs +1 -2
- package/dist/components/CardNews.d.ts +6 -2
- package/dist/components/CardNews.js +1 -2
- package/dist/components/CardNews.mjs +1 -2
- package/dist/components/CardTopic.d.ts +0 -1
- package/dist/components/CardTopic.js +1 -2
- package/dist/components/CardTopic.mjs +1 -2
- package/dist/components/CardWeek.d.ts +0 -1
- package/dist/components/CardWeek.js +1 -2
- package/dist/components/CardWeek.mjs +1 -2
- package/dist/components/Carousel.d.ts +0 -1
- package/dist/components/Carousel.js +1 -2
- package/dist/components/Carousel.mjs +1 -2
- package/dist/components/Checkbox.d.ts +0 -1
- package/dist/components/Checkbox.js +1 -2
- package/dist/components/Checkbox.mjs +1 -2
- package/dist/components/Chip.d.ts +2 -3
- package/dist/components/Chip.js +1 -2
- package/dist/components/Chip.mjs +1 -2
- package/dist/components/Collapsible.d.ts +0 -1
- package/dist/components/Collapsible.js +1 -2
- package/dist/components/Collapsible.mjs +1 -2
- package/dist/components/Command.d.ts +1 -2
- package/dist/components/Command.js +1 -2
- package/dist/components/Command.mjs +1 -2
- package/dist/components/ConfirmDeleteButton.d.ts +0 -1
- package/dist/components/ConfirmDeleteButton.js +1 -2
- package/dist/components/ConfirmDeleteButton.mjs +1 -2
- package/dist/components/DatePicker.d.ts +2 -3
- package/dist/components/DatePicker.js +1 -2
- package/dist/components/DatePicker.mjs +1 -2
- package/dist/components/Dialog.d.ts +4 -6
- package/dist/components/Dialog.js +1 -2
- package/dist/components/Dialog.mjs +1 -2
- package/dist/components/Dismiss.d.ts +12 -0
- package/dist/components/Dismiss.js +3 -0
- package/dist/components/Dismiss.mjs +3 -0
- package/dist/components/DropdownMenu.d.ts +11 -5
- package/dist/components/DropdownMenu.js +1 -2
- package/dist/components/DropdownMenu.mjs +1 -2
- package/dist/components/FallbackImage.d.ts +0 -1
- package/dist/components/FallbackImage.js +0 -1
- package/dist/components/FallbackImage.mjs +0 -1
- package/dist/components/IndexLevel.d.ts +0 -1
- package/dist/components/IndexLevel.js +0 -1
- package/dist/components/IndexLevel.mjs +0 -1
- package/dist/components/IndexLevelAnimated.d.ts +0 -1
- package/dist/components/IndexLevelAnimated.js +0 -1
- package/dist/components/IndexLevelAnimated.mjs +0 -1
- package/dist/components/Input.d.ts +0 -1
- package/dist/components/Input.js +1 -2
- package/dist/components/Input.mjs +1 -2
- package/dist/components/Label.d.ts +0 -1
- package/dist/components/Label.js +1 -2
- package/dist/components/Label.mjs +1 -2
- package/dist/components/Loading.d.ts +3 -4
- package/dist/components/Loading.js +1 -2
- package/dist/components/Loading.mjs +1 -2
- package/dist/components/LoadingOverlay.d.ts +30 -0
- package/dist/components/LoadingOverlay.js +3 -0
- package/dist/components/LoadingOverlay.mjs +3 -0
- package/dist/components/Logo.d.ts +0 -1
- package/dist/components/Logo.js +0 -1
- package/dist/components/Logo.mjs +1 -2
- package/dist/components/NoteEditor.d.ts +22 -8
- package/dist/components/NoteEditor.js +1 -2
- package/dist/components/NoteEditor.mjs +1 -2
- package/dist/components/NoteEditorLinkDialog.d.ts +0 -8
- package/dist/components/NoteEditorLinkDialog.js +1 -2
- package/dist/components/NoteEditorLinkDialog.mjs +1 -2
- package/dist/components/Offcanvas.d.ts +0 -1
- package/dist/components/Offcanvas.js +1 -2
- package/dist/components/Offcanvas.mjs +1 -2
- package/dist/components/Pagination.d.ts +0 -1
- package/dist/components/Pagination.js +1 -2
- package/dist/components/Pagination.mjs +1 -2
- package/dist/components/Popover.d.ts +0 -1
- package/dist/components/Popover.js +1 -2
- package/dist/components/Popover.mjs +1 -2
- package/dist/components/Progress.d.ts +0 -1
- package/dist/components/Progress.js +1 -2
- package/dist/components/Progress.mjs +1 -2
- package/dist/components/ProgressCircle.d.ts +0 -1
- package/dist/components/ProgressCircle.js +1 -2
- package/dist/components/ProgressCircle.mjs +1 -2
- package/dist/components/RadioGroup.d.ts +0 -1
- package/dist/components/RadioGroup.js +1 -2
- package/dist/components/RadioGroup.mjs +1 -2
- package/dist/components/Ranking.d.ts +0 -1
- package/dist/components/Ranking.js +1 -2
- package/dist/components/Ranking.mjs +1 -2
- package/dist/components/Rating.d.ts +0 -1
- package/dist/components/Rating.js +1 -2
- package/dist/components/Rating.mjs +1 -2
- package/dist/components/ScrollArea.d.ts +0 -1
- package/dist/components/ScrollArea.js +0 -1
- package/dist/components/ScrollArea.mjs +0 -1
- package/dist/components/SegmentControl.d.ts +0 -1
- package/dist/components/SegmentControl.js +1 -2
- package/dist/components/SegmentControl.mjs +1 -2
- package/dist/components/Select.d.ts +0 -1
- package/dist/components/Select.js +1 -2
- package/dist/components/Select.mjs +1 -2
- package/dist/components/Separator.d.ts +0 -1
- package/dist/components/Separator.js +0 -1
- package/dist/components/Separator.mjs +0 -1
- package/dist/components/Sheet.d.ts +0 -1
- package/dist/components/Sheet.js +1 -2
- package/dist/components/Sheet.mjs +1 -2
- package/dist/components/Sidebar.d.ts +1 -2
- package/dist/components/Sidebar.js +1 -2
- package/dist/components/Sidebar.mjs +1 -2
- package/dist/components/Skeleton.d.ts +0 -1
- package/dist/components/Skeleton.js +0 -1
- package/dist/components/Skeleton.mjs +0 -1
- package/dist/components/Switch.d.ts +0 -1
- package/dist/components/Switch.js +1 -2
- package/dist/components/Switch.mjs +1 -2
- package/dist/components/Switcher.d.ts +3 -6
- package/dist/components/Switcher.js +1 -2
- package/dist/components/Switcher.mjs +1 -2
- package/dist/components/Tabs.d.ts +0 -1
- package/dist/components/Tabs.js +1 -2
- package/dist/components/Tabs.mjs +1 -2
- package/dist/components/Tag.d.ts +4 -3
- package/dist/components/Tag.js +1 -2
- package/dist/components/Tag.mjs +1 -2
- package/dist/components/TagPicker.d.ts +1 -2
- package/dist/components/TagPicker.js +1 -2
- package/dist/components/TagPicker.mjs +1 -2
- package/dist/components/Textarea.d.ts +0 -1
- package/dist/components/Textarea.js +1 -2
- package/dist/components/Textarea.mjs +1 -2
- package/dist/components/Tile.d.ts +0 -1
- package/dist/components/Tile.js +1 -2
- package/dist/components/Tile.mjs +1 -2
- package/dist/components/Toast.d.ts +5 -4
- package/dist/components/Toast.js +1 -2
- package/dist/components/Toast.mjs +1 -2
- package/dist/components/Tooltip.d.ts +0 -1
- package/dist/components/Tooltip.js +1 -2
- package/dist/components/Tooltip.mjs +1 -2
- package/dist/hooks/use-composed-refs.d.ts +0 -1
- package/dist/hooks/use-composed-refs.js +1 -2
- package/dist/hooks/use-composed-refs.mjs +0 -1
- package/dist/hooks/use-field-fill.d.ts +10 -0
- package/dist/hooks/use-field-fill.js +2 -0
- package/dist/hooks/use-field-fill.mjs +2 -0
- package/dist/hooks/use-id.d.ts +0 -1
- package/dist/hooks/use-id.js +0 -1
- package/dist/hooks/use-id.mjs +0 -1
- package/dist/hooks/use-mobile.d.ts +0 -1
- package/dist/hooks/use-mobile.js +0 -1
- package/dist/hooks/use-mobile.mjs +0 -1
- package/dist/hooks/use-prefers-reduced-motion.d.ts +0 -1
- package/dist/hooks/use-prefers-reduced-motion.js +1 -2
- package/dist/hooks/use-prefers-reduced-motion.mjs +0 -1
- package/dist/hooks/use-toast.d.ts +1 -2
- package/dist/hooks/use-toast.js +1 -2
- package/dist/hooks/use-toast.mjs +1 -2
- package/dist/index.d.ts +9 -6
- package/dist/index.js +1 -2
- package/dist/index.mjs +1 -2
- package/dist/lib/cmdk.d.ts +2 -3
- package/dist/lib/cmdk.js +1 -2
- package/dist/lib/cmdk.mjs +1 -2
- package/dist/lib/command-score.d.ts +0 -1
- package/dist/lib/command-score.js +0 -1
- package/dist/lib/command-score.mjs +0 -1
- package/dist/lib/floating-label.d.ts +2 -0
- package/dist/lib/floating-label.js +2 -0
- package/dist/lib/floating-label.mjs +2 -0
- package/dist/lib/image-toolbar-placement.d.ts +0 -1
- package/dist/lib/image-toolbar-placement.js +0 -1
- package/dist/lib/image-toolbar-placement.mjs +0 -1
- package/dist/lib/utils.d.ts +1 -1
- package/dist/lib/utils.js +1 -2
- package/dist/lib/utils.mjs +1 -2
- package/dist/note-editor.d.ts +0 -1
- package/dist/note-editor.js +0 -1
- package/dist/note-editor.mjs +0 -1
- package/package.json +7 -7
- package/dist/assets/js/tokens.d.mts +0 -794
- package/dist/assets/js/tokens.d.mts.map +0 -1
- package/dist/assets/js/tokens.d.ts.map +0 -1
- package/dist/assets/js/tokens.js.map +0 -1
- package/dist/assets/js/tokens.mjs.map +0 -1
- package/dist/components/Alert.d.mts +0 -29
- package/dist/components/Alert.d.mts.map +0 -1
- package/dist/components/Alert.d.ts.map +0 -1
- package/dist/components/Alert.js.map +0 -1
- package/dist/components/Alert.mjs.map +0 -1
- package/dist/components/AlertDialog.d.mts +0 -39
- package/dist/components/AlertDialog.d.mts.map +0 -1
- package/dist/components/AlertDialog.d.ts.map +0 -1
- package/dist/components/AlertDialog.js.map +0 -1
- package/dist/components/AlertDialog.mjs.map +0 -1
- package/dist/components/Autocomplete.d.mts +0 -57
- package/dist/components/Autocomplete.d.mts.map +0 -1
- package/dist/components/Autocomplete.d.ts.map +0 -1
- package/dist/components/Autocomplete.js.map +0 -1
- package/dist/components/Autocomplete.mjs.map +0 -1
- package/dist/components/Avatar.d.mts +0 -18
- package/dist/components/Avatar.d.mts.map +0 -1
- package/dist/components/Avatar.d.ts.map +0 -1
- package/dist/components/Avatar.js.map +0 -1
- package/dist/components/Avatar.mjs.map +0 -1
- package/dist/components/Badge.d.mts +0 -16
- package/dist/components/Badge.d.mts.map +0 -1
- package/dist/components/Badge.d.ts.map +0 -1
- package/dist/components/Badge.js.map +0 -1
- package/dist/components/Badge.mjs.map +0 -1
- package/dist/components/Breadcrumb.d.mts +0 -20
- package/dist/components/Breadcrumb.d.mts.map +0 -1
- package/dist/components/Breadcrumb.d.ts.map +0 -1
- package/dist/components/Breadcrumb.js.map +0 -1
- package/dist/components/Breadcrumb.mjs.map +0 -1
- package/dist/components/Button.d.mts +0 -21
- package/dist/components/Button.d.mts.map +0 -1
- package/dist/components/Button.d.ts.map +0 -1
- package/dist/components/Button.js.map +0 -1
- package/dist/components/Button.mjs.map +0 -1
- package/dist/components/CardContinue.d.mts +0 -20
- package/dist/components/CardContinue.d.mts.map +0 -1
- package/dist/components/CardContinue.d.ts.map +0 -1
- package/dist/components/CardContinue.js.map +0 -1
- package/dist/components/CardContinue.mjs.map +0 -1
- package/dist/components/CardLesson.d.mts +0 -45
- package/dist/components/CardLesson.d.mts.map +0 -1
- package/dist/components/CardLesson.d.ts.map +0 -1
- package/dist/components/CardLesson.js.map +0 -1
- package/dist/components/CardLesson.mjs.map +0 -1
- package/dist/components/CardModule.d.mts +0 -33
- package/dist/components/CardModule.d.mts.map +0 -1
- package/dist/components/CardModule.d.ts.map +0 -1
- package/dist/components/CardModule.js.map +0 -1
- package/dist/components/CardModule.mjs.map +0 -1
- package/dist/components/CardNews.d.mts +0 -42
- package/dist/components/CardNews.d.mts.map +0 -1
- package/dist/components/CardNews.d.ts.map +0 -1
- package/dist/components/CardNews.js.map +0 -1
- package/dist/components/CardNews.mjs.map +0 -1
- package/dist/components/CardTopic.d.mts +0 -27
- package/dist/components/CardTopic.d.mts.map +0 -1
- package/dist/components/CardTopic.d.ts.map +0 -1
- package/dist/components/CardTopic.js.map +0 -1
- package/dist/components/CardTopic.mjs.map +0 -1
- package/dist/components/CardWeek.d.mts +0 -32
- package/dist/components/CardWeek.d.mts.map +0 -1
- package/dist/components/CardWeek.d.ts.map +0 -1
- package/dist/components/CardWeek.js.map +0 -1
- package/dist/components/CardWeek.mjs.map +0 -1
- package/dist/components/Carousel.d.mts +0 -76
- package/dist/components/Carousel.d.mts.map +0 -1
- package/dist/components/Carousel.d.ts.map +0 -1
- package/dist/components/Carousel.js.map +0 -1
- package/dist/components/Carousel.mjs.map +0 -1
- package/dist/components/Checkbox.d.mts +0 -14
- package/dist/components/Checkbox.d.mts.map +0 -1
- package/dist/components/Checkbox.d.ts.map +0 -1
- package/dist/components/Checkbox.js.map +0 -1
- package/dist/components/Checkbox.mjs.map +0 -1
- package/dist/components/Chip.d.mts +0 -38
- package/dist/components/Chip.d.mts.map +0 -1
- package/dist/components/Chip.d.ts.map +0 -1
- package/dist/components/Chip.js.map +0 -1
- package/dist/components/Chip.mjs.map +0 -1
- package/dist/components/Collapsible.d.mts +0 -15
- package/dist/components/Collapsible.d.mts.map +0 -1
- package/dist/components/Collapsible.d.ts.map +0 -1
- package/dist/components/Collapsible.js.map +0 -1
- package/dist/components/Collapsible.mjs.map +0 -1
- package/dist/components/Command.d.mts +0 -20
- package/dist/components/Command.d.mts.map +0 -1
- package/dist/components/Command.d.ts.map +0 -1
- package/dist/components/Command.js.map +0 -1
- package/dist/components/Command.mjs.map +0 -1
- package/dist/components/ConfirmDeleteButton.d.mts +0 -26
- package/dist/components/ConfirmDeleteButton.d.mts.map +0 -1
- package/dist/components/ConfirmDeleteButton.d.ts.map +0 -1
- package/dist/components/ConfirmDeleteButton.js.map +0 -1
- package/dist/components/ConfirmDeleteButton.mjs.map +0 -1
- package/dist/components/DatePicker.d.mts +0 -57
- package/dist/components/DatePicker.d.mts.map +0 -1
- package/dist/components/DatePicker.d.ts.map +0 -1
- package/dist/components/DatePicker.js.map +0 -1
- package/dist/components/DatePicker.mjs.map +0 -1
- package/dist/components/Dialog.d.mts +0 -35
- package/dist/components/Dialog.d.mts.map +0 -1
- package/dist/components/Dialog.d.ts.map +0 -1
- package/dist/components/Dialog.js.map +0 -1
- package/dist/components/Dialog.mjs.map +0 -1
- package/dist/components/DropdownMenu.d.mts +0 -28
- package/dist/components/DropdownMenu.d.mts.map +0 -1
- package/dist/components/DropdownMenu.d.ts.map +0 -1
- package/dist/components/DropdownMenu.js.map +0 -1
- package/dist/components/DropdownMenu.mjs.map +0 -1
- package/dist/components/FallbackImage.d.mts +0 -8
- package/dist/components/FallbackImage.d.mts.map +0 -1
- package/dist/components/FallbackImage.d.ts.map +0 -1
- package/dist/components/FallbackImage.js.map +0 -1
- package/dist/components/FallbackImage.mjs.map +0 -1
- package/dist/components/IndexLevel.d.mts +0 -47
- package/dist/components/IndexLevel.d.mts.map +0 -1
- package/dist/components/IndexLevel.d.ts.map +0 -1
- package/dist/components/IndexLevel.js.map +0 -1
- package/dist/components/IndexLevel.mjs.map +0 -1
- package/dist/components/IndexLevelAnimated.d.mts +0 -34
- package/dist/components/IndexLevelAnimated.d.mts.map +0 -1
- package/dist/components/IndexLevelAnimated.d.ts.map +0 -1
- package/dist/components/IndexLevelAnimated.js.map +0 -1
- package/dist/components/IndexLevelAnimated.mjs.map +0 -1
- package/dist/components/Input.d.mts +0 -44
- package/dist/components/Input.d.mts.map +0 -1
- package/dist/components/Input.d.ts.map +0 -1
- package/dist/components/Input.js.map +0 -1
- package/dist/components/Input.mjs.map +0 -1
- package/dist/components/Label.d.mts +0 -14
- package/dist/components/Label.d.mts.map +0 -1
- package/dist/components/Label.d.ts.map +0 -1
- package/dist/components/Label.js.map +0 -1
- package/dist/components/Label.mjs.map +0 -1
- package/dist/components/Loading.d.mts +0 -8
- package/dist/components/Loading.d.mts.map +0 -1
- package/dist/components/Loading.d.ts.map +0 -1
- package/dist/components/Loading.js.map +0 -1
- package/dist/components/Loading.mjs.map +0 -1
- package/dist/components/Logo.d.mts +0 -9
- package/dist/components/Logo.d.mts.map +0 -1
- package/dist/components/Logo.d.ts.map +0 -1
- package/dist/components/Logo.js.map +0 -1
- package/dist/components/Logo.mjs.map +0 -1
- package/dist/components/NoteEditor.d.mts +0 -124
- package/dist/components/NoteEditor.d.mts.map +0 -1
- package/dist/components/NoteEditor.d.ts.map +0 -1
- package/dist/components/NoteEditor.js.map +0 -1
- package/dist/components/NoteEditor.mjs.map +0 -1
- package/dist/components/NoteEditorLinkDialog.d.mts +0 -36
- package/dist/components/NoteEditorLinkDialog.d.mts.map +0 -1
- package/dist/components/NoteEditorLinkDialog.d.ts.map +0 -1
- package/dist/components/NoteEditorLinkDialog.js.map +0 -1
- package/dist/components/NoteEditorLinkDialog.mjs.map +0 -1
- package/dist/components/Offcanvas.d.mts +0 -53
- package/dist/components/Offcanvas.d.mts.map +0 -1
- package/dist/components/Offcanvas.d.ts.map +0 -1
- package/dist/components/Offcanvas.js.map +0 -1
- package/dist/components/Offcanvas.mjs.map +0 -1
- package/dist/components/Pagination.d.mts +0 -43
- package/dist/components/Pagination.d.mts.map +0 -1
- package/dist/components/Pagination.d.ts.map +0 -1
- package/dist/components/Pagination.js.map +0 -1
- package/dist/components/Pagination.mjs.map +0 -1
- package/dist/components/Popover.d.mts +0 -10
- package/dist/components/Popover.d.mts.map +0 -1
- package/dist/components/Popover.d.ts.map +0 -1
- package/dist/components/Popover.js.map +0 -1
- package/dist/components/Popover.mjs.map +0 -1
- package/dist/components/Progress.d.mts +0 -9
- package/dist/components/Progress.d.mts.map +0 -1
- package/dist/components/Progress.d.ts.map +0 -1
- package/dist/components/Progress.js.map +0 -1
- package/dist/components/Progress.mjs.map +0 -1
- package/dist/components/ProgressCircle.d.mts +0 -14
- package/dist/components/ProgressCircle.d.mts.map +0 -1
- package/dist/components/ProgressCircle.d.ts.map +0 -1
- package/dist/components/ProgressCircle.js.map +0 -1
- package/dist/components/ProgressCircle.mjs.map +0 -1
- package/dist/components/RadioGroup.d.mts +0 -14
- package/dist/components/RadioGroup.d.mts.map +0 -1
- package/dist/components/RadioGroup.d.ts.map +0 -1
- package/dist/components/RadioGroup.js.map +0 -1
- package/dist/components/RadioGroup.mjs.map +0 -1
- package/dist/components/Ranking.d.mts +0 -95
- package/dist/components/Ranking.d.mts.map +0 -1
- package/dist/components/Ranking.d.ts.map +0 -1
- package/dist/components/Ranking.js.map +0 -1
- package/dist/components/Ranking.mjs.map +0 -1
- package/dist/components/Rating.d.mts +0 -29
- package/dist/components/Rating.d.mts.map +0 -1
- package/dist/components/Rating.d.ts.map +0 -1
- package/dist/components/Rating.js.map +0 -1
- package/dist/components/Rating.mjs.map +0 -1
- package/dist/components/ScrollArea.d.mts +0 -6
- package/dist/components/ScrollArea.d.mts.map +0 -1
- package/dist/components/ScrollArea.d.ts.map +0 -1
- package/dist/components/ScrollArea.js.map +0 -1
- package/dist/components/ScrollArea.mjs.map +0 -1
- package/dist/components/SegmentControl.d.mts +0 -27
- package/dist/components/SegmentControl.d.mts.map +0 -1
- package/dist/components/SegmentControl.d.ts.map +0 -1
- package/dist/components/SegmentControl.js.map +0 -1
- package/dist/components/SegmentControl.mjs.map +0 -1
- package/dist/components/Select.d.mts +0 -32
- package/dist/components/Select.d.mts.map +0 -1
- package/dist/components/Select.d.ts.map +0 -1
- package/dist/components/Select.js.map +0 -1
- package/dist/components/Select.mjs.map +0 -1
- package/dist/components/Separator.d.mts +0 -5
- package/dist/components/Separator.d.mts.map +0 -1
- package/dist/components/Separator.d.ts.map +0 -1
- package/dist/components/Separator.js.map +0 -1
- package/dist/components/Separator.mjs.map +0 -1
- package/dist/components/Sheet.d.mts +0 -17
- package/dist/components/Sheet.d.mts.map +0 -1
- package/dist/components/Sheet.d.ts.map +0 -1
- package/dist/components/Sheet.js.map +0 -1
- package/dist/components/Sheet.mjs.map +0 -1
- package/dist/components/Sidebar.d.mts +0 -90
- package/dist/components/Sidebar.d.mts.map +0 -1
- package/dist/components/Sidebar.d.ts.map +0 -1
- package/dist/components/Sidebar.js.map +0 -1
- package/dist/components/Sidebar.mjs.map +0 -1
- package/dist/components/Skeleton.d.mts +0 -4
- package/dist/components/Skeleton.d.mts.map +0 -1
- package/dist/components/Skeleton.d.ts.map +0 -1
- package/dist/components/Skeleton.js.map +0 -1
- package/dist/components/Skeleton.mjs.map +0 -1
- package/dist/components/Switch.d.mts +0 -15
- package/dist/components/Switch.d.mts.map +0 -1
- package/dist/components/Switch.d.ts.map +0 -1
- package/dist/components/Switch.js.map +0 -1
- package/dist/components/Switch.mjs.map +0 -1
- package/dist/components/Switcher.d.mts +0 -56
- package/dist/components/Switcher.d.mts.map +0 -1
- package/dist/components/Switcher.d.ts.map +0 -1
- package/dist/components/Switcher.js.map +0 -1
- package/dist/components/Switcher.mjs.map +0 -1
- package/dist/components/Tabs.d.mts +0 -39
- package/dist/components/Tabs.d.mts.map +0 -1
- package/dist/components/Tabs.d.ts.map +0 -1
- package/dist/components/Tabs.js.map +0 -1
- package/dist/components/Tabs.mjs.map +0 -1
- package/dist/components/Tag.d.mts +0 -14
- package/dist/components/Tag.d.mts.map +0 -1
- package/dist/components/Tag.d.ts.map +0 -1
- package/dist/components/Tag.js.map +0 -1
- package/dist/components/Tag.mjs.map +0 -1
- package/dist/components/TagPicker.d.mts +0 -91
- package/dist/components/TagPicker.d.mts.map +0 -1
- package/dist/components/TagPicker.d.ts.map +0 -1
- package/dist/components/TagPicker.js.map +0 -1
- package/dist/components/TagPicker.mjs.map +0 -1
- package/dist/components/Textarea.d.mts +0 -15
- package/dist/components/Textarea.d.mts.map +0 -1
- package/dist/components/Textarea.d.ts.map +0 -1
- package/dist/components/Textarea.js.map +0 -1
- package/dist/components/Textarea.mjs.map +0 -1
- package/dist/components/Tile.d.mts +0 -20
- package/dist/components/Tile.d.mts.map +0 -1
- package/dist/components/Tile.d.ts.map +0 -1
- package/dist/components/Tile.js.map +0 -1
- package/dist/components/Tile.mjs.map +0 -1
- package/dist/components/Toast.d.mts +0 -34
- package/dist/components/Toast.d.mts.map +0 -1
- package/dist/components/Toast.d.ts.map +0 -1
- package/dist/components/Toast.js.map +0 -1
- package/dist/components/Toast.mjs.map +0 -1
- package/dist/components/Tooltip.d.mts +0 -8
- package/dist/components/Tooltip.d.mts.map +0 -1
- package/dist/components/Tooltip.d.ts.map +0 -1
- package/dist/components/Tooltip.js.map +0 -1
- package/dist/components/Tooltip.mjs.map +0 -1
- package/dist/hooks/use-composed-refs.d.mts +0 -3
- package/dist/hooks/use-composed-refs.d.mts.map +0 -1
- package/dist/hooks/use-composed-refs.d.ts.map +0 -1
- package/dist/hooks/use-composed-refs.js.map +0 -1
- package/dist/hooks/use-composed-refs.mjs.map +0 -1
- package/dist/hooks/use-id.d.mts +0 -2
- package/dist/hooks/use-id.d.mts.map +0 -1
- package/dist/hooks/use-id.d.ts.map +0 -1
- package/dist/hooks/use-id.js.map +0 -1
- package/dist/hooks/use-id.mjs.map +0 -1
- package/dist/hooks/use-mobile.d.mts +0 -2
- package/dist/hooks/use-mobile.d.mts.map +0 -1
- package/dist/hooks/use-mobile.d.ts.map +0 -1
- package/dist/hooks/use-mobile.js.map +0 -1
- package/dist/hooks/use-mobile.mjs.map +0 -1
- package/dist/hooks/use-prefers-reduced-motion.d.mts +0 -2
- package/dist/hooks/use-prefers-reduced-motion.d.mts.map +0 -1
- package/dist/hooks/use-prefers-reduced-motion.d.ts.map +0 -1
- package/dist/hooks/use-prefers-reduced-motion.js.map +0 -1
- package/dist/hooks/use-prefers-reduced-motion.mjs.map +0 -1
- package/dist/hooks/use-toast.d.mts +0 -45
- package/dist/hooks/use-toast.d.mts.map +0 -1
- package/dist/hooks/use-toast.d.ts.map +0 -1
- package/dist/hooks/use-toast.js.map +0 -1
- package/dist/hooks/use-toast.mjs.map +0 -1
- package/dist/index.d.mts +0 -98
- package/dist/index.d.mts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/lib/cmdk.d.mts +0 -124
- package/dist/lib/cmdk.d.mts.map +0 -1
- package/dist/lib/cmdk.d.ts.map +0 -1
- package/dist/lib/cmdk.js.map +0 -1
- package/dist/lib/cmdk.mjs.map +0 -1
- package/dist/lib/command-score.d.mts +0 -2
- package/dist/lib/command-score.d.mts.map +0 -1
- package/dist/lib/command-score.d.ts.map +0 -1
- package/dist/lib/command-score.js.map +0 -1
- package/dist/lib/command-score.mjs.map +0 -1
- package/dist/lib/image-toolbar-placement.d.mts +0 -32
- package/dist/lib/image-toolbar-placement.d.mts.map +0 -1
- package/dist/lib/image-toolbar-placement.d.ts.map +0 -1
- package/dist/lib/image-toolbar-placement.js.map +0 -1
- package/dist/lib/image-toolbar-placement.mjs.map +0 -1
- package/dist/lib/utils.d.mts +0 -4
- package/dist/lib/utils.d.mts.map +0 -1
- package/dist/lib/utils.d.ts.map +0 -1
- package/dist/lib/utils.js.map +0 -1
- package/dist/lib/utils.mjs.map +0 -1
- package/dist/note-editor.d.mts +0 -14
- package/dist/note-editor.d.mts.map +0 -1
- package/dist/note-editor.d.ts.map +0 -1
- package/dist/note-editor.js.map +0 -1
- package/dist/note-editor.mjs.map +0 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
-
"use strict";var t=require("react/jsx-runtime"),C=require("../lib/utils.js"),E=require("@medway-ui/icons"),Ve=require("class-variance-authority"),d=require("react"),we=require("react-dom"),je=require("../hooks/use-id.js"),qe=Object.defineProperty,$e=Object.defineProperties,He=Object.getOwnPropertyDescriptors,ae=Object.getOwnPropertySymbols,Ne=Object.prototype.hasOwnProperty,Ce=Object.prototype.propertyIsEnumerable,De=(e,a,s)=>a in e?qe(e,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[a]=s,M=(e,a)=>{for(var s in a||(a={}))Ne.call(a,s)&&De(e,s,a[s]);if(ae)for(var s of ae(a))Ce.call(a,s)&&De(e,s,a[s]);return e},$=(e,a)=>$e(e,He(a)),X=(e,a)=>{var s={};for(var o in e)Ne.call(e,o)&&a.indexOf(o)<0&&(s[o]=e[o]);if(e!=null&&ae)for(var o of ae(e))a.indexOf(o)<0&&Ce.call(e,o)&&(s[o]=e[o]);return s};const ve=d.createContext({invalid:!1}),ze={start:1950,end:new Date().getFullYear()};function be(e,a){const s=e.getFullYear();return s<a.start?new Date(a.start,0,1):s>a.end?new Date(a.end,11,31):e}const ye=Ve.cva(["flex w-full min-w-0 items-center justify-between gap-2 rounded-md border-2 border-gray-stroke-muted bg-surface-card px-4 py-3 text-left text-gray-foreground outline-none transition-[color,box-shadow] enabled:hover:border-gray-stroke-emphasis enabled:hover:ring-[3px] enabled:hover:ring-state-focus focus-visible:border-gray-stroke-emphasis focus-visible:ring-[3px] focus-visible:ring-state-focus data-[invalid]:focus-visible:border-feedback-error-stroke data-[invalid]:focus-visible:ring-state-error disabled:pointer-events-none disabled:bg-gray-background-soft-muted disabled:text-gray-foreground-muted data-[invalid]:border-feedback-error-stroke data-[invalid]:enabled:hover:border-feedback-error-stroke data-[invalid]:enabled:hover:ring-[3px] data-[invalid]:enabled:hover:ring-state-error","group-has-[[data-slot=date-picker-label]]:data-[placeholder]:text-transparent"],{variants:{size:{lg:["h-12 max-h-12 text-md","max-sm:h-14 max-sm:text-base"],md:["h-10 max-h-10 text-sm","max-sm:h-11"]}},defaultVariants:{size:"lg"}});function Be(e){var a=e,{className:s}=a,o=X(a,["className"]);return t.jsx("div",M({className:C.cn("group relative flex flex-col gap-2",s),"data-slot":"date-picker-wrapper"},o))}function Qe(e){var a=e,{className:s,children:o}=a,u=X(a,["className","children"]);return t.jsx("label",$(M({className:C.cn("pointer-events-none absolute start-3 top-0 z-10 max-w-[calc(100%-1.5rem)] origin-left -translate-y-1/2 truncate bg-surface-card px-1 text-xs font-medium text-gray-foreground transition-all duration-200 ease-out","group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open])]:start-4 group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open])]:top-6 group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open])]:max-w-[calc(100%-4rem)] group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open])]:bg-transparent group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open])]:px-0 group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open])]:text-md group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open])]:font-normal group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open])]:text-gray-foreground max-sm:group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open])]:top-7","group-has-[[data-slot=date-picker-trigger][data-size=md]]:group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open])]:top-5 group-has-[[data-slot=date-picker-trigger][data-size=md]]:group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open])]:!text-sm max-sm:group-has-[[data-slot=date-picker-trigger][data-size=md]]:group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open])]:top-[22px]",s),"data-slot":"date-picker-label"},u),{children:o}))}function Ge(e){var a=e,{className:s}=a,o=X(a,["className"]);const{invalid:u}=d.useContext(ve);return t.jsx("span",M({className:C.cn("-mt-1 text-xs",u?"text-feedback-error-foreground":"text-gray-foreground",s),"data-slot":"date-picker-text"},o))}function H(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function Z(e,a){return e.getFullYear()===a.getFullYear()&&e.getMonth()===a.getMonth()&&e.getDate()===a.getDate()}function re(e,a){return new Date(e.getFullYear(),e.getMonth()+a,1)}function U(e){return new Date(e.getFullYear(),e.getMonth(),1)}function ne(e,a){return U(be(e!=null?e:new Date,a))}function ke(e,a){return H(e).getTime()<H(a).getTime()}function Ee(e,a){return H(e).getTime()>H(a).getTime()}function Re(e,a){const s=new Date(e.start,0,1);if(!a)return s;const o=U(a);return o>s?o:s}function Se(e,a){const s=new Date(e.end,11,1);if(!a)return s;const o=U(a);return o<s?o:s}function ee(e,a,s){return!!(a&&ke(e,a)||s&&Ee(e,s))}function Te(e){return new Intl.DateTimeFormat("pt-BR",{year:"numeric",month:"2-digit",day:"2-digit"}).format(e)}const Me=20,Pe=18,Fe=8,Le=8,_e=290,Ke=330;function Je(e,a){const s=window.innerHeight-e.bottom<a,o=window.innerWidth,u=window.matchMedia("(max-width: 639px)").matches?Math.min(512,o-16):Math.min(320,o),v=Le,l=o-u-Le;let g=e.left;return g<v?g=v:g>l&&(g=l),$(M({position:"fixed"},s?{bottom:window.innerHeight-e.top+Fe}:{top:e.bottom+Fe}),{left:g,width:u,maxWidth:360})}function Oe({open:e,estimatedHeight:a,triggerRef:s,rootRef:o}){const[u,v]=d.useState(null),l=d.useRef(null),g=d.useCallback(()=>{var k,R,T;const W=(T=(k=s.current)==null?void 0:k.getBoundingClientRect())!=null?T:(R=o.current)==null?void 0:R.getBoundingClientRect();W&&v(Je(W,a))},[a,o,s]),p=d.useCallback(()=>{l.current===null&&(l.current=window.requestAnimationFrame(()=>{l.current=null,g()}))},[g]);return d.useEffect(()=>{if(!e){v(null);return}return window.addEventListener("scroll",p,{passive:!0,capture:!0}),window.addEventListener("resize",p),()=>{window.removeEventListener("scroll",p,{capture:!0}),window.removeEventListener("resize",p),l.current!==null&&(window.cancelAnimationFrame(l.current),l.current=null)}},[e,p]),{style:u,updatePosition:g}}const Ae=new Intl.DateTimeFormat("pt-BR",{day:"numeric",month:"long",year:"numeric"}),Xe=['[data-slot="date-picker-day"][aria-pressed="true"]:not(:disabled)','[data-slot="date-picker-day"][data-today]:not(:disabled)','[data-slot="date-picker-day"]:not(:disabled)'];function Ze(e){if(!e)return null;for(const a of Xe){const s=e.querySelector(a);if(s)return s}return null}function We({open:e,setOpen:a,viewMonthTime:s,targetMonthTime:o,contentRef:u,triggerRef:v}){const l=d.useRef(!0),g=d.useCallback(()=>{var p,k,R;const T=(k=(p=u.current)==null?void 0:p.contains(document.activeElement))!=null?k:!1;a(!1),T&&((R=v.current)==null||R.focus())},[u,a,v]);return d.useEffect(()=>{if(!e){l.current=!0;return}if(!l.current||s!==o)return;const p=Ze(u.current);p&&(l.current=!1,p.focus({preventScroll:!0}))},[e,s,o,u]),g}function Ue(e){var a=e,{value:s,defaultValue:o=null,onValueChange:u,placeholder:v="Selecione uma data",disabled:l,min:g,max:p,format:k=Te,className:R,inputClassName:T,contentClassName:W,size:P="lg",yearRange:f=ze,showYearSelector:se=!0,invalid:w=!1,children:oe,onClick:B}=a,ie=X(a,["value","defaultValue","onValueChange","placeholder","disabled","min","max","format","className","inputClassName","contentClassName","size","yearRange","showYearSelector","invalid","children","onClick"]);const Y=s!==void 0,[Q,de]=d.useState(o),b=Y?s:Q,[n,h]=d.useState(!1),[D,j]=d.useState(()=>U(be(b!=null?b:new Date,f))),S=d.useRef(null),F=d.useRef(null),L=d.useRef(null),I=je.useId(),{style:G,updatePosition:te}=Oe({open:n,estimatedHeight:_e,triggerRef:F,rootRef:S}),_=d.useCallback(i=>{Y||de(i),u==null||u(i)},[Y,u]),z=We({open:n,setOpen:h,viewMonthTime:D.getTime(),targetMonthTime:ne(b,f).getTime(),contentRef:L,triggerRef:F});d.useEffect(()=>{n&&j(ne(b,f))},[n,b,f]),d.useEffect(()=>{if(!n)return;const i=r=>{const m=S.current,c=L.current;m&&r.target instanceof Node&&!m.contains(r.target)&&!(c!=null&&c.contains(r.target))&&h(!1)},x=r=>{r.key==="Escape"&&z()};return window.addEventListener("pointerdown",i,{capture:!0}),window.addEventListener("keydown",x),()=>{window.removeEventListener("pointerdown",i,{capture:!0}),window.removeEventListener("keydown",x)}},[n,z]);const V=i=>{if(B==null||B(i),!i.defaultPrevented){if(n){h(!1);return}te(),h(!0)}},K=H(new Date),N=D.getFullYear(),y=D.getMonth(),O=new Date(N,y,1),le=new Date(N,y+1,0).getDate(),ce=O.getDay(),q=b?k(b):"",ue=Array.from({length:12},(i,x)=>({value:x,label:new Intl.DateTimeFormat("pt-BR",{month:"long"}).format(new Date(2e3,x,1))})),me=Array.from({length:f.end-f.start+1},(i,x)=>f.start+x),ge=D.getTime()<=Re(f,g).getTime(),pe=D.getTime()>=Se(f,p).getTime(),fe=i=>{j(new Date(N,i,1))},he=i=>{j(new Date(i,y,1))};return t.jsxs(ve.Provider,{value:d.useMemo(()=>({invalid:w}),[w]),children:[t.jsxs("div",{ref:S,className:C.cn("relative inline-flex w-full min-w-0",R),children:[t.jsxs("button",$(M($(M({ref:F,type:"button",disabled:l,"aria-haspopup":"dialog","aria-expanded":n,"aria-controls":n?I:void 0,"data-invalid":w||void 0,"data-slot":"date-picker-trigger","data-size":P,"data-state":n?"open":"closed"},!q&&{"data-placeholder":""}),{className:C.cn(ye({size:P}),n&&"border-gray-stroke-emphasis ring-[3px] ring-state-focus",q&&!w&&"border-gray-stroke-emphasis ring-[3px] ring-state-focus",q&&w&&"border-feedback-error-stroke ring-[3px] ring-state-error",T)}),ie),{onClick:V,children:[t.jsx("span",{className:"truncate",children:q||v}),t.jsx(E.Calendar,{size:P==="md"?Pe:Me,strokeWidth:1.6,className:"shrink-0 !text-gray-foreground","aria-hidden":"true"})]})),n&&we.createPortal(t.jsxs("div",{ref:L,id:I,role:"dialog","aria-label":"Calend\xE1rio","data-slot":"date-picker-content",style:G!=null?G:void 0,className:C.cn("z-50 overflow-hidden rounded-md border border-gray-stroke-muted bg-surface-elevated p-3 shadow-md",W),children:[t.jsxs("div",{className:"mb-3 flex items-center justify-center gap-2",children:[t.jsx("button",{type:"button",className:"inline-flex size-8 items-center justify-center rounded-md hover:bg-secondary-background-soft-emphasis disabled:pointer-events-none disabled:opacity-50 max-sm:size-10",onClick:()=>j(i=>re(i,-1)),disabled:ge,"aria-label":"M\xEAs anterior",children:t.jsx(E.ChevronLeftMd,{size:18,strokeWidth:1.8})}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("div",{className:"relative",children:[t.jsx("select",{value:y,onChange:i=>fe(Number(i.target.value)),className:"min-w-[7rem] appearance-none rounded-md border border-gray-stroke-muted bg-surface-card py-1 pl-2 pr-7 text-sm font-medium capitalize text-gray-foreground outline-none hover:border-gray-stroke-emphasis focus:border-gray-stroke-emphasis focus:ring-2 focus:ring-state-focus max-sm:min-w-[8rem] max-sm:py-2 max-sm:text-base","aria-label":"Selecionar m\xEAs",children:ue.map(i=>t.jsx("option",{value:i.value,className:"capitalize",children:i.label},i.value))}),t.jsx(E.ChevronDown,{size:14,strokeWidth:1.8,className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-gray-foreground","aria-hidden":!0})]}),se?t.jsxs("div",{className:"relative",children:[t.jsx("select",{value:N,onChange:i=>he(Number(i.target.value)),className:"min-w-[5rem] appearance-none rounded-md border border-gray-stroke-muted bg-surface-card py-1 pl-2 pr-7 text-sm font-medium text-gray-foreground outline-none hover:border-gray-stroke-emphasis focus:border-gray-stroke-emphasis focus:ring-2 focus:ring-state-focus max-sm:min-w-[5.5rem] max-sm:py-2 max-sm:text-base","aria-label":"Selecionar ano",children:me.map(i=>t.jsx("option",{value:i,children:i},i))}),t.jsx(E.ChevronDown,{size:14,strokeWidth:1.8,className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-gray-foreground","aria-hidden":!0})]}):t.jsx("div",{className:"text-sm font-semibold text-gray-foreground",children:N})]}),t.jsx("button",{type:"button",className:"inline-flex size-8 items-center justify-center rounded-md hover:bg-secondary-background-soft-emphasis disabled:pointer-events-none disabled:opacity-50 max-sm:size-10",onClick:()=>j(i=>re(i,1)),disabled:pe,"aria-label":"Pr\xF3ximo m\xEAs",children:t.jsx(E.ChevronRightMd,{size:18,strokeWidth:1.8})})]}),t.jsxs("div",{className:"grid grid-cols-7 gap-1 text-center text-xs font-medium text-gray-foreground-muted max-sm:text-sm",children:[t.jsx("div",{children:"Dom"}),t.jsx("div",{children:"Seg"}),t.jsx("div",{children:"Ter"}),t.jsx("div",{children:"Qua"}),t.jsx("div",{children:"Qui"}),t.jsx("div",{children:"Sex"}),t.jsx("div",{children:"S\xE1b"})]}),t.jsxs("div",{className:"mt-2 grid grid-cols-7 gap-1",children:[Array.from({length:ce}).map((i,x)=>t.jsx("div",{},`empty-${x}`)),Array.from({length:le}).map((i,x)=>{const r=new Date(N,y,x+1),m=b?Z(r,b):!1,c=Z(r,K),A=l||ee(r,g,p);return t.jsx("button",{type:"button","data-slot":"date-picker-day","data-today":c||void 0,"aria-current":c?"date":void 0,"aria-label":Ae.format(r),disabled:A,onClick:()=>{_(r),z()},className:C.cn("inline-flex h-9 w-full items-center justify-center rounded-md text-sm font-medium outline-none transition-colors hover:bg-secondary-background-soft-emphasis focus-visible:ring-2 focus-visible:ring-state-focus disabled:pointer-events-none disabled:opacity-50 max-sm:h-11 max-sm:text-base",c&&"ring-1 ring-gray-stroke-emphasis",m&&"bg-primary-background-fill text-primary-foreground-onfill hover:bg-primary-background-fill-emphasis"),"aria-pressed":m,children:x+1},r.toISOString())})]}),t.jsxs("div",{className:"mt-3 flex items-center justify-between gap-2",children:[t.jsx("button",{type:"button",className:"rounded-md px-2 py-1 text-xs font-medium text-gray-foreground hover:bg-secondary-background-soft-emphasis max-sm:px-3 max-sm:py-2 max-sm:text-sm",onClick:()=>{_(K),z()},disabled:l||ee(K,g,p),children:"Hoje"}),t.jsx("button",{type:"button",className:"rounded-md px-2 py-1 text-xs font-medium text-gray-foreground hover:bg-secondary-background-soft-emphasis max-sm:px-3 max-sm:py-2 max-sm:text-sm",onClick:()=>_(null),disabled:l||!b,children:"Limpar"})]})]}),document.body)]}),oe]})}function et(e){var a=e,{value:s,defaultValue:o=null,onValueChange:u,placeholder:v="Selecionar per\xEDodo",disabled:l,min:g,max:p,format:k=Te,className:R,inputClassName:T,contentClassName:W,size:P="lg",yearRange:f=ze,showYearSelector:se=!0,invalid:w=!1,children:oe,onClick:B}=a,ie=X(a,["value","defaultValue","onValueChange","placeholder","disabled","min","max","format","className","inputClassName","contentClassName","size","yearRange","showYearSelector","invalid","children","onClick"]),Y;const Q=s!==void 0,[de,b]=d.useState(o),n=Q?s:de,[h,D]=d.useState(!1),[j,S]=d.useState(()=>{var r,m;return U(be((m=(r=n==null?void 0:n.start)!=null?r:n==null?void 0:n.end)!=null?m:new Date,f))}),F=d.useRef(null),L=d.useRef(null),I=d.useRef(null),G=je.useId(),{style:te,updatePosition:_}=Oe({open:h,estimatedHeight:Ke,triggerRef:L,rootRef:F}),z=d.useCallback(r=>{Q||b(r),u==null||u(r)},[Q,u]),V=We({open:h,setOpen:D,viewMonthTime:j.getTime(),targetMonthTime:ne((Y=n==null?void 0:n.start)!=null?Y:n==null?void 0:n.end,f).getTime(),contentRef:I,triggerRef:L});d.useEffect(()=>{var r;h&&S(ne((r=n==null?void 0:n.start)!=null?r:n==null?void 0:n.end,f))},[h,n,f]),d.useEffect(()=>{if(!h)return;const r=c=>{const A=F.current,J=I.current;A&&c.target instanceof Node&&!A.contains(c.target)&&!(J!=null&&J.contains(c.target))&&D(!1)},m=c=>{c.key==="Escape"&&V()};return window.addEventListener("pointerdown",r,{capture:!0}),window.addEventListener("keydown",m),()=>{window.removeEventListener("pointerdown",r,{capture:!0}),window.removeEventListener("keydown",m)}},[h,V]);const K=r=>{if(B==null||B(r),!r.defaultPrevented){if(h){D(!1);return}_(),D(!0)}},N=H(new Date),y=j.getFullYear(),O=j.getMonth(),le=new Date(y,O,1),ce=new Date(y,O+1,0).getDate(),q=le.getDay(),ue=Array.from({length:12},(r,m)=>({value:m,label:new Intl.DateTimeFormat("pt-BR",{month:"long"}).format(new Date(2e3,m,1))})),me=Array.from({length:f.end-f.start+1},(r,m)=>f.start+m),ge=j.getTime()<=Re(f,g).getTime(),pe=j.getTime()>=Se(f,p).getTime(),fe=r=>{S(new Date(y,r,1))},he=r=>{S(new Date(r,O,1))},i=r=>{l||ee(r,g,p)||(!n||!n.start||n.end?z({start:r,end:null}):(ke(r,n.start)?z({start:r,end:n.start}):z({start:n.start,end:r}),V()))},x=n!=null&&n.start&&n!=null&&n.end?`${k(n.start)} - ${k(n.end)}`:n!=null&&n.start?k(n.start):"";return t.jsxs(ve.Provider,{value:d.useMemo(()=>({invalid:w}),[w]),children:[t.jsxs("div",{ref:F,className:C.cn("relative inline-flex w-full min-w-0",R),children:[t.jsxs("button",$(M($(M({ref:L,type:"button",disabled:l,"aria-haspopup":"dialog","aria-expanded":h,"aria-controls":h?G:void 0,"data-invalid":w||void 0,"data-slot":"date-picker-trigger","data-size":P,"data-state":h?"open":"closed"},!x&&{"data-placeholder":""}),{className:C.cn(ye({size:P}),h&&"border-gray-stroke-emphasis ring-[3px] ring-state-focus",x&&!w&&"border-gray-stroke-emphasis ring-[3px] ring-state-focus",x&&w&&"border-feedback-error-stroke ring-[3px] ring-state-error",T)}),ie),{onClick:K,children:[t.jsx("span",{className:"truncate",children:x||v}),t.jsx(E.Calendar,{size:P==="md"?Pe:Me,strokeWidth:1.6,className:"shrink-0 !text-gray-foreground","aria-hidden":"true"})]})),h&&we.createPortal(t.jsxs("div",{ref:I,id:G,role:"dialog","aria-label":"Calend\xE1rio","data-slot":"date-picker-content",style:te!=null?te:void 0,className:C.cn("z-50 overflow-hidden rounded-md border border-gray-stroke-muted bg-surface-elevated p-3 shadow-md",W),children:[t.jsxs("div",{className:"mb-3 flex items-center justify-center gap-2",children:[t.jsx("button",{type:"button",className:"inline-flex size-8 items-center justify-center rounded-md hover:bg-secondary-background-soft-emphasis disabled:pointer-events-none disabled:opacity-50 max-sm:size-10",onClick:()=>S(r=>re(r,-1)),disabled:ge,"aria-label":"M\xEAs anterior",children:t.jsx(E.ChevronLeftMd,{size:18,strokeWidth:1.8})}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("div",{className:"relative",children:[t.jsx("select",{value:O,onChange:r=>fe(Number(r.target.value)),className:"min-w-[7rem] appearance-none rounded-md border border-gray-stroke-muted bg-surface-card py-1 pl-2 pr-7 text-sm font-medium capitalize text-gray-foreground outline-none hover:border-gray-stroke-emphasis focus:border-gray-stroke-emphasis focus:ring-2 focus:ring-state-focus max-sm:min-w-[8rem] max-sm:py-2 max-sm:text-base","aria-label":"Selecionar m\xEAs",children:ue.map(r=>t.jsx("option",{value:r.value,className:"capitalize",children:r.label},r.value))}),t.jsx(E.ChevronDown,{size:14,strokeWidth:1.8,className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-gray-foreground","aria-hidden":!0})]}),se?t.jsxs("div",{className:"relative",children:[t.jsx("select",{value:y,onChange:r=>he(Number(r.target.value)),className:"min-w-[5rem] appearance-none rounded-md border border-gray-stroke-muted bg-surface-card py-1 pl-2 pr-7 text-sm font-medium text-gray-foreground outline-none hover:border-gray-stroke-emphasis focus:border-gray-stroke-emphasis focus:ring-2 focus:ring-state-focus max-sm:min-w-[5.5rem] max-sm:py-2 max-sm:text-base","aria-label":"Selecionar ano",children:me.map(r=>t.jsx("option",{value:r,children:r},r))}),t.jsx(E.ChevronDown,{size:14,strokeWidth:1.8,className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-gray-foreground","aria-hidden":!0})]}):t.jsx("div",{className:"text-sm font-semibold text-gray-foreground",children:y})]}),t.jsx("button",{type:"button",className:"inline-flex size-8 items-center justify-center rounded-md hover:bg-secondary-background-soft-emphasis disabled:pointer-events-none disabled:opacity-50 max-sm:size-10",onClick:()=>S(r=>re(r,1)),disabled:pe,"aria-label":"Pr\xF3ximo m\xEAs",children:t.jsx(E.ChevronRightMd,{size:18,strokeWidth:1.8})})]}),t.jsxs("div",{className:"grid grid-cols-7 gap-1 text-center text-xs font-medium text-gray-foreground-muted max-sm:text-sm",children:[t.jsx("div",{children:"Dom"}),t.jsx("div",{children:"Seg"}),t.jsx("div",{children:"Ter"}),t.jsx("div",{children:"Qua"}),t.jsx("div",{children:"Qui"}),t.jsx("div",{children:"Sex"}),t.jsx("div",{children:"S\xE1b"})]}),t.jsxs("div",{className:"mt-2 grid grid-cols-7 gap-1",children:[Array.from({length:q}).map((r,m)=>t.jsx("div",{},`empty-${m}`)),Array.from({length:ce}).map((r,m)=>{const c=new Date(y,O,m+1),A=(n==null?void 0:n.start)&&Z(c,n.start),J=(n==null?void 0:n.end)&&Z(c,n.end),Ye=(n==null?void 0:n.start)&&(n==null?void 0:n.end)&&Ee(c,n.start)&&ke(c,n.end),xe=Z(c,N),Ie=l||ee(c,g,p);return t.jsx("button",{type:"button","data-slot":"date-picker-day","data-today":xe||void 0,"aria-current":xe?"date":void 0,"aria-label":Ae.format(c),disabled:Ie,onClick:()=>i(c),className:C.cn("inline-flex h-9 w-full items-center justify-center rounded-md text-sm font-medium outline-none transition-colors hover:bg-secondary-background-soft-emphasis focus-visible:ring-2 focus-visible:ring-state-focus disabled:pointer-events-none disabled:opacity-50",xe&&"ring-1 ring-gray-stroke-emphasis",Ye&&"bg-primary-background-soft",(A||J)&&"bg-primary-background-fill text-primary-foreground-onfill hover:bg-primary-background-fill-emphasis"),"aria-pressed":A||J||void 0,children:m+1},c.toISOString())})]}),t.jsxs("div",{className:"mt-3 flex items-center justify-between gap-2",children:[t.jsx("button",{type:"button",className:"rounded-md px-2 py-1 text-xs font-medium text-gray-foreground hover:bg-secondary-background-soft-emphasis",onClick:()=>{z({start:N,end:N}),V()},disabled:l||ee(N,g,p),children:"Hoje"}),t.jsx("button",{type:"button",className:"rounded-md px-2 py-1 text-xs font-medium text-gray-foreground hover:bg-secondary-background-soft-emphasis",onClick:()=>z(null),disabled:l||!n,children:"Limpar"})]})]}),document.body)]}),oe]})}exports.DatePicker=Ue,exports.DatePickerLabel=Qe,exports.DatePickerText=Ge,exports.DatePickerWrapper=Be,exports.DateRangePicker=et,exports.datePickerTriggerVariants=ye;
|
|
4
|
-
//# sourceMappingURL=DatePicker.js.map
|
|
3
|
+
"use strict";var a=require("react/jsx-runtime"),Le=require("../lib/floating-label.js"),C=require("../lib/utils.js"),at=require("../assets/js/tokens.js"),q=require("./Button.js"),Ye=require("../hooks/use-composed-refs.js"),M=require("@medway-ui/icons"),rt=require("class-variance-authority"),W=require("radix-ui"),l=require("react"),Be=require("../hooks/use-id.js"),nt=Object.defineProperty,st=Object.defineProperties,it=Object.getOwnPropertyDescriptors,fe=Object.getOwnPropertySymbols,Ie=Object.prototype.hasOwnProperty,Ve=Object.prototype.propertyIsEnumerable,qe=(e,t,r)=>t in e?nt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,E=(e,t)=>{for(var r in t||(t={}))Ie.call(t,r)&&qe(e,r,t[r]);if(fe)for(var r of fe(t))Ve.call(t,r)&&qe(e,r,t[r]);return e},Q=(e,t)=>st(e,it(t)),de=(e,t)=>{var r={};for(var i in e)Ie.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&fe)for(var i of fe(e))t.indexOf(i)<0&&Ve.call(e,i)&&(r[i]=e[i]);return r};const Me=l.createContext({invalid:!1}),We={start:1950,end:new Date().getFullYear()};function Ae(e,t){const r=e.getFullYear();return r<t.start?new Date(t.start,0,1):r>t.end?new Date(t.end,11,31):e}const Oe=rt.cva(["flex w-full min-w-0 items-center justify-between rounded-md border-2 border-gray-stroke-muted bg-surface-card text-left text-gray-foreground outline-none transition-[color,box-shadow] enabled:hover:border-gray-stroke enabled:hover:ring-4 enabled:hover:ring-state-hover focus-visible:border-gray-stroke-emphasis focus-visible:ring-4 focus-visible:ring-state-focus data-[invalid]:focus-visible:border-feedback-error-stroke data-[invalid]:focus-visible:ring-state-error disabled:pointer-events-none disabled:bg-gray-background-soft-muted disabled:text-gray-foreground-muted data-[invalid]:border-feedback-error-stroke data-[invalid]:enabled:hover:border-feedback-error-stroke data-[invalid]:enabled:hover:ring-state-error","group-has-[[data-slot=date-picker-label]]:data-[placeholder]:text-transparent"],{variants:{size:{lg:"h-12 max-h-12 gap-3 px-3.5 py-2.5 text-md",md:"h-10 max-h-10 gap-2.5 px-3 py-2 text-sm"}},defaultVariants:{size:"lg"}});function ot(e){var t=e,{className:r}=t,i=de(t,["className"]);return a.jsx("div",E({className:C.cn(Le.FLOATING_LABEL_WRAPPER,r),"data-slot":"date-picker-wrapper"},i))}function lt(e){var t=e,{className:r,children:i}=t,c=de(t,["className","children"]);return a.jsx("label",Q(E({className:C.cn(Le.FLOATING_LABEL_BASE,"z-10","group-has-[[data-slot=date-picker-trigger][data-size=md]]:start-2","group-has-[[data-slot=date-picker-trigger]:disabled]:text-gray-foreground-muted group-has-[[data-slot=date-picker-trigger]:focus-visible]:text-gray-foreground-emphasis group-has-[[data-slot=date-picker-trigger]:hover:not(:focus-visible):not(:disabled):not([data-state=open])]:text-gray-foreground-emphasis group-has-[[data-slot=date-picker-trigger][data-invalid]:focus-visible]:text-feedback-error-foreground group-has-[[data-slot=date-picker-trigger][data-invalid][data-state=open]]:text-feedback-error-foreground group-has-[[data-slot=date-picker-trigger][data-state=open]]:text-gray-foreground-emphasis","group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open]):not(:focus-visible)]:start-4 group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open]):not(:focus-visible)]:top-6 group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open]):not(:focus-visible)]:max-w-[calc(100%-4rem)] group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open]):not(:focus-visible)]:bg-transparent group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open]):not(:focus-visible)]:px-0 group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open]):not(:focus-visible)]:text-md group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open]):not(:focus-visible)]:font-regular group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open]):not(:focus-visible)]:leading-md","group-has-[[data-slot=date-picker-trigger][data-size=md]]:group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open]):not(:focus-visible)]:start-3.5 group-has-[[data-slot=date-picker-trigger][data-size=md]]:group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open]):not(:focus-visible)]:top-5 group-has-[[data-slot=date-picker-trigger][data-size=md]]:group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open]):not(:focus-visible)]:!text-sm group-has-[[data-slot=date-picker-trigger][data-size=md]]:group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open]):not(:focus-visible)]:leading-sm",r),"data-slot":"date-picker-label"},c),{children:i}))}function dt(e){var t=e,{className:r}=t,i=de(t,["className"]);const{invalid:c}=l.useContext(Me);return a.jsx("span",E({className:C.cn("-mt-1 text-xs",c?"text-feedback-error-foreground":"text-gray-foreground",r),"data-slot":"date-picker-text"},i))}function L(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function _(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function he(e,t){return new Date(e.getFullYear(),e.getMonth()+t,1)}function te(e,t){return new Date(e.getFullYear(),e.getMonth(),e.getDate()+t)}function He(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()}function ae(e){return new Date(e.getFullYear(),e.getMonth(),1)}function ve(e,t){return ae(Ae(e!=null?e:new Date,t))}function ue(e,t){return L(e).getTime()<L(t).getTime()}function xe(e,t){return L(e).getTime()>L(t).getTime()}function $e(e,t){const r=new Date(e.start,0,1);if(!t)return r;const i=ae(t);return i>r?i:r}function Ke(e,t){const r=new Date(e.end,11,1);if(!t)return r;const i=ae(t);return i<r?i:r}function be(e,t,r){return!!(t&&ue(e,t)||r&&xe(e,r))}function Qe(e){return new Intl.DateTimeFormat("pt-BR",{year:"numeric",month:"2-digit",day:"2-digit"}).format(e)}const _e=24,Ue=20,ye="max-md:!size-10",ke="max-md:min-h-10 max-md:text-sm max-md:leading-sm",Pe=8,Fe=8,ut=376,ct=336,gt=320,mt=360,pt=`(max-width: ${parseInt(at.screens.md)-1}px)`;function ft(e,t){const r=window.innerHeight-e.bottom<t+Pe,i=window.innerWidth,c=window.matchMedia(pt).matches?Math.min(mt,i-2*Fe):Math.min(gt,i),b=Fe,d=i-c-Fe;let u=e.left;return u<b?u=b:u>d&&(u=d),{side:r?"top":"bottom",alignOffset:u-e.left,style:{width:c}}}function ht(e,t){return(e==null?void 0:e.side)===t.side&&e.alignOffset===t.alignOffset&&e.style.width===t.style.width}function Ze({open:e,estimatedHeight:t,triggerRef:r,contentRef:i}){const[c,b]=l.useState(null),d=l.useRef(null),u=l.useCallback(()=>{var p,D,j;const k=(p=r.current)==null?void 0:p.getBoundingClientRect();if(!k)return;const g=(j=(D=i.current)==null?void 0:D.offsetHeight)!=null?j:t,Y=ft(k,g);b(f=>ht(f,Y)?f:Y)},[i,t,r]),m=l.useCallback(()=>{d.current===null&&(d.current=window.requestAnimationFrame(()=>{d.current=null,u()}))},[u]);l.useEffect(()=>{if(!e){b(null);return}return window.addEventListener("scroll",m,{passive:!0,capture:!0}),window.addEventListener("resize",m),()=>{window.removeEventListener("scroll",m,{capture:!0}),window.removeEventListener("resize",m),d.current!==null&&(window.cancelAnimationFrame(d.current),d.current=null)}},[e,m]);const y=l.useCallback(p=>{p&&u()},[u]);return{placement:c,updatePosition:u,measureContent:y}}const Ge=new Intl.DateTimeFormat("pt-BR",{day:"numeric",month:"long",year:"numeric"}),vt=new Intl.DateTimeFormat("pt-BR",{month:"long"}),Xe=Array.from({length:12},(e,t)=>({value:t,label:vt.format(new Date(2e3,t,1))})),xt=['[data-slot="date-picker-day"][aria-pressed="true"]:not(:disabled)','[data-slot="date-picker-day"][data-today]:not(:disabled)','[data-slot="date-picker-day"]:not(:disabled)'];function bt(e){if(!e)return null;for(const t of xt){const r=e.querySelector(t);if(r)return r}return null}function Je({open:e,setOpen:t,viewMonthTime:r,targetMonthTime:i,contentRef:c,triggerRef:b}){const d=l.useRef(!0),u=l.useCallback(()=>{var p,D,j;const k=(D=(p=c.current)==null?void 0:p.contains(document.activeElement))!=null?D:!1;t(!1),k&&((j=b.current)==null||j.focus())},[c,t,b]),m=l.useCallback(()=>{if(!d.current||r!==i)return;const p=bt(c.current);p&&(d.current=!1,p.focus({preventScroll:!0}))},[r,i,c]),y=l.useCallback(p=>{p.preventDefault(),m()},[m]);return l.useEffect(()=>{if(!e){d.current=!0;return}m()},[e,m]),{closeAndRestoreFocus:u,handleOpenAutoFocus:y}}const yt={ArrowLeft:e=>te(e,-1),ArrowRight:e=>te(e,1),ArrowUp:e=>te(e,-7),ArrowDown:e=>te(e,7),Home:e=>te(e,-e.getDay()),End:e=>te(e,6-e.getDay())};function kt(e,t,r,i){const c=new Date(t.start,0,1),b=new Date(t.end,11,31),d=r&&xe(r,c)?r:c,u=i&&ue(i,b)?i:b;return ue(e,d)?L(d):xe(e,u)?L(u):e}function et({open:e,viewMonth:t,setViewMonth:r,preferredDays:i,isDayDisabled:c,yearRange:b,min:d,max:u}){var m;const[y,p]=l.useState(null),D=l.useRef([]),j=l.useRef(!1),k=t.getTime(),g=h=>!!h&&He(h,t)&&!c(h),Y=new Date(t.getFullYear(),t.getMonth()+1,0).getDate(),f=Array.from({length:Y},(h,N)=>new Date(t.getFullYear(),t.getMonth(),N+1)),U=(m=[y===null?null:new Date(y),...i,L(new Date)].find(g))!=null?m:f.find(g),re=h=>({ref:N=>{D.current[h.getDate()]=N},tabIndex:U&&_(h,U)?0:-1,onFocus:()=>p(h.getTime()),onKeyDown:N=>{const H=yt[N.key];if(!H)return;N.preventDefault();const v=kt(H(h),b,d,u);_(v,h)||(j.current=!0,p(v.getTime()),He(v,t)||r(ae(v)))}});return l.useEffect(()=>{e||p(null)},[e]),l.useEffect(()=>{var h;!j.current||y===null||(j.current=!1,(h=D.current[new Date(y).getDate()])==null||h.focus())},[y,k]),{getDayNavigationProps:re}}function wt(e){var t=e,{value:r,defaultValue:i=null,onValueChange:c,placeholder:b="Selecione uma data",disabled:d,min:u,max:m,format:y=Qe,className:p,inputClassName:D,contentClassName:j,size:k="lg",yearRange:g=We,showYearSelector:Y=!0,invalid:f=!1,children:U}=t,re=de(t,["value","defaultValue","onValueChange","placeholder","disabled","min","max","format","className","inputClassName","contentClassName","size","yearRange","showYearSelector","invalid","children"]);const h=r!==void 0,[N,H]=l.useState(i),v=h?r:N,[w,ce]=l.useState(!1),[n,x]=l.useState(()=>ae(Ae(v!=null?v:new Date,g))),Z=l.useRef(null),R=l.useRef(null),A=Be.useId(),{placement:T,updatePosition:ne,measureContent:ge}=Ze({open:w,estimatedHeight:ut,triggerRef:Z,contentRef:R}),B=Ye.useComposedRefs(R,ge),se=l.useCallback(o=>{h||H(o),c==null||c(o)},[h,c]),{closeAndRestoreFocus:ie,handleOpenAutoFocus:we}=Je({open:w,setOpen:ce,viewMonthTime:n.getTime(),targetMonthTime:ve(v,g).getTime(),contentRef:R,triggerRef:Z}),O=v==null?void 0:v.getTime(),{start:G,end:me}=g,oe=o=>{o&&ne(),ce(o)},X=L(new Date),P=n.getFullYear(),$=n.getMonth(),J=new Date(P,$,1),I=new Date(P,$+1,0).getDate(),K=J.getDay(),le=v?y(v):"",pe=o=>!!d||be(o,u,m),{getDayNavigationProps:je}=et({open:w,viewMonth:n,setViewMonth:x,preferredDays:[v],isDayDisabled:pe,yearRange:g,min:u,max:m}),De=Array.from({length:g.end-g.start+1},(o,V)=>g.start+V),Ne=n.getTime()<=$e(g,u).getTime(),Ce=n.getTime()>=Ke(g,m).getTime(),Re=o=>{x(new Date(P,o,1))},Te=o=>{x(new Date(o,$,1))};return l.useEffect(()=>{w&&x(ve(O===void 0?null:new Date(O),{start:G,end:me}))},[w,O,G,me]),a.jsxs(Me.Provider,{value:l.useMemo(()=>({invalid:f}),[f]),children:[a.jsx(W.Popover.Root,{open:w,onOpenChange:oe,children:a.jsxs("div",{className:C.cn("relative inline-flex w-full min-w-0",p),children:[a.jsx(W.Popover.Trigger,{asChild:!0,children:a.jsxs("button",Q(E(Q(E({ref:Z,type:"button",disabled:d,"aria-haspopup":"dialog","aria-expanded":w,"aria-controls":w?A:void 0,"aria-invalid":f||void 0,"data-invalid":f||void 0,"data-slot":"date-picker-trigger","data-size":k,"data-state":w?"open":"closed"},!le&&{"data-placeholder":""}),{className:C.cn(Oe({size:k}),!f&&(le||w)&&"border-gray-stroke-emphasis enabled:hover:border-gray-stroke-emphasis",w&&!f&&"ring-4 ring-state-focus enabled:hover:ring-state-focus",w&&f&&"ring-4 ring-state-error",D)}),re),{children:[a.jsx("span",{className:"truncate",children:le||b}),a.jsx(M.Calendar,{size:k==="md"?Ue:_e,strokeWidth:1.6,className:"shrink-0 !text-gray-foreground","aria-hidden":"true"})]}))}),a.jsx(W.Popover.Portal,{children:a.jsxs(W.Popover.Content,{ref:B,id:A,"aria-label":"Calend\xE1rio","data-slot":"date-picker-content",side:T==null?void 0:T.side,align:"start",sideOffset:Pe,alignOffset:T==null?void 0:T.alignOffset,avoidCollisions:!1,style:T==null?void 0:T.style,onOpenAutoFocus:we,onEscapeKeyDown:ie,className:C.cn("z-50 overflow-hidden rounded-md border border-gray-stroke-muted bg-surface-elevated p-3 text-gray-foreground shadow-level-3 outline-none",j),children:[a.jsxs("div",{className:"mb-3 flex items-center justify-center gap-2",children:[a.jsx(q.Button,{variant:"regular-basic",size:"sm",iconLeft:a.jsx(M.ChevronLeftMd,{strokeWidth:1.8}),className:ye,onClick:()=>x(o=>he(o,-1)),disabled:Ne,"aria-label":"M\xEAs anterior"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"relative",children:[a.jsx("select",{value:$,onChange:o=>Re(Number(o.target.value)),className:"min-w-[7rem] appearance-none rounded-md border border-gray-stroke-muted bg-surface-card py-1 pl-2 pr-7 text-sm font-medium capitalize text-gray-foreground outline-none hover:border-gray-stroke-emphasis focus:border-gray-stroke-emphasis focus-visible:ring-4 focus-visible:ring-state-focus max-md:min-w-[8rem] max-md:py-2 max-md:text-md","aria-label":"Selecionar m\xEAs",children:Xe.map(o=>a.jsx("option",{value:o.value,className:"capitalize",children:o.label},o.value))}),a.jsx(M.ChevronDown,{size:14,strokeWidth:1.8,className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-gray-foreground","aria-hidden":!0})]}),Y?a.jsxs("div",{className:"relative",children:[a.jsx("select",{value:P,onChange:o=>Te(Number(o.target.value)),className:"min-w-[5rem] appearance-none rounded-md border border-gray-stroke-muted bg-surface-card py-1 pl-2 pr-7 text-sm font-medium text-gray-foreground outline-none hover:border-gray-stroke-emphasis focus:border-gray-stroke-emphasis focus-visible:ring-4 focus-visible:ring-state-focus max-md:min-w-[5.5rem] max-md:py-2 max-md:text-md","aria-label":"Selecionar ano",children:De.map(o=>a.jsx("option",{value:o,children:o},o))}),a.jsx(M.ChevronDown,{size:14,strokeWidth:1.8,className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-gray-foreground","aria-hidden":!0})]}):a.jsx("div",{className:"text-sm font-semibold text-gray-foreground",children:P})]}),a.jsx(q.Button,{variant:"regular-basic",size:"sm",iconLeft:a.jsx(M.ChevronRightMd,{strokeWidth:1.8}),className:ye,onClick:()=>x(o=>he(o,1)),disabled:Ce,"aria-label":"Pr\xF3ximo m\xEAs"})]}),a.jsxs("div",{className:"grid grid-cols-7 gap-1 text-center text-xs font-medium text-gray-foreground-muted max-md:text-sm",children:[a.jsx("div",{children:"Dom"}),a.jsx("div",{children:"Seg"}),a.jsx("div",{children:"Ter"}),a.jsx("div",{children:"Qua"}),a.jsx("div",{children:"Qui"}),a.jsx("div",{children:"Sex"}),a.jsx("div",{children:"S\xE1b"})]}),a.jsxs("div",{className:"mt-2 grid grid-cols-7 gap-1",children:[Array.from({length:K}).map((o,V)=>a.jsx("div",{},`empty-${V}`)),Array.from({length:I}).map((o,V)=>{const F=new Date(P,$,V+1),ee=v?_(F,v):!1,s=_(F,X);return a.jsx("button",Q(E({},je(F)),{type:"button","data-slot":"date-picker-day","data-today":s||void 0,"aria-current":s?"date":void 0,"aria-label":Ge.format(F),disabled:pe(F),onClick:()=>{se(F),ie()},className:C.cn("relative inline-flex h-9 w-full items-center justify-center rounded-md text-sm font-medium outline-none transition-colors hover:bg-secondary-background-soft-emphasis focus-visible:z-10 focus-visible:ring-4 focus-visible:ring-state-focus disabled:pointer-events-none disabled:opacity-50 max-md:h-11 max-md:text-md",s&&"ring-1 ring-gray-stroke-emphasis",ee&&"bg-primary-background-fill text-primary-foreground-onfill hover:bg-primary-background-fill-emphasis"),"aria-pressed":ee,children:V+1}),F.toISOString())})]}),a.jsxs("div",{className:"mt-3 flex items-center justify-between gap-2",children:[a.jsx(q.Button,{variant:"regular-basic",size:"sm",className:ke,onClick:()=>{se(X),ie()},disabled:d||be(X,u,m),children:"Hoje"}),a.jsx(q.Button,{variant:"regular-basic",size:"sm",className:ke,onClick:()=>se(null),disabled:d||!v,children:"Limpar"})]})]})})]})}),U]})}function jt(e){var t=e,{value:r,defaultValue:i=null,onValueChange:c,placeholder:b="Selecionar per\xEDodo",disabled:d,min:u,max:m,format:y=Qe,className:p,inputClassName:D,contentClassName:j,size:k="lg",yearRange:g=We,showYearSelector:Y=!0,invalid:f=!1,children:U}=t,re=de(t,["value","defaultValue","onValueChange","placeholder","disabled","min","max","format","className","inputClassName","contentClassName","size","yearRange","showYearSelector","invalid","children"]),h,N,H;const v=r!==void 0,[w,ce]=l.useState(i),n=v?r:w,[x,Z]=l.useState(!1),[R,A]=l.useState(()=>{var s,S;return ae(Ae((S=(s=n==null?void 0:n.start)!=null?s:n==null?void 0:n.end)!=null?S:new Date,g))}),T=l.useRef(null),ne=l.useRef(null),ge=Be.useId(),{placement:B,updatePosition:se,measureContent:ie}=Ze({open:x,estimatedHeight:ct,triggerRef:T,contentRef:ne}),we=Ye.useComposedRefs(ne,ie),O=l.useCallback(s=>{v||ce(s),c==null||c(s)},[v,c]),{closeAndRestoreFocus:G,handleOpenAutoFocus:me}=Je({open:x,setOpen:Z,viewMonthTime:R.getTime(),targetMonthTime:ve((h=n==null?void 0:n.start)!=null?h:n==null?void 0:n.end,g).getTime(),contentRef:ne,triggerRef:T}),oe=(H=(N=n==null?void 0:n.start)!=null?N:n==null?void 0:n.end)==null?void 0:H.getTime(),{start:X,end:P}=g,$=s=>{s&&se(),Z(s)},J=L(new Date),I=R.getFullYear(),K=R.getMonth(),le=new Date(I,K,1),pe=new Date(I,K+1,0).getDate(),je=le.getDay(),De=Array.from({length:g.end-g.start+1},(s,S)=>g.start+S),Ne=R.getTime()<=$e(g,u).getTime(),Ce=R.getTime()>=Ke(g,m).getTime(),Re=s=>{A(new Date(I,s,1))},Te=s=>{A(new Date(s,K,1))},o=s=>!!d||be(s,u,m),{getDayNavigationProps:V}=et({open:x,viewMonth:R,setViewMonth:A,preferredDays:[n==null?void 0:n.start,n==null?void 0:n.end],isDayDisabled:o,yearRange:g,min:u,max:m}),F=s=>{o(s)||(!n||!n.start||n.end?O({start:s,end:null}):(ue(s,n.start)?O({start:s,end:n.start}):O({start:n.start,end:s}),G()))},ee=n!=null&&n.start&&n!=null&&n.end?`${y(n.start)} - ${y(n.end)}`:n!=null&&n.start?y(n.start):"";return l.useEffect(()=>{x&&A(ve(oe===void 0?null:new Date(oe),{start:X,end:P}))},[x,oe,X,P]),a.jsxs(Me.Provider,{value:l.useMemo(()=>({invalid:f}),[f]),children:[a.jsx(W.Popover.Root,{open:x,onOpenChange:$,children:a.jsxs("div",{className:C.cn("relative inline-flex w-full min-w-0",p),children:[a.jsx(W.Popover.Trigger,{asChild:!0,children:a.jsxs("button",Q(E(Q(E({ref:T,type:"button",disabled:d,"aria-haspopup":"dialog","aria-expanded":x,"aria-controls":x?ge:void 0,"aria-invalid":f||void 0,"data-invalid":f||void 0,"data-slot":"date-picker-trigger","data-size":k,"data-state":x?"open":"closed"},!ee&&{"data-placeholder":""}),{className:C.cn(Oe({size:k}),!f&&(ee||x)&&"border-gray-stroke-emphasis enabled:hover:border-gray-stroke-emphasis",x&&!f&&"ring-4 ring-state-focus enabled:hover:ring-state-focus",x&&f&&"ring-4 ring-state-error",D)}),re),{children:[a.jsx("span",{className:"truncate",children:ee||b}),a.jsx(M.Calendar,{size:k==="md"?Ue:_e,strokeWidth:1.6,className:"shrink-0 !text-gray-foreground","aria-hidden":"true"})]}))}),a.jsx(W.Popover.Portal,{children:a.jsxs(W.Popover.Content,{ref:we,id:ge,"aria-label":"Calend\xE1rio","data-slot":"date-picker-content",side:B==null?void 0:B.side,align:"start",sideOffset:Pe,alignOffset:B==null?void 0:B.alignOffset,avoidCollisions:!1,style:B==null?void 0:B.style,onOpenAutoFocus:me,onEscapeKeyDown:G,className:C.cn("z-50 overflow-hidden rounded-md border border-gray-stroke-muted bg-surface-elevated p-3 text-gray-foreground shadow-level-3 outline-none",j),children:[a.jsxs("div",{className:"mb-3 flex items-center justify-center gap-2",children:[a.jsx(q.Button,{variant:"regular-basic",size:"sm",iconLeft:a.jsx(M.ChevronLeftMd,{strokeWidth:1.8}),className:ye,onClick:()=>A(s=>he(s,-1)),disabled:Ne,"aria-label":"M\xEAs anterior"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"relative",children:[a.jsx("select",{value:K,onChange:s=>Re(Number(s.target.value)),className:"min-w-[7rem] appearance-none rounded-md border border-gray-stroke-muted bg-surface-card py-1 pl-2 pr-7 text-sm font-medium capitalize text-gray-foreground outline-none hover:border-gray-stroke-emphasis focus:border-gray-stroke-emphasis focus-visible:ring-4 focus-visible:ring-state-focus max-md:min-w-[8rem] max-md:py-2 max-md:text-md","aria-label":"Selecionar m\xEAs",children:Xe.map(s=>a.jsx("option",{value:s.value,className:"capitalize",children:s.label},s.value))}),a.jsx(M.ChevronDown,{size:14,strokeWidth:1.8,className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-gray-foreground","aria-hidden":!0})]}),Y?a.jsxs("div",{className:"relative",children:[a.jsx("select",{value:I,onChange:s=>Te(Number(s.target.value)),className:"min-w-[5rem] appearance-none rounded-md border border-gray-stroke-muted bg-surface-card py-1 pl-2 pr-7 text-sm font-medium text-gray-foreground outline-none hover:border-gray-stroke-emphasis focus:border-gray-stroke-emphasis focus-visible:ring-4 focus-visible:ring-state-focus max-md:min-w-[5.5rem] max-md:py-2 max-md:text-md","aria-label":"Selecionar ano",children:De.map(s=>a.jsx("option",{value:s,children:s},s))}),a.jsx(M.ChevronDown,{size:14,strokeWidth:1.8,className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-gray-foreground","aria-hidden":!0})]}):a.jsx("div",{className:"text-sm font-semibold text-gray-foreground",children:I})]}),a.jsx(q.Button,{variant:"regular-basic",size:"sm",iconLeft:a.jsx(M.ChevronRightMd,{strokeWidth:1.8}),className:ye,onClick:()=>A(s=>he(s,1)),disabled:Ce,"aria-label":"Pr\xF3ximo m\xEAs"})]}),a.jsxs("div",{className:"grid grid-cols-7 gap-1 text-center text-xs font-medium text-gray-foreground-muted max-md:text-sm",children:[a.jsx("div",{children:"Dom"}),a.jsx("div",{children:"Seg"}),a.jsx("div",{children:"Ter"}),a.jsx("div",{children:"Qua"}),a.jsx("div",{children:"Qui"}),a.jsx("div",{children:"Sex"}),a.jsx("div",{children:"S\xE1b"})]}),a.jsxs("div",{className:"mt-2 grid grid-cols-7 gap-1",children:[Array.from({length:je}).map((s,S)=>a.jsx("div",{},`empty-${S}`)),Array.from({length:pe}).map((s,S)=>{const z=new Date(I,K,S+1),Se=(n==null?void 0:n.start)&&_(z,n.start),Ee=(n==null?void 0:n.end)&&_(z,n.end),tt=(n==null?void 0:n.start)&&(n==null?void 0:n.end)&&xe(z,n.start)&&ue(z,n.end),ze=_(z,J);return a.jsx("button",Q(E({},V(z)),{type:"button","data-slot":"date-picker-day","data-today":ze||void 0,"aria-current":ze?"date":void 0,"aria-label":Ge.format(z),disabled:o(z),onClick:()=>F(z),className:C.cn("relative inline-flex h-9 w-full items-center justify-center rounded-md text-sm font-medium outline-none transition-colors hover:bg-secondary-background-soft-emphasis focus-visible:z-10 focus-visible:ring-4 focus-visible:ring-state-focus disabled:pointer-events-none disabled:opacity-50 max-md:h-11 max-md:text-md",ze&&"ring-1 ring-gray-stroke-emphasis",tt&&"bg-primary-background-soft",(Se||Ee)&&"bg-primary-background-fill text-primary-foreground-onfill hover:bg-primary-background-fill-emphasis"),"aria-pressed":Se||Ee||void 0,children:S+1}),z.toISOString())})]}),a.jsxs("div",{className:"mt-3 flex items-center justify-between gap-2",children:[a.jsx(q.Button,{variant:"regular-basic",size:"sm",className:ke,onClick:()=>{O({start:J,end:J}),G()},disabled:d||be(J,u,m),children:"Hoje"}),a.jsx(q.Button,{variant:"regular-basic",size:"sm",className:ke,onClick:()=>O(null),disabled:d||!n,children:"Limpar"})]})]})})]})}),U]})}exports.DatePicker=wt,exports.DatePickerLabel=lt,exports.DatePickerText=dt,exports.DatePickerWrapper=ot,exports.DateRangePicker=jt,exports.datePickerTriggerVariants=Oe;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
-
import{jsxs as c,jsx as o}from"react/jsx-runtime";import{cn as C}from"../lib/utils.mjs";import{Calendar as ze,ChevronLeftMd as Ee,ChevronDown as oe,ChevronRightMd as Te}from"@medway-ui/icons";import{cva as Ke}from"class-variance-authority";import{createContext as Je,useState as A,useRef as M,useCallback as U,useEffect as Q,useMemo as Re,useContext as Xe}from"react";import{createPortal as Se}from"react-dom";import{useId as Me}from"../hooks/use-id.mjs";var Ze=Object.defineProperty,Ue=Object.defineProperties,et=Object.getOwnPropertyDescriptors,ie=Object.getOwnPropertySymbols,Pe=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable,Fe=(e,t,n)=>t in e?Ze(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P=(e,t)=>{for(var n in t||(t={}))Pe.call(t,n)&&Fe(e,n,t[n]);if(ie)for(var n of ie(t))je.call(t,n)&&Fe(e,n,t[n]);return e},$=(e,t)=>Ue(e,et(t)),ee=(e,t)=>{var n={};for(var i in e)Pe.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&ie)for(var i of ie(e))t.indexOf(i)<0&&je.call(e,i)&&(n[i]=e[i]);return n};const we=Je({invalid:!1}),Oe={start:1950,end:new Date().getFullYear()};function Ne(e,t){const n=e.getFullYear();return n<t.start?new Date(t.start,0,1):n>t.end?new Date(t.end,11,31):e}const De=Ke(["flex w-full min-w-0 items-center justify-between gap-2 rounded-md border-2 border-gray-stroke-muted bg-surface-card px-4 py-3 text-left text-gray-foreground outline-none transition-[color,box-shadow] enabled:hover:border-gray-stroke-emphasis enabled:hover:ring-[3px] enabled:hover:ring-state-focus focus-visible:border-gray-stroke-emphasis focus-visible:ring-[3px] focus-visible:ring-state-focus data-[invalid]:focus-visible:border-feedback-error-stroke data-[invalid]:focus-visible:ring-state-error disabled:pointer-events-none disabled:bg-gray-background-soft-muted disabled:text-gray-foreground-muted data-[invalid]:border-feedback-error-stroke data-[invalid]:enabled:hover:border-feedback-error-stroke data-[invalid]:enabled:hover:ring-[3px] data-[invalid]:enabled:hover:ring-state-error","group-has-[[data-slot=date-picker-label]]:data-[placeholder]:text-transparent"],{variants:{size:{lg:["h-12 max-h-12 text-md","max-sm:h-14 max-sm:text-base"],md:["h-10 max-h-10 text-sm","max-sm:h-11"]}},defaultVariants:{size:"lg"}});function tt(e){var t=e,{className:n}=t,i=ee(t,["className"]);return o("div",P({className:C("group relative flex flex-col gap-2",n),"data-slot":"date-picker-wrapper"},i))}function at(e){var t=e,{className:n,children:i}=t,u=ee(t,["className","children"]);return o("label",$(P({className:C("pointer-events-none absolute start-3 top-0 z-10 max-w-[calc(100%-1.5rem)] origin-left -translate-y-1/2 truncate bg-surface-card px-1 text-xs font-medium text-gray-foreground transition-all duration-200 ease-out","group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open])]:start-4 group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open])]:top-6 group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open])]:max-w-[calc(100%-4rem)] group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open])]:bg-transparent group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open])]:px-0 group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open])]:text-md group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open])]:font-normal group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open])]:text-gray-foreground max-sm:group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open])]:top-7","group-has-[[data-slot=date-picker-trigger][data-size=md]]:group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open])]:top-5 group-has-[[data-slot=date-picker-trigger][data-size=md]]:group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open])]:!text-sm max-sm:group-has-[[data-slot=date-picker-trigger][data-size=md]]:group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open])]:top-[22px]",n),"data-slot":"date-picker-label"},u),{children:i}))}function rt(e){var t=e,{className:n}=t,i=ee(t,["className"]);const{invalid:u}=Xe(we);return o("span",P({className:C("-mt-1 text-xs",u?"text-feedback-error-foreground":"text-gray-foreground",n),"data-slot":"date-picker-text"},i))}function q(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function te(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function se(e,t){return new Date(e.getFullYear(),e.getMonth()+t,1)}function ae(e){return new Date(e.getFullYear(),e.getMonth(),1)}function de(e,t){return ae(Ne(e!=null?e:new Date,t))}function Ce(e,t){return q(e).getTime()<q(t).getTime()}function Le(e,t){return q(e).getTime()>q(t).getTime()}function We(e,t){const n=new Date(e.start,0,1);if(!t)return n;const i=ae(t);return i>n?i:n}function Ae(e,t){const n=new Date(e.end,11,1);if(!t)return n;const i=ae(t);return i<n?i:n}function re(e,t,n){return!!(t&&Ce(e,t)||n&&Le(e,n))}function Ye(e){return new Intl.DateTimeFormat("pt-BR",{year:"numeric",month:"2-digit",day:"2-digit"}).format(e)}const Ve=20,Ie=18,He=8,Be=8,nt=290,ot=330;function it(e,t){const n=window.innerHeight-e.bottom<t,i=window.innerWidth,u=window.matchMedia("(max-width: 639px)").matches?Math.min(512,i-16):Math.min(320,i),v=Be,d=i-u-Be;let g=e.left;return g<v?g=v:g>d&&(g=d),$(P({position:"fixed"},n?{bottom:window.innerHeight-e.top+He}:{top:e.bottom+He}),{left:g,width:u,maxWidth:360})}function Qe({open:e,estimatedHeight:t,triggerRef:n,rootRef:i}){const[u,v]=A(null),d=M(null),g=U(()=>{var k,T,S;const Y=(S=(k=n.current)==null?void 0:k.getBoundingClientRect())!=null?S:(T=i.current)==null?void 0:T.getBoundingClientRect();Y&&v(it(Y,t))},[t,i,n]),p=U(()=>{d.current===null&&(d.current=window.requestAnimationFrame(()=>{d.current=null,g()}))},[g]);return Q(()=>{if(!e){v(null);return}return window.addEventListener("scroll",p,{passive:!0,capture:!0}),window.addEventListener("resize",p),()=>{window.removeEventListener("scroll",p,{capture:!0}),window.removeEventListener("resize",p),d.current!==null&&(window.cancelAnimationFrame(d.current),d.current=null)}},[e,p]),{style:u,updatePosition:g}}const $e=new Intl.DateTimeFormat("pt-BR",{day:"numeric",month:"long",year:"numeric"}),st=['[data-slot="date-picker-day"][aria-pressed="true"]:not(:disabled)','[data-slot="date-picker-day"][data-today]:not(:disabled)','[data-slot="date-picker-day"]:not(:disabled)'];function dt(e){if(!e)return null;for(const t of st){const n=e.querySelector(t);if(n)return n}return null}function qe({open:e,setOpen:t,viewMonthTime:n,targetMonthTime:i,contentRef:u,triggerRef:v}){const d=M(!0),g=U(()=>{var p,k,T;const S=(k=(p=u.current)==null?void 0:p.contains(document.activeElement))!=null?k:!1;t(!1),S&&((T=v.current)==null||T.focus())},[u,t,v]);return Q(()=>{if(!e){d.current=!0;return}if(!d.current||n!==i)return;const p=dt(u.current);p&&(d.current=!1,p.focus({preventScroll:!0}))},[e,n,i,u]),g}function lt(e){var t=e,{value:n,defaultValue:i=null,onValueChange:u,placeholder:v="Selecione uma data",disabled:d,min:g,max:p,format:k=Ye,className:T,inputClassName:S,contentClassName:Y,size:j="lg",yearRange:f=Oe,showYearSelector:le=!0,invalid:w=!1,children:ce,onClick:G}=t,ue=ee(t,["value","defaultValue","onValueChange","placeholder","disabled","min","max","format","className","inputClassName","contentClassName","size","yearRange","showYearSelector","invalid","children","onClick"]);const V=n!==void 0,[_,me]=A(i),x=V?n:_,[r,h]=A(!1),[z,N]=A(()=>ae(Ne(x!=null?x:new Date,f))),R=M(null),F=M(null),O=M(null),I=Me(),{style:K,updatePosition:ne}=Qe({open:r,estimatedHeight:nt,triggerRef:F,rootRef:R}),J=U(s=>{V||me(s),u==null||u(s)},[V,u]),E=qe({open:r,setOpen:h,viewMonthTime:z.getTime(),targetMonthTime:de(x,f).getTime(),contentRef:O,triggerRef:F});Q(()=>{r&&N(de(x,f))},[r,x,f]),Q(()=>{if(!r)return;const s=a=>{const m=R.current,l=O.current;m&&a.target instanceof Node&&!m.contains(a.target)&&!(l!=null&&l.contains(a.target))&&h(!1)},b=a=>{a.key==="Escape"&&E()};return window.addEventListener("pointerdown",s,{capture:!0}),window.addEventListener("keydown",b),()=>{window.removeEventListener("pointerdown",s,{capture:!0}),window.removeEventListener("keydown",b)}},[r,E]);const H=s=>{if(G==null||G(s),!s.defaultPrevented){if(r){h(!1);return}ne(),h(!0)}},X=q(new Date),D=z.getFullYear(),y=z.getMonth(),L=new Date(D,y,1),ge=new Date(D,y+1,0).getDate(),pe=L.getDay(),B=x?k(x):"",fe=Array.from({length:12},(s,b)=>({value:b,label:new Intl.DateTimeFormat("pt-BR",{month:"long"}).format(new Date(2e3,b,1))})),he=Array.from({length:f.end-f.start+1},(s,b)=>f.start+b),be=z.getTime()<=We(f,g).getTime(),ve=z.getTime()>=Ae(f,p).getTime(),xe=s=>{N(new Date(D,s,1))},ye=s=>{N(new Date(s,y,1))};return c(we.Provider,{value:Re(()=>({invalid:w}),[w]),children:[c("div",{ref:R,className:C("relative inline-flex w-full min-w-0",T),children:[c("button",$(P($(P({ref:F,type:"button",disabled:d,"aria-haspopup":"dialog","aria-expanded":r,"aria-controls":r?I:void 0,"data-invalid":w||void 0,"data-slot":"date-picker-trigger","data-size":j,"data-state":r?"open":"closed"},!B&&{"data-placeholder":""}),{className:C(De({size:j}),r&&"border-gray-stroke-emphasis ring-[3px] ring-state-focus",B&&!w&&"border-gray-stroke-emphasis ring-[3px] ring-state-focus",B&&w&&"border-feedback-error-stroke ring-[3px] ring-state-error",S)}),ue),{onClick:H,children:[o("span",{className:"truncate",children:B||v}),o(ze,{size:j==="md"?Ie:Ve,strokeWidth:1.6,className:"shrink-0 !text-gray-foreground","aria-hidden":"true"})]})),r&&Se(c("div",{ref:O,id:I,role:"dialog","aria-label":"Calend\xE1rio","data-slot":"date-picker-content",style:K!=null?K:void 0,className:C("z-50 overflow-hidden rounded-md border border-gray-stroke-muted bg-surface-elevated p-3 shadow-md",Y),children:[c("div",{className:"mb-3 flex items-center justify-center gap-2",children:[o("button",{type:"button",className:"inline-flex size-8 items-center justify-center rounded-md hover:bg-secondary-background-soft-emphasis disabled:pointer-events-none disabled:opacity-50 max-sm:size-10",onClick:()=>N(s=>se(s,-1)),disabled:be,"aria-label":"M\xEAs anterior",children:o(Ee,{size:18,strokeWidth:1.8})}),c("div",{className:"flex items-center gap-2",children:[c("div",{className:"relative",children:[o("select",{value:y,onChange:s=>xe(Number(s.target.value)),className:"min-w-[7rem] appearance-none rounded-md border border-gray-stroke-muted bg-surface-card py-1 pl-2 pr-7 text-sm font-medium capitalize text-gray-foreground outline-none hover:border-gray-stroke-emphasis focus:border-gray-stroke-emphasis focus:ring-2 focus:ring-state-focus max-sm:min-w-[8rem] max-sm:py-2 max-sm:text-base","aria-label":"Selecionar m\xEAs",children:fe.map(s=>o("option",{value:s.value,className:"capitalize",children:s.label},s.value))}),o(oe,{size:14,strokeWidth:1.8,className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-gray-foreground","aria-hidden":!0})]}),le?c("div",{className:"relative",children:[o("select",{value:D,onChange:s=>ye(Number(s.target.value)),className:"min-w-[5rem] appearance-none rounded-md border border-gray-stroke-muted bg-surface-card py-1 pl-2 pr-7 text-sm font-medium text-gray-foreground outline-none hover:border-gray-stroke-emphasis focus:border-gray-stroke-emphasis focus:ring-2 focus:ring-state-focus max-sm:min-w-[5.5rem] max-sm:py-2 max-sm:text-base","aria-label":"Selecionar ano",children:he.map(s=>o("option",{value:s,children:s},s))}),o(oe,{size:14,strokeWidth:1.8,className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-gray-foreground","aria-hidden":!0})]}):o("div",{className:"text-sm font-semibold text-gray-foreground",children:D})]}),o("button",{type:"button",className:"inline-flex size-8 items-center justify-center rounded-md hover:bg-secondary-background-soft-emphasis disabled:pointer-events-none disabled:opacity-50 max-sm:size-10",onClick:()=>N(s=>se(s,1)),disabled:ve,"aria-label":"Pr\xF3ximo m\xEAs",children:o(Te,{size:18,strokeWidth:1.8})})]}),c("div",{className:"grid grid-cols-7 gap-1 text-center text-xs font-medium text-gray-foreground-muted max-sm:text-sm",children:[o("div",{children:"Dom"}),o("div",{children:"Seg"}),o("div",{children:"Ter"}),o("div",{children:"Qua"}),o("div",{children:"Qui"}),o("div",{children:"Sex"}),o("div",{children:"S\xE1b"})]}),c("div",{className:"mt-2 grid grid-cols-7 gap-1",children:[Array.from({length:pe}).map((s,b)=>o("div",{},`empty-${b}`)),Array.from({length:ge}).map((s,b)=>{const a=new Date(D,y,b+1),m=x?te(a,x):!1,l=te(a,X),W=d||re(a,g,p);return o("button",{type:"button","data-slot":"date-picker-day","data-today":l||void 0,"aria-current":l?"date":void 0,"aria-label":$e.format(a),disabled:W,onClick:()=>{J(a),E()},className:C("inline-flex h-9 w-full items-center justify-center rounded-md text-sm font-medium outline-none transition-colors hover:bg-secondary-background-soft-emphasis focus-visible:ring-2 focus-visible:ring-state-focus disabled:pointer-events-none disabled:opacity-50 max-sm:h-11 max-sm:text-base",l&&"ring-1 ring-gray-stroke-emphasis",m&&"bg-primary-background-fill text-primary-foreground-onfill hover:bg-primary-background-fill-emphasis"),"aria-pressed":m,children:b+1},a.toISOString())})]}),c("div",{className:"mt-3 flex items-center justify-between gap-2",children:[o("button",{type:"button",className:"rounded-md px-2 py-1 text-xs font-medium text-gray-foreground hover:bg-secondary-background-soft-emphasis max-sm:px-3 max-sm:py-2 max-sm:text-sm",onClick:()=>{J(X),E()},disabled:d||re(X,g,p),children:"Hoje"}),o("button",{type:"button",className:"rounded-md px-2 py-1 text-xs font-medium text-gray-foreground hover:bg-secondary-background-soft-emphasis max-sm:px-3 max-sm:py-2 max-sm:text-sm",onClick:()=>J(null),disabled:d||!x,children:"Limpar"})]})]}),document.body)]}),ce]})}function ct(e){var t=e,{value:n,defaultValue:i=null,onValueChange:u,placeholder:v="Selecionar per\xEDodo",disabled:d,min:g,max:p,format:k=Ye,className:T,inputClassName:S,contentClassName:Y,size:j="lg",yearRange:f=Oe,showYearSelector:le=!0,invalid:w=!1,children:ce,onClick:G}=t,ue=ee(t,["value","defaultValue","onValueChange","placeholder","disabled","min","max","format","className","inputClassName","contentClassName","size","yearRange","showYearSelector","invalid","children","onClick"]),V;const _=n!==void 0,[me,x]=A(i),r=_?n:me,[h,z]=A(!1),[N,R]=A(()=>{var a,m;return ae(Ne((m=(a=r==null?void 0:r.start)!=null?a:r==null?void 0:r.end)!=null?m:new Date,f))}),F=M(null),O=M(null),I=M(null),K=Me(),{style:ne,updatePosition:J}=Qe({open:h,estimatedHeight:ot,triggerRef:O,rootRef:F}),E=U(a=>{_||x(a),u==null||u(a)},[_,u]),H=qe({open:h,setOpen:z,viewMonthTime:N.getTime(),targetMonthTime:de((V=r==null?void 0:r.start)!=null?V:r==null?void 0:r.end,f).getTime(),contentRef:I,triggerRef:O});Q(()=>{var a;h&&R(de((a=r==null?void 0:r.start)!=null?a:r==null?void 0:r.end,f))},[h,r,f]),Q(()=>{if(!h)return;const a=l=>{const W=F.current,Z=I.current;W&&l.target instanceof Node&&!W.contains(l.target)&&!(Z!=null&&Z.contains(l.target))&&z(!1)},m=l=>{l.key==="Escape"&&H()};return window.addEventListener("pointerdown",a,{capture:!0}),window.addEventListener("keydown",m),()=>{window.removeEventListener("pointerdown",a,{capture:!0}),window.removeEventListener("keydown",m)}},[h,H]);const X=a=>{if(G==null||G(a),!a.defaultPrevented){if(h){z(!1);return}J(),z(!0)}},D=q(new Date),y=N.getFullYear(),L=N.getMonth(),ge=new Date(y,L,1),pe=new Date(y,L+1,0).getDate(),B=ge.getDay(),fe=Array.from({length:12},(a,m)=>({value:m,label:new Intl.DateTimeFormat("pt-BR",{month:"long"}).format(new Date(2e3,m,1))})),he=Array.from({length:f.end-f.start+1},(a,m)=>f.start+m),be=N.getTime()<=We(f,g).getTime(),ve=N.getTime()>=Ae(f,p).getTime(),xe=a=>{R(new Date(y,a,1))},ye=a=>{R(new Date(a,L,1))},s=a=>{d||re(a,g,p)||(!r||!r.start||r.end?E({start:a,end:null}):(Ce(a,r.start)?E({start:a,end:r.start}):E({start:r.start,end:a}),H()))},b=r!=null&&r.start&&r!=null&&r.end?`${k(r.start)} - ${k(r.end)}`:r!=null&&r.start?k(r.start):"";return c(we.Provider,{value:Re(()=>({invalid:w}),[w]),children:[c("div",{ref:F,className:C("relative inline-flex w-full min-w-0",T),children:[c("button",$(P($(P({ref:O,type:"button",disabled:d,"aria-haspopup":"dialog","aria-expanded":h,"aria-controls":h?K:void 0,"data-invalid":w||void 0,"data-slot":"date-picker-trigger","data-size":j,"data-state":h?"open":"closed"},!b&&{"data-placeholder":""}),{className:C(De({size:j}),h&&"border-gray-stroke-emphasis ring-[3px] ring-state-focus",b&&!w&&"border-gray-stroke-emphasis ring-[3px] ring-state-focus",b&&w&&"border-feedback-error-stroke ring-[3px] ring-state-error",S)}),ue),{onClick:X,children:[o("span",{className:"truncate",children:b||v}),o(ze,{size:j==="md"?Ie:Ve,strokeWidth:1.6,className:"shrink-0 !text-gray-foreground","aria-hidden":"true"})]})),h&&Se(c("div",{ref:I,id:K,role:"dialog","aria-label":"Calend\xE1rio","data-slot":"date-picker-content",style:ne!=null?ne:void 0,className:C("z-50 overflow-hidden rounded-md border border-gray-stroke-muted bg-surface-elevated p-3 shadow-md",Y),children:[c("div",{className:"mb-3 flex items-center justify-center gap-2",children:[o("button",{type:"button",className:"inline-flex size-8 items-center justify-center rounded-md hover:bg-secondary-background-soft-emphasis disabled:pointer-events-none disabled:opacity-50 max-sm:size-10",onClick:()=>R(a=>se(a,-1)),disabled:be,"aria-label":"M\xEAs anterior",children:o(Ee,{size:18,strokeWidth:1.8})}),c("div",{className:"flex items-center gap-2",children:[c("div",{className:"relative",children:[o("select",{value:L,onChange:a=>xe(Number(a.target.value)),className:"min-w-[7rem] appearance-none rounded-md border border-gray-stroke-muted bg-surface-card py-1 pl-2 pr-7 text-sm font-medium capitalize text-gray-foreground outline-none hover:border-gray-stroke-emphasis focus:border-gray-stroke-emphasis focus:ring-2 focus:ring-state-focus max-sm:min-w-[8rem] max-sm:py-2 max-sm:text-base","aria-label":"Selecionar m\xEAs",children:fe.map(a=>o("option",{value:a.value,className:"capitalize",children:a.label},a.value))}),o(oe,{size:14,strokeWidth:1.8,className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-gray-foreground","aria-hidden":!0})]}),le?c("div",{className:"relative",children:[o("select",{value:y,onChange:a=>ye(Number(a.target.value)),className:"min-w-[5rem] appearance-none rounded-md border border-gray-stroke-muted bg-surface-card py-1 pl-2 pr-7 text-sm font-medium text-gray-foreground outline-none hover:border-gray-stroke-emphasis focus:border-gray-stroke-emphasis focus:ring-2 focus:ring-state-focus max-sm:min-w-[5.5rem] max-sm:py-2 max-sm:text-base","aria-label":"Selecionar ano",children:he.map(a=>o("option",{value:a,children:a},a))}),o(oe,{size:14,strokeWidth:1.8,className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-gray-foreground","aria-hidden":!0})]}):o("div",{className:"text-sm font-semibold text-gray-foreground",children:y})]}),o("button",{type:"button",className:"inline-flex size-8 items-center justify-center rounded-md hover:bg-secondary-background-soft-emphasis disabled:pointer-events-none disabled:opacity-50 max-sm:size-10",onClick:()=>R(a=>se(a,1)),disabled:ve,"aria-label":"Pr\xF3ximo m\xEAs",children:o(Te,{size:18,strokeWidth:1.8})})]}),c("div",{className:"grid grid-cols-7 gap-1 text-center text-xs font-medium text-gray-foreground-muted max-sm:text-sm",children:[o("div",{children:"Dom"}),o("div",{children:"Seg"}),o("div",{children:"Ter"}),o("div",{children:"Qua"}),o("div",{children:"Qui"}),o("div",{children:"Sex"}),o("div",{children:"S\xE1b"})]}),c("div",{className:"mt-2 grid grid-cols-7 gap-1",children:[Array.from({length:B}).map((a,m)=>o("div",{},`empty-${m}`)),Array.from({length:pe}).map((a,m)=>{const l=new Date(y,L,m+1),W=(r==null?void 0:r.start)&&te(l,r.start),Z=(r==null?void 0:r.end)&&te(l,r.end),Ge=(r==null?void 0:r.start)&&(r==null?void 0:r.end)&&Le(l,r.start)&&Ce(l,r.end),ke=te(l,D),_e=d||re(l,g,p);return o("button",{type:"button","data-slot":"date-picker-day","data-today":ke||void 0,"aria-current":ke?"date":void 0,"aria-label":$e.format(l),disabled:_e,onClick:()=>s(l),className:C("inline-flex h-9 w-full items-center justify-center rounded-md text-sm font-medium outline-none transition-colors hover:bg-secondary-background-soft-emphasis focus-visible:ring-2 focus-visible:ring-state-focus disabled:pointer-events-none disabled:opacity-50",ke&&"ring-1 ring-gray-stroke-emphasis",Ge&&"bg-primary-background-soft",(W||Z)&&"bg-primary-background-fill text-primary-foreground-onfill hover:bg-primary-background-fill-emphasis"),"aria-pressed":W||Z||void 0,children:m+1},l.toISOString())})]}),c("div",{className:"mt-3 flex items-center justify-between gap-2",children:[o("button",{type:"button",className:"rounded-md px-2 py-1 text-xs font-medium text-gray-foreground hover:bg-secondary-background-soft-emphasis",onClick:()=>{E({start:D,end:D}),H()},disabled:d||re(D,g,p),children:"Hoje"}),o("button",{type:"button",className:"rounded-md px-2 py-1 text-xs font-medium text-gray-foreground hover:bg-secondary-background-soft-emphasis",onClick:()=>E(null),disabled:d||!r,children:"Limpar"})]})]}),document.body)]}),ce]})}export{lt as DatePicker,at as DatePickerLabel,rt as DatePickerText,tt as DatePickerWrapper,ct as DateRangePicker,De as datePickerTriggerVariants};
|
|
4
|
-
//# sourceMappingURL=DatePicker.mjs.map
|
|
3
|
+
import{jsxs as g,jsx as r}from"react/jsx-runtime";import{FLOATING_LABEL_BASE as dt,FLOATING_LABEL_WRAPPER as ct}from"../lib/floating-label.mjs";import{cn as T}from"../lib/utils.mjs";import{screens as ut}from"../assets/js/tokens.mjs";import{Button as I}from"./Button.mjs";import{useComposedRefs as Ie}from"../hooks/use-composed-refs.mjs";import{Calendar as He,ChevronLeftMd as Be,ChevronDown as be,ChevronRightMd as $e}from"@medway-ui/icons";import{cva as mt}from"class-variance-authority";import{Popover as H}from"radix-ui";import{createContext as gt,useState as B,useRef as $,useCallback as K,useEffect as re,useMemo as Ke,useContext as pt}from"react";import{useId as Qe}from"../hooks/use-id.mjs";var ft=Object.defineProperty,ht=Object.defineProperties,vt=Object.getOwnPropertyDescriptors,ye=Object.getOwnPropertySymbols,_e=Object.prototype.hasOwnProperty,qe=Object.prototype.propertyIsEnumerable,Ze=(e,t,a)=>t in e?ft(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,S=(e,t)=>{for(var a in t||(t={}))_e.call(t,a)&&Ze(e,a,t[a]);if(ye)for(var a of ye(t))qe.call(t,a)&&Ze(e,a,t[a]);return e},Z=(e,t)=>ht(e,vt(t)),me=(e,t)=>{var a={};for(var o in e)_e.call(e,o)&&t.indexOf(o)<0&&(a[o]=e[o]);if(e!=null&&ye)for(var o of ye(e))t.indexOf(o)<0&&qe.call(e,o)&&(a[o]=e[o]);return a};const Ee=gt({invalid:!1}),Ge={start:1950,end:new Date().getFullYear()};function Se(e,t){const a=e.getFullYear();return a<t.start?new Date(t.start,0,1):a>t.end?new Date(t.end,11,31):e}const Le=mt(["flex w-full min-w-0 items-center justify-between rounded-md border-2 border-gray-stroke-muted bg-surface-card text-left text-gray-foreground outline-none transition-[color,box-shadow] enabled:hover:border-gray-stroke enabled:hover:ring-4 enabled:hover:ring-state-hover focus-visible:border-gray-stroke-emphasis focus-visible:ring-4 focus-visible:ring-state-focus data-[invalid]:focus-visible:border-feedback-error-stroke data-[invalid]:focus-visible:ring-state-error disabled:pointer-events-none disabled:bg-gray-background-soft-muted disabled:text-gray-foreground-muted data-[invalid]:border-feedback-error-stroke data-[invalid]:enabled:hover:border-feedback-error-stroke data-[invalid]:enabled:hover:ring-state-error","group-has-[[data-slot=date-picker-label]]:data-[placeholder]:text-transparent"],{variants:{size:{lg:"h-12 max-h-12 gap-3 px-3.5 py-2.5 text-md",md:"h-10 max-h-10 gap-2.5 px-3 py-2 text-sm"}},defaultVariants:{size:"lg"}});function bt(e){var t=e,{className:a}=t,o=me(t,["className"]);return r("div",S({className:T(ct,a),"data-slot":"date-picker-wrapper"},o))}function yt(e){var t=e,{className:a,children:o}=t,c=me(t,["className","children"]);return r("label",Z(S({className:T(dt,"z-10","group-has-[[data-slot=date-picker-trigger][data-size=md]]:start-2","group-has-[[data-slot=date-picker-trigger]:disabled]:text-gray-foreground-muted group-has-[[data-slot=date-picker-trigger]:focus-visible]:text-gray-foreground-emphasis group-has-[[data-slot=date-picker-trigger]:hover:not(:focus-visible):not(:disabled):not([data-state=open])]:text-gray-foreground-emphasis group-has-[[data-slot=date-picker-trigger][data-invalid]:focus-visible]:text-feedback-error-foreground group-has-[[data-slot=date-picker-trigger][data-invalid][data-state=open]]:text-feedback-error-foreground group-has-[[data-slot=date-picker-trigger][data-state=open]]:text-gray-foreground-emphasis","group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open]):not(:focus-visible)]:start-4 group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open]):not(:focus-visible)]:top-6 group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open]):not(:focus-visible)]:max-w-[calc(100%-4rem)] group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open]):not(:focus-visible)]:bg-transparent group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open]):not(:focus-visible)]:px-0 group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open]):not(:focus-visible)]:text-md group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open]):not(:focus-visible)]:font-regular group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open]):not(:focus-visible)]:leading-md","group-has-[[data-slot=date-picker-trigger][data-size=md]]:group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open]):not(:focus-visible)]:start-3.5 group-has-[[data-slot=date-picker-trigger][data-size=md]]:group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open]):not(:focus-visible)]:top-5 group-has-[[data-slot=date-picker-trigger][data-size=md]]:group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open]):not(:focus-visible)]:!text-sm group-has-[[data-slot=date-picker-trigger][data-size=md]]:group-has-[[data-slot=date-picker-trigger][data-placeholder]:not([data-state=open]):not(:focus-visible)]:leading-sm",a),"data-slot":"date-picker-label"},c),{children:o}))}function xt(e){var t=e,{className:a}=t,o=me(t,["className"]);const{invalid:c}=pt(Ee);return r("span",S({className:T("-mt-1 text-xs",c?"text-feedback-error-foreground":"text-gray-foreground",a),"data-slot":"date-picker-text"},o))}function L(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function G(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function xe(e,t){return new Date(e.getFullYear(),e.getMonth()+t,1)}function ne(e,t){return new Date(e.getFullYear(),e.getMonth(),e.getDate()+t)}function Ue(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()}function ie(e){return new Date(e.getFullYear(),e.getMonth(),1)}function we(e,t){return ie(Se(e!=null?e:new Date,t))}function ge(e,t){return L(e).getTime()<L(t).getTime()}function ke(e,t){return L(e).getTime()>L(t).getTime()}function Xe(e,t){const a=new Date(e.start,0,1);if(!t)return a;const o=ie(t);return o>a?o:a}function Je(e,t){const a=new Date(e.end,11,1);if(!t)return a;const o=ie(t);return o<a?o:a}function De(e,t,a){return!!(t&&ge(e,t)||a&&ke(e,a))}function et(e){return new Intl.DateTimeFormat("pt-BR",{year:"numeric",month:"2-digit",day:"2-digit"}).format(e)}const tt=24,at=20,Ne="max-md:!size-10",Ce="max-md:min-h-10 max-md:text-sm max-md:leading-sm",Ye=8,je=8,wt=376,kt=336,Dt=320,Nt=360,Ct=`(max-width: ${parseInt(ut.md)-1}px)`;function Tt(e,t){const a=window.innerHeight-e.bottom<t+Ye,o=window.innerWidth,c=window.matchMedia(Ct).matches?Math.min(Nt,o-2*je):Math.min(Dt,o),y=je,l=o-c-je;let d=e.left;return d<y?d=y:d>l&&(d=l),{side:a?"top":"bottom",alignOffset:d-e.left,style:{width:c}}}function zt(e,t){return(e==null?void 0:e.side)===t.side&&e.alignOffset===t.alignOffset&&e.style.width===t.style.width}function rt({open:e,estimatedHeight:t,triggerRef:a,contentRef:o}){const[c,y]=B(null),l=$(null),d=K(()=>{var p,N,D;const w=(p=a.current)==null?void 0:p.getBoundingClientRect();if(!w)return;const u=(D=(N=o.current)==null?void 0:N.offsetHeight)!=null?D:t,Y=Tt(w,u);y(f=>zt(f,Y)?f:Y)},[o,t,a]),m=K(()=>{l.current===null&&(l.current=window.requestAnimationFrame(()=>{l.current=null,d()}))},[d]);re(()=>{if(!e){y(null);return}return window.addEventListener("scroll",m,{passive:!0,capture:!0}),window.addEventListener("resize",m),()=>{window.removeEventListener("scroll",m,{capture:!0}),window.removeEventListener("resize",m),l.current!==null&&(window.cancelAnimationFrame(l.current),l.current=null)}},[e,m]);const x=K(p=>{p&&d()},[d]);return{placement:c,updatePosition:d,measureContent:x}}const nt=new Intl.DateTimeFormat("pt-BR",{day:"numeric",month:"long",year:"numeric"}),Rt=new Intl.DateTimeFormat("pt-BR",{month:"long"}),it=Array.from({length:12},(e,t)=>({value:t,label:Rt.format(new Date(2e3,t,1))})),At=['[data-slot="date-picker-day"][aria-pressed="true"]:not(:disabled)','[data-slot="date-picker-day"][data-today]:not(:disabled)','[data-slot="date-picker-day"]:not(:disabled)'];function Mt(e){if(!e)return null;for(const t of At){const a=e.querySelector(t);if(a)return a}return null}function ot({open:e,setOpen:t,viewMonthTime:a,targetMonthTime:o,contentRef:c,triggerRef:y}){const l=$(!0),d=K(()=>{var p,N,D;const w=(N=(p=c.current)==null?void 0:p.contains(document.activeElement))!=null?N:!1;t(!1),w&&((D=y.current)==null||D.focus())},[c,t,y]),m=K(()=>{if(!l.current||a!==o)return;const p=Mt(c.current);p&&(l.current=!1,p.focus({preventScroll:!0}))},[a,o,c]),x=K(p=>{p.preventDefault(),m()},[m]);return re(()=>{if(!e){l.current=!0;return}m()},[e,m]),{closeAndRestoreFocus:d,handleOpenAutoFocus:x}}const Ot={ArrowLeft:e=>ne(e,-1),ArrowRight:e=>ne(e,1),ArrowUp:e=>ne(e,-7),ArrowDown:e=>ne(e,7),Home:e=>ne(e,-e.getDay()),End:e=>ne(e,6-e.getDay())};function Ft(e,t,a,o){const c=new Date(t.start,0,1),y=new Date(t.end,11,31),l=a&&ke(a,c)?a:c,d=o&&ge(o,y)?o:y;return ge(e,l)?L(l):ke(e,d)?L(d):e}function st({open:e,viewMonth:t,setViewMonth:a,preferredDays:o,isDayDisabled:c,yearRange:y,min:l,max:d}){var m;const[x,p]=B(null),N=$([]),D=$(!1),w=t.getTime(),u=h=>!!h&&Ue(h,t)&&!c(h),Y=new Date(t.getFullYear(),t.getMonth()+1,0).getDate(),f=Array.from({length:Y},(h,C)=>new Date(t.getFullYear(),t.getMonth(),C+1)),U=(m=[x===null?null:new Date(x),...o,L(new Date)].find(u))!=null?m:f.find(u),oe=h=>({ref:C=>{N.current[h.getDate()]=C},tabIndex:U&&G(h,U)?0:-1,onFocus:()=>p(h.getTime()),onKeyDown:C=>{const Q=Ot[C.key];if(!Q)return;C.preventDefault();const v=Ft(Q(h),y,l,d);G(v,h)||(D.current=!0,p(v.getTime()),Ue(v,t)||a(ie(v)))}});return re(()=>{e||p(null)},[e]),re(()=>{var h;!D.current||x===null||(D.current=!1,(h=N.current[new Date(x).getDate()])==null||h.focus())},[x,w]),{getDayNavigationProps:oe}}function Pt(e){var t=e,{value:a,defaultValue:o=null,onValueChange:c,placeholder:y="Selecione uma data",disabled:l,min:d,max:m,format:x=et,className:p,inputClassName:N,contentClassName:D,size:w="lg",yearRange:u=Ge,showYearSelector:Y=!0,invalid:f=!1,children:U}=t,oe=me(t,["value","defaultValue","onValueChange","placeholder","disabled","min","max","format","className","inputClassName","contentClassName","size","yearRange","showYearSelector","invalid","children"]);const h=a!==void 0,[C,Q]=B(o),v=h?a:C,[k,pe]=B(!1),[n,b]=B(()=>ie(Se(v!=null?v:new Date,u))),X=$(null),z=$(null),M=Qe(),{placement:R,updatePosition:se,measureContent:fe}=rt({open:k,estimatedHeight:wt,triggerRef:X,contentRef:z}),j=Ie(z,fe),le=K(s=>{h||Q(s),c==null||c(s)},[h,c]),{closeAndRestoreFocus:de,handleOpenAutoFocus:Te}=ot({open:k,setOpen:pe,viewMonthTime:n.getTime(),targetMonthTime:we(v,u).getTime(),contentRef:z,triggerRef:X}),O=v==null?void 0:v.getTime(),{start:J,end:he}=u,ce=s=>{s&&se(),pe(s)},ee=L(new Date),F=n.getFullYear(),_=n.getMonth(),te=new Date(F,_,1),V=new Date(F,_+1,0).getDate(),q=te.getDay(),ue=v?x(v):"",ve=s=>!!l||De(s,d,m),{getDayNavigationProps:ze}=st({open:k,viewMonth:n,setViewMonth:b,preferredDays:[v],isDayDisabled:ve,yearRange:u,min:d,max:m}),Re=Array.from({length:u.end-u.start+1},(s,W)=>u.start+W),Ae=n.getTime()<=Xe(u,d).getTime(),Me=n.getTime()>=Je(u,m).getTime(),Oe=s=>{b(new Date(F,s,1))},Fe=s=>{b(new Date(s,_,1))};return re(()=>{k&&b(we(O===void 0?null:new Date(O),{start:J,end:he}))},[k,O,J,he]),g(Ee.Provider,{value:Ke(()=>({invalid:f}),[f]),children:[r(H.Root,{open:k,onOpenChange:ce,children:g("div",{className:T("relative inline-flex w-full min-w-0",p),children:[r(H.Trigger,{asChild:!0,children:g("button",Z(S(Z(S({ref:X,type:"button",disabled:l,"aria-haspopup":"dialog","aria-expanded":k,"aria-controls":k?M:void 0,"aria-invalid":f||void 0,"data-invalid":f||void 0,"data-slot":"date-picker-trigger","data-size":w,"data-state":k?"open":"closed"},!ue&&{"data-placeholder":""}),{className:T(Le({size:w}),!f&&(ue||k)&&"border-gray-stroke-emphasis enabled:hover:border-gray-stroke-emphasis",k&&!f&&"ring-4 ring-state-focus enabled:hover:ring-state-focus",k&&f&&"ring-4 ring-state-error",N)}),oe),{children:[r("span",{className:"truncate",children:ue||y}),r(He,{size:w==="md"?at:tt,strokeWidth:1.6,className:"shrink-0 !text-gray-foreground","aria-hidden":"true"})]}))}),r(H.Portal,{children:g(H.Content,{ref:j,id:M,"aria-label":"Calend\xE1rio","data-slot":"date-picker-content",side:R==null?void 0:R.side,align:"start",sideOffset:Ye,alignOffset:R==null?void 0:R.alignOffset,avoidCollisions:!1,style:R==null?void 0:R.style,onOpenAutoFocus:Te,onEscapeKeyDown:de,className:T("z-50 overflow-hidden rounded-md border border-gray-stroke-muted bg-surface-elevated p-3 text-gray-foreground shadow-level-3 outline-none",D),children:[g("div",{className:"mb-3 flex items-center justify-center gap-2",children:[r(I,{variant:"regular-basic",size:"sm",iconLeft:r(Be,{strokeWidth:1.8}),className:Ne,onClick:()=>b(s=>xe(s,-1)),disabled:Ae,"aria-label":"M\xEAs anterior"}),g("div",{className:"flex items-center gap-2",children:[g("div",{className:"relative",children:[r("select",{value:_,onChange:s=>Oe(Number(s.target.value)),className:"min-w-[7rem] appearance-none rounded-md border border-gray-stroke-muted bg-surface-card py-1 pl-2 pr-7 text-sm font-medium capitalize text-gray-foreground outline-none hover:border-gray-stroke-emphasis focus:border-gray-stroke-emphasis focus-visible:ring-4 focus-visible:ring-state-focus max-md:min-w-[8rem] max-md:py-2 max-md:text-md","aria-label":"Selecionar m\xEAs",children:it.map(s=>r("option",{value:s.value,className:"capitalize",children:s.label},s.value))}),r(be,{size:14,strokeWidth:1.8,className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-gray-foreground","aria-hidden":!0})]}),Y?g("div",{className:"relative",children:[r("select",{value:F,onChange:s=>Fe(Number(s.target.value)),className:"min-w-[5rem] appearance-none rounded-md border border-gray-stroke-muted bg-surface-card py-1 pl-2 pr-7 text-sm font-medium text-gray-foreground outline-none hover:border-gray-stroke-emphasis focus:border-gray-stroke-emphasis focus-visible:ring-4 focus-visible:ring-state-focus max-md:min-w-[5.5rem] max-md:py-2 max-md:text-md","aria-label":"Selecionar ano",children:Re.map(s=>r("option",{value:s,children:s},s))}),r(be,{size:14,strokeWidth:1.8,className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-gray-foreground","aria-hidden":!0})]}):r("div",{className:"text-sm font-semibold text-gray-foreground",children:F})]}),r(I,{variant:"regular-basic",size:"sm",iconLeft:r($e,{strokeWidth:1.8}),className:Ne,onClick:()=>b(s=>xe(s,1)),disabled:Me,"aria-label":"Pr\xF3ximo m\xEAs"})]}),g("div",{className:"grid grid-cols-7 gap-1 text-center text-xs font-medium text-gray-foreground-muted max-md:text-sm",children:[r("div",{children:"Dom"}),r("div",{children:"Seg"}),r("div",{children:"Ter"}),r("div",{children:"Qua"}),r("div",{children:"Qui"}),r("div",{children:"Sex"}),r("div",{children:"S\xE1b"})]}),g("div",{className:"mt-2 grid grid-cols-7 gap-1",children:[Array.from({length:q}).map((s,W)=>r("div",{},`empty-${W}`)),Array.from({length:V}).map((s,W)=>{const P=new Date(F,_,W+1),ae=v?G(P,v):!1,i=G(P,ee);return r("button",Z(S({},ze(P)),{type:"button","data-slot":"date-picker-day","data-today":i||void 0,"aria-current":i?"date":void 0,"aria-label":nt.format(P),disabled:ve(P),onClick:()=>{le(P),de()},className:T("relative inline-flex h-9 w-full items-center justify-center rounded-md text-sm font-medium outline-none transition-colors hover:bg-secondary-background-soft-emphasis focus-visible:z-10 focus-visible:ring-4 focus-visible:ring-state-focus disabled:pointer-events-none disabled:opacity-50 max-md:h-11 max-md:text-md",i&&"ring-1 ring-gray-stroke-emphasis",ae&&"bg-primary-background-fill text-primary-foreground-onfill hover:bg-primary-background-fill-emphasis"),"aria-pressed":ae,children:W+1}),P.toISOString())})]}),g("div",{className:"mt-3 flex items-center justify-between gap-2",children:[r(I,{variant:"regular-basic",size:"sm",className:Ce,onClick:()=>{le(ee),de()},disabled:l||De(ee,d,m),children:"Hoje"}),r(I,{variant:"regular-basic",size:"sm",className:Ce,onClick:()=>le(null),disabled:l||!v,children:"Limpar"})]})]})})]})}),U]})}function Et(e){var t=e,{value:a,defaultValue:o=null,onValueChange:c,placeholder:y="Selecionar per\xEDodo",disabled:l,min:d,max:m,format:x=et,className:p,inputClassName:N,contentClassName:D,size:w="lg",yearRange:u=Ge,showYearSelector:Y=!0,invalid:f=!1,children:U}=t,oe=me(t,["value","defaultValue","onValueChange","placeholder","disabled","min","max","format","className","inputClassName","contentClassName","size","yearRange","showYearSelector","invalid","children"]),h,C,Q;const v=a!==void 0,[k,pe]=B(o),n=v?a:k,[b,X]=B(!1),[z,M]=B(()=>{var i,E;return ie(Se((E=(i=n==null?void 0:n.start)!=null?i:n==null?void 0:n.end)!=null?E:new Date,u))}),R=$(null),se=$(null),fe=Qe(),{placement:j,updatePosition:le,measureContent:de}=rt({open:b,estimatedHeight:kt,triggerRef:R,contentRef:se}),Te=Ie(se,de),O=K(i=>{v||pe(i),c==null||c(i)},[v,c]),{closeAndRestoreFocus:J,handleOpenAutoFocus:he}=ot({open:b,setOpen:X,viewMonthTime:z.getTime(),targetMonthTime:we((h=n==null?void 0:n.start)!=null?h:n==null?void 0:n.end,u).getTime(),contentRef:se,triggerRef:R}),ce=(Q=(C=n==null?void 0:n.start)!=null?C:n==null?void 0:n.end)==null?void 0:Q.getTime(),{start:ee,end:F}=u,_=i=>{i&&le(),X(i)},te=L(new Date),V=z.getFullYear(),q=z.getMonth(),ue=new Date(V,q,1),ve=new Date(V,q+1,0).getDate(),ze=ue.getDay(),Re=Array.from({length:u.end-u.start+1},(i,E)=>u.start+E),Ae=z.getTime()<=Xe(u,d).getTime(),Me=z.getTime()>=Je(u,m).getTime(),Oe=i=>{M(new Date(V,i,1))},Fe=i=>{M(new Date(i,q,1))},s=i=>!!l||De(i,d,m),{getDayNavigationProps:W}=st({open:b,viewMonth:z,setViewMonth:M,preferredDays:[n==null?void 0:n.start,n==null?void 0:n.end],isDayDisabled:s,yearRange:u,min:d,max:m}),P=i=>{s(i)||(!n||!n.start||n.end?O({start:i,end:null}):(ge(i,n.start)?O({start:i,end:n.start}):O({start:n.start,end:i}),J()))},ae=n!=null&&n.start&&n!=null&&n.end?`${x(n.start)} - ${x(n.end)}`:n!=null&&n.start?x(n.start):"";return re(()=>{b&&M(we(ce===void 0?null:new Date(ce),{start:ee,end:F}))},[b,ce,ee,F]),g(Ee.Provider,{value:Ke(()=>({invalid:f}),[f]),children:[r(H.Root,{open:b,onOpenChange:_,children:g("div",{className:T("relative inline-flex w-full min-w-0",p),children:[r(H.Trigger,{asChild:!0,children:g("button",Z(S(Z(S({ref:R,type:"button",disabled:l,"aria-haspopup":"dialog","aria-expanded":b,"aria-controls":b?fe:void 0,"aria-invalid":f||void 0,"data-invalid":f||void 0,"data-slot":"date-picker-trigger","data-size":w,"data-state":b?"open":"closed"},!ae&&{"data-placeholder":""}),{className:T(Le({size:w}),!f&&(ae||b)&&"border-gray-stroke-emphasis enabled:hover:border-gray-stroke-emphasis",b&&!f&&"ring-4 ring-state-focus enabled:hover:ring-state-focus",b&&f&&"ring-4 ring-state-error",N)}),oe),{children:[r("span",{className:"truncate",children:ae||y}),r(He,{size:w==="md"?at:tt,strokeWidth:1.6,className:"shrink-0 !text-gray-foreground","aria-hidden":"true"})]}))}),r(H.Portal,{children:g(H.Content,{ref:Te,id:fe,"aria-label":"Calend\xE1rio","data-slot":"date-picker-content",side:j==null?void 0:j.side,align:"start",sideOffset:Ye,alignOffset:j==null?void 0:j.alignOffset,avoidCollisions:!1,style:j==null?void 0:j.style,onOpenAutoFocus:he,onEscapeKeyDown:J,className:T("z-50 overflow-hidden rounded-md border border-gray-stroke-muted bg-surface-elevated p-3 text-gray-foreground shadow-level-3 outline-none",D),children:[g("div",{className:"mb-3 flex items-center justify-center gap-2",children:[r(I,{variant:"regular-basic",size:"sm",iconLeft:r(Be,{strokeWidth:1.8}),className:Ne,onClick:()=>M(i=>xe(i,-1)),disabled:Ae,"aria-label":"M\xEAs anterior"}),g("div",{className:"flex items-center gap-2",children:[g("div",{className:"relative",children:[r("select",{value:q,onChange:i=>Oe(Number(i.target.value)),className:"min-w-[7rem] appearance-none rounded-md border border-gray-stroke-muted bg-surface-card py-1 pl-2 pr-7 text-sm font-medium capitalize text-gray-foreground outline-none hover:border-gray-stroke-emphasis focus:border-gray-stroke-emphasis focus-visible:ring-4 focus-visible:ring-state-focus max-md:min-w-[8rem] max-md:py-2 max-md:text-md","aria-label":"Selecionar m\xEAs",children:it.map(i=>r("option",{value:i.value,className:"capitalize",children:i.label},i.value))}),r(be,{size:14,strokeWidth:1.8,className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-gray-foreground","aria-hidden":!0})]}),Y?g("div",{className:"relative",children:[r("select",{value:V,onChange:i=>Fe(Number(i.target.value)),className:"min-w-[5rem] appearance-none rounded-md border border-gray-stroke-muted bg-surface-card py-1 pl-2 pr-7 text-sm font-medium text-gray-foreground outline-none hover:border-gray-stroke-emphasis focus:border-gray-stroke-emphasis focus-visible:ring-4 focus-visible:ring-state-focus max-md:min-w-[5.5rem] max-md:py-2 max-md:text-md","aria-label":"Selecionar ano",children:Re.map(i=>r("option",{value:i,children:i},i))}),r(be,{size:14,strokeWidth:1.8,className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-gray-foreground","aria-hidden":!0})]}):r("div",{className:"text-sm font-semibold text-gray-foreground",children:V})]}),r(I,{variant:"regular-basic",size:"sm",iconLeft:r($e,{strokeWidth:1.8}),className:Ne,onClick:()=>M(i=>xe(i,1)),disabled:Me,"aria-label":"Pr\xF3ximo m\xEAs"})]}),g("div",{className:"grid grid-cols-7 gap-1 text-center text-xs font-medium text-gray-foreground-muted max-md:text-sm",children:[r("div",{children:"Dom"}),r("div",{children:"Seg"}),r("div",{children:"Ter"}),r("div",{children:"Qua"}),r("div",{children:"Qui"}),r("div",{children:"Sex"}),r("div",{children:"S\xE1b"})]}),g("div",{className:"mt-2 grid grid-cols-7 gap-1",children:[Array.from({length:ze}).map((i,E)=>r("div",{},`empty-${E}`)),Array.from({length:ve}).map((i,E)=>{const A=new Date(V,q,E+1),Ve=(n==null?void 0:n.start)&&G(A,n.start),We=(n==null?void 0:n.end)&&G(A,n.end),lt=(n==null?void 0:n.start)&&(n==null?void 0:n.end)&&ke(A,n.start)&&ge(A,n.end),Pe=G(A,te);return r("button",Z(S({},W(A)),{type:"button","data-slot":"date-picker-day","data-today":Pe||void 0,"aria-current":Pe?"date":void 0,"aria-label":nt.format(A),disabled:s(A),onClick:()=>P(A),className:T("relative inline-flex h-9 w-full items-center justify-center rounded-md text-sm font-medium outline-none transition-colors hover:bg-secondary-background-soft-emphasis focus-visible:z-10 focus-visible:ring-4 focus-visible:ring-state-focus disabled:pointer-events-none disabled:opacity-50 max-md:h-11 max-md:text-md",Pe&&"ring-1 ring-gray-stroke-emphasis",lt&&"bg-primary-background-soft",(Ve||We)&&"bg-primary-background-fill text-primary-foreground-onfill hover:bg-primary-background-fill-emphasis"),"aria-pressed":Ve||We||void 0,children:E+1}),A.toISOString())})]}),g("div",{className:"mt-3 flex items-center justify-between gap-2",children:[r(I,{variant:"regular-basic",size:"sm",className:Ce,onClick:()=>{O({start:te,end:te}),J()},disabled:l||De(te,d,m),children:"Hoje"}),r(I,{variant:"regular-basic",size:"sm",className:Ce,onClick:()=>O(null),disabled:l||!n,children:"Limpar"})]})]})})]})}),U]})}export{Pt as DatePicker,yt as DatePickerLabel,xt as DatePickerText,bt as DatePickerWrapper,Et as DateRangePicker,Le as datePickerTriggerVariants};
|
|
@@ -11,11 +11,10 @@ interface DialogContainerProps extends ComponentProps<typeof DialogPrimitive.Con
|
|
|
11
11
|
closeLabel?: string;
|
|
12
12
|
}
|
|
13
13
|
declare function DialogContainer({ className, overlayClassName, children, showCloseButton, closeLabel, ...props }: DialogContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
|
|
14
|
+
interface DialogContentProps extends ComponentProps<"div"> {
|
|
15
15
|
containerClassName?: string;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
}
|
|
17
|
+
declare function DialogContent({ containerClassName, className, ...props }: DialogContentProps): import("react/jsx-runtime").JSX.Element;
|
|
19
18
|
interface DialogHeaderProps extends ComponentProps<"div"> {
|
|
20
19
|
separator?: boolean;
|
|
21
20
|
}
|
|
@@ -31,5 +30,4 @@ interface DialogTitleProps extends ComponentProps<typeof DialogPrimitive.Title>
|
|
|
31
30
|
declare function DialogTitle({ className, iconLeft, iconRight, children, ...props }: DialogTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
32
31
|
declare function DialogDescription({ className, ...props }: ComponentProps<typeof DialogPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
|
|
33
32
|
export { Dialog, DialogClose, DialogContainer, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
34
|
-
export type { DialogContainerProps, DialogFooterProps, DialogHeaderProps, DialogTitleProps, };
|
|
35
|
-
//# sourceMappingURL=Dialog.d.ts.map
|
|
33
|
+
export type { DialogContainerProps, DialogContentProps, DialogFooterProps, DialogHeaderProps, DialogTitleProps, };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
-
"use strict";var
|
|
4
|
-
//# sourceMappingURL=Dialog.js.map
|
|
3
|
+
"use strict";var l=require("react/jsx-runtime"),i=require("radix-ui"),m=require("react"),h=require("./Dismiss.js"),j=require("./Separator.js"),n=require("../lib/utils.js"),z=Object.defineProperty,S=Object.defineProperties,q=Object.getOwnPropertyDescriptors,f=Object.getOwnPropertySymbols,D=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,b=(e,a,t)=>a in e?z(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,s=(e,a)=>{for(var t in a||(a={}))D.call(a,t)&&b(e,t,a[t]);if(f)for(var t of f(a))y.call(a,t)&&b(e,t,a[t]);return e},w=(e,a)=>S(e,q(a)),d=(e,a)=>{var t={};for(var o in e)D.call(e,o)&&a.indexOf(o)<0&&(t[o]=e[o]);if(e!=null&&f)for(var o of f(e))a.indexOf(o)<0&&y.call(e,o)&&(t[o]=e[o]);return t};const C=m.createContext(!1);function R(e){var a=d(e,[]);return l.jsx(i.Dialog.Root,s({"data-slot":"dialog"},a))}const k=m.forwardRef(function(e,a){return l.jsx(i.Dialog.Trigger,s({ref:a,"data-slot":"dialog-trigger"},e))});function O(e){var a=d(e,[]);return l.jsx(i.Dialog.Portal,s({"data-slot":"dialog-portal"},a))}const L=m.forwardRef(function(e,a){return l.jsx(i.Dialog.Close,s({ref:a,"data-slot":"dialog-close"},e))});function P(e){var a=e,{className:t}=a,o=d(a,["className"]);return l.jsx(i.Dialog.Overlay,s({"data-slot":"dialog-overlay",className:n.cn("fixed inset-0 z-50 bg-backdrop data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 motion-reduce:!animate-none",t)},o))}function T(e){var a=e,{className:t,overlayClassName:o,children:r,showCloseButton:c=!0,closeLabel:p="Fechar"}=a,u=d(a,["className","overlayClassName","children","showCloseButton","closeLabel"]);return l.jsxs(O,{"data-slot":"dialog-portal",children:[l.jsx(P,{className:n.cn("modal-overlay",o)}),l.jsxs(i.Dialog.Content,w(s({"data-slot":"dialog-container",className:n.cn("modal-overlay fixed left-1/2 top-1/2 z-50 flex max-h-[calc(100%-2rem)] w-full max-w-[568px] -translate-x-1/2 -translate-y-1/2 flex-col gap-0 overflow-y-auto rounded-lg bg-surface-elevated p-0 shadow-level-5 duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-1/2 data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-1/2 motion-reduce:!animate-none md:max-h-[85vh]","max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:max-w-none max-md:translate-x-0 max-md:translate-y-0 max-md:rounded-b-none max-md:data-[state=closed]:zoom-out-100 max-md:data-[state=open]:zoom-in-100 max-md:data-[state=closed]:slide-out-to-bottom max-md:data-[state=closed]:slide-out-to-left-0 max-md:data-[state=open]:slide-in-from-bottom max-md:data-[state=open]:slide-in-from-left-0",t)},u),{children:[l.jsx("div",{"aria-hidden":!0,"data-slot":"dialog-handle",className:"absolute left-1/2 top-[13px] h-[3px] w-[98px] -translate-x-1/2 rounded-pill bg-gray-stroke md:hidden"}),l.jsx(C.Provider,{value:c,children:r}),c&&l.jsx(i.Dialog.Close,{"data-slot":"dialog-close",asChild:!0,children:l.jsx(h.Dismiss,{label:p,className:h.DISMISS_PANEL_POSITION})})]}))]})}function I(e){var a=e,{containerClassName:t,className:o}=a,r=d(a,["containerClassName","className"]);return l.jsx("div",{className:n.cn("mb-auto overflow-y-auto",t),children:l.jsx("div",s({"data-slot":"dialog-content",className:n.cn("px-8 py-6 text-md leading-md text-primary-foreground",o)},r))})}function E(e){var a=e,{className:t,separator:o=!1}=a,r=d(a,["className","separator"]);const c=m.useContext(C);return l.jsxs(l.Fragment,{children:[l.jsx("div",s({"data-slot":"dialog-header",className:n.cn("flex flex-col gap-2 px-8 py-6 text-left",c&&"pr-14",t)},r)),o&&l.jsx(j.Separator,{})]})}function F(e){var a=e,{className:t,separator:o=!1}=a,r=d(a,["className","separator"]);return l.jsxs(l.Fragment,{children:[o&&l.jsx(j.Separator,{}),l.jsx("div",s({"data-slot":"dialog-footer",className:n.cn("flex justify-end gap-2 px-8 py-6",t)},r))]})}function W(e){var a=e,{className:t,iconLeft:o,iconRight:r,children:c}=a,p=d(a,["className","iconLeft","iconRight","children"]);const u=g=>{var v,N;if(m.isValidElement(g)){const x=g;return m.cloneElement(x,{size:(v=x.props.size)!=null?v:32,strokeWidth:(N=x.props.strokeWidth)!=null?N:2.2,className:n.cn("flex-shrink-0",x.props.className)})}return g};return l.jsxs(i.Dialog.Title,w(s({"data-slot":"dialog-title",className:n.cn("flex items-center gap-3 text-title-md font-semibold leading-title-md !text-content-title",t)},p),{children:[o&&u(o),c,r&&u(r)]}))}function _(e){var a=e,{className:t}=a,o=d(a,["className"]);return l.jsx(i.Dialog.Description,s({"data-slot":"dialog-description",className:n.cn("text-md leading-md text-content-paragraph",t)},o))}exports.Dialog=R,exports.DialogClose=L,exports.DialogContainer=T,exports.DialogContent=I,exports.DialogDescription=_,exports.DialogFooter=F,exports.DialogHeader=E,exports.DialogOverlay=P,exports.DialogPortal=O,exports.DialogTitle=W,exports.DialogTrigger=k;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
-
import{jsx as
|
|
4
|
-
//# sourceMappingURL=Dialog.mjs.map
|
|
3
|
+
import{jsx as l,jsxs as c,Fragment as N}from"react/jsx-runtime";import{Dialog as i}from"radix-ui";import{createContext as k,forwardRef as y,useContext as I,isValidElement as L,cloneElement as S}from"react";import{Dismiss as T,DISMISS_PANEL_POSITION as R}from"./Dismiss.mjs";import{Separator as b}from"./Separator.mjs";import{cn as n}from"../lib/utils.mjs";var E=Object.defineProperty,F=Object.defineProperties,W=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertySymbols,D=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable,w=(e,a,t)=>a in e?E(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,s=(e,a)=>{for(var t in a||(a={}))D.call(a,t)&&w(e,t,a[t]);if(u)for(var t of u(a))C.call(a,t)&&w(e,t,a[t]);return e},O=(e,a)=>F(e,W(a)),d=(e,a)=>{var t={};for(var o in e)D.call(e,o)&&a.indexOf(o)<0&&(t[o]=e[o]);if(e!=null&&u)for(var o of u(e))a.indexOf(o)<0&&C.call(e,o)&&(t[o]=e[o]);return t};const P=k(!1);function _(e){var a=d(e,[]);return l(i.Root,s({"data-slot":"dialog"},a))}const A=y(function(e,a){return l(i.Trigger,s({ref:a,"data-slot":"dialog-trigger"},e))});function j(e){var a=d(e,[]);return l(i.Portal,s({"data-slot":"dialog-portal"},a))}const B=y(function(e,a){return l(i.Close,s({ref:a,"data-slot":"dialog-close"},e))});function z(e){var a=e,{className:t}=a,o=d(a,["className"]);return l(i.Overlay,s({"data-slot":"dialog-overlay",className:n("fixed inset-0 z-50 bg-backdrop data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 motion-reduce:!animate-none",t)},o))}function M(e){var a=e,{className:t,overlayClassName:o,children:r,showCloseButton:m=!0,closeLabel:g="Fechar"}=a,f=d(a,["className","overlayClassName","children","showCloseButton","closeLabel"]);return c(j,{"data-slot":"dialog-portal",children:[l(z,{className:n("modal-overlay",o)}),c(i.Content,O(s({"data-slot":"dialog-container",className:n("modal-overlay fixed left-1/2 top-1/2 z-50 flex max-h-[calc(100%-2rem)] w-full max-w-[568px] -translate-x-1/2 -translate-y-1/2 flex-col gap-0 overflow-y-auto rounded-lg bg-surface-elevated p-0 shadow-level-5 duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-1/2 data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-1/2 motion-reduce:!animate-none md:max-h-[85vh]","max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:max-w-none max-md:translate-x-0 max-md:translate-y-0 max-md:rounded-b-none max-md:data-[state=closed]:zoom-out-100 max-md:data-[state=open]:zoom-in-100 max-md:data-[state=closed]:slide-out-to-bottom max-md:data-[state=closed]:slide-out-to-left-0 max-md:data-[state=open]:slide-in-from-bottom max-md:data-[state=open]:slide-in-from-left-0",t)},f),{children:[l("div",{"aria-hidden":!0,"data-slot":"dialog-handle",className:"absolute left-1/2 top-[13px] h-[3px] w-[98px] -translate-x-1/2 rounded-pill bg-gray-stroke md:hidden"}),l(P.Provider,{value:m,children:r}),m&&l(i.Close,{"data-slot":"dialog-close",asChild:!0,children:l(T,{label:g,className:R})})]}))]})}function V(e){var a=e,{containerClassName:t,className:o}=a,r=d(a,["containerClassName","className"]);return l("div",{className:n("mb-auto overflow-y-auto",t),children:l("div",s({"data-slot":"dialog-content",className:n("px-8 py-6 text-md leading-md text-primary-foreground",o)},r))})}function q(e){var a=e,{className:t,separator:o=!1}=a,r=d(a,["className","separator"]);const m=I(P);return c(N,{children:[l("div",s({"data-slot":"dialog-header",className:n("flex flex-col gap-2 px-8 py-6 text-left",m&&"pr-14",t)},r)),o&&l(b,{})]})}function G(e){var a=e,{className:t,separator:o=!1}=a,r=d(a,["className","separator"]);return c(N,{children:[o&&l(b,{}),l("div",s({"data-slot":"dialog-footer",className:n("flex justify-end gap-2 px-8 py-6",t)},r))]})}function H(e){var a=e,{className:t,iconLeft:o,iconRight:r,children:m}=a,g=d(a,["className","iconLeft","iconRight","children"]);const f=x=>{var v,h;if(L(x)){const p=x;return S(p,{size:(v=p.props.size)!=null?v:32,strokeWidth:(h=p.props.strokeWidth)!=null?h:2.2,className:n("flex-shrink-0",p.props.className)})}return x};return c(i.Title,O(s({"data-slot":"dialog-title",className:n("flex items-center gap-3 text-title-md font-semibold leading-title-md !text-content-title",t)},g),{children:[o&&f(o),m,r&&f(r)]}))}function J(e){var a=e,{className:t}=a,o=d(a,["className"]);return l(i.Description,s({"data-slot":"dialog-description",className:n("text-md leading-md text-content-paragraph",t)},o))}export{_ as Dialog,B as DialogClose,M as DialogContainer,V as DialogContent,J as DialogDescription,G as DialogFooter,q as DialogHeader,z as DialogOverlay,j as DialogPortal,H as DialogTitle,A as DialogTrigger};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import { type ComponentProps } from "react";
|
|
3
|
+
interface DismissProps extends ComponentProps<"button">, VariantProps<typeof dismissVariants> {
|
|
4
|
+
label?: string;
|
|
5
|
+
}
|
|
6
|
+
declare const DISMISS_PANEL_POSITION = "absolute right-[18px] top-[18px]";
|
|
7
|
+
declare const dismissVariants: (props?: ({
|
|
8
|
+
size?: "sm" | "md" | null | undefined;
|
|
9
|
+
} & ({ class: import("clsx").ClassValue; className?: never } | { class?: never; className: import("clsx").ClassValue } | { class?: never; className?: never })) | undefined) => string;
|
|
10
|
+
declare const Dismiss: import("react").ForwardRefExoticComponent<Omit<DismissProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
export { Dismiss, DISMISS_PANEL_POSITION, dismissVariants };
|
|
12
|
+
export type { DismissProps };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
"use strict";var n=require("react/jsx-runtime"),b=require("@medway-ui/icons"),g=require("class-variance-authority"),y=require("react"),m=require("../lib/utils.js"),h=Object.defineProperty,O=Object.defineProperties,x=Object.getOwnPropertyDescriptors,t=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,u=(e,r,i)=>r in e?h(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i,j=(e,r)=>{for(var i in r||(r={}))o.call(r,i)&&u(e,i,r[i]);if(t)for(var i of t(r))l.call(r,i)&&u(e,i,r[i]);return e},z=(e,r)=>O(e,x(r)),P=(e,r)=>{var i={};for(var a in e)o.call(e,a)&&r.indexOf(a)<0&&(i[a]=e[a]);if(e!=null&&t)for(var a of t(e))r.indexOf(a)<0&&l.call(e,a)&&(i[a]=e[a]);return i};const I="absolute right-[18px] top-[18px]",c=g.cva("inline-flex shrink-0 items-center justify-center rounded-circular text-gray-foreground transition-colors hover:cursor-pointer hover:bg-gray-background-soft hover:text-gray-foreground-emphasis focus:outline-0 focus-visible:ring-4 focus-visible:ring-state-focus disabled:pointer-events-none disabled:text-gray-foreground-muted [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{size:{sm:"size-7 p-1.5 [&_svg]:size-4",md:"size-10 p-2.5 [&_svg]:size-5"}},defaultVariants:{size:"sm"}}),_=y.forwardRef(function(e,r){var i=e,{size:a,label:v="Fechar",type:f="button",className:d,children:s}=i,p=P(i,["size","label","type","className","children"]);return n.jsx("button",z(j({ref:r,type:f,"data-slot":"dismiss","aria-label":v,className:m.cn(c({size:a}),d)},p),{children:s!=null?s:n.jsx(b.CloseMd,{})}))});exports.DISMISS_PANEL_POSITION=I,exports.Dismiss=_,exports.dismissVariants=c;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
import{jsx as s}from"react/jsx-runtime";import{CloseMd as d}from"@medway-ui/icons";import{cva as b}from"class-variance-authority";import{forwardRef as g}from"react";import{cn as y}from"../lib/utils.mjs";var h=Object.defineProperty,O=Object.defineProperties,x=Object.getOwnPropertyDescriptors,t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,c=(e,r,i)=>r in e?h(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i,z=(e,r)=>{for(var i in r||(r={}))n.call(r,i)&&c(e,i,r[i]);if(t)for(var i of t(r))l.call(r,i)&&c(e,i,r[i]);return e},j=(e,r)=>O(e,x(r)),P=(e,r)=>{var i={};for(var o in e)n.call(e,o)&&r.indexOf(o)<0&&(i[o]=e[o]);if(e!=null&&t)for(var o of t(e))r.indexOf(o)<0&&l.call(e,o)&&(i[o]=e[o]);return i};const I="absolute right-[18px] top-[18px]",f=b("inline-flex shrink-0 items-center justify-center rounded-circular text-gray-foreground transition-colors hover:cursor-pointer hover:bg-gray-background-soft hover:text-gray-foreground-emphasis focus:outline-0 focus-visible:ring-4 focus-visible:ring-state-focus disabled:pointer-events-none disabled:text-gray-foreground-muted [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{size:{sm:"size-7 p-1.5 [&_svg]:size-4",md:"size-10 p-2.5 [&_svg]:size-5"}},defaultVariants:{size:"sm"}}),_=g(function(e,r){var i=e,{size:o,label:u="Fechar",type:p="button",className:m,children:a}=i,v=P(i,["size","label","type","className","children"]);return s("button",j(z({ref:r,type:p,"data-slot":"dismiss","aria-label":u,className:y(f({size:o}),m)},v),{children:a!=null?a:s(d,{})}))});export{I as DISMISS_PANEL_POSITION,_ as Dismiss,f as dismissVariants};
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { type ComponentProps } from "react";
|
|
1
|
+
import { type ComponentProps, type ComponentPropsWithoutRef } from "react";
|
|
2
2
|
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
|
|
3
|
+
type DropdownMenuSize = "sm" | "md" | "lg";
|
|
3
4
|
declare function DropdownMenu({ ...props }: ComponentProps<typeof DropdownMenuPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
5
|
declare function DropdownMenuPortal({ ...props }: ComponentProps<typeof DropdownMenuPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
5
6
|
declare const DropdownMenuTrigger: import("react").ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuTriggerProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
6
|
-
|
|
7
|
+
interface DropdownMenuContentProps extends ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content> {
|
|
8
|
+
size?: DropdownMenuSize;
|
|
9
|
+
}
|
|
10
|
+
declare const DropdownMenuContent: import("react").ForwardRefExoticComponent<DropdownMenuContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
7
11
|
declare function DropdownMenuGroup({ ...props }: ComponentProps<typeof DropdownMenuPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
|
|
8
12
|
declare const DropdownMenuItem: import("react").ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
9
13
|
inset?: boolean;
|
|
@@ -22,7 +26,9 @@ declare function DropdownMenuSub({ ...props }: ComponentProps<typeof DropdownMen
|
|
|
22
26
|
declare const DropdownMenuSubTrigger: import("react").ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
23
27
|
inset?: boolean;
|
|
24
28
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
25
|
-
|
|
29
|
+
interface DropdownMenuSubContentProps extends ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent> {
|
|
30
|
+
size?: DropdownMenuSize;
|
|
31
|
+
}
|
|
32
|
+
declare const DropdownMenuSubContent: import("react").ForwardRefExoticComponent<DropdownMenuSubContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
26
33
|
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|
|
27
|
-
export type { DropdownMenuLabelProps };
|
|
28
|
-
//# sourceMappingURL=DropdownMenu.d.ts.map
|
|
34
|
+
export type { DropdownMenuContentProps, DropdownMenuLabelProps, DropdownMenuSize, DropdownMenuSubContentProps, };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
-
"use strict";var
|
|
4
|
-
//# sourceMappingURL=DropdownMenu.js.map
|
|
3
|
+
"use strict";var r=require("react/jsx-runtime"),g=require("react"),s=require("radix-ui"),b=require("@medway-ui/icons"),u=require("../lib/utils.js"),k=require("../hooks/use-mobile.js"),M=Object.defineProperty,D=Object.defineProperties,z=Object.getOwnPropertyDescriptors,f=Object.getOwnPropertySymbols,w=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,j=(t,e,a)=>e in t?M(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,l=(t,e)=>{for(var a in e||(e={}))w.call(e,a)&&j(t,a,e[a]);if(f)for(var a of f(e))y.call(e,a)&&j(t,a,e[a]);return t},h=(t,e)=>D(t,z(e)),c=(t,e)=>{var a={};for(var n in t)w.call(t,n)&&e.indexOf(n)<0&&(a[n]=t[n]);if(t!=null&&f)for(var n of f(t))e.indexOf(n)<0&&y.call(t,n)&&(a[n]=t[n]);return a};const v={sm:{content:"p-1",item:"gap-2 px-3 py-2 text-xs leading-xs data-[inset]:pl-9 [&_svg:not([class*=size-])]:size-4",selectableItem:"pr-9",itemContent:"gap-2",itemIndicator:"right-3 size-4",icon:"size-4",label:"px-3 pb-2 pt-3 text-xxs leading-xxs data-[inset]:pl-9",separator:"-mx-1 my-1",shortcut:"text-xxs",subTriggerIcon:"size-2.5"},md:{content:"p-1.5",item:"gap-2.5 px-3.5 py-2.5 text-sm leading-sm data-[inset]:pl-11 [&_svg:not([class*=size-])]:size-5",selectableItem:"pr-11",itemContent:"gap-2.5",itemIndicator:"right-3.5 size-5",icon:"size-5",label:"px-3.5 pb-2.5 pt-3.5 text-xs leading-xs data-[inset]:pl-11",separator:"-mx-1.5 my-1.5",shortcut:"text-xs",subTriggerIcon:"size-3"},lg:{content:"p-2",item:"gap-3 px-4 py-3 text-md leading-md data-[inset]:pl-[52px] [&_svg:not([class*=size-])]:size-6",selectableItem:"pr-[52px]",itemContent:"gap-3",itemIndicator:"right-4 size-6",icon:"size-6",label:"px-4 pb-3 pt-4 text-sm leading-sm data-[inset]:pl-[52px]",separator:"-mx-2 my-2",shortcut:"text-sm",subTriggerIcon:"size-3.5"}},x=g.createContext("md");function p(){return v[g.useContext(x)]}function I(t){var e=c(t,[]);return r.jsx(s.DropdownMenu.Root,l({"data-slot":"dropdown-menu"},e))}function _(t){var e=c(t,[]);return r.jsx(s.DropdownMenu.Portal,l({"data-slot":"dropdown-menu-portal"},e))}const C=g.forwardRef(function(t,e){var a=t,{className:n}=a,o=c(a,["className"]);return r.jsx(s.DropdownMenu.Trigger,l({ref:e,className:u.cn("cursor-pointer",n),"data-slot":"dropdown-menu-trigger"},o))}),O=g.forwardRef(function(t,e){var a=t,{className:n,sideOffset:o=4,side:m,size:d="md"}=a,i=c(a,["className","sideOffset","side","size"]);const N=k.useIsMobile();return r.jsx(x.Provider,{value:d,children:r.jsx(s.DropdownMenu.Portal,{children:r.jsx(s.DropdownMenu.Content,l({ref:e,"data-slot":"dropdown-menu-content","data-size":d,sideOffset:o,side:N?"bottom":m,className:u.cn("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] origin-[var(--radix-dropdown-menu-content-transform-origin)] overflow-y-auto overflow-x-hidden rounded-md bg-surface-elevated text-foreground shadow-level-3 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 motion-reduce:!animate-none",v[d].content,n)},i))})})});function R(t){var e=c(t,[]);return r.jsx(s.DropdownMenu.Group,l({"data-slot":"dropdown-menu-group"},e))}const S=g.forwardRef(function(t,e){var a=t,{className:n,inset:o,variant:m="default"}=a,d=c(a,["className","inset","variant"]);const i=p();return r.jsx(s.DropdownMenu.Item,l({ref:e,"data-slot":"dropdown-menu-item","data-inset":o||void 0,"data-variant":m,className:u.cn("relative flex cursor-pointer select-none items-center rounded-md font-medium text-gray-foreground outline-none focus:outline-0 data-[disabled]:pointer-events-none data-[disabled]:bg-gray-background-soft-muted data-[highlighted]:bg-primary-background-soft-muted data-[variant=destructive]:data-[highlighted]:bg-feedback-error-background-soft-emphasis data-[disabled]:text-gray-foreground-muted data-[highlighted]:text-gray-foreground-emphasis data-[variant=destructive]:data-[disabled]:text-gray-foreground-muted data-[variant=destructive]:data-[highlighted]:text-feedback-error-foreground-emphasis data-[variant=destructive]:text-feedback-error-foreground dark:[&_img]:brightness-0 dark:[&_img]:invert [&_svg]:pointer-events-none [&_svg]:shrink-0",i.item,n)},d))}),P=g.forwardRef(function(t,e){var a=t,{className:n,children:o,checked:m}=a,d=c(a,["className","children","checked"]);const i=p();return r.jsxs(s.DropdownMenu.CheckboxItem,h(l({ref:e,"data-slot":"dropdown-menu-checkbox-item",className:u.cn("relative flex cursor-pointer select-none items-center rounded-md font-medium text-gray-foreground outline-none focus:outline-0 data-[disabled]:pointer-events-none data-[disabled]:bg-gray-background-soft-muted data-[highlighted]:bg-primary-background-soft-muted data-[disabled]:text-gray-foreground-muted data-[highlighted]:text-gray-foreground-emphasis dark:[&_img]:brightness-0 dark:[&_img]:invert [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:text-secondary-foreground [&_svg]:data-[disabled]:text-gray-foreground-muted",i.item,i.selectableItem,n),checked:m},d),{children:[r.jsx("span",{className:u.cn("flex min-w-0 flex-1 break-words",i.itemContent),children:o}),r.jsx("span",{className:u.cn("pointer-events-none absolute flex items-center justify-center",i.itemIndicator),children:r.jsx(s.DropdownMenu.ItemIndicator,{children:r.jsx(b.Check,{className:i.icon})})})]}))});function T(t){var e=c(t,[]);return r.jsx(s.DropdownMenu.RadioGroup,l({"data-slot":"dropdown-menu-radio-group"},e))}const q=g.forwardRef(function(t,e){var a=t,{className:n,children:o}=a,m=c(a,["className","children"]);const d=p();return r.jsxs(s.DropdownMenu.RadioItem,h(l({ref:e,"data-slot":"dropdown-menu-radio-item",className:u.cn("relative flex cursor-pointer select-none items-center rounded-md font-medium text-gray-foreground outline-none focus:outline-0 aria-checked:text-secondary-foreground data-[disabled]:pointer-events-none data-[disabled]:bg-gray-background-soft-muted data-[highlighted]:bg-primary-background-soft-muted data-[disabled]:text-gray-foreground-muted data-[highlighted]:text-gray-foreground-emphasis dark:[&_img]:brightness-0 dark:[&_img]:invert [&_svg]:pointer-events-none [&_svg]:text-secondary-foreground [&_svg]:data-[disabled]:text-gray-foreground-muted",d.item,d.selectableItem,n)},m),{children:[r.jsx("span",{className:u.cn("flex min-w-0 flex-1 break-words",d.itemContent),children:o}),r.jsx("span",{className:u.cn("pointer-events-none absolute flex items-center justify-center",d.itemIndicator),children:r.jsx(s.DropdownMenu.ItemIndicator,{children:r.jsx(b.Check,{className:d.icon})})})]}))});function G(t){var e=t,{className:a,inset:n}=e,o=c(e,["className","inset"]);const m=p();return r.jsx(s.DropdownMenu.Label,l({"data-slot":"dropdown-menu-label","data-inset":n||void 0,className:u.cn("font-medium text-gray-foreground-muted",m.label,a)},o))}function L(t){var e=t,{className:a}=e,n=c(e,["className"]);const o=p();return r.jsx(s.DropdownMenu.Separator,l({"data-slot":"dropdown-menu-separator",className:u.cn("h-px bg-gray-stroke-muted",o.separator,a)},n))}function E(t){var e=t,{className:a}=e,n=c(e,["className"]);const o=p();return r.jsx("span",l({"data-slot":"dropdown-menu-shortcut",className:u.cn("ml-auto tracking-widest text-gray-foreground",o.shortcut,a)},n))}function U(t){var e=c(t,[]);return r.jsx(s.DropdownMenu.Sub,l({"data-slot":"dropdown-menu-sub"},e))}const A=g.forwardRef(function(t,e){var a=t,{className:n,inset:o,children:m}=a,d=c(a,["className","inset","children"]);const i=p();return r.jsxs(s.DropdownMenu.SubTrigger,h(l({ref:e,"data-slot":"dropdown-menu-sub-trigger","data-inset":o||void 0,className:u.cn("flex cursor-pointer select-none items-center rounded-md font-medium text-gray-foreground outline-0 focus:outline-0 data-[disabled]:pointer-events-none data-[disabled]:bg-gray-background-soft-muted data-[highlighted]:bg-primary-background-soft-muted data-[state=open]:bg-primary-background-soft-muted data-[disabled]:text-gray-foreground-muted data-[highlighted]:text-gray-foreground-emphasis data-[state=open]:text-gray-foreground-emphasis [&_svg]:pointer-events-none [&_svg]:shrink-0",i.item,n)},d),{children:[m,r.jsx(b.ChevronRight,{className:u.cn("ml-auto",i.subTriggerIcon)})]}))}),B=g.forwardRef(function(t,e){var a=t,{className:n,size:o}=a,m=c(a,["className","size"]);const d=g.useContext(x),i=o!=null?o:d;return r.jsx(x.Provider,{value:i,children:r.jsx(s.DropdownMenu.SubContent,l({ref:e,"data-slot":"dropdown-menu-sub-content","data-size":i,className:u.cn("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] origin-[var(--radix-dropdown-menu-content-transform-origin)] overflow-y-auto overflow-x-hidden rounded-md bg-surface-elevated text-gray-foreground shadow-level-3 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 motion-reduce:!animate-none",v[i].content,n)},m))})});exports.DropdownMenu=I,exports.DropdownMenuCheckboxItem=P,exports.DropdownMenuContent=O,exports.DropdownMenuGroup=R,exports.DropdownMenuItem=S,exports.DropdownMenuLabel=G,exports.DropdownMenuPortal=_,exports.DropdownMenuRadioGroup=T,exports.DropdownMenuRadioItem=q,exports.DropdownMenuSeparator=L,exports.DropdownMenuShortcut=E,exports.DropdownMenuSub=U,exports.DropdownMenuSubContent=B,exports.DropdownMenuSubTrigger=A,exports.DropdownMenuTrigger=C;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
-
import{jsx as
|
|
4
|
-
//# sourceMappingURL=DropdownMenu.mjs.map
|
|
3
|
+
import{jsx as r,jsxs as h}from"react/jsx-runtime";import{createContext as _,forwardRef as g,useContext as w}from"react";import{DropdownMenu as s}from"radix-ui";import{Check as y,ChevronRight as D}from"@medway-ui/icons";import{cn as l}from"../lib/utils.mjs";import{useIsMobile as M}from"../hooks/use-mobile.mjs";var C=Object.defineProperty,O=Object.defineProperties,j=Object.getOwnPropertyDescriptors,f=Object.getOwnPropertySymbols,N=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable,z=(t,e,a)=>e in t?C(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,m=(t,e)=>{for(var a in e||(e={}))N.call(e,a)&&z(t,a,e[a]);if(f)for(var a of f(e))k.call(e,a)&&z(t,a,e[a]);return t},v=(t,e)=>O(t,j(e)),u=(t,e)=>{var a={};for(var o in t)N.call(t,o)&&e.indexOf(o)<0&&(a[o]=t[o]);if(t!=null&&f)for(var o of f(t))e.indexOf(o)<0&&k.call(t,o)&&(a[o]=t[o]);return a};const x={sm:{content:"p-1",item:"gap-2 px-3 py-2 text-xs leading-xs data-[inset]:pl-9 [&_svg:not([class*=size-])]:size-4",selectableItem:"pr-9",itemContent:"gap-2",itemIndicator:"right-3 size-4",icon:"size-4",label:"px-3 pb-2 pt-3 text-xxs leading-xxs data-[inset]:pl-9",separator:"-mx-1 my-1",shortcut:"text-xxs",subTriggerIcon:"size-2.5"},md:{content:"p-1.5",item:"gap-2.5 px-3.5 py-2.5 text-sm leading-sm data-[inset]:pl-11 [&_svg:not([class*=size-])]:size-5",selectableItem:"pr-11",itemContent:"gap-2.5",itemIndicator:"right-3.5 size-5",icon:"size-5",label:"px-3.5 pb-2.5 pt-3.5 text-xs leading-xs data-[inset]:pl-11",separator:"-mx-1.5 my-1.5",shortcut:"text-xs",subTriggerIcon:"size-3"},lg:{content:"p-2",item:"gap-3 px-4 py-3 text-md leading-md data-[inset]:pl-[52px] [&_svg:not([class*=size-])]:size-6",selectableItem:"pr-[52px]",itemContent:"gap-3",itemIndicator:"right-4 size-6",icon:"size-6",label:"px-4 pb-3 pt-4 text-sm leading-sm data-[inset]:pl-[52px]",separator:"-mx-2 my-2",shortcut:"text-sm",subTriggerIcon:"size-3.5"}},b=_("md");function p(){return x[w(b)]}function S(t){var e=u(t,[]);return r(s.Root,m({"data-slot":"dropdown-menu"},e))}function P(t){var e=u(t,[]);return r(s.Portal,m({"data-slot":"dropdown-menu-portal"},e))}const T=g(function(t,e){var a=t,{className:o}=a,n=u(a,["className"]);return r(s.Trigger,m({ref:e,className:l("cursor-pointer",o),"data-slot":"dropdown-menu-trigger"},n))}),R=g(function(t,e){var a=t,{className:o,sideOffset:n=4,side:c,size:d="md"}=a,i=u(a,["className","sideOffset","side","size"]);const I=M();return r(b.Provider,{value:d,children:r(s.Portal,{children:r(s.Content,m({ref:e,"data-slot":"dropdown-menu-content","data-size":d,sideOffset:n,side:I?"bottom":c,className:l("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] origin-[var(--radix-dropdown-menu-content-transform-origin)] overflow-y-auto overflow-x-hidden rounded-md bg-surface-elevated text-foreground shadow-level-3 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 motion-reduce:!animate-none",x[d].content,o)},i))})})});function G(t){var e=u(t,[]);return r(s.Group,m({"data-slot":"dropdown-menu-group"},e))}const L=g(function(t,e){var a=t,{className:o,inset:n,variant:c="default"}=a,d=u(a,["className","inset","variant"]);const i=p();return r(s.Item,m({ref:e,"data-slot":"dropdown-menu-item","data-inset":n||void 0,"data-variant":c,className:l("relative flex cursor-pointer select-none items-center rounded-md font-medium text-gray-foreground outline-none focus:outline-0 data-[disabled]:pointer-events-none data-[disabled]:bg-gray-background-soft-muted data-[highlighted]:bg-primary-background-soft-muted data-[variant=destructive]:data-[highlighted]:bg-feedback-error-background-soft-emphasis data-[disabled]:text-gray-foreground-muted data-[highlighted]:text-gray-foreground-emphasis data-[variant=destructive]:data-[disabled]:text-gray-foreground-muted data-[variant=destructive]:data-[highlighted]:text-feedback-error-foreground-emphasis data-[variant=destructive]:text-feedback-error-foreground dark:[&_img]:brightness-0 dark:[&_img]:invert [&_svg]:pointer-events-none [&_svg]:shrink-0",i.item,o)},d))}),E=g(function(t,e){var a=t,{className:o,children:n,checked:c}=a,d=u(a,["className","children","checked"]);const i=p();return h(s.CheckboxItem,v(m({ref:e,"data-slot":"dropdown-menu-checkbox-item",className:l("relative flex cursor-pointer select-none items-center rounded-md font-medium text-gray-foreground outline-none focus:outline-0 data-[disabled]:pointer-events-none data-[disabled]:bg-gray-background-soft-muted data-[highlighted]:bg-primary-background-soft-muted data-[disabled]:text-gray-foreground-muted data-[highlighted]:text-gray-foreground-emphasis dark:[&_img]:brightness-0 dark:[&_img]:invert [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:text-secondary-foreground [&_svg]:data-[disabled]:text-gray-foreground-muted",i.item,i.selectableItem,o),checked:c},d),{children:[r("span",{className:l("flex min-w-0 flex-1 break-words",i.itemContent),children:n}),r("span",{className:l("pointer-events-none absolute flex items-center justify-center",i.itemIndicator),children:r(s.ItemIndicator,{children:r(y,{className:i.icon})})})]}))});function q(t){var e=u(t,[]);return r(s.RadioGroup,m({"data-slot":"dropdown-menu-radio-group"},e))}const A=g(function(t,e){var a=t,{className:o,children:n}=a,c=u(a,["className","children"]);const d=p();return h(s.RadioItem,v(m({ref:e,"data-slot":"dropdown-menu-radio-item",className:l("relative flex cursor-pointer select-none items-center rounded-md font-medium text-gray-foreground outline-none focus:outline-0 aria-checked:text-secondary-foreground data-[disabled]:pointer-events-none data-[disabled]:bg-gray-background-soft-muted data-[highlighted]:bg-primary-background-soft-muted data-[disabled]:text-gray-foreground-muted data-[highlighted]:text-gray-foreground-emphasis dark:[&_img]:brightness-0 dark:[&_img]:invert [&_svg]:pointer-events-none [&_svg]:text-secondary-foreground [&_svg]:data-[disabled]:text-gray-foreground-muted",d.item,d.selectableItem,o)},c),{children:[r("span",{className:l("flex min-w-0 flex-1 break-words",d.itemContent),children:n}),r("span",{className:l("pointer-events-none absolute flex items-center justify-center",d.itemIndicator),children:r(s.ItemIndicator,{children:r(y,{className:d.icon})})})]}))});function B(t){var e=t,{className:a,inset:o}=e,n=u(e,["className","inset"]);const c=p();return r(s.Label,m({"data-slot":"dropdown-menu-label","data-inset":o||void 0,className:l("font-medium text-gray-foreground-muted",c.label,a)},n))}function F(t){var e=t,{className:a}=e,o=u(e,["className"]);const n=p();return r(s.Separator,m({"data-slot":"dropdown-menu-separator",className:l("h-px bg-gray-stroke-muted",n.separator,a)},o))}function H(t){var e=t,{className:a}=e,o=u(e,["className"]);const n=p();return r("span",m({"data-slot":"dropdown-menu-shortcut",className:l("ml-auto tracking-widest text-gray-foreground",n.shortcut,a)},o))}function J(t){var e=u(t,[]);return r(s.Sub,m({"data-slot":"dropdown-menu-sub"},e))}const U=g(function(t,e){var a=t,{className:o,inset:n,children:c}=a,d=u(a,["className","inset","children"]);const i=p();return h(s.SubTrigger,v(m({ref:e,"data-slot":"dropdown-menu-sub-trigger","data-inset":n||void 0,className:l("flex cursor-pointer select-none items-center rounded-md font-medium text-gray-foreground outline-0 focus:outline-0 data-[disabled]:pointer-events-none data-[disabled]:bg-gray-background-soft-muted data-[highlighted]:bg-primary-background-soft-muted data-[state=open]:bg-primary-background-soft-muted data-[disabled]:text-gray-foreground-muted data-[highlighted]:text-gray-foreground-emphasis data-[state=open]:text-gray-foreground-emphasis [&_svg]:pointer-events-none [&_svg]:shrink-0",i.item,o)},d),{children:[c,r(D,{className:l("ml-auto",i.subTriggerIcon)})]}))}),W=g(function(t,e){var a=t,{className:o,size:n}=a,c=u(a,["className","size"]);const d=w(b),i=n!=null?n:d;return r(b.Provider,{value:i,children:r(s.SubContent,m({ref:e,"data-slot":"dropdown-menu-sub-content","data-size":i,className:l("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] origin-[var(--radix-dropdown-menu-content-transform-origin)] overflow-y-auto overflow-x-hidden rounded-md bg-surface-elevated text-gray-foreground shadow-level-3 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 motion-reduce:!animate-none",x[i].content,o)},c))})});export{S as DropdownMenu,E as DropdownMenuCheckboxItem,R as DropdownMenuContent,G as DropdownMenuGroup,L as DropdownMenuItem,B as DropdownMenuLabel,P as DropdownMenuPortal,q as DropdownMenuRadioGroup,A as DropdownMenuRadioItem,F as DropdownMenuSeparator,H as DropdownMenuShortcut,J as DropdownMenuSub,W as DropdownMenuSubContent,U as DropdownMenuSubTrigger,T as DropdownMenuTrigger};
|
|
@@ -5,4 +5,3 @@ interface FallbackImageProps extends ComponentProps<"svg"> {
|
|
|
5
5
|
declare function FallbackImage({ className, label, ...props }: FallbackImageProps): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export { FallbackImage };
|
|
7
7
|
export type { FallbackImageProps };
|
|
8
|
-
//# sourceMappingURL=FallbackImage.d.ts.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
3
|
"use strict";var a=require("react/jsx-runtime"),f=require("../hooks/use-id.js"),d=require("../lib/utils.js"),p=Object.defineProperty,u=Object.defineProperties,v=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,c=(r,e,C)=>e in r?p(r,e,{enumerable:!0,configurable:!0,writable:!0,value:C}):r[e]=C,H=(r,e)=>{for(var C in e||(e={}))i.call(e,C)&&c(r,C,e[C]);if(l)for(var C of l(e))o.call(e,C)&&c(r,C,e[C]);return r},V=(r,e)=>u(r,v(e)),b=(r,e)=>{var C={};for(var t in r)i.call(r,t)&&e.indexOf(t)<0&&(C[t]=r[t]);if(r!=null&&l)for(var t of l(r))e.indexOf(t)<0&&o.call(r,t)&&(C[t]=r[t]);return C};function j(r){var e=r,{className:C,label:t="Medway"}=e,n=b(e,["className","label"]);const s=f.useId();return a.jsxs("svg",V(H({"data-slot":"fallback-image",role:"img","aria-label":t,className:d.cn("size-full",C)},n),{children:[a.jsx("defs",{children:a.jsxs("radialGradient",{id:s,cx:"50%",cy:"42%",r:"78%",children:[a.jsx("stop",{offset:"0%",stopColor:"#15397A"}),a.jsx("stop",{offset:"55%",stopColor:"#06245E"}),a.jsx("stop",{offset:"100%",stopColor:"#021536"})]})}),a.jsx("rect",{width:"100%",height:"100%",fill:`url(#${s})`}),a.jsx("svg",{x:"26.75%",y:"35%",width:"46.5%",height:"30%",viewBox:"0 0 108 22",preserveAspectRatio:"xMidYMid meet",fill:"#FFFFFF",children:a.jsx("path",{d:"M104.229 3.90299H107.408C107.836 3.90299 108.122 4.34302 107.948 4.73464L100.413 21.6491C100.318 21.8625 100.106 22 99.8724 22H96.6935C96.2653 22 95.9791 21.56 96.153 21.1684L97.89 17.2687L92.3798 4.90074C92.1706 4.43102 92.5141 3.90189 93.0281 3.90189H95.8779C96.1585 3.90189 96.4128 4.0669 96.5262 4.32322L100.09 12.325L103.686 4.25391C103.781 4.0405 103.993 3.90299 104.227 3.90299H104.229ZM91.9043 11.0005V17.3875C91.9043 17.7791 91.5862 18.097 91.1943 18.097H88.9455C88.5537 18.097 88.2356 17.7791 88.2356 17.3875V17.2841C87.1547 17.8957 85.8999 18.2367 84.5647 18.2147C80.7496 18.152 77.6159 15.0928 77.4706 11.2822C77.3132 7.16906 80.6043 3.78419 84.6847 3.78419C88.765 3.78419 91.9043 7.01505 91.9043 10.9994V11.0005ZM88.0573 11.0005C88.0573 9.13926 86.5471 7.62888 84.6836 7.62888C82.8201 7.62888 81.3099 9.13816 81.3099 11.0005C81.3099 12.8629 82.8201 14.3722 84.6836 14.3722C86.5471 14.3722 88.0573 12.8629 88.0573 11.0005ZM75.4519 12.1578V4.61363C75.4519 4.22201 75.1338 3.9041 74.7419 3.9041H72.3159C71.9241 3.9041 71.606 4.22201 71.606 4.61363V12.2282C71.606 13.4273 70.6153 14.3997 69.4089 14.3711C68.2378 14.3436 67.3154 13.358 67.3154 12.1875V4.61363C67.3154 4.22201 66.9973 3.9041 66.6054 3.9041H64.1794C63.7876 3.9041 63.4695 4.22201 63.4695 4.61363V12.2282C63.4695 13.4273 62.4788 14.3997 61.2724 14.3711C60.1013 14.3436 59.1789 13.358 59.1789 12.1875V4.61363C59.1789 4.22201 58.8608 3.9041 58.4689 3.9041H56.0429C55.6511 3.9041 55.333 4.22201 55.333 4.61363V12.1578C55.333 15.4778 58.0507 18.2422 61.3726 18.2158C62.9235 18.2037 64.3346 17.5998 65.3935 16.6196C66.4524 17.5998 67.8635 18.2037 69.4144 18.2158C72.7364 18.2422 75.4541 15.4767 75.4541 12.1578H75.4519ZM49.7094 0H51.9582C52.35 0 52.6682 0.317916 52.6682 0.709535V17.3875C52.6682 17.7791 52.35 18.097 51.9582 18.097H49.7094C49.3176 18.097 48.9995 17.7791 48.9995 17.3875V17.2841C47.9505 17.877 46.7397 18.2158 45.4486 18.2158C41.3671 18.2158 38.0771 14.832 38.2345 10.7178C38.3798 6.90834 41.5135 3.84799 45.3286 3.78529C46.6648 3.76329 47.9186 4.1043 48.9995 4.71594V0.709535C48.9995 0.317916 49.3176 0 49.7094 0ZM48.8223 11.0005C48.8223 9.13926 47.3121 7.62888 45.4486 7.62888C43.585 7.62888 42.0749 9.13816 42.0749 11.0005C42.0749 12.8629 43.585 14.3722 45.4486 14.3722C47.3121 14.3722 48.8223 12.8629 48.8223 11.0005ZM26.4139 12.2425C26.1508 12.2425 25.9769 12.5186 26.0947 12.7529C26.6979 13.9608 27.9031 14.7847 29.2945 14.7847C30.2576 14.7847 31.1326 14.3887 31.7799 13.7452C31.9109 13.6143 32.0903 13.5428 32.2752 13.5428H34.8806C35.4265 13.5428 35.7689 14.1324 35.497 14.6054C34.2587 16.7626 31.945 18.2147 29.2945 18.2147C25.3396 18.2147 22.1343 14.9838 22.1343 10.9994C22.1343 7.01505 25.3407 3.78419 29.2945 3.78419C33.2482 3.78419 36.4546 7.01505 36.4546 10.9994C36.4546 11.1997 36.4469 11.3966 36.4304 11.5924C36.4007 11.9598 36.0914 12.2414 35.7226 12.2414H26.4139V12.2425ZM26.2356 8.98855C26.0947 9.22286 26.2686 9.52208 26.5427 9.52208H32.0451C32.3192 9.52208 32.4931 9.22396 32.3522 8.98855C31.7138 7.9237 30.5823 7.21526 29.2945 7.21526C28.0066 7.21526 26.8751 7.9237 26.2367 8.98855H26.2356ZM14.0815 3.78529C12.5306 3.79739 11.1194 4.40132 10.0605 5.38147C9.00165 4.40132 7.59054 3.79739 6.03963 3.78529C2.71767 3.75889 0 6.52443 0 9.84329V17.3875C0 17.7791 0.318107 18.097 0.709962 18.097H3.13594C3.52779 18.097 3.8459 17.7791 3.8459 17.3875V9.81359C3.8459 8.64313 4.7683 7.65748 5.93946 7.62998C7.14585 7.60138 8.13649 8.57383 8.13649 9.77289V17.3875C8.13649 17.7791 8.4546 18.097 8.84645 18.097H11.2724C11.6643 18.097 11.9824 17.7791 11.9824 17.3875V9.81359C11.9824 8.64313 12.9048 7.65748 14.076 7.62998C15.2823 7.60138 16.273 8.57383 16.273 9.77289V17.3875C16.273 17.7791 16.5911 18.097 16.9829 18.097H19.4089C19.8008 18.097 20.1189 17.7791 20.1189 17.3875V9.84329C20.1189 6.52333 17.4012 3.75889 14.0793 3.78529H14.0815Z"})})]}))}exports.FallbackImage=j;
|
|
4
|
-
//# sourceMappingURL=FallbackImage.js.map
|