@qijenchen/design-system 0.1.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +163 -0
- package/dist/components/Accordion/accordion.d.ts +37 -0
- package/dist/components/Accordion/accordion.d.ts.map +1 -0
- package/dist/components/Accordion/accordion.js +78 -0
- package/dist/components/Accordion/accordion.js.map +1 -0
- package/dist/components/Alert/alert.d.ts +47 -0
- package/dist/components/Alert/alert.d.ts.map +1 -0
- package/dist/components/Alert/alert.js +132 -0
- package/dist/components/Alert/alert.js.map +1 -0
- package/dist/components/AppShell/_demo-helpers.d.ts +49 -0
- package/dist/components/AppShell/_demo-helpers.d.ts.map +1 -0
- package/dist/components/AppShell/app-shell.d.ts +76 -0
- package/dist/components/AppShell/app-shell.d.ts.map +1 -0
- package/dist/components/AppShell/app-shell.js +214 -0
- package/dist/components/AppShell/app-shell.js.map +1 -0
- package/dist/components/AspectRatio/aspect-ratio.d.ts +40 -0
- package/dist/components/AspectRatio/aspect-ratio.d.ts.map +1 -0
- package/dist/components/AspectRatio/aspect-ratio.js +23 -0
- package/dist/components/AspectRatio/aspect-ratio.js.map +1 -0
- package/dist/components/Avatar/avatar.d.ts +85 -0
- package/dist/components/Avatar/avatar.d.ts.map +1 -0
- package/dist/components/Avatar/avatar.js +195 -0
- package/dist/components/Avatar/avatar.js.map +1 -0
- package/dist/components/Badge/badge.d.ts +43 -0
- package/dist/components/Badge/badge.d.ts.map +1 -0
- package/dist/components/Badge/badge.js +69 -0
- package/dist/components/Badge/badge.js.map +1 -0
- package/dist/components/Breadcrumb/breadcrumb.d.ts +163 -0
- package/dist/components/Breadcrumb/breadcrumb.d.ts.map +1 -0
- package/dist/components/Breadcrumb/breadcrumb.js +300 -0
- package/dist/components/Breadcrumb/breadcrumb.js.map +1 -0
- package/dist/components/BulkActionBar/bulk-action-bar.d.ts +46 -0
- package/dist/components/BulkActionBar/bulk-action-bar.d.ts.map +1 -0
- package/dist/components/BulkActionBar/bulk-action-bar.js +78 -0
- package/dist/components/BulkActionBar/bulk-action-bar.js.map +1 -0
- package/dist/components/Button/button-group.d.ts +49 -0
- package/dist/components/Button/button-group.d.ts.map +1 -0
- package/dist/components/Button/button-group.js +46 -0
- package/dist/components/Button/button-group.js.map +1 -0
- package/dist/components/Button/button.d.ts +203 -0
- package/dist/components/Button/button.d.ts.map +1 -0
- package/dist/components/Button/button.js +309 -0
- package/dist/components/Button/button.js.map +1 -0
- package/dist/components/Calendar/calendar.d.ts +81 -0
- package/dist/components/Calendar/calendar.d.ts.map +1 -0
- package/dist/components/Calendar/calendar.js +282 -0
- package/dist/components/Calendar/calendar.js.map +1 -0
- package/dist/components/Carousel/carousel.d.ts +61 -0
- package/dist/components/Carousel/carousel.d.ts.map +1 -0
- package/dist/components/Carousel/carousel.js +276 -0
- package/dist/components/Carousel/carousel.js.map +1 -0
- package/dist/components/Chart/chart.d.ts +94 -0
- package/dist/components/Chart/chart.d.ts.map +1 -0
- package/dist/components/Chart/chart.js +233 -0
- package/dist/components/Chart/chart.js.map +1 -0
- package/dist/components/Checkbox/checkbox-group.d.ts +58 -0
- package/dist/components/Checkbox/checkbox-group.d.ts.map +1 -0
- package/dist/components/Checkbox/checkbox-group.js +28 -0
- package/dist/components/Checkbox/checkbox-group.js.map +1 -0
- package/dist/components/Checkbox/checkbox.d.ts +73 -0
- package/dist/components/Checkbox/checkbox.d.ts.map +1 -0
- package/dist/components/Checkbox/checkbox.js +125 -0
- package/dist/components/Checkbox/checkbox.js.map +1 -0
- package/dist/components/Chip/chip.d.ts +54 -0
- package/dist/components/Chip/chip.d.ts.map +1 -0
- package/dist/components/Chip/chip.js +224 -0
- package/dist/components/Chip/chip.js.map +1 -0
- package/dist/components/CircularProgress/circular-progress.d.ts +40 -0
- package/dist/components/CircularProgress/circular-progress.d.ts.map +1 -0
- package/dist/components/CircularProgress/circular-progress.js +118 -0
- package/dist/components/CircularProgress/circular-progress.js.map +1 -0
- package/dist/components/Coachmark/coachmark.d.ts +100 -0
- package/dist/components/Coachmark/coachmark.d.ts.map +1 -0
- package/dist/components/Coachmark/coachmark.js +107 -0
- package/dist/components/Coachmark/coachmark.js.map +1 -0
- package/dist/components/Combobox/combobox.d.ts +150 -0
- package/dist/components/Combobox/combobox.d.ts.map +1 -0
- package/dist/components/Combobox/combobox.js +595 -0
- package/dist/components/Combobox/combobox.js.map +1 -0
- package/dist/components/Command/command.d.ts +106 -0
- package/dist/components/Command/command.d.ts.map +1 -0
- package/dist/components/Command/command.js +123 -0
- package/dist/components/Command/command.js.map +1 -0
- package/dist/components/DataTable/active-editor-controller.d.ts +66 -0
- package/dist/components/DataTable/active-editor-controller.d.ts.map +1 -0
- package/dist/components/DataTable/cell-registry.d.ts +37 -0
- package/dist/components/DataTable/cell-registry.d.ts.map +1 -0
- package/dist/components/DataTable/cell-registry.js +377 -0
- package/dist/components/DataTable/cell-registry.js.map +1 -0
- package/dist/components/DataTable/column-types.d.ts +145 -0
- package/dist/components/DataTable/column-types.d.ts.map +1 -0
- package/dist/components/DataTable/column-types.js +17 -0
- package/dist/components/DataTable/column-types.js.map +1 -0
- package/dist/components/DataTable/data-table-column-visibility-panel.d.ts +49 -0
- package/dist/components/DataTable/data-table-column-visibility-panel.d.ts.map +1 -0
- package/dist/components/DataTable/data-table-filter-panel.d.ts +30 -0
- package/dist/components/DataTable/data-table-filter-panel.d.ts.map +1 -0
- package/dist/components/DataTable/data-table-interaction-layer.d.ts +78 -0
- package/dist/components/DataTable/data-table-interaction-layer.d.ts.map +1 -0
- package/dist/components/DataTable/data-table-interaction-layer.js +220 -0
- package/dist/components/DataTable/data-table-interaction-layer.js.map +1 -0
- package/dist/components/DataTable/data-table-sort-manager.d.ts +19 -0
- package/dist/components/DataTable/data-table-sort-manager.d.ts.map +1 -0
- package/dist/components/DataTable/data-table.d.ts +181 -0
- package/dist/components/DataTable/data-table.d.ts.map +1 -0
- package/dist/components/DataTable/data-table.js +1851 -0
- package/dist/components/DataTable/data-table.js.map +1 -0
- package/dist/components/DataTable/filter-operators.d.ts +116 -0
- package/dist/components/DataTable/filter-operators.d.ts.map +1 -0
- package/dist/components/DataTable/filter-tree.d.ts +66 -0
- package/dist/components/DataTable/filter-tree.d.ts.map +1 -0
- package/dist/components/DataTable/lib/column-meta.d.ts +49 -0
- package/dist/components/DataTable/lib/column-meta.d.ts.map +1 -0
- package/dist/components/DateGrid/date-grid.d.ts +61 -0
- package/dist/components/DateGrid/date-grid.d.ts.map +1 -0
- package/dist/components/DateGrid/date-grid.js +168 -0
- package/dist/components/DateGrid/date-grid.js.map +1 -0
- package/dist/components/DatePicker/date-picker.d.ts +119 -0
- package/dist/components/DatePicker/date-picker.d.ts.map +1 -0
- package/dist/components/DatePicker/date-picker.js +743 -0
- package/dist/components/DatePicker/date-picker.js.map +1 -0
- package/dist/components/DescriptionList/description-list.d.ts +60 -0
- package/dist/components/DescriptionList/description-list.d.ts.map +1 -0
- package/dist/components/DescriptionList/description-list.js +77 -0
- package/dist/components/DescriptionList/description-list.js.map +1 -0
- package/dist/components/Dialog/dialog.d.ts +54 -0
- package/dist/components/Dialog/dialog.d.ts.map +1 -0
- package/dist/components/Dialog/dialog.js +151 -0
- package/dist/components/Dialog/dialog.js.map +1 -0
- package/dist/components/DropdownMenu/dropdown-menu.d.ts +111 -0
- package/dist/components/DropdownMenu/dropdown-menu.d.ts.map +1 -0
- package/dist/components/DropdownMenu/dropdown-menu.js +288 -0
- package/dist/components/DropdownMenu/dropdown-menu.js.map +1 -0
- package/dist/components/Empty/empty.d.ts +40 -0
- package/dist/components/Empty/empty.d.ts.map +1 -0
- package/dist/components/Empty/empty.js +66 -0
- package/dist/components/Empty/empty.js.map +1 -0
- package/dist/components/Field/field-context.d.ts +77 -0
- package/dist/components/Field/field-context.d.ts.map +1 -0
- package/dist/components/Field/field-context.js +37 -0
- package/dist/components/Field/field-context.js.map +1 -0
- package/dist/components/Field/field-types.d.ts +5 -0
- package/dist/components/Field/field-types.d.ts.map +1 -0
- package/dist/components/Field/field-types.js +13 -0
- package/dist/components/Field/field-types.js.map +1 -0
- package/dist/components/Field/field-wrapper.d.ts +17 -0
- package/dist/components/Field/field-wrapper.d.ts.map +1 -0
- package/dist/components/Field/field-wrapper.js +252 -0
- package/dist/components/Field/field-wrapper.js.map +1 -0
- package/dist/components/Field/field.d.ts +127 -0
- package/dist/components/Field/field.d.ts.map +1 -0
- package/dist/components/Field/field.js +295 -0
- package/dist/components/Field/field.js.map +1 -0
- package/dist/components/FieldControlGroup/field-control-group.d.ts +74 -0
- package/dist/components/FieldControlGroup/field-control-group.d.ts.map +1 -0
- package/dist/components/FieldControlGroup/field-control-group.js +62 -0
- package/dist/components/FieldControlGroup/field-control-group.js.map +1 -0
- package/dist/components/FileItem/file-item.d.ts +44 -0
- package/dist/components/FileItem/file-item.d.ts.map +1 -0
- package/dist/components/FileItem/file-item.js +202 -0
- package/dist/components/FileItem/file-item.js.map +1 -0
- package/dist/components/FileUpload/file-upload.d.ts +97 -0
- package/dist/components/FileUpload/file-upload.d.ts.map +1 -0
- package/dist/components/FileUpload/file-upload.js +231 -0
- package/dist/components/FileUpload/file-upload.js.map +1 -0
- package/dist/components/FileViewer/file-viewer-types.d.ts +73 -0
- package/dist/components/FileViewer/file-viewer-types.d.ts.map +1 -0
- package/dist/components/FileViewer/file-viewer.d.ts +82 -0
- package/dist/components/FileViewer/file-viewer.d.ts.map +1 -0
- package/dist/components/FileViewer/file-viewer.js +752 -0
- package/dist/components/FileViewer/file-viewer.js.map +1 -0
- package/dist/components/FileViewer/image-renderer.d.ts +9 -0
- package/dist/components/FileViewer/image-renderer.d.ts.map +1 -0
- package/dist/components/FileViewer/image-renderer.js +165 -0
- package/dist/components/FileViewer/image-renderer.js.map +1 -0
- package/dist/components/HoverCard/hover-card.d.ts +30 -0
- package/dist/components/HoverCard/hover-card.d.ts.map +1 -0
- package/dist/components/HoverCard/hover-card.js +61 -0
- package/dist/components/HoverCard/hover-card.js.map +1 -0
- package/dist/components/Input/input.d.ts +72 -0
- package/dist/components/Input/input.d.ts.map +1 -0
- package/dist/components/Input/input.js +148 -0
- package/dist/components/Input/input.js.map +1 -0
- package/dist/components/LinkInput/link-input.d.ts +46 -0
- package/dist/components/LinkInput/link-input.d.ts.map +1 -0
- package/dist/components/LinkInput/link-input.js +215 -0
- package/dist/components/LinkInput/link-input.js.map +1 -0
- package/dist/components/Menu/menu-item.d.ts +83 -0
- package/dist/components/Menu/menu-item.d.ts.map +1 -0
- package/dist/components/Menu/menu-item.js +209 -0
- package/dist/components/Menu/menu-item.js.map +1 -0
- package/dist/components/NameCard/name-card.d.ts +85 -0
- package/dist/components/NameCard/name-card.d.ts.map +1 -0
- package/dist/components/NameCard/name-card.js +153 -0
- package/dist/components/NameCard/name-card.js.map +1 -0
- package/dist/components/Notice/notice.d.ts +69 -0
- package/dist/components/Notice/notice.d.ts.map +1 -0
- package/dist/components/Notice/notice.js +121 -0
- package/dist/components/Notice/notice.js.map +1 -0
- package/dist/components/NumberInput/number-input.d.ts +57 -0
- package/dist/components/NumberInput/number-input.d.ts.map +1 -0
- package/dist/components/NumberInput/number-input.js +131 -0
- package/dist/components/NumberInput/number-input.js.map +1 -0
- package/dist/components/OverflowIndicator/overflow-indicator.d.ts +23 -0
- package/dist/components/OverflowIndicator/overflow-indicator.d.ts.map +1 -0
- package/dist/components/OverflowIndicator/overflow-indicator.js +111 -0
- package/dist/components/OverflowIndicator/overflow-indicator.js.map +1 -0
- package/dist/components/PeoplePicker/avatar-stack-overflow.d.ts +57 -0
- package/dist/components/PeoplePicker/avatar-stack-overflow.d.ts.map +1 -0
- package/dist/components/PeoplePicker/avatar-stack-overflow.js +35 -0
- package/dist/components/PeoplePicker/avatar-stack-overflow.js.map +1 -0
- package/dist/components/PeoplePicker/people-picker-helpers.d.ts +7 -0
- package/dist/components/PeoplePicker/people-picker-helpers.d.ts.map +1 -0
- package/dist/components/PeoplePicker/people-picker-helpers.js +25 -0
- package/dist/components/PeoplePicker/people-picker-helpers.js.map +1 -0
- package/dist/components/PeoplePicker/people-picker.d.ts +77 -0
- package/dist/components/PeoplePicker/people-picker.d.ts.map +1 -0
- package/dist/components/PeoplePicker/people-picker.js +263 -0
- package/dist/components/PeoplePicker/people-picker.js.map +1 -0
- package/dist/components/PeoplePicker/person-display.d.ts +66 -0
- package/dist/components/PeoplePicker/person-display.d.ts.map +1 -0
- package/dist/components/PeoplePicker/person-display.js +203 -0
- package/dist/components/PeoplePicker/person-display.js.map +1 -0
- package/dist/components/Popover/popover.d.ts +50 -0
- package/dist/components/Popover/popover.d.ts.map +1 -0
- package/dist/components/Popover/popover.js +113 -0
- package/dist/components/Popover/popover.js.map +1 -0
- package/dist/components/ProgressBar/progress-bar.d.ts +37 -0
- package/dist/components/ProgressBar/progress-bar.d.ts.map +1 -0
- package/dist/components/ProgressBar/progress-bar.js +86 -0
- package/dist/components/ProgressBar/progress-bar.js.map +1 -0
- package/dist/components/RadioGroup/radio-group.d.ts +78 -0
- package/dist/components/RadioGroup/radio-group.d.ts.map +1 -0
- package/dist/components/RadioGroup/radio-group.js +153 -0
- package/dist/components/RadioGroup/radio-group.js.map +1 -0
- package/dist/components/Rating/rating.d.ts +46 -0
- package/dist/components/Rating/rating.d.ts.map +1 -0
- package/dist/components/Rating/rating.js +179 -0
- package/dist/components/Rating/rating.js.map +1 -0
- package/dist/components/ScrollArea/scroll-area.d.ts +45 -0
- package/dist/components/ScrollArea/scroll-area.d.ts.map +1 -0
- package/dist/components/ScrollArea/scroll-area.js +65 -0
- package/dist/components/ScrollArea/scroll-area.js.map +1 -0
- package/dist/components/SegmentedControl/segmented-control.d.ts +102 -0
- package/dist/components/SegmentedControl/segmented-control.d.ts.map +1 -0
- package/dist/components/SegmentedControl/segmented-control.js +171 -0
- package/dist/components/SegmentedControl/segmented-control.js.map +1 -0
- package/dist/components/Select/select.d.ts +102 -0
- package/dist/components/Select/select.d.ts.map +1 -0
- package/dist/components/Select/select.js +435 -0
- package/dist/components/Select/select.js.map +1 -0
- package/dist/components/SelectMenu/select-menu.d.ts +103 -0
- package/dist/components/SelectMenu/select-menu.d.ts.map +1 -0
- package/dist/components/SelectMenu/select-menu.js +239 -0
- package/dist/components/SelectMenu/select-menu.js.map +1 -0
- package/dist/components/SelectionControl/selection-item.d.ts +69 -0
- package/dist/components/SelectionControl/selection-item.d.ts.map +1 -0
- package/dist/components/SelectionControl/selection-item.js +142 -0
- package/dist/components/SelectionControl/selection-item.js.map +1 -0
- package/dist/components/Separator/separator.d.ts +17 -0
- package/dist/components/Separator/separator.d.ts.map +1 -0
- package/dist/components/Separator/separator.js +39 -0
- package/dist/components/Separator/separator.js.map +1 -0
- package/dist/components/Sheet/sheet.d.ts +56 -0
- package/dist/components/Sheet/sheet.d.ts.map +1 -0
- package/dist/components/Sheet/sheet.js +145 -0
- package/dist/components/Sheet/sheet.js.map +1 -0
- package/dist/components/Sidebar/sidebar.d.ts +195 -0
- package/dist/components/Sidebar/sidebar.d.ts.map +1 -0
- package/dist/components/Sidebar/sidebar.js +826 -0
- package/dist/components/Sidebar/sidebar.js.map +1 -0
- package/dist/components/Skeleton/skeleton.d.ts +16 -0
- package/dist/components/Skeleton/skeleton.d.ts.map +1 -0
- package/dist/components/Skeleton/skeleton.js +30 -0
- package/dist/components/Skeleton/skeleton.js.map +1 -0
- package/dist/components/Slider/slider.d.ts +48 -0
- package/dist/components/Slider/slider.d.ts.map +1 -0
- package/dist/components/Slider/slider.js +108 -0
- package/dist/components/Slider/slider.js.map +1 -0
- package/dist/components/Steps/steps.d.ts +71 -0
- package/dist/components/Steps/steps.d.ts.map +1 -0
- package/dist/components/Steps/steps.js +583 -0
- package/dist/components/Steps/steps.js.map +1 -0
- package/dist/components/Switch/switch.d.ts +112 -0
- package/dist/components/Switch/switch.d.ts.map +1 -0
- package/dist/components/Switch/switch.js +179 -0
- package/dist/components/Switch/switch.js.map +1 -0
- package/dist/components/Tabs/tabs.d.ts +104 -0
- package/dist/components/Tabs/tabs.d.ts.map +1 -0
- package/dist/components/Tabs/tabs.js +316 -0
- package/dist/components/Tabs/tabs.js.map +1 -0
- package/dist/components/Tag/tag.d.ts +86 -0
- package/dist/components/Tag/tag.d.ts.map +1 -0
- package/dist/components/Tag/tag.js +172 -0
- package/dist/components/Tag/tag.js.map +1 -0
- package/dist/components/Textarea/textarea.d.ts +74 -0
- package/dist/components/Textarea/textarea.d.ts.map +1 -0
- package/dist/components/Textarea/textarea.js +224 -0
- package/dist/components/Textarea/textarea.js.map +1 -0
- package/dist/components/TimePicker/time-columns.d.ts +46 -0
- package/dist/components/TimePicker/time-columns.d.ts.map +1 -0
- package/dist/components/TimePicker/time-columns.js +173 -0
- package/dist/components/TimePicker/time-columns.js.map +1 -0
- package/dist/components/TimePicker/time-picker.d.ts +94 -0
- package/dist/components/TimePicker/time-picker.d.ts.map +1 -0
- package/dist/components/TimePicker/time-picker.js +253 -0
- package/dist/components/TimePicker/time-picker.js.map +1 -0
- package/dist/components/Toast/toast.d.ts +61 -0
- package/dist/components/Toast/toast.d.ts.map +1 -0
- package/dist/components/Toast/toast.js +76 -0
- package/dist/components/Toast/toast.js.map +1 -0
- package/dist/components/Tooltip/tooltip.d.ts +20 -0
- package/dist/components/Tooltip/tooltip.d.ts.map +1 -0
- package/dist/components/Tooltip/tooltip.js +53 -0
- package/dist/components/Tooltip/tooltip.js.map +1 -0
- package/dist/components/TreeView/tree-view.d.ts +166 -0
- package/dist/components/TreeView/tree-view.d.ts.map +1 -0
- package/dist/components/TreeView/tree-view.js +617 -0
- package/dist/components/TreeView/tree-view.js.map +1 -0
- package/dist/hooks/use-controllable.d.ts +16 -0
- package/dist/hooks/use-controllable.d.ts.map +1 -0
- package/dist/hooks/use-controllable.js +26 -0
- package/dist/hooks/use-controllable.js.map +1 -0
- package/dist/hooks/use-is-narrow-viewport.d.ts +2 -0
- package/dist/hooks/use-is-narrow-viewport.d.ts.map +1 -0
- package/dist/hooks/use-is-narrow-viewport.js +19 -0
- package/dist/hooks/use-is-narrow-viewport.js.map +1 -0
- package/dist/hooks/use-is-touch-device.d.ts +8 -0
- package/dist/hooks/use-is-touch-device.d.ts.map +1 -0
- package/dist/hooks/use-is-touch-device.js +16 -0
- package/dist/hooks/use-is-touch-device.js.map +1 -0
- package/dist/hooks/use-overflow-items.d.ts +124 -0
- package/dist/hooks/use-overflow-items.d.ts.map +1 -0
- package/dist/hooks/use-overflow-items.js +97 -0
- package/dist/hooks/use-overflow-items.js.map +1 -0
- package/dist/index.d.ts +74 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +371 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/drag-visual.d.ts +158 -0
- package/dist/lib/drag-visual.d.ts.map +1 -0
- package/dist/lib/drag-visual.js +96 -0
- package/dist/lib/drag-visual.js.map +1 -0
- package/dist/lib/i18n/i18n-context.d.ts +105 -0
- package/dist/lib/i18n/i18n-context.d.ts.map +1 -0
- package/dist/lib/multi-select-ordering.d.ts +54 -0
- package/dist/lib/multi-select-ordering.d.ts.map +1 -0
- package/dist/lib/multi-select-ordering.js +13 -0
- package/dist/lib/multi-select-ordering.js.map +1 -0
- package/dist/lib/utils.d.ts +12 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +79 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/patterns/element-anatomy/item-anatomy.d.ts +370 -0
- package/dist/patterns/element-anatomy/item-anatomy.d.ts.map +1 -0
- package/dist/patterns/element-anatomy/item-anatomy.js +272 -0
- package/dist/patterns/element-anatomy/item-anatomy.js.map +1 -0
- package/dist/patterns/header-canonical/chrome-header.d.ts +80 -0
- package/dist/patterns/header-canonical/chrome-header.d.ts.map +1 -0
- package/dist/patterns/header-canonical/chrome-header.js +75 -0
- package/dist/patterns/header-canonical/chrome-header.js.map +1 -0
- package/dist/patterns/horizontal-overflow/horizontal-overflow.d.ts +101 -0
- package/dist/patterns/horizontal-overflow/horizontal-overflow.d.ts.map +1 -0
- package/dist/patterns/horizontal-overflow/horizontal-overflow.js +105 -0
- package/dist/patterns/horizontal-overflow/horizontal-overflow.js.map +1 -0
- package/dist/patterns/overlay-surface/overlay-surface.d.ts +28 -0
- package/dist/patterns/overlay-surface/overlay-surface.d.ts.map +1 -0
- package/dist/patterns/overlay-surface/overlay-surface.js +85 -0
- package/dist/patterns/overlay-surface/overlay-surface.js.map +1 -0
- package/dist/patterns/resize-handle/resize-handle.d.ts +102 -0
- package/dist/patterns/resize-handle/resize-handle.d.ts.map +1 -0
- package/dist/patterns/resize-handle/resize-handle.js +74 -0
- package/dist/patterns/resize-handle/resize-handle.js.map +1 -0
- package/dist/react-day-picker.css +457 -0
- package/dist/stories-helpers/anatomy/anatomy-utils.d.ts +40 -0
- package/dist/stories-helpers/anatomy/anatomy-utils.d.ts.map +1 -0
- package/dist/tokens/elevation/overlay-geometry.d.ts +12 -0
- package/dist/tokens/elevation/overlay-geometry.d.ts.map +1 -0
- package/dist/tokens/elevation/overlay-geometry.js +7 -0
- package/dist/tokens/elevation/overlay-geometry.js.map +1 -0
- package/dist/tokens/motion/motion.d.ts +15 -0
- package/dist/tokens/motion/motion.d.ts.map +1 -0
- package/dist/tokens/motion/motion.js +9 -0
- package/dist/tokens/motion/motion.js.map +1 -0
- package/dist/tokens/uiSize/icon-size.d.ts +53 -0
- package/dist/tokens/uiSize/icon-size.d.ts.map +1 -0
- package/package.json +92 -0
- package/src/README.md +32 -0
- package/src/components/Accordion/accordion.tsx +104 -0
- package/src/components/Alert/alert.tsx +188 -0
- package/src/components/AppShell/_demo-helpers.tsx +198 -0
- package/src/components/AppShell/app-shell.tsx +364 -0
- package/src/components/AspectRatio/aspect-ratio.tsx +58 -0
- package/src/components/Avatar/avatar.tsx +368 -0
- package/src/components/Badge/badge.tsx +104 -0
- package/src/components/Breadcrumb/breadcrumb.tsx +619 -0
- package/src/components/BulkActionBar/bulk-action-bar.tsx +156 -0
- package/src/components/Button/button-group.tsx +96 -0
- package/src/components/Button/button.tsx +539 -0
- package/src/components/Calendar/calendar.tsx +411 -0
- package/src/components/Carousel/carousel.tsx +371 -0
- package/src/components/Chart/chart.tsx +376 -0
- package/src/components/Checkbox/checkbox-group.tsx +94 -0
- package/src/components/Checkbox/checkbox.tsx +237 -0
- package/src/components/Chip/chip.tsx +359 -0
- package/src/components/CircularProgress/circular-progress.tsx +204 -0
- package/src/components/Coachmark/coachmark.tsx +255 -0
- package/src/components/Combobox/combobox.tsx +826 -0
- package/src/components/Command/command.tsx +187 -0
- package/src/components/DataTable/active-editor-controller.ts +72 -0
- package/src/components/DataTable/cell-registry.tsx +520 -0
- package/src/components/DataTable/column-types.ts +180 -0
- package/src/components/DataTable/data-table-column-visibility-panel.tsx +261 -0
- package/src/components/DataTable/data-table-filter-panel.tsx +813 -0
- package/src/components/DataTable/data-table-interaction-layer.tsx +483 -0
- package/src/components/DataTable/data-table-sort-manager.tsx +210 -0
- package/src/components/DataTable/data-table.css +165 -0
- package/src/components/DataTable/data-table.tsx +2924 -0
- package/src/components/DataTable/filter-operators.ts +225 -0
- package/src/components/DataTable/filter-tree.ts +313 -0
- package/src/components/DataTable/lib/column-meta.ts +79 -0
- package/src/components/DateGrid/date-grid.tsx +209 -0
- package/src/components/DatePicker/date-picker.tsx +1114 -0
- package/src/components/DescriptionList/description-list.tsx +141 -0
- package/src/components/Dialog/dialog.tsx +267 -0
- package/src/components/DropdownMenu/dropdown-menu.tsx +475 -0
- package/src/components/Empty/empty.tsx +108 -0
- package/src/components/Field/field-context.ts +136 -0
- package/src/components/Field/field-types.ts +52 -0
- package/src/components/Field/field-wrapper.tsx +348 -0
- package/src/components/Field/field.tsx +535 -0
- package/src/components/FieldControlGroup/field-control-group.tsx +136 -0
- package/src/components/FileItem/file-item.tsx +322 -0
- package/src/components/FileUpload/file-upload.tsx +326 -0
- package/src/components/FileViewer/file-viewer-types.ts +76 -0
- package/src/components/FileViewer/file-viewer.tsx +1065 -0
- package/src/components/FileViewer/image-renderer.tsx +256 -0
- package/src/components/HoverCard/hover-card.tsx +79 -0
- package/src/components/Input/input.tsx +233 -0
- package/src/components/LinkInput/link-input.tsx +304 -0
- package/src/components/Menu/menu-item.tsx +334 -0
- package/src/components/NameCard/name-card.tsx +319 -0
- package/src/components/Notice/notice.tsx +196 -0
- package/src/components/NumberInput/number-input.tsx +203 -0
- package/src/components/OverflowIndicator/overflow-indicator.tsx +156 -0
- package/src/components/PeoplePicker/avatar-stack-overflow.ts +100 -0
- package/src/components/PeoplePicker/people-picker-helpers.ts +76 -0
- package/src/components/PeoplePicker/people-picker.tsx +455 -0
- package/src/components/PeoplePicker/person-display.tsx +358 -0
- package/src/components/Popover/popover.tsx +183 -0
- package/src/components/ProgressBar/progress-bar.tsx +157 -0
- package/src/components/README.md +58 -0
- package/src/components/RadioGroup/radio-group.tsx +261 -0
- package/src/components/Rating/rating.tsx +295 -0
- package/src/components/ScrollArea/scroll-area.tsx +110 -0
- package/src/components/SegmentedControl/segmented-control.tsx +304 -0
- package/src/components/Select/select.tsx +658 -0
- package/src/components/SelectMenu/select-menu.tsx +430 -0
- package/src/components/SelectionControl/selection-item.tsx +261 -0
- package/src/components/Separator/separator.tsx +48 -0
- package/src/components/Sheet/sheet.tsx +240 -0
- package/src/components/Sidebar/sidebar.tsx +1280 -0
- package/src/components/Skeleton/skeleton.tsx +35 -0
- package/src/components/Slider/slider.tsx +158 -0
- package/src/components/Steps/steps.tsx +850 -0
- package/src/components/Switch/switch.tsx +285 -0
- package/src/components/Tabs/tabs.tsx +515 -0
- package/src/components/Tag/tag.tsx +246 -0
- package/src/components/Textarea/textarea.tsx +280 -0
- package/src/components/TimePicker/time-columns.tsx +260 -0
- package/src/components/TimePicker/time-picker.tsx +419 -0
- package/src/components/Toast/toast.tsx +129 -0
- package/src/components/Tooltip/tooltip.tsx +68 -0
- package/src/components/TreeView/tree-view.tsx +1031 -0
- package/src/hooks/use-controllable.ts +40 -0
- package/src/hooks/use-is-narrow-viewport.ts +19 -0
- package/src/hooks/use-is-touch-device.ts +21 -0
- package/src/hooks/use-overflow-items.ts +256 -0
- package/src/index.ts +85 -0
- package/src/lib/README.md +82 -0
- package/src/lib/drag-visual.ts +272 -0
- package/src/lib/i18n/README.md +60 -0
- package/src/lib/i18n/i18n-context.tsx +129 -0
- package/src/lib/multi-select-ordering.ts +61 -0
- package/src/lib/utils.ts +93 -0
- package/src/patterns/README.md +67 -0
- package/src/patterns/element-anatomy/item-anatomy.tsx +744 -0
- package/src/patterns/header-canonical/chrome-header.tsx +175 -0
- package/src/patterns/header-canonical/header-canonical.css +27 -0
- package/src/patterns/horizontal-overflow/horizontal-overflow.tsx +217 -0
- package/src/patterns/overlay-surface/overlay-surface.tsx +191 -0
- package/src/patterns/resize-handle/resize-handle.tsx +188 -0
- package/src/stories-helpers/anatomy/anatomy-utils.tsx +64 -0
- package/src/styles/preset.css +31 -0
- package/src/styles/tokens.css +35 -0
- package/src/tokens/README.md +53 -0
- package/src/tokens/color/primitives.css +429 -0
- package/src/tokens/color/semantic.css +539 -0
- package/src/tokens/elevation/overlay-geometry.ts +13 -0
- package/src/tokens/layoutSpace/layoutSpace.css +36 -0
- package/src/tokens/motion/motion.css +30 -0
- package/src/tokens/motion/motion.ts +17 -0
- package/src/tokens/opacity/opacity.css +23 -0
- package/src/tokens/radius/radius.css +19 -0
- package/src/tokens/typography/typography.css +118 -0
- package/src/tokens/uiSize/icon-size.ts +52 -0
- package/src/tokens/uiSize/uiSize.css +125 -0
|
@@ -0,0 +1,752 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
4
|
+
import { ChevronLeft, ChevronRight, File, Info, Download, X, FileText, Minus, ChevronDown, Plus } from "lucide-react";
|
|
5
|
+
import { cn } from "../../lib/utils.js";
|
|
6
|
+
import { Button } from "../Button/button.js";
|
|
7
|
+
import { Separator } from "../Separator/separator.js";
|
|
8
|
+
import { Input } from "../Input/input.js";
|
|
9
|
+
import { Empty } from "../Empty/empty.js";
|
|
10
|
+
import { AspectRatio } from "../AspectRatio/aspect-ratio.js";
|
|
11
|
+
import { Textarea } from "../Textarea/textarea.js";
|
|
12
|
+
import { Field, FieldLabel } from "../Field/field.js";
|
|
13
|
+
import { DescriptionList, DescriptionItem } from "../DescriptionList/description-list.js";
|
|
14
|
+
import { ItemInlineActionButton } from "../../patterns/element-anatomy/item-anatomy.js";
|
|
15
|
+
import { ChromeHeader } from "../../patterns/header-canonical/chrome-header.js";
|
|
16
|
+
import { ScrollArea } from "../ScrollArea/scroll-area.js";
|
|
17
|
+
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator } from "../DropdownMenu/dropdown-menu.js";
|
|
18
|
+
import { useScrollByPage, buildFadeMask, OverflowScrollArrow } from "../../patterns/horizontal-overflow/horizontal-overflow.js";
|
|
19
|
+
import { canRenderImage, ImageRenderer } from "./image-renderer.js";
|
|
20
|
+
import { useScrollEdges } from "../../hooks/use-overflow-items.js";
|
|
21
|
+
const FallbackRenderer = ({ file }) => /* @__PURE__ */ jsx("div", { className: "w-full h-full flex items-center justify-center p-8", children: /* @__PURE__ */ jsx(
|
|
22
|
+
Empty,
|
|
23
|
+
{
|
|
24
|
+
icon: FileText,
|
|
25
|
+
title: file.name,
|
|
26
|
+
description: `無法在瀏覽器中預覽此檔案類型(${file.mimeType || "unknown"})。請下載後檢視。`
|
|
27
|
+
}
|
|
28
|
+
) });
|
|
29
|
+
const fallbackRenderer = {
|
|
30
|
+
id: "fallback",
|
|
31
|
+
canRender: () => true,
|
|
32
|
+
component: ({ file }) => /* @__PURE__ */ jsx(FallbackRenderer, { file })
|
|
33
|
+
};
|
|
34
|
+
const imageRenderer = {
|
|
35
|
+
id: "image",
|
|
36
|
+
canRender: canRenderImage,
|
|
37
|
+
component: ImageRenderer
|
|
38
|
+
};
|
|
39
|
+
const userRegistered = [];
|
|
40
|
+
function registerFileRenderer(renderer) {
|
|
41
|
+
const existingIdx = userRegistered.findIndex((r) => r.id === renderer.id);
|
|
42
|
+
if (existingIdx >= 0) {
|
|
43
|
+
userRegistered[existingIdx] = renderer;
|
|
44
|
+
} else {
|
|
45
|
+
userRegistered.push(renderer);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function resolveRenderer(file) {
|
|
49
|
+
for (const r of userRegistered) {
|
|
50
|
+
if (r.canRender(file)) return r;
|
|
51
|
+
}
|
|
52
|
+
if (imageRenderer.canRender(file)) return imageRenderer;
|
|
53
|
+
return fallbackRenderer;
|
|
54
|
+
}
|
|
55
|
+
const ZOOM_PRESETS = [10, 25, 50, 75, 100, 125, 150, 200, 400];
|
|
56
|
+
const ZOOM_FIT_OPTIONS = [
|
|
57
|
+
{ value: "fit-width", label: "Fit to width" },
|
|
58
|
+
{ value: "fit-page", label: "Fit to page" }
|
|
59
|
+
];
|
|
60
|
+
function nextZoomIn(current) {
|
|
61
|
+
for (const p of ZOOM_PRESETS) {
|
|
62
|
+
if (p > current) return p;
|
|
63
|
+
}
|
|
64
|
+
return ZOOM_PRESETS[ZOOM_PRESETS.length - 1];
|
|
65
|
+
}
|
|
66
|
+
function nextZoomOut(current) {
|
|
67
|
+
for (let i = ZOOM_PRESETS.length - 1; i >= 0; i--) {
|
|
68
|
+
if (ZOOM_PRESETS[i] < current) return ZOOM_PRESETS[i];
|
|
69
|
+
}
|
|
70
|
+
return ZOOM_PRESETS[0];
|
|
71
|
+
}
|
|
72
|
+
const ZoomInput = ({ value, onChange, onFit, labels }) => {
|
|
73
|
+
const [draft, setDraft] = React.useState(`${value}%`);
|
|
74
|
+
const [menuOpen, setMenuOpen] = React.useState(false);
|
|
75
|
+
React.useEffect(() => {
|
|
76
|
+
setDraft(`${value}%`);
|
|
77
|
+
}, [value]);
|
|
78
|
+
const commitDraft = () => {
|
|
79
|
+
const parsed = parseInt(draft.replace(/[^0-9]/g, ""), 10);
|
|
80
|
+
if (Number.isFinite(parsed) && parsed > 0) {
|
|
81
|
+
const clamped = Math.min(400, Math.max(10, parsed));
|
|
82
|
+
onChange(clamped);
|
|
83
|
+
setDraft(`${clamped}%`);
|
|
84
|
+
} else {
|
|
85
|
+
setDraft(`${value}%`);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
return (
|
|
89
|
+
// zoom group = toolbar 按鈕群組,`gap-2`(8px)對齊本 DS 按鈕 gap canonical。
|
|
90
|
+
/* @__PURE__ */ jsxs("div", { className: "inline-flex items-center gap-2", children: [
|
|
91
|
+
/* @__PURE__ */ jsx(
|
|
92
|
+
Button,
|
|
93
|
+
{
|
|
94
|
+
variant: "text",
|
|
95
|
+
size: "sm",
|
|
96
|
+
iconOnly: true,
|
|
97
|
+
startIcon: Minus,
|
|
98
|
+
"aria-label": "縮小",
|
|
99
|
+
disabled: value <= 10,
|
|
100
|
+
onClick: () => onChange(nextZoomOut(value))
|
|
101
|
+
}
|
|
102
|
+
),
|
|
103
|
+
/* @__PURE__ */ jsxs(DropdownMenu, { open: menuOpen, onOpenChange: setMenuOpen, children: [
|
|
104
|
+
/* @__PURE__ */ jsx(
|
|
105
|
+
Input,
|
|
106
|
+
{
|
|
107
|
+
size: "sm",
|
|
108
|
+
autoWidth: true,
|
|
109
|
+
"aria-label": labels.zoomInput,
|
|
110
|
+
value: draft,
|
|
111
|
+
onChange: (e) => setDraft(e.target.value),
|
|
112
|
+
onBlur: commitDraft,
|
|
113
|
+
onKeyDown: (e) => {
|
|
114
|
+
if (e.key === "Enter") {
|
|
115
|
+
e.preventDefault();
|
|
116
|
+
commitDraft();
|
|
117
|
+
e.target.blur();
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
className: "text-center tabular-nums",
|
|
121
|
+
endSlot: /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
122
|
+
ItemInlineActionButton,
|
|
123
|
+
{
|
|
124
|
+
icon: ChevronDown,
|
|
125
|
+
"aria-label": labels.zoomMenu,
|
|
126
|
+
size: "sm",
|
|
127
|
+
overlayTrigger: true
|
|
128
|
+
}
|
|
129
|
+
) })
|
|
130
|
+
}
|
|
131
|
+
),
|
|
132
|
+
/* @__PURE__ */ jsx(
|
|
133
|
+
DropdownMenuContent,
|
|
134
|
+
{
|
|
135
|
+
align: "end",
|
|
136
|
+
sideOffset: 8,
|
|
137
|
+
className: "min-w-[9rem] w-auto bg-surface-raised text-foreground border-divider",
|
|
138
|
+
"data-theme": "dark",
|
|
139
|
+
children: /* @__PURE__ */ jsxs("div", { "data-theme": "dark", className: "contents", children: [
|
|
140
|
+
ZOOM_FIT_OPTIONS.map((opt) => /* @__PURE__ */ jsx(
|
|
141
|
+
DropdownMenuItem,
|
|
142
|
+
{
|
|
143
|
+
onSelect: () => onFit(opt.value),
|
|
144
|
+
children: opt.label
|
|
145
|
+
},
|
|
146
|
+
opt.value
|
|
147
|
+
)),
|
|
148
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
149
|
+
ZOOM_PRESETS.map((p) => {
|
|
150
|
+
const selected = p === value;
|
|
151
|
+
return /* @__PURE__ */ jsxs(
|
|
152
|
+
DropdownMenuItem,
|
|
153
|
+
{
|
|
154
|
+
onSelect: () => onChange(p),
|
|
155
|
+
"data-state": selected ? "checked" : void 0,
|
|
156
|
+
className: cn(
|
|
157
|
+
"tabular-nums",
|
|
158
|
+
selected && "bg-neutral-selected"
|
|
159
|
+
),
|
|
160
|
+
children: [
|
|
161
|
+
p,
|
|
162
|
+
"%"
|
|
163
|
+
]
|
|
164
|
+
},
|
|
165
|
+
p
|
|
166
|
+
);
|
|
167
|
+
})
|
|
168
|
+
] })
|
|
169
|
+
}
|
|
170
|
+
)
|
|
171
|
+
] }),
|
|
172
|
+
/* @__PURE__ */ jsx(
|
|
173
|
+
Button,
|
|
174
|
+
{
|
|
175
|
+
variant: "text",
|
|
176
|
+
size: "sm",
|
|
177
|
+
iconOnly: true,
|
|
178
|
+
startIcon: Plus,
|
|
179
|
+
"aria-label": "放大",
|
|
180
|
+
disabled: value >= 400,
|
|
181
|
+
onClick: () => onChange(nextZoomIn(value))
|
|
182
|
+
}
|
|
183
|
+
)
|
|
184
|
+
] })
|
|
185
|
+
);
|
|
186
|
+
};
|
|
187
|
+
ZoomInput.displayName = "ZoomInput";
|
|
188
|
+
const Toolbar = ({
|
|
189
|
+
file,
|
|
190
|
+
capabilities,
|
|
191
|
+
zoom,
|
|
192
|
+
onZoomChange,
|
|
193
|
+
onFit,
|
|
194
|
+
infoOpen,
|
|
195
|
+
onInfoToggle,
|
|
196
|
+
onDownload,
|
|
197
|
+
allowDownload,
|
|
198
|
+
onClose,
|
|
199
|
+
labels
|
|
200
|
+
}) => {
|
|
201
|
+
return /* @__PURE__ */ jsxs(
|
|
202
|
+
ChromeHeader,
|
|
203
|
+
{
|
|
204
|
+
lockDensity: "lg",
|
|
205
|
+
className: cn(
|
|
206
|
+
// Chrome layer — `bg-surface-raised` 對齊 token semantic「遮蓋型浮層必須不透明」。
|
|
207
|
+
// FileViewer 整體是 overlay,chrome 屬其 raised surface(同 DropdownMenuContent line 244)。
|
|
208
|
+
// 不用 bg-surface(dark = white α8 半透明,outer 透明時失去 backdrop 洗白)。
|
|
209
|
+
// 不用 bg-canvas(那是「頁面最底層」semantic,chrome 不是 page)。
|
|
210
|
+
// ChromeHeader 自帶 flex/items-center/gap-2/shrink-0/h-chrome-header-height/border-b/px-loose
|
|
211
|
+
"bg-surface-raised"
|
|
212
|
+
),
|
|
213
|
+
children: [
|
|
214
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 min-w-0 flex-1", children: [
|
|
215
|
+
/* @__PURE__ */ jsx(File, { size: 16, className: "text-foreground shrink-0", "aria-hidden": true }),
|
|
216
|
+
/* @__PURE__ */ jsx(
|
|
217
|
+
"span",
|
|
218
|
+
{
|
|
219
|
+
className: "text-body-lg text-foreground truncate",
|
|
220
|
+
title: file.name,
|
|
221
|
+
children: file.name
|
|
222
|
+
}
|
|
223
|
+
)
|
|
224
|
+
] }),
|
|
225
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 shrink-0", children: [
|
|
226
|
+
capabilities.zoom && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
227
|
+
/* @__PURE__ */ jsx(ZoomInput, { value: zoom, onChange: onZoomChange, onFit, labels }),
|
|
228
|
+
/* @__PURE__ */ jsx(Separator, { orientation: "vertical", className: "h-6 mx-1" })
|
|
229
|
+
] }),
|
|
230
|
+
/* @__PURE__ */ jsx(
|
|
231
|
+
Button,
|
|
232
|
+
{
|
|
233
|
+
variant: "text",
|
|
234
|
+
size: "sm",
|
|
235
|
+
iconOnly: true,
|
|
236
|
+
startIcon: Info,
|
|
237
|
+
"aria-label": infoOpen ? labels.infoToggleCollapse : labels.infoToggleExpand,
|
|
238
|
+
pressed: infoOpen,
|
|
239
|
+
onClick: onInfoToggle
|
|
240
|
+
}
|
|
241
|
+
),
|
|
242
|
+
allowDownload && /* @__PURE__ */ jsx(
|
|
243
|
+
Button,
|
|
244
|
+
{
|
|
245
|
+
variant: "text",
|
|
246
|
+
size: "sm",
|
|
247
|
+
iconOnly: true,
|
|
248
|
+
startIcon: Download,
|
|
249
|
+
"aria-label": labels.download,
|
|
250
|
+
onClick: onDownload
|
|
251
|
+
}
|
|
252
|
+
),
|
|
253
|
+
/* @__PURE__ */ jsx(Separator, { orientation: "vertical", className: "h-6 mx-1" }),
|
|
254
|
+
/* @__PURE__ */ jsx(
|
|
255
|
+
Button,
|
|
256
|
+
{
|
|
257
|
+
iconOnly: true,
|
|
258
|
+
dismiss: true,
|
|
259
|
+
size: "sm",
|
|
260
|
+
"data-dismiss": true,
|
|
261
|
+
startIcon: X,
|
|
262
|
+
"aria-label": labels.close,
|
|
263
|
+
onClick: onClose
|
|
264
|
+
}
|
|
265
|
+
)
|
|
266
|
+
] })
|
|
267
|
+
]
|
|
268
|
+
}
|
|
269
|
+
);
|
|
270
|
+
};
|
|
271
|
+
function formatBytes(bytes) {
|
|
272
|
+
if (bytes == null) return void 0;
|
|
273
|
+
if (bytes < 1024) return `${bytes} B`;
|
|
274
|
+
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
275
|
+
if (bytes < 1024 * 1024 * 1024) return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
276
|
+
return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)} GB`;
|
|
277
|
+
}
|
|
278
|
+
const InfoPanel = ({
|
|
279
|
+
file,
|
|
280
|
+
readOnly,
|
|
281
|
+
onDescriptionChange,
|
|
282
|
+
onClose,
|
|
283
|
+
labels
|
|
284
|
+
}) => {
|
|
285
|
+
const [draft, setDraft] = React.useState(file.description ?? "");
|
|
286
|
+
React.useEffect(() => {
|
|
287
|
+
setDraft(file.description ?? "");
|
|
288
|
+
}, [file.id, file.description]);
|
|
289
|
+
const commit = () => {
|
|
290
|
+
if (readOnly) return;
|
|
291
|
+
if (draft !== (file.description ?? "")) {
|
|
292
|
+
onDescriptionChange == null ? void 0 : onDescriptionChange(file.id, draft);
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
const sizeText = formatBytes(file.size);
|
|
296
|
+
return /* @__PURE__ */ jsxs(
|
|
297
|
+
"aside",
|
|
298
|
+
{
|
|
299
|
+
className: cn(
|
|
300
|
+
// Chrome — bg-surface-raised 同 Toolbar / Filmstrip(token semantic「遮蓋型浮層」)
|
|
301
|
+
"w-80 shrink-0 flex flex-col bg-surface-raised border-l border-divider",
|
|
302
|
+
"h-full"
|
|
303
|
+
),
|
|
304
|
+
"aria-label": labels.detailPanel,
|
|
305
|
+
children: [
|
|
306
|
+
/* @__PURE__ */ jsxs(ChromeHeader, { lockDensity: "lg", className: "justify-between", children: [
|
|
307
|
+
/* @__PURE__ */ jsx("h3", { className: "text-body-lg font-medium text-foreground", children: labels.detailsHeading }),
|
|
308
|
+
/* @__PURE__ */ jsx(
|
|
309
|
+
Button,
|
|
310
|
+
{
|
|
311
|
+
iconOnly: true,
|
|
312
|
+
dismiss: true,
|
|
313
|
+
size: "sm",
|
|
314
|
+
"data-dismiss": true,
|
|
315
|
+
startIcon: X,
|
|
316
|
+
"aria-label": labels.detailPanelClose,
|
|
317
|
+
onClick: onClose
|
|
318
|
+
}
|
|
319
|
+
)
|
|
320
|
+
] }),
|
|
321
|
+
/* @__PURE__ */ jsx(ScrollArea, { className: "flex-1 min-h-0", children: /* @__PURE__ */ jsxs("div", { className: cn(
|
|
322
|
+
"flex flex-col gap-[var(--layout-space-loose)]",
|
|
323
|
+
"px-[var(--layout-space-loose)]",
|
|
324
|
+
"pt-[var(--layout-space-tight)] pb-[var(--layout-space-loose)]"
|
|
325
|
+
), children: [
|
|
326
|
+
/* @__PURE__ */ jsxs(Field, { children: [
|
|
327
|
+
/* @__PURE__ */ jsx(FieldLabel, { children: "說明" }),
|
|
328
|
+
/* @__PURE__ */ jsx(
|
|
329
|
+
Textarea,
|
|
330
|
+
{
|
|
331
|
+
value: draft,
|
|
332
|
+
onChange: (e) => setDraft(e.target.value),
|
|
333
|
+
onBlur: commit,
|
|
334
|
+
readOnly,
|
|
335
|
+
placeholder: readOnly ? labels.descriptionPlaceholderReadOnly : labels.descriptionPlaceholderEdit,
|
|
336
|
+
rows: 5
|
|
337
|
+
}
|
|
338
|
+
)
|
|
339
|
+
] }),
|
|
340
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-[var(--layout-space-tight)]", children: [
|
|
341
|
+
/* @__PURE__ */ jsx("span", { className: "text-body font-normal text-foreground", children: labels.fileInfoHeading }),
|
|
342
|
+
/* @__PURE__ */ jsxs(DescriptionList, { direction: "horizontal", divided: true, children: [
|
|
343
|
+
/* @__PURE__ */ jsx(DescriptionItem, { label: "檔名", children: file.name }),
|
|
344
|
+
/* @__PURE__ */ jsx(DescriptionItem, { label: "類型", children: file.mimeType || "—" }),
|
|
345
|
+
sizeText && /* @__PURE__ */ jsx(DescriptionItem, { label: "大小", children: /* @__PURE__ */ jsx("span", { className: "tabular-nums", children: sizeText }) }),
|
|
346
|
+
file.metadata && Object.entries(file.metadata).map(([k, v]) => /* @__PURE__ */ jsx(DescriptionItem, { label: k, children: String(v) }, k))
|
|
347
|
+
] })
|
|
348
|
+
] })
|
|
349
|
+
] }) })
|
|
350
|
+
]
|
|
351
|
+
}
|
|
352
|
+
);
|
|
353
|
+
};
|
|
354
|
+
const THUMB_SIZE = 64;
|
|
355
|
+
const Filmstrip = ({ files, activeIndex, onSelect, labels }) => {
|
|
356
|
+
const { scrollRef, atStart, atEnd, canScroll } = useScrollEdges();
|
|
357
|
+
const scrollByPage = useScrollByPage(scrollRef);
|
|
358
|
+
const maskImage = buildFadeMask({ canScroll, atStart, atEnd, reserveArrowWidth: 32 });
|
|
359
|
+
React.useEffect(() => {
|
|
360
|
+
const el = scrollRef.current;
|
|
361
|
+
if (!el) return;
|
|
362
|
+
const active = el.querySelector(`[data-thumb-index="${activeIndex}"]`);
|
|
363
|
+
active == null ? void 0 : active.scrollIntoView({ behavior: "smooth", inline: "center", block: "nearest" });
|
|
364
|
+
}, [activeIndex, scrollRef]);
|
|
365
|
+
return /* @__PURE__ */ jsxs(
|
|
366
|
+
"div",
|
|
367
|
+
{
|
|
368
|
+
className: cn(
|
|
369
|
+
// Chrome — bg-surface-raised 同 Toolbar / InfoPanel(token semantic「遮蓋型浮層」)
|
|
370
|
+
"relative shrink-0 h-24 bg-surface-raised border-t border-divider",
|
|
371
|
+
"flex items-center",
|
|
372
|
+
"px-[var(--layout-space-loose)]"
|
|
373
|
+
),
|
|
374
|
+
children: [
|
|
375
|
+
canScroll && !atStart && /* @__PURE__ */ jsx(OverflowScrollArrow, { direction: "left", onClick: () => scrollByPage("left") }),
|
|
376
|
+
/* @__PURE__ */ jsx(
|
|
377
|
+
"div",
|
|
378
|
+
{
|
|
379
|
+
ref: scrollRef,
|
|
380
|
+
className: cn(
|
|
381
|
+
"flex items-center",
|
|
382
|
+
// 刻意隱藏 native scrollbar + 用 fade-mask(horizontal-overflow pattern)
|
|
383
|
+
"scrollbar-none overflow-x-auto overflow-y-hidden h-full py-2",
|
|
384
|
+
"w-full"
|
|
385
|
+
),
|
|
386
|
+
style: {
|
|
387
|
+
maskImage,
|
|
388
|
+
WebkitMaskImage: maskImage
|
|
389
|
+
},
|
|
390
|
+
children: /* @__PURE__ */ jsx(
|
|
391
|
+
"div",
|
|
392
|
+
{
|
|
393
|
+
role: "tablist",
|
|
394
|
+
"aria-label": labels.filmstripLabel,
|
|
395
|
+
className: "flex items-center gap-[var(--layout-space-tight)] mx-auto shrink-0",
|
|
396
|
+
children: files.map((file, i) => {
|
|
397
|
+
var _a;
|
|
398
|
+
const active = i === activeIndex;
|
|
399
|
+
const isImage = canRenderImage(file);
|
|
400
|
+
const ext = ((_a = file.name.split(".").pop()) == null ? void 0 : _a.toUpperCase()) ?? "檔";
|
|
401
|
+
return /* @__PURE__ */ jsx(
|
|
402
|
+
"button",
|
|
403
|
+
{
|
|
404
|
+
type: "button",
|
|
405
|
+
role: "tab",
|
|
406
|
+
"aria-selected": active,
|
|
407
|
+
"aria-label": `${i + 1} / ${files.length}:${file.name}`,
|
|
408
|
+
"data-thumb-index": i,
|
|
409
|
+
onClick: () => onSelect(i),
|
|
410
|
+
className: cn(
|
|
411
|
+
"shrink-0 rounded-md bg-muted overflow-hidden",
|
|
412
|
+
"outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
413
|
+
"transition-shadow duration-150",
|
|
414
|
+
active ? "ring-2 ring-primary" : "ring-1 ring-border hover:ring-border-hover"
|
|
415
|
+
),
|
|
416
|
+
style: { width: THUMB_SIZE, height: THUMB_SIZE },
|
|
417
|
+
children: /* @__PURE__ */ jsx(AspectRatio, { ratio: 1, className: "w-full h-full", children: isImage ? /* @__PURE__ */ jsx(
|
|
418
|
+
"img",
|
|
419
|
+
{
|
|
420
|
+
src: file.url,
|
|
421
|
+
alt: "",
|
|
422
|
+
"aria-hidden": true,
|
|
423
|
+
className: "w-full h-full object-cover",
|
|
424
|
+
draggable: false
|
|
425
|
+
}
|
|
426
|
+
) : /* @__PURE__ */ jsxs("div", { className: "w-full h-full flex flex-col items-center justify-center gap-0.5", children: [
|
|
427
|
+
/* @__PURE__ */ jsx(FileText, { size: 20, className: "text-fg-muted", "aria-hidden": true }),
|
|
428
|
+
/* @__PURE__ */ jsx("span", { className: "text-footnote text-fg-muted font-medium", children: ext })
|
|
429
|
+
] }) })
|
|
430
|
+
},
|
|
431
|
+
file.id
|
|
432
|
+
);
|
|
433
|
+
})
|
|
434
|
+
}
|
|
435
|
+
)
|
|
436
|
+
}
|
|
437
|
+
),
|
|
438
|
+
canScroll && !atEnd && /* @__PURE__ */ jsx(OverflowScrollArrow, { direction: "right", onClick: () => scrollByPage("right") })
|
|
439
|
+
]
|
|
440
|
+
}
|
|
441
|
+
);
|
|
442
|
+
};
|
|
443
|
+
const DEFAULT_LABELS = {
|
|
444
|
+
zoomInput: "縮放比例",
|
|
445
|
+
zoomMenu: "開啟縮放選單",
|
|
446
|
+
infoToggleCollapse: "收合詳細資訊面板",
|
|
447
|
+
infoToggleExpand: "展開詳細資訊面板",
|
|
448
|
+
download: "下載檔案",
|
|
449
|
+
close: "關閉檢視器",
|
|
450
|
+
detailPanel: "檔案詳細資訊",
|
|
451
|
+
detailsHeading: "詳細資訊",
|
|
452
|
+
detailPanelClose: "關閉詳細資訊",
|
|
453
|
+
descriptionPlaceholderReadOnly: "尚無說明",
|
|
454
|
+
descriptionPlaceholderEdit: "為這個檔案加上說明…",
|
|
455
|
+
fileInfoHeading: "檔案資訊",
|
|
456
|
+
filmstripLabel: "檔案佇列",
|
|
457
|
+
previousFile: "上一個檔案",
|
|
458
|
+
nextFile: "下一個檔案"
|
|
459
|
+
};
|
|
460
|
+
const FileViewer = React.forwardRef(function FileViewer2({
|
|
461
|
+
files,
|
|
462
|
+
initialIndex = 0,
|
|
463
|
+
open,
|
|
464
|
+
defaultOpen,
|
|
465
|
+
onOpenChange,
|
|
466
|
+
index: indexProp,
|
|
467
|
+
onIndexChange,
|
|
468
|
+
onDescriptionChange,
|
|
469
|
+
readOnly = false,
|
|
470
|
+
showFilmstrip = false,
|
|
471
|
+
allowDownload = true,
|
|
472
|
+
onDownload,
|
|
473
|
+
labels: labelsOverride,
|
|
474
|
+
...props
|
|
475
|
+
}, ref) {
|
|
476
|
+
const labels = React.useMemo(
|
|
477
|
+
() => ({ ...DEFAULT_LABELS, ...labelsOverride }),
|
|
478
|
+
[labelsOverride]
|
|
479
|
+
);
|
|
480
|
+
const [internalIndex, setInternalIndex] = React.useState(initialIndex);
|
|
481
|
+
const activeIndex = indexProp ?? internalIndex;
|
|
482
|
+
const setIndex = React.useCallback(
|
|
483
|
+
(next) => {
|
|
484
|
+
const clamped = Math.max(0, Math.min(files.length - 1, next));
|
|
485
|
+
if (indexProp === void 0) setInternalIndex(clamped);
|
|
486
|
+
onIndexChange == null ? void 0 : onIndexChange(clamped);
|
|
487
|
+
},
|
|
488
|
+
[files.length, indexProp, onIndexChange]
|
|
489
|
+
);
|
|
490
|
+
React.useEffect(() => {
|
|
491
|
+
if (open && indexProp === void 0) {
|
|
492
|
+
setInternalIndex(Math.max(0, Math.min(files.length - 1, initialIndex)));
|
|
493
|
+
}
|
|
494
|
+
}, [open, initialIndex, files.length, indexProp]);
|
|
495
|
+
const [infoOpen, setInfoOpen] = React.useState(false);
|
|
496
|
+
const [zoom, setZoom] = React.useState(100);
|
|
497
|
+
const [fitRequest, setFitRequest] = React.useState(null);
|
|
498
|
+
const [capabilities, setCapabilities] = React.useState({
|
|
499
|
+
zoom: false
|
|
500
|
+
});
|
|
501
|
+
const file = files[activeIndex];
|
|
502
|
+
const Renderer = file ? resolveRenderer(file) : null;
|
|
503
|
+
const handleFit = React.useCallback((fit) => {
|
|
504
|
+
setFitRequest((prev) => ({ fit, nonce: ((prev == null ? void 0 : prev.nonce) ?? 0) + 1 }));
|
|
505
|
+
}, []);
|
|
506
|
+
const handleDownload = React.useCallback(() => {
|
|
507
|
+
if (!file) return;
|
|
508
|
+
if (onDownload) {
|
|
509
|
+
onDownload(file);
|
|
510
|
+
return;
|
|
511
|
+
}
|
|
512
|
+
const a = document.createElement("a");
|
|
513
|
+
a.href = file.url;
|
|
514
|
+
a.download = file.name;
|
|
515
|
+
a.target = "_blank";
|
|
516
|
+
a.rel = "noopener";
|
|
517
|
+
document.body.appendChild(a);
|
|
518
|
+
a.click();
|
|
519
|
+
document.body.removeChild(a);
|
|
520
|
+
}, [file, onDownload]);
|
|
521
|
+
React.useEffect(() => {
|
|
522
|
+
if (!open) return;
|
|
523
|
+
const handler = (e) => {
|
|
524
|
+
const target = e.target;
|
|
525
|
+
const tag = target == null ? void 0 : target.tagName;
|
|
526
|
+
if (tag === "INPUT" || tag === "TEXTAREA" || (target == null ? void 0 : target.isContentEditable)) return;
|
|
527
|
+
if (e.key === "ArrowLeft" && files.length > 1) {
|
|
528
|
+
e.preventDefault();
|
|
529
|
+
setIndex(activeIndex - 1);
|
|
530
|
+
} else if (e.key === "ArrowRight" && files.length > 1) {
|
|
531
|
+
e.preventDefault();
|
|
532
|
+
setIndex(activeIndex + 1);
|
|
533
|
+
} else if (e.key === "+" || e.key === "=") {
|
|
534
|
+
if (capabilities.zoom) {
|
|
535
|
+
e.preventDefault();
|
|
536
|
+
setZoom((z) => nextZoomIn(z));
|
|
537
|
+
}
|
|
538
|
+
} else if (e.key === "-") {
|
|
539
|
+
if (capabilities.zoom) {
|
|
540
|
+
e.preventDefault();
|
|
541
|
+
setZoom((z) => nextZoomOut(z));
|
|
542
|
+
}
|
|
543
|
+
} else if (e.key === "0") {
|
|
544
|
+
if (capabilities.zoom) {
|
|
545
|
+
e.preventDefault();
|
|
546
|
+
setZoom(100);
|
|
547
|
+
}
|
|
548
|
+
} else if (e.key === "f" || e.key === "F") {
|
|
549
|
+
if (capabilities.zoom) {
|
|
550
|
+
e.preventDefault();
|
|
551
|
+
handleFit("fit-page");
|
|
552
|
+
}
|
|
553
|
+
} else if (e.key === "i" || e.key === "I") {
|
|
554
|
+
e.preventDefault();
|
|
555
|
+
setInfoOpen((o) => !o);
|
|
556
|
+
}
|
|
557
|
+
};
|
|
558
|
+
window.addEventListener("keydown", handler);
|
|
559
|
+
return () => window.removeEventListener("keydown", handler);
|
|
560
|
+
}, [open, activeIndex, files.length, setIndex, capabilities.zoom, handleFit]);
|
|
561
|
+
const [armVisible, setArmVisible] = React.useState(false);
|
|
562
|
+
const idleTimerRef = React.useRef(null);
|
|
563
|
+
const handleViewportMouseMove = React.useCallback(() => {
|
|
564
|
+
setArmVisible(true);
|
|
565
|
+
if (idleTimerRef.current) clearTimeout(idleTimerRef.current);
|
|
566
|
+
idleTimerRef.current = setTimeout(() => setArmVisible(false), 2500);
|
|
567
|
+
}, []);
|
|
568
|
+
const handleViewportMouseLeave = React.useCallback(() => {
|
|
569
|
+
setArmVisible(false);
|
|
570
|
+
if (idleTimerRef.current) clearTimeout(idleTimerRef.current);
|
|
571
|
+
}, []);
|
|
572
|
+
React.useEffect(() => () => {
|
|
573
|
+
if (idleTimerRef.current) clearTimeout(idleTimerRef.current);
|
|
574
|
+
}, []);
|
|
575
|
+
if (!file || !Renderer) {
|
|
576
|
+
return null;
|
|
577
|
+
}
|
|
578
|
+
const showFilmstripResolved = showFilmstrip && files.length > 1;
|
|
579
|
+
const showArrows = files.length > 1;
|
|
580
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Root, { open, defaultOpen, onOpenChange, children: /* @__PURE__ */ jsxs(DialogPrimitive.Portal, { children: [
|
|
581
|
+
/* @__PURE__ */ jsx(
|
|
582
|
+
DialogPrimitive.Overlay,
|
|
583
|
+
{
|
|
584
|
+
"data-theme": "dark",
|
|
585
|
+
className: cn(
|
|
586
|
+
"fixed inset-0 z-50 bg-overlay",
|
|
587
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
588
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"
|
|
589
|
+
)
|
|
590
|
+
}
|
|
591
|
+
),
|
|
592
|
+
/* @__PURE__ */ jsx(
|
|
593
|
+
DialogPrimitive.Content,
|
|
594
|
+
{
|
|
595
|
+
ref,
|
|
596
|
+
className: cn(
|
|
597
|
+
// Edge-to-edge fullscreen,無 inset / 無 radius(與一般 Dialog 差別的所在)
|
|
598
|
+
"fixed inset-0 z-50 outline-none",
|
|
599
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
600
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"
|
|
601
|
+
),
|
|
602
|
+
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
603
|
+
...props,
|
|
604
|
+
children: /* @__PURE__ */ jsxs(
|
|
605
|
+
"div",
|
|
606
|
+
{
|
|
607
|
+
"data-theme": "dark",
|
|
608
|
+
className: "w-full h-full flex flex-col text-foreground",
|
|
609
|
+
children: [
|
|
610
|
+
/* @__PURE__ */ jsxs(DialogPrimitive.Title, { className: "sr-only", children: [
|
|
611
|
+
"檔案檢視器:",
|
|
612
|
+
file.name
|
|
613
|
+
] }),
|
|
614
|
+
/* @__PURE__ */ jsx(
|
|
615
|
+
Toolbar,
|
|
616
|
+
{
|
|
617
|
+
file,
|
|
618
|
+
capabilities,
|
|
619
|
+
zoom,
|
|
620
|
+
onZoomChange: setZoom,
|
|
621
|
+
onFit: handleFit,
|
|
622
|
+
infoOpen,
|
|
623
|
+
onInfoToggle: () => setInfoOpen((o) => !o),
|
|
624
|
+
onDownload: handleDownload,
|
|
625
|
+
allowDownload,
|
|
626
|
+
onClose: () => onOpenChange == null ? void 0 : onOpenChange(false),
|
|
627
|
+
labels
|
|
628
|
+
}
|
|
629
|
+
),
|
|
630
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-h-0 flex", children: [
|
|
631
|
+
/* @__PURE__ */ jsxs(
|
|
632
|
+
"div",
|
|
633
|
+
{
|
|
634
|
+
className: "relative flex-1 min-w-0",
|
|
635
|
+
onMouseMove: handleViewportMouseMove,
|
|
636
|
+
onMouseLeave: handleViewportMouseLeave,
|
|
637
|
+
onClick: (e) => {
|
|
638
|
+
const t = e.target;
|
|
639
|
+
if (t.closest('button, [role="button"]')) return;
|
|
640
|
+
const img = e.currentTarget.querySelector("img");
|
|
641
|
+
if (img) {
|
|
642
|
+
const r = img.getBoundingClientRect();
|
|
643
|
+
if (e.clientX >= r.left && e.clientX <= r.right && e.clientY >= r.top && e.clientY <= r.bottom) return;
|
|
644
|
+
}
|
|
645
|
+
onOpenChange == null ? void 0 : onOpenChange(false);
|
|
646
|
+
},
|
|
647
|
+
children: [
|
|
648
|
+
showArrows && activeIndex > 0 && /* @__PURE__ */ jsx(
|
|
649
|
+
"div",
|
|
650
|
+
{
|
|
651
|
+
className: cn(
|
|
652
|
+
"absolute left-[var(--layout-space-loose)] top-1/2 -translate-y-1/2 z-10",
|
|
653
|
+
"transition-opacity duration-150",
|
|
654
|
+
// armVisible state 控制,或 focus-within 時 a11y 強制顯示
|
|
655
|
+
armVisible ? "opacity-100" : "opacity-0 pointer-events-none",
|
|
656
|
+
"focus-within:opacity-100 focus-within:pointer-events-auto"
|
|
657
|
+
),
|
|
658
|
+
children: /* @__PURE__ */ jsx(
|
|
659
|
+
Button,
|
|
660
|
+
{
|
|
661
|
+
variant: "text",
|
|
662
|
+
size: "md",
|
|
663
|
+
iconOnly: true,
|
|
664
|
+
startIcon: ChevronLeft,
|
|
665
|
+
"aria-label": labels.previousFile,
|
|
666
|
+
onClick: () => setIndex(activeIndex - 1)
|
|
667
|
+
}
|
|
668
|
+
)
|
|
669
|
+
}
|
|
670
|
+
),
|
|
671
|
+
/* @__PURE__ */ jsx("div", { className: "w-full h-full", children: /* @__PURE__ */ jsx(
|
|
672
|
+
Renderer.component,
|
|
673
|
+
{
|
|
674
|
+
file,
|
|
675
|
+
zoom,
|
|
676
|
+
onZoomChange: setZoom,
|
|
677
|
+
fitRequest,
|
|
678
|
+
onCapabilitiesChange: setCapabilities
|
|
679
|
+
}
|
|
680
|
+
) }),
|
|
681
|
+
showArrows && activeIndex < files.length - 1 && /* @__PURE__ */ jsx(
|
|
682
|
+
"div",
|
|
683
|
+
{
|
|
684
|
+
className: cn(
|
|
685
|
+
"absolute right-[var(--layout-space-loose)] top-1/2 -translate-y-1/2 z-10",
|
|
686
|
+
"transition-opacity duration-150",
|
|
687
|
+
armVisible ? "opacity-100" : "opacity-0 pointer-events-none",
|
|
688
|
+
"focus-within:opacity-100 focus-within:pointer-events-auto"
|
|
689
|
+
),
|
|
690
|
+
children: /* @__PURE__ */ jsx(
|
|
691
|
+
Button,
|
|
692
|
+
{
|
|
693
|
+
variant: "text",
|
|
694
|
+
size: "md",
|
|
695
|
+
iconOnly: true,
|
|
696
|
+
startIcon: ChevronRight,
|
|
697
|
+
"aria-label": labels.nextFile,
|
|
698
|
+
onClick: () => setIndex(activeIndex + 1)
|
|
699
|
+
}
|
|
700
|
+
)
|
|
701
|
+
}
|
|
702
|
+
)
|
|
703
|
+
]
|
|
704
|
+
}
|
|
705
|
+
),
|
|
706
|
+
infoOpen && /* @__PURE__ */ jsx(
|
|
707
|
+
InfoPanel,
|
|
708
|
+
{
|
|
709
|
+
file,
|
|
710
|
+
readOnly,
|
|
711
|
+
onDescriptionChange,
|
|
712
|
+
onClose: () => setInfoOpen(false),
|
|
713
|
+
labels
|
|
714
|
+
}
|
|
715
|
+
)
|
|
716
|
+
] }),
|
|
717
|
+
showFilmstripResolved && /* @__PURE__ */ jsx(
|
|
718
|
+
Filmstrip,
|
|
719
|
+
{
|
|
720
|
+
files,
|
|
721
|
+
activeIndex,
|
|
722
|
+
onSelect: setIndex,
|
|
723
|
+
labels
|
|
724
|
+
}
|
|
725
|
+
)
|
|
726
|
+
]
|
|
727
|
+
}
|
|
728
|
+
)
|
|
729
|
+
}
|
|
730
|
+
)
|
|
731
|
+
] }) });
|
|
732
|
+
});
|
|
733
|
+
FileViewer.displayName = "FileViewer";
|
|
734
|
+
const fileViewerMeta = {
|
|
735
|
+
component: "FileViewer",
|
|
736
|
+
family: null,
|
|
737
|
+
// non-family composite / overlay / layout
|
|
738
|
+
variants: {},
|
|
739
|
+
sizes: {},
|
|
740
|
+
states: ["default", "hover", "active", "focus-visible", "disabled"],
|
|
741
|
+
tokens: {
|
|
742
|
+
bg: ["bg-muted", "bg-surface", "bg-surface-raised"],
|
|
743
|
+
fg: ["text-fg-muted", "text-foreground"],
|
|
744
|
+
ring: ["ring-primary", "ring-ring"]
|
|
745
|
+
}
|
|
746
|
+
};
|
|
747
|
+
export {
|
|
748
|
+
FileViewer,
|
|
749
|
+
fileViewerMeta,
|
|
750
|
+
registerFileRenderer
|
|
751
|
+
};
|
|
752
|
+
//# sourceMappingURL=file-viewer.js.map
|