@godxjp/ui 31.31.8 → 32.0.1
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 +102 -121
- package/agent/START-HERE.md +10 -10
- package/agent/components/Accordion.json +2 -2
- package/agent/components/AccountChip.json +1 -1
- package/agent/components/Actions.json +1 -1
- package/agent/components/Activity.json +2 -2
- package/agent/components/Affix.json +1 -1
- package/agent/components/Alert.json +22 -6
- package/agent/components/AlertDialog.json +8 -1
- package/agent/components/Anchor.json +4 -3
- package/agent/components/AppLauncher.json +2 -2
- package/agent/components/AppProvider.json +19 -11
- package/agent/components/AppSettingPicker.json +18 -2
- package/agent/components/AppShell.json +4 -5
- package/agent/components/AreaChart.json +0 -1
- package/agent/components/AspectRatio.json +2 -2
- package/agent/components/Attachments.json +3 -3
- package/agent/components/AuthAccountSummary.json +1 -1
- package/agent/components/AuthDivider.json +1 -1
- package/agent/components/AuthExpiryProvider.json +0 -1
- package/agent/components/AuthFooter.json +2 -2
- package/agent/components/AuthIdentity.json +3 -3
- package/agent/components/AuthStack.json +1 -1
- package/agent/components/Avatar.json +2 -12
- package/agent/components/Badge.json +1 -1
- package/agent/components/BarChart.json +0 -1
- package/agent/components/BranchScopePicker.json +1 -1
- package/agent/components/Breadcrumb.json +1 -1
- package/agent/components/Button.json +3 -3
- package/agent/components/Calendar.json +1 -1
- package/agent/components/Card.json +2 -2
- package/agent/components/CardBar.json +0 -1
- package/agent/components/CardContent.json +0 -1
- package/agent/components/Carousel.json +4 -3
- package/agent/components/Cascader.json +1 -1
- package/agent/components/CenteredShell.json +78 -17
- package/agent/components/ChatBubble.json +3 -3
- package/agent/components/ChatBubbleList.json +3 -3
- package/agent/components/ChatComposer.json +3 -3
- package/agent/components/ChatSuggestion.json +3 -3
- package/agent/components/Checkbox.json +1 -1
- package/agent/components/CheckboxGroup.json +0 -1
- package/agent/components/CodeBlock.json +1 -1
- package/agent/components/Collapsible.json +4 -4
- package/agent/components/ColorPicker.json +1 -1
- package/agent/components/Command.json +5 -5
- package/agent/components/CommandPalette.json +1 -1
- package/agent/components/CompactBarTrend.json +1 -1
- package/agent/components/Conversations.json +3 -3
- package/agent/components/CredentialReveal.json +1 -1
- package/agent/components/DataState.json +2 -2
- package/agent/components/DataTable.json +1 -1
- package/agent/components/DatePicker.json +1 -1
- package/agent/components/Descriptions.json +1 -1
- package/agent/components/Dialog.json +2 -2
- package/agent/components/DraggablePanel.json +5 -4
- package/agent/components/DropdownMenu.json +1 -1
- package/agent/components/EmojiPicker.json +3 -2
- package/agent/components/EmptyState.json +1 -1
- package/agent/components/ErrorSurface.json +3 -3
- package/agent/components/FeatureList.json +1 -1
- package/agent/components/Field.json +0 -1
- package/agent/components/Flex.json +34 -4
- package/agent/components/FloatButton.json +6 -5
- package/agent/components/Form.json +1 -1
- package/agent/components/FormErrors.json +0 -1
- package/agent/components/FormField.json +6 -6
- package/agent/components/FormFieldArray.json +0 -1
- package/agent/components/FormFieldControl.json +0 -1
- package/agent/components/FormRoot.json +1 -1
- package/agent/components/Heading.json +3 -0
- package/agent/components/Icon.json +1 -1
- package/agent/components/Image.json +7 -4
- package/agent/components/InfiniteQueryState.json +1 -1
- package/agent/components/Input.json +1 -1
- package/agent/components/InputOTP.json +2 -2
- package/agent/components/Label.json +3 -3
- package/agent/components/LegalDocumentShell.json +5 -4
- package/agent/components/Legend.json +1 -1
- package/agent/components/LineChart.json +0 -1
- package/agent/components/Link.json +0 -1
- package/agent/components/ListRow.json +1 -1
- package/agent/components/Logo.json +5 -4
- package/agent/components/Marquee.json +4 -3
- package/agent/components/Masonry.json +4 -3
- package/agent/components/MasterDetail.json +1 -1
- package/agent/components/MegaMenu.json +4 -3
- package/agent/components/MobileShell.json +4 -4
- package/agent/components/NavList.json +1 -1
- package/agent/components/NumberInput.json +1 -1
- package/agent/components/OrgChart.json +4 -3
- package/agent/components/OrgSwitcher.json +1 -1
- package/agent/components/OverlayPortalProvider.json +0 -1
- package/agent/components/PageContainer.json +3 -3
- package/agent/components/PageCover.json +3 -2
- package/agent/components/Pagination.json +1 -1
- package/agent/components/PasswordInput.json +1 -1
- package/agent/components/PasswordStrength.json +1 -1
- package/agent/components/PermissionMatrix.json +1 -1
- package/agent/components/PieChart.json +0 -1
- package/agent/components/Popover.json +31 -6
- package/agent/components/PrefetchLink.json +1 -1
- package/agent/components/Progress.json +1 -1
- package/agent/components/Prose.json +1 -1
- package/agent/components/QrCode.json +1 -1
- package/agent/components/Radio.json +0 -1
- package/agent/components/RadioGroup.json +2 -2
- package/agent/components/RangeTimeline.json +2 -1
- package/agent/components/Rating.json +1 -1
- package/agent/components/RecordPicker.json +1 -1
- package/agent/components/ResizablePanel.json +1 -1
- package/agent/components/ResponsiveGrid.json +2 -2
- package/agent/components/Reveal.json +3 -3
- package/agent/components/ScrollArea.json +2 -2
- package/agent/components/SearchInput.json +1 -1
- package/agent/components/Segmented.json +1 -1
- package/agent/components/Select.json +7 -5
- package/agent/components/Separator.json +1 -1
- package/agent/components/ServiceCatalogCta.json +0 -1
- package/agent/components/ServiceLauncherCard.json +1 -1
- package/agent/components/ServiceRolePanel.json +1 -1
- package/agent/components/Sheet.json +5 -5
- package/agent/components/Sidebar.json +1 -1
- package/agent/components/Skeleton.json +26 -12
- package/agent/components/Slider.json +2 -2
- package/agent/components/SortableList.json +3 -2
- package/agent/components/SplitPane.json +1 -1
- package/agent/components/StatCard.json +1 -1
- package/agent/components/Steps.json +1 -1
- package/agent/components/Swatch.json +1 -1
- package/agent/components/Switch.json +1 -1
- package/agent/components/Table.json +1 -1
- package/agent/components/Tabs.json +3 -3
- package/agent/components/Text.json +5 -1
- package/agent/components/TextDiff.json +5 -4
- package/agent/components/Textarea.json +1 -1
- package/agent/components/ThemeScope.json +1 -1
- package/agent/components/ThoughtChain.json +3 -3
- package/agent/components/TimePicker.json +1 -1
- package/agent/components/Timeline.json +1 -1
- package/agent/components/TimelineGrid.json +5 -4
- package/agent/components/Toaster.json +0 -1
- package/agent/components/Toggle.json +3 -3
- package/agent/components/ToggleGroup.json +1 -1
- package/agent/components/Toolbar.json +10 -3
- package/agent/components/Tooltip.json +9 -9
- package/agent/components/Topbar.json +1 -1
- package/agent/components/TopbarItem.json +1 -1
- package/agent/components/Transfer.json +2 -2
- package/agent/components/Tree.json +1 -1
- package/agent/components/TreeSelect.json +1 -1
- package/agent/components/TwoFactorSetup.json +1 -1
- package/agent/components/Upload.json +1 -1
- package/agent/components/UploadCropDialog.json +1 -1
- package/agent/components/Welcome.json +3 -3
- package/agent/components/formatDate.json +2 -2
- package/agent/components/inertiaUpload.json +0 -1
- package/agent/components/useZodForm.json +0 -1
- package/agent/components-index.json +80 -154
- package/agent/components.json +541 -1737
- package/agent/index.json +10 -10
- package/agent/llms.txt +9 -9
- package/agent/patterns/account-recovery-settings.json +1 -1
- package/agent/patterns/auth-recovery-panels.json +2 -2
- package/agent/patterns/error-pages.json +1 -1
- package/agent/patterns/pricing-plans.json +17 -0
- package/agent/patterns-index.json +17 -1
- package/agent/patterns.json +21 -4
- package/agent/rules.json +30 -65
- package/agent/tokens.json +27 -57
- package/agent/vocabulary.json +3 -3
- package/dist/app/app-provider.d.ts +5 -3
- package/dist/app/app-provider.js +47 -12
- package/dist/app/date-format-labels.d.ts +3 -1
- package/dist/app/date-format-labels.js +2 -4
- package/dist/app/date-formats.d.ts +21 -2
- package/dist/app/date-formats.js +51 -2
- package/dist/app/index.d.ts +3 -1
- package/dist/app/index.js +5 -0
- package/dist/app/locales.d.ts +58 -3
- package/dist/app/locales.js +134 -8
- package/dist/app/preset.d.ts +25 -0
- package/dist/app/preset.js +10 -0
- package/dist/app/request-headers.d.ts +3 -3
- package/dist/app/request-headers.js +19 -10
- package/dist/app/settings-scope.d.ts +54 -0
- package/dist/app/settings-scope.js +46 -0
- package/dist/app/tenant-theme.js +8 -3
- package/dist/app/time-format-labels.d.ts +4 -1
- package/dist/app/time-format-labels.js +7 -1
- package/dist/app/types.d.ts +10 -2
- package/dist/app/use-formatting.d.ts +1 -1
- package/dist/components/admin/index.d.ts +1 -1
- package/dist/components/admin/index.js +1 -1
- package/dist/components/data-display/accordion.d.ts +51 -1
- package/dist/components/data-display/accordion.js +247 -1
- package/dist/components/data-display/avatar.d.ts +16 -1
- package/dist/components/data-display/avatar.js +109 -1
- package/dist/components/data-display/credential-reveal.d.ts +9 -2
- package/dist/components/data-display/credential-reveal.js +156 -1
- package/dist/components/data-display/image.js +5 -3
- package/dist/components/data-display/index.d.ts +0 -21
- package/dist/components/data-display/index.js +1 -43
- package/dist/components/data-display/popover.d.ts +15 -3
- package/dist/components/data-display/popover.js +168 -2
- package/dist/components/data-entry/branch-scope-picker.d.ts +1 -1
- package/dist/components/data-entry/index.d.ts +5 -12
- package/dist/components/data-entry/index.js +11 -12
- package/dist/components/data-entry/input-otp.d.ts +48 -2
- package/dist/components/data-entry/input-otp.js +94 -1
- package/dist/components/data-entry/number-input.d.ts +1 -1
- package/dist/components/data-entry/password-input.d.ts +38 -2
- package/dist/components/data-entry/password-input.js +56 -1
- package/dist/components/data-entry/rating.d.ts +38 -2
- package/dist/components/data-entry/rating.js +127 -1
- package/dist/components/data-entry/segmented.d.ts +94 -2
- package/dist/components/data-entry/segmented.js +104 -1
- package/dist/components/{ui/tag-input.d.ts → data-entry/select-tags-inline.d.ts} +7 -4
- package/dist/components/{ui/tag-input.js → data-entry/select-tags-inline.js} +4 -4
- package/dist/components/data-entry/select.js +4 -0
- package/dist/components/data-entry/toggle-group.d.ts +108 -2
- package/dist/components/data-entry/toggle-group.js +189 -1
- package/dist/components/data-entry/toggle.d.ts +86 -2
- package/dist/components/data-entry/toggle.js +153 -2
- package/dist/components/feedback/alert.d.ts +5 -3
- package/dist/components/feedback/alert.js +14 -2
- package/dist/components/feedback/index.d.ts +2 -6
- package/dist/components/feedback/index.js +1 -13
- package/dist/components/feedback/skeleton.d.ts +4 -17
- package/dist/components/feedback/skeleton.js +3 -40
- package/dist/components/general/index.d.ts +2 -4
- package/dist/components/general/index.js +1 -6
- package/dist/components/general/typography.d.ts +4 -58
- package/dist/components/general/typography.js +7 -141
- package/dist/components/layout/aspect-ratio.d.ts +24 -1
- package/dist/components/layout/aspect-ratio.js +18 -1
- package/dist/components/layout/auth-divider.js +1 -1
- package/dist/components/layout/auth-identity.js +6 -2
- package/dist/components/layout/centered-shell.d.ts +13 -8
- package/dist/components/layout/centered-shell.js +43 -1
- package/dist/components/layout/flex.d.ts +1 -1
- package/dist/components/layout/flex.js +73 -1
- package/dist/components/layout/index.d.ts +1 -13
- package/dist/components/layout/index.js +0 -12
- package/dist/components/layout/separator.d.ts +25 -2
- package/dist/components/layout/separator.js +71 -1
- package/dist/components/navigation/{app-setting-toggle.d.ts → app-setting-cycle.d.ts} +3 -4
- package/dist/components/navigation/{app-setting-toggle.js → app-setting-cycle.js} +3 -3
- package/dist/components/navigation/app-setting-picker.d.ts +6 -2
- package/dist/components/navigation/app-setting-picker.js +20 -2
- package/dist/components/navigation/index.d.ts +3 -11
- package/dist/components/navigation/index.js +1 -9
- package/dist/components/navigation/tabs.js +1 -1
- package/dist/components/ui/carousel.d.ts +1 -1
- package/dist/components/ui/carousel.js +1 -1
- package/dist/components/ui/index.d.ts +11 -5
- package/dist/components/ui/index.js +5 -5
- package/dist/contracts/measurement.json +2 -2
- package/dist/email/brand-mark.d.ts +3 -2
- package/dist/email/brand-mark.js +1 -1
- package/dist/email/color.d.ts +7 -0
- package/dist/email/color.js +14 -1
- package/dist/email/index.d.ts +10 -2
- package/dist/email/index.js +23 -2
- package/dist/email/tokens.generated.d.ts +120 -2
- package/dist/email/tokens.generated.js +119 -1
- package/dist/i18n/locale-tags.d.ts +25 -0
- package/dist/i18n/locale-tags.js +59 -0
- package/dist/i18n/translate.d.ts +20 -3
- package/dist/i18n/translate.js +25 -14
- package/dist/i18n/use-translation.d.ts +3 -3
- package/dist/i18n/use-translation.js +4 -2
- package/dist/{components/navigation → lab}/anchor.d.ts +2 -2
- package/dist/{components/navigation → lab}/anchor.js +5 -5
- package/dist/{components/data-display → lab}/carousel.js +2 -2
- package/dist/{components/layout → lab}/draggable-panel.d.ts +8 -8
- package/dist/{components/layout → lab}/draggable-panel.js +2 -2
- package/dist/{components/data-entry → lab}/emoji-picker.d.ts +2 -2
- package/dist/{components/data-entry → lab}/emoji-picker.js +6 -6
- package/dist/{components/general → lab}/float-button.d.ts +8 -8
- package/dist/{components/general → lab}/float-button.js +7 -7
- package/dist/lab/index.d.ts +39 -0
- package/dist/lab/index.js +48 -0
- package/dist/{components/layout → lab}/legal-document-shell.d.ts +2 -2
- package/dist/{components/layout → lab}/legal-document-shell.js +4 -4
- package/dist/{components/data-display → lab}/marquee.d.ts +5 -5
- package/dist/{components/data-display → lab}/marquee.js +5 -5
- package/dist/{components/layout → lab}/masonry.d.ts +2 -2
- package/dist/{components/layout → lab}/masonry.js +3 -3
- package/dist/{components/navigation → lab}/mega-menu.d.ts +4 -4
- package/dist/{components/navigation → lab}/mega-menu.js +2 -2
- package/dist/{components/data-display → lab}/org-chart.d.ts +2 -2
- package/dist/{components/data-display → lab}/org-chart.js +4 -4
- package/dist/{components/layout → lab}/page-cover.d.ts +2 -2
- package/dist/{components/layout → lab}/page-cover.js +2 -2
- package/dist/{components/data-display → lab}/range-timeline.d.ts +1 -1
- package/dist/{components/data-display → lab}/range-timeline.js +6 -6
- package/dist/{components/data-entry → lab}/sortable-list.d.ts +2 -2
- package/dist/{components/data-entry → lab}/sortable-list.js +3 -3
- package/dist/{components/data-display → lab}/text-diff.d.ts +3 -3
- package/dist/{components/data-display → lab}/text-diff.js +4 -4
- package/dist/{components/data-display → lab}/timeline-grid.d.ts +2 -2
- package/dist/{components/data-display → lab}/timeline-grid.js +1 -1
- package/dist/lib/control-styles.js +1 -1
- package/dist/lib/datetime/format.js +20 -6
- package/dist/lib/datetime/sync.d.ts +6 -2
- package/dist/lib/datetime/sync.js +14 -18
- package/dist/lib/platform.d.ts +1 -1
- package/dist/props/components/app.prop.d.ts +28 -13
- package/dist/props/components/data-display.prop.d.ts +19 -29
- package/dist/props/components/feedback.prop.d.ts +15 -44
- package/dist/props/components/general.prop.d.ts +2 -64
- package/dist/props/components/index.d.ts +9 -1
- package/dist/props/components/layout.prop.d.ts +41 -57
- package/dist/props/registry.d.ts +48 -101
- package/dist/props/registry.js +45 -129
- package/dist/props/vocabulary/index.d.ts +1 -1
- package/dist/props/vocabulary/interaction.prop.d.ts +3 -12
- package/dist/styles/alert-layout.css +0 -29
- package/dist/styles/data-display-layout.css +14 -22
- package/dist/styles/fonts/OFL.txt +93 -0
- package/dist/styles/form-layout.css +4 -0
- package/dist/styles/index.css +0 -2
- package/dist/styles/layers.json +44 -179
- package/dist/styles/text-layout.css +0 -15
- package/dist/styles.css +2 -0
- package/dist/themes/godx-tokens.css +41 -0
- package/dist/themes/godx.css +3 -0
- package/dist/themes/godx.d.ts +16 -0
- package/dist/themes/godx.js +12 -0
- package/dist/tokens/components/feedback.css +0 -6
- package/dist/tokens/derived.css +23 -22
- package/dist/tokens/foundation.css +4 -6
- package/docs/COMPOSITION-VS-COMPONENT.md +58 -33
- package/docs/CONSUMER-RULES.md +1 -1
- package/docs/CUSTOMER-THEMING.md +17 -53
- package/docs/migrations/v32.md +105 -0
- package/package.json +59 -19
- package/scripts/_agent-setup.mjs +54 -3
- package/scripts/brand-accent.generated.mjs +15 -2
- package/scripts/cli.mjs +36 -11
- package/scripts/codemod.mjs +542 -0
- package/scripts/consumer-rule.md +21 -43
- package/scripts/postinstall.mjs +10 -47
- package/scripts/prune-css.mjs +1 -1
- package/scripts/ui-audit.mjs +5 -2
- package/dist/components/data-display/chat-bubble.d.ts +0 -30
- package/dist/components/data-display/chat-bubble.js +0 -229
- package/dist/components/data-display/hover-card.d.ts +0 -1
- package/dist/components/data-display/hover-card.js +0 -7
- package/dist/components/data-display/thought-chain.d.ts +0 -42
- package/dist/components/data-display/thought-chain.js +0 -177
- package/dist/components/data-display/thumbnail.d.ts +0 -37
- package/dist/components/data-display/thumbnail.js +0 -20
- package/dist/components/data-display/welcome.d.ts +0 -26
- package/dist/components/data-display/welcome.js +0 -37
- package/dist/components/data-entry/attachments.d.ts +0 -19
- package/dist/components/data-entry/attachments.js +0 -366
- package/dist/components/data-entry/chat-composer.d.ts +0 -51
- package/dist/components/data-entry/chat-composer.js +0 -200
- package/dist/components/data-entry/chat-suggestion.d.ts +0 -28
- package/dist/components/data-entry/chat-suggestion.js +0 -309
- package/dist/components/data-entry/tag-input.d.ts +0 -2
- package/dist/components/data-entry/tag-input.js +0 -5
- package/dist/components/feedback/banner.d.ts +0 -21
- package/dist/components/feedback/banner.js +0 -19
- package/dist/components/feedback/callout.d.ts +0 -23
- package/dist/components/feedback/callout.js +0 -42
- package/dist/components/layout/auth-shell.d.ts +0 -10
- package/dist/components/layout/auth-shell.js +0 -42
- package/dist/components/layout/space-compact.d.ts +0 -65
- package/dist/components/layout/space-compact.js +0 -52
- package/dist/components/navigation/conversations.d.ts +0 -39
- package/dist/components/navigation/conversations.js +0 -371
- package/dist/components/ui/accordion.d.ts +0 -51
- package/dist/components/ui/accordion.js +0 -254
- package/dist/components/ui/aspect-ratio.d.ts +0 -24
- package/dist/components/ui/aspect-ratio.js +0 -21
- package/dist/components/ui/avatar.d.ts +0 -16
- package/dist/components/ui/avatar.js +0 -115
- package/dist/components/ui/credential-reveal.d.ts +0 -9
- package/dist/components/ui/credential-reveal.js +0 -160
- package/dist/components/ui/hover-card.d.ts +0 -47
- package/dist/components/ui/hover-card.js +0 -205
- package/dist/components/ui/input-otp.d.ts +0 -48
- package/dist/components/ui/input-otp.js +0 -101
- package/dist/components/ui/password-input.d.ts +0 -38
- package/dist/components/ui/password-input.js +0 -60
- package/dist/components/ui/rating.d.ts +0 -38
- package/dist/components/ui/rating.js +0 -131
- package/dist/components/ui/segmented.d.ts +0 -94
- package/dist/components/ui/segmented.js +0 -108
- package/dist/components/ui/separator.d.ts +0 -25
- package/dist/components/ui/separator.js +0 -74
- package/dist/components/ui/toggle-group.d.ts +0 -108
- package/dist/components/ui/toggle-group.js +0 -194
- package/dist/components/ui/toggle.d.ts +0 -86
- package/dist/components/ui/toggle.js +0 -156
- package/docs/CANONICAL-CONTRACTS.md +0 -206
- package/docs/COMPONENTS.md +0 -163
- package/docs/DATETIME.md +0 -78
- package/docs/DEVELOPMENT.md +0 -269
- package/docs/FRAME-A11Y-CI.md +0 -287
- package/docs/FRAME-COVERAGE-LEDGER.md +0 -123
- package/docs/FRAME-COVERAGE-REPORT.md +0 -228
- package/docs/FRAME-COVERAGE-STANDARD.md +0 -65
- package/docs/FRAME-COVERAGE.md +0 -29
- package/docs/MEASUREMENT-CONTRACT.md +0 -109
- package/docs/PROPS-REGISTRY.md +0 -61
- package/docs/PROPS-VOCABULARY.md +0 -100
- package/docs/REGISTRY.md +0 -70
- package/docs/TESTING.md +0 -107
- package/docs/THEME-API-COVERAGE.md +0 -538
- package/docs/WHAT-BELONGS-HERE.md +0 -179
- package/docs/asset-modules.d.ts +0 -53
- package/docs/assets/cover-terrain.svg +0 -6
- package/docs/assets/portrait-amber.svg +0 -5
- package/docs/assets/portrait-clay.svg +0 -5
- package/docs/assets/portrait-indigo.svg +0 -5
- package/docs/assets/portrait-iris.svg +0 -5
- package/docs/assets/portrait-moss.svg +0 -5
- package/docs/assets/portrait-plum.svg +0 -5
- package/docs/assets/portrait-slate.svg +0 -5
- package/docs/assets/service-mark-rose.svg +0 -6
- package/docs/assets/service-mark-teal.svg +0 -5
- package/docs/assets/shot-landscape.svg +0 -12
- package/docs/assets/shot-portrait.svg +0 -10
- package/docs/assets/tcgm/card-1.svg +0 -1
- package/docs/assets/tcgm/card-2.svg +0 -1
- package/docs/assets/tcgm/card-3.svg +0 -1
- package/docs/assets/tcgm/card-4.svg +0 -1
- package/docs/assets/tcgm/card-5.svg +0 -1
- package/docs/assets/tcgm/card-6.svg +0 -1
- package/docs/assets/tcgm/hero-prism.svg +0 -1
- package/docs/assets/tcgm/scene-1.svg +0 -1
- package/docs/assets/tcgm/scene-2.svg +0 -1
- package/docs/assets/tcgm/scene-3.svg +0 -1
- package/docs/assets/tcgm/scene-4.svg +0 -1
- package/docs/assets/tcgm/scene-5.svg +0 -1
- package/docs/assets/tcgm/tcgm-lockup-color.svg +0 -1
- package/docs/assets/tcgm/tcgm-symbol-color.svg +0 -1
- package/docs/charts/cjk-category-axis.tsx +0 -81
- package/docs/charts/compact-bar-trend.tsx +0 -327
- package/docs/charts/size-tiers.tsx +0 -192
- package/docs/data-display/accordion.tsx +0 -99
- package/docs/data-display/avatar.tsx +0 -502
- package/docs/data-display/badge.tsx +0 -335
- package/docs/data-display/card/examples/detail-panel.tsx +0 -106
- package/docs/data-display/card/examples/tab-list.tsx +0 -97
- package/docs/data-display/card/index.md +0 -3
- package/docs/data-display/card/index.tsx +0 -390
- package/docs/data-display/carousel.tsx +0 -160
- package/docs/data-display/charts.tsx +0 -278
- package/docs/data-display/chat-bubble.tsx +0 -397
- package/docs/data-display/code-block.tsx +0 -188
- package/docs/data-display/collapsible.tsx +0 -162
- package/docs/data-display/credential-reveal.tsx +0 -148
- package/docs/data-display/data-table/examples/antd-parity.tsx +0 -257
- package/docs/data-display/data-table/examples/approval-queue.tsx +0 -212
- package/docs/data-display/data-table/examples/grid-features.tsx +0 -158
- package/docs/data-display/data-table/examples/list-page.tsx +0 -175
- package/docs/data-display/data-table/examples/selectable-inbox.tsx +0 -113
- package/docs/data-display/data-table/examples/server-paged.tsx +0 -179
- package/docs/data-display/data-table/examples/striped-list.tsx +0 -173
- package/docs/data-display/data-table/index.md +0 -9
- package/docs/data-display/data-table/index.tsx +0 -407
- package/docs/data-display/descriptions.tsx +0 -263
- package/docs/data-display/empty-state.tsx +0 -164
- package/docs/data-display/feature-list.tsx +0 -159
- package/docs/data-display/hover-card.tsx +0 -181
- package/docs/data-display/image.tsx +0 -170
- package/docs/data-display/legend.tsx +0 -158
- package/docs/data-display/list-row.tsx +0 -441
- package/docs/data-display/markdown.tsx +0 -86
- package/docs/data-display/marquee.tsx +0 -254
- package/docs/data-display/org-chart.tsx +0 -165
- package/docs/data-display/permission-matrix.tsx +0 -188
- package/docs/data-display/popover-touch.tsx +0 -27
- package/docs/data-display/popover.tsx +0 -331
- package/docs/data-display/progress.tsx +0 -162
- package/docs/data-display/prose.tsx +0 -169
- package/docs/data-display/qr-code.tsx +0 -68
- package/docs/data-display/scroll-area.tsx +0 -420
- package/docs/data-display/service-launcher-card.tsx +0 -445
- package/docs/data-display/stat-card.tsx +0 -354
- package/docs/data-display/swatch.tsx +0 -107
- package/docs/data-display/table.tsx +0 -362
- package/docs/data-display/text-diff.tsx +0 -89
- package/docs/data-display/thought-chain.tsx +0 -176
- package/docs/data-display/thumbnail.tsx +0 -128
- package/docs/data-display/timeline-grid.tsx +0 -119
- package/docs/data-display/timeline.tsx +0 -671
- package/docs/data-display/touch-actions.tsx +0 -36
- package/docs/data-display/tree.tsx +0 -724
- package/docs/data-display/welcome.tsx +0 -115
- package/docs/data-entry/attachments.tsx +0 -160
- package/docs/data-entry/block-editor.tsx +0 -105
- package/docs/data-entry/branch-scope-picker.tsx +0 -128
- package/docs/data-entry/calendar.tsx +0 -226
- package/docs/data-entry/cascader.tsx +0 -380
- package/docs/data-entry/chat-composer.tsx +0 -619
- package/docs/data-entry/chat-suggestion.tsx +0 -301
- package/docs/data-entry/checkbox.tsx +0 -256
- package/docs/data-entry/color-picker.tsx +0 -189
- package/docs/data-entry/command-palette.tsx +0 -179
- package/docs/data-entry/command.tsx +0 -341
- package/docs/data-entry/country-picker-recipe.tsx +0 -175
- package/docs/data-entry/date-picker.tsx +0 -452
- package/docs/data-entry/emoji-picker.tsx +0 -35
- package/docs/data-entry/form/examples/employee-settings.tsx +0 -267
- package/docs/data-entry/form/examples/invoice-form.tsx +0 -387
- package/docs/data-entry/form-dynamic-fields.tsx +0 -199
- package/docs/data-entry/form-field/examples/a11y-contract.tsx +0 -242
- package/docs/data-entry/form-field/examples/create-form.tsx +0 -107
- package/docs/data-entry/form-field/index.md +0 -8
- package/docs/data-entry/form-field/index.tsx +0 -337
- package/docs/data-entry/form-inertia.tsx +0 -80
- package/docs/data-entry/form-root.tsx +0 -112
- package/docs/data-entry/form.tsx +0 -1498
- package/docs/data-entry/input-otp.tsx +0 -258
- package/docs/data-entry/input.tsx +0 -796
- package/docs/data-entry/label.tsx +0 -102
- package/docs/data-entry/markdown-editor.tsx +0 -69
- package/docs/data-entry/number-input.tsx +0 -279
- package/docs/data-entry/password-input.tsx +0 -102
- package/docs/data-entry/password-strength.tsx +0 -99
- package/docs/data-entry/radio-group.tsx +0 -316
- package/docs/data-entry/rating.tsx +0 -91
- package/docs/data-entry/record-picker.tsx +0 -209
- package/docs/data-entry/search-input.tsx +0 -121
- package/docs/data-entry/segmented-in-filter-row.tsx +0 -60
- package/docs/data-entry/segmented.tsx +0 -300
- package/docs/data-entry/select-async-contracts.tsx +0 -108
- package/docs/data-entry/select-matrix.tsx +0 -209
- package/docs/data-entry/select.tsx +0 -547
- package/docs/data-entry/slider.tsx +0 -212
- package/docs/data-entry/sortable-list.tsx +0 -76
- package/docs/data-entry/switch.tsx +0 -314
- package/docs/data-entry/tag-input.tsx +0 -145
- package/docs/data-entry/textarea.tsx +0 -249
- package/docs/data-entry/time-picker.tsx +0 -187
- package/docs/data-entry/time-range-picker.tsx +0 -55
- package/docs/data-entry/toggle-count.tsx +0 -348
- package/docs/data-entry/toggle-group.tsx +0 -438
- package/docs/data-entry/toggle.tsx +0 -217
- package/docs/data-entry/transfer.tsx +0 -115
- package/docs/data-entry/tree-select.tsx +0 -204
- package/docs/data-entry/upload-crop-dialog.tsx +0 -109
- package/docs/data-entry/upload.tsx +0 -310
- package/docs/feedback/alert-dialog.tsx +0 -270
- package/docs/feedback/alert.tsx +0 -248
- package/docs/feedback/auth-expiry.tsx +0 -104
- package/docs/feedback/banner.tsx +0 -183
- package/docs/feedback/callout.tsx +0 -220
- package/docs/feedback/danger-confirm.tsx +0 -91
- package/docs/feedback/dialog-touch.tsx +0 -24
- package/docs/feedback/dialog.tsx +0 -373
- package/docs/feedback/sheet.tsx +0 -510
- package/docs/feedback/skeleton.tsx +0 -168
- package/docs/feedback/toast.tsx +0 -135
- package/docs/feedback/tooltip.tsx +0 -171
- package/docs/feedback/two-factor-setup.tsx +0 -68
- package/docs/foundation/_email-specimen.ts +0 -274
- package/docs/foundation/_theme-editor-scope.ts +0 -222
- package/docs/foundation/colors.tsx +0 -207
- package/docs/foundation/density.tsx +0 -242
- package/docs/foundation/email-tokens.tsx +0 -323
- package/docs/foundation/radius-shadow.tsx +0 -154
- package/docs/foundation/spacing.tsx +0 -216
- package/docs/foundation/theme-editor.tsx +0 -654
- package/docs/foundation/typography.tsx +0 -147
- package/docs/general/actions.tsx +0 -175
- package/docs/general/activity.tsx +0 -289
- package/docs/general/button/examples/destructive-confirm.tsx +0 -90
- package/docs/general/button/examples/form-actions.tsx +0 -87
- package/docs/general/button/examples/toolbar.tsx +0 -160
- package/docs/general/button/index.md +0 -16
- package/docs/general/button/index.tsx +0 -236
- package/docs/general/float-button.tsx +0 -133
- package/docs/general/icon.tsx +0 -217
- package/docs/general/logo.tsx +0 -194
- package/docs/general/reveal.tsx +0 -309
- package/docs/general/typography.tsx +0 -542
- package/docs/i18n/messages/en.json +0 -1715
- package/docs/i18n/messages/ja.json +0 -1708
- package/docs/i18n/messages/vi.json +0 -1708
- package/docs/layout/account-chip.tsx +0 -72
- package/docs/layout/admin-collection.tsx +0 -122
- package/docs/layout/affix.tsx +0 -209
- package/docs/layout/app-launcher.tsx +0 -211
- package/docs/layout/app-shell-arrangements.tsx +0 -225
- package/docs/layout/app-shell-narrow-bar.tsx +0 -205
- package/docs/layout/app-shell-states.tsx +0 -171
- package/docs/layout/app-shell.tsx +0 -395
- package/docs/layout/aspect-ratio.tsx +0 -135
- package/docs/layout/auth-account-summary.tsx +0 -103
- package/docs/layout/auth-divider.tsx +0 -28
- package/docs/layout/auth-footer.tsx +0 -37
- package/docs/layout/auth-identity.tsx +0 -70
- package/docs/layout/auth-recovery/examples/mfa-challenge.md +0 -41
- package/docs/layout/auth-recovery/examples/mfa-challenge.tsx +0 -254
- package/docs/layout/auth-recovery/examples/mobile-390.md +0 -25
- package/docs/layout/auth-recovery/examples/mobile-390.tsx +0 -82
- package/docs/layout/auth-recovery/examples/password-recovery.md +0 -24
- package/docs/layout/auth-recovery/examples/password-recovery.tsx +0 -197
- package/docs/layout/auth-recovery/examples/wrapping-ja-en-vi.md +0 -27
- package/docs/layout/auth-recovery/examples/wrapping-ja-en-vi.tsx +0 -156
- package/docs/layout/auth-recovery/index.md +0 -140
- package/docs/layout/auth-recovery/index.tsx +0 -96
- package/docs/layout/auth-shell-context.tsx +0 -103
- package/docs/layout/auth-shell-device.tsx +0 -112
- package/docs/layout/auth-shell-registration.tsx +0 -338
- package/docs/layout/auth-shell-variants.tsx +0 -143
- package/docs/layout/auth-shell.tsx +0 -59
- package/docs/layout/auth-stack.tsx +0 -40
- package/docs/layout/centered-shell.tsx +0 -102
- package/docs/layout/draggable-panel.tsx +0 -127
- package/docs/layout/error-surface/examples/application-403.tsx +0 -84
- package/docs/layout/error-surface/examples/application-404.tsx +0 -77
- package/docs/layout/error-surface/examples/system-500.tsx +0 -47
- package/docs/layout/error-surface/examples/system-503.tsx +0 -48
- package/docs/layout/error-surface/index.md +0 -153
- package/docs/layout/error-surface/index.tsx +0 -239
- package/docs/layout/flex.tsx +0 -444
- package/docs/layout/legal-document-shell/_data.ts +0 -110
- package/docs/layout/legal-document-shell/examples/desktop-1440.md +0 -12
- package/docs/layout/legal-document-shell/examples/desktop-1440.tsx +0 -83
- package/docs/layout/legal-document-shell/examples/mobile-390.md +0 -22
- package/docs/layout/legal-document-shell/examples/mobile-390.tsx +0 -70
- package/docs/layout/legal-document-shell/examples/tablet-1024.md +0 -3
- package/docs/layout/legal-document-shell/examples/tablet-1024.tsx +0 -84
- package/docs/layout/legal-document-shell/examples/wrapping-ja-en-vi.md +0 -18
- package/docs/layout/legal-document-shell/examples/wrapping-ja-en-vi.tsx +0 -61
- package/docs/layout/legal-document-shell/index.md +0 -51
- package/docs/layout/legal-document-shell/index.tsx +0 -101
- package/docs/layout/masonry.tsx +0 -291
- package/docs/layout/master-detail.tsx +0 -390
- package/docs/layout/mobile-shell.tsx +0 -106
- package/docs/layout/nav-list.tsx +0 -584
- package/docs/layout/org-switcher.tsx +0 -131
- package/docs/layout/page-container.tsx +0 -1020
- package/docs/layout/page-cover.tsx +0 -56
- package/docs/layout/resizable-panel.tsx +0 -419
- package/docs/layout/responsive-grid.tsx +0 -403
- package/docs/layout/separator.tsx +0 -327
- package/docs/layout/service-role-panel.tsx +0 -144
- package/docs/layout/sidebar.tsx +0 -689
- package/docs/layout/space-compact.tsx +0 -202
- package/docs/layout/split-pane.tsx +0 -532
- package/docs/layout/topbar-item.tsx +0 -233
- package/docs/layout/topbar.tsx +0 -360
- package/docs/navigation/anchor.tsx +0 -295
- package/docs/navigation/app-setting-picker.tsx +0 -178
- package/docs/navigation/app-setting-toggle.tsx +0 -111
- package/docs/navigation/breadcrumb.tsx +0 -207
- package/docs/navigation/card-tabs.tsx +0 -344
- package/docs/navigation/conversations.tsx +0 -176
- package/docs/navigation/dropdown-menu.tsx +0 -345
- package/docs/navigation/filter-bar.tsx +0 -247
- package/docs/navigation/mega-menu-panel.tsx +0 -86
- package/docs/navigation/mega-menu.tsx +0 -254
- package/docs/navigation/pagination.tsx +0 -293
- package/docs/navigation/steps.tsx +0 -315
- package/docs/navigation/tabs-rtl.tsx +0 -28
- package/docs/navigation/tabs.tsx +0 -755
- package/docs/navigation/toolbar.tsx +0 -347
- package/docs/providers/app-provider.tsx +0 -191
- package/docs/providers/format-date.tsx +0 -230
- package/docs/providers/theme-scope.tsx +0 -186
- package/docs/query/button-refetch.tsx +0 -161
- package/docs/query/data-state.tsx +0 -262
- package/docs/query/infinite-query-state.tsx +0 -97
- package/docs/query/mutation-feedback.tsx +0 -128
- package/docs/query/touch-actions.tsx +0 -68
- package/docs/react-router/prefetch-link.tsx +0 -262
- package/docs/roadmap/ai-chat-components.md +0 -206
- package/docs/roadmap/antd-parity.md +0 -155
- package/docs/roadmap/badge-tag-chip-count.md +0 -172
- package/docs/roadmap/list-masonry.md +0 -159
- package/docs/roadmap/parity-audit-data-display-feedback.md +0 -567
- package/docs/roadmap/parity-audit-data-entry.md +0 -368
- package/docs/roadmap/parity-audit-layout-navigation-general.md +0 -459
- package/docs/roadmap/parity-backlog.md +0 -77
- package/docs/roadmap/tree-components.md +0 -151
- package/docs/roadmap/website-components.md +0 -813
- package/docs/showcase/acme-portal.tsx +0 -461
- package/docs/showcase/acme-website.tsx +0 -499
- package/docs/showcase/caimono-price-comparison.tsx +0 -919
- package/docs/showcase/case1-warehouse-dashboard.tsx +0 -358
- package/docs/showcase/case2-employee-me.tsx +0 -438
- package/docs/showcase/case3-approval-workflow.tsx +0 -531
- package/docs/showcase/case4-login.tsx +0 -312
- package/docs/showcase/case5-shift-calendar.tsx +0 -702
- package/docs/showcase/case6-agency-handy.tsx +0 -1120
- package/docs/showcase/futurelastic-web.tsx +0 -441
- package/docs/showcase/marketing-page.tsx +0 -895
- package/docs/showcase/org-switcher.tsx +0 -320
- package/docs/showcase/permission-matrix.tsx +0 -354
- package/docs/showcase/public-landing.tsx +0 -210
- package/docs/showcase/settings-account-sections.tsx +0 -559
- package/docs/showcase/settings-security-mfa.tsx +0 -145
- package/docs/showcase/table-approval-queue.tsx +0 -199
- package/docs/showcase/table-bulk-actions.tsx +0 -468
- package/docs/showcase/table-compact-kintone.tsx +0 -438
- package/docs/showcase/table-conditional-format.tsx +0 -367
- package/docs/showcase/table-crud-list.tsx +0 -544
- package/docs/showcase/table-density.tsx +0 -349
- package/docs/showcase/table-expandable-rows.tsx +0 -496
- package/docs/showcase/table-filter-chips.tsx +0 -468
- package/docs/showcase/table-footer-totals.tsx +0 -328
- package/docs/showcase/table-grouped-subtotals.tsx +0 -398
- package/docs/showcase/table-master-detail.tsx +0 -482
- package/docs/showcase/table-pagination.tsx +0 -409
- package/docs/showcase/table-states.tsx +0 -371
- package/docs/showcase/table-sticky-columns.tsx +0 -377
- package/docs/showcase/table-tree-rows.tsx +0 -451
- package/docs/showcase/table-view-tabs.tsx +0 -488
- package/docs/showcase/tcgm-website.tsx +0 -1047
- package/docs/showcase/tenant-brand-color.tsx +0 -338
- package/docs/showcase/theme-customization.tsx +0 -1292
- package/docs/showcase/theme-lab.tsx +0 -2125
- package/docs/themes/flat.css +0 -466
- package/docs/themes/glassmorphism.css +0 -960
- package/docs/themes/index.ts +0 -219
- package/docs/themes/neubrutalism.css +0 -481
- /package/dist/components/navigation/{filter-bar.d.ts → toolbar.d.ts} +0 -0
- /package/dist/components/navigation/{filter-bar.js → toolbar.js} +0 -0
- /package/dist/{components/data-display → lab}/carousel.d.ts +0 -0
- /package/dist/{components/data-entry → lab}/emoji-data.d.ts +0 -0
- /package/dist/{components/data-entry → lab}/emoji-data.js +0 -0
- /package/dist/{components/data-display → lab}/marquee-reveal.d.ts +0 -0
- /package/dist/{components/data-display → lab}/marquee-reveal.js +0 -0
|
@@ -1,1120 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Showcase · case6 — 代理店ハンディ (Agency Handy, mobile)
|
|
3
|
-
*
|
|
4
|
-
* The Acme consolidation-warehouse handheld app (390×844, gloves-on, scan-heavy),
|
|
5
|
-
* rebuilt ENTIRELY from real @godxjp/ui primitives — the reference-design "Handy Agency"
|
|
6
|
-
* design recreated as a skeleton (intent + look), not a transcription of its prototype DOM.
|
|
7
|
-
*
|
|
8
|
-
* Composition map (Handy prototype block → @godxjp/ui primitive):
|
|
9
|
-
* phone shell ................. composed frame (status bar / header / scroll / sticky bar / tabbar)
|
|
10
|
-
* header text-action .......... Button(ghost, size=sm) — iOS "Chọn" select-mode entry
|
|
11
|
-
* filter chips ................ ToggleGroup(type=single) — 32px count pills
|
|
12
|
-
* outbound segmented .......... ToggleGroup(type=single) — Chờ niêm phong / Chờ bàn giao / Đã bàn giao
|
|
13
|
-
* list-card recipe ............ Card + composed 3-line row + Badge(tone) + select-mode Checkbox
|
|
14
|
-
* status badge (1:1) .......... Badge tone — attention/info/muted/success/warning, color-locked
|
|
15
|
-
* select-mode bar ............. primary-soft toolbar strip (count + actions) above tabbar
|
|
16
|
-
* big scan Button ............. sticky-actions primary "Quét / Tìm mã" (flex-2, dominant)
|
|
17
|
-
* ItemLookupSheet ............. Sheet(side=bottom) — viewfinder placeholder + manual mono input
|
|
18
|
-
* package-picker Sheet ........ Sheet(side=bottom) — list of PKG rows + create-new row
|
|
19
|
-
* ItemFormModal Sheet ......... Sheet(side=bottom) — barcode + qty + radio-row "Đích đến"
|
|
20
|
-
* detail rows ................. Descriptions + Descriptions.Item(mono) — item detail
|
|
21
|
-
* confirm Dialog .............. AlertDialog — Seal / Handoff (verb confirm, not "OK")
|
|
22
|
-
* toast ....................... Toaster + toast.success — "Đã bàn giao … · 16:24"
|
|
23
|
-
* four list states ............ Loading(Skeleton) · Empty(EmptyState) · Error(Alert) · populated
|
|
24
|
-
*
|
|
25
|
-
* DNA applied: comfortable 44px touch density, mono codes (RC-/JAN/PKG-/A-03-02),
|
|
26
|
-
* fixed color signaling (attention 朱 = Chưa phân loại + fixable errors, info 群青 = open,
|
|
27
|
-
* muted = in-package/draft, success 若竹 = sealed, warning 山吹 = delivered), tabular-nums,
|
|
28
|
-
* scan-first (primary action widest), bottom-sheet-driven, vi-first quiet copy, no emoji.
|
|
29
|
-
*/
|
|
30
|
-
import * as React from "react";
|
|
31
|
-
import {
|
|
32
|
-
Boxes,
|
|
33
|
-
Check,
|
|
34
|
-
Inbox,
|
|
35
|
-
Package,
|
|
36
|
-
PackagePlus,
|
|
37
|
-
Plus,
|
|
38
|
-
RefreshCw,
|
|
39
|
-
ScanLine,
|
|
40
|
-
Search,
|
|
41
|
-
Truck,
|
|
42
|
-
X,
|
|
43
|
-
} from "lucide-react";
|
|
44
|
-
|
|
45
|
-
import { Button, Heading, Text } from "@godxjp/ui/general";
|
|
46
|
-
import { Flex, MobileShell, ResponsiveGrid } from "@godxjp/ui/layout";
|
|
47
|
-
import {
|
|
48
|
-
Badge,
|
|
49
|
-
type BadgeProps,
|
|
50
|
-
Card,
|
|
51
|
-
CardContent,
|
|
52
|
-
Descriptions,
|
|
53
|
-
EmptyState,
|
|
54
|
-
} from "@godxjp/ui/data-display";
|
|
55
|
-
import { Checkbox, Input, RadioGroup, ToggleGroup, ToggleGroupItem } from "@godxjp/ui/data-entry";
|
|
56
|
-
import {
|
|
57
|
-
AlertDialog,
|
|
58
|
-
Alert,
|
|
59
|
-
AlertTitle,
|
|
60
|
-
AlertDescription,
|
|
61
|
-
Sheet,
|
|
62
|
-
SheetBody,
|
|
63
|
-
SheetContent,
|
|
64
|
-
SheetFooter,
|
|
65
|
-
SheetHeader,
|
|
66
|
-
SheetTitle,
|
|
67
|
-
Skeleton,
|
|
68
|
-
Toaster,
|
|
69
|
-
toast,
|
|
70
|
-
} from "@godxjp/ui/feedback";
|
|
71
|
-
|
|
72
|
-
type BadgeTone = NonNullable<BadgeProps["tone"]>;
|
|
73
|
-
|
|
74
|
-
// ── Status vocabulary — 1:1 color-locked (Handy §6b: "same word in different colors is a bug") ──
|
|
75
|
-
type ItemStatus = "unsorted" | "shelf" | "packed";
|
|
76
|
-
const ITEM_STATUS: Record<ItemStatus, { label: string; tone: BadgeTone }> = {
|
|
77
|
-
unsorted: { label: "Chưa phân loại", tone: "destructive" }, // 朱 attention via destructive-adjacent? -> use warning? see note
|
|
78
|
-
shelf: { label: "Trên giá hàng", tone: "info" }, // 群青 open
|
|
79
|
-
packed: { label: "Trong kiện", tone: "muted" }, // draft / in-package
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
// Attention (朱) is the fixable-but-needs-action signal. Badge tones expose
|
|
83
|
-
// success/warning/destructive/info/muted/neutral — there is no dedicated "attention"
|
|
84
|
-
// tone, so non-destructive "Chưa phân loại" maps to warning (山吹), reserving
|
|
85
|
-
// destructive (茜) for the irreversible logout confirm only. (see gapNotes)
|
|
86
|
-
ITEM_STATUS.unsorted.tone = "warning";
|
|
87
|
-
|
|
88
|
-
type PackingStatus = "active" | "open" | "draft" | "sealed" | "delivered";
|
|
89
|
-
const PACKING_STATUS: Record<PackingStatus, { label: string; tone: BadgeTone }> = {
|
|
90
|
-
active: { label: "Đang làm", tone: "info" },
|
|
91
|
-
open: { label: "Đang mở", tone: "info" },
|
|
92
|
-
draft: { label: "Nháp", tone: "muted" },
|
|
93
|
-
sealed: { label: "Đã niêm phong", tone: "success" },
|
|
94
|
-
delivered: { label: "Đã bàn giao", tone: "muted" },
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
// ── Mock data ───────────────────────────────────────────────────────────────
|
|
98
|
-
|
|
99
|
-
interface HandyItem {
|
|
100
|
-
id: string;
|
|
101
|
-
name: string;
|
|
102
|
-
rc: string;
|
|
103
|
-
jan: string;
|
|
104
|
-
status: ItemStatus;
|
|
105
|
-
qty: number;
|
|
106
|
-
receivedAt: string;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
const ITEMS: HandyItem[] = [
|
|
110
|
-
{
|
|
111
|
-
id: "1",
|
|
112
|
-
name: "Sữa rửa mặt Hada Labo",
|
|
113
|
-
rc: "RC-204881",
|
|
114
|
-
jan: "4987241135219",
|
|
115
|
-
status: "unsorted",
|
|
116
|
-
qty: 3,
|
|
117
|
-
receivedAt: "14:02",
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
id: "2",
|
|
121
|
-
name: "Kem chống nắng Anessa",
|
|
122
|
-
rc: "RC-204882",
|
|
123
|
-
jan: "4909978141004",
|
|
124
|
-
status: "shelf",
|
|
125
|
-
qty: 1,
|
|
126
|
-
receivedAt: "13:48",
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
id: "3",
|
|
130
|
-
name: "Vitamin DHC B-Complex",
|
|
131
|
-
rc: "RC-204879",
|
|
132
|
-
jan: "4511413404164",
|
|
133
|
-
status: "shelf",
|
|
134
|
-
qty: 2,
|
|
135
|
-
receivedAt: "13:31",
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
id: "4",
|
|
139
|
-
name: "Bàn chải Ora2 Me",
|
|
140
|
-
rc: "RC-204875",
|
|
141
|
-
jan: "4903301242697",
|
|
142
|
-
status: "packed",
|
|
143
|
-
qty: 4,
|
|
144
|
-
receivedAt: "11:20",
|
|
145
|
-
},
|
|
146
|
-
];
|
|
147
|
-
|
|
148
|
-
interface Packing {
|
|
149
|
-
id: string;
|
|
150
|
-
code: string;
|
|
151
|
-
customer: string;
|
|
152
|
-
city: string;
|
|
153
|
-
items: number;
|
|
154
|
-
status: PackingStatus;
|
|
155
|
-
slot?: string;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
const PACKINGS: Packing[] = [
|
|
159
|
-
{
|
|
160
|
-
id: "p1",
|
|
161
|
-
code: "PKG-000041",
|
|
162
|
-
customer: "Bùi Hà",
|
|
163
|
-
city: "Hà Nội",
|
|
164
|
-
items: 8,
|
|
165
|
-
status: "active",
|
|
166
|
-
slot: "A-03-02",
|
|
167
|
-
},
|
|
168
|
-
{ id: "p2", code: "PKG-000040", customer: "Lê Minh", city: "TP.HCM", items: 5, status: "open" },
|
|
169
|
-
{
|
|
170
|
-
id: "p3",
|
|
171
|
-
code: "PKG-000038",
|
|
172
|
-
customer: "Trần Linh",
|
|
173
|
-
city: "Đà Nẵng",
|
|
174
|
-
items: 12,
|
|
175
|
-
status: "draft",
|
|
176
|
-
},
|
|
177
|
-
];
|
|
178
|
-
|
|
179
|
-
const OUTBOUND: Packing[] = [
|
|
180
|
-
{
|
|
181
|
-
id: "o1",
|
|
182
|
-
code: "PKG-000037",
|
|
183
|
-
customer: "Phạm An",
|
|
184
|
-
city: "Hà Nội",
|
|
185
|
-
items: 9,
|
|
186
|
-
status: "sealed",
|
|
187
|
-
slot: "B-01-04",
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
id: "o2",
|
|
191
|
-
code: "PKG-000036",
|
|
192
|
-
customer: "Vũ Nga",
|
|
193
|
-
city: "TP.HCM",
|
|
194
|
-
items: 6,
|
|
195
|
-
status: "sealed",
|
|
196
|
-
slot: "B-02-01",
|
|
197
|
-
},
|
|
198
|
-
];
|
|
199
|
-
|
|
200
|
-
const TABS = [
|
|
201
|
-
{ id: "inbound", label: "Nhập kho", icon: Inbox },
|
|
202
|
-
{ id: "packing", label: "Đóng gói", icon: Package },
|
|
203
|
-
{ id: "outbound", label: "Xuất kho", icon: Truck },
|
|
204
|
-
] as const;
|
|
205
|
-
|
|
206
|
-
const FILTERS = [
|
|
207
|
-
{ id: "all", label: "Tất cả", count: 42 },
|
|
208
|
-
{ id: "unsorted", label: "Chưa phân loại", count: 9 },
|
|
209
|
-
{ id: "shelf", label: "Trên giá hàng", count: 33 },
|
|
210
|
-
] as const;
|
|
211
|
-
|
|
212
|
-
// ── Small composed parts ─────────────────────────────────────────────────────
|
|
213
|
-
|
|
214
|
-
function MonoCode({ children }: { children: React.ReactNode }) {
|
|
215
|
-
return (
|
|
216
|
-
<Text size="xs" mono tone="muted" tabular>
|
|
217
|
-
{children}
|
|
218
|
-
</Text>
|
|
219
|
-
);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
/** The Handy list-card recipe: full-tap row, name + mono codes + badge/meta. */
|
|
223
|
-
function ItemListCard({
|
|
224
|
-
item,
|
|
225
|
-
selectMode,
|
|
226
|
-
selected,
|
|
227
|
-
onToggle,
|
|
228
|
-
}: {
|
|
229
|
-
item: HandyItem;
|
|
230
|
-
selectMode: boolean;
|
|
231
|
-
selected: boolean;
|
|
232
|
-
onToggle: () => void;
|
|
233
|
-
}) {
|
|
234
|
-
const st = ITEM_STATUS[item.status];
|
|
235
|
-
return (
|
|
236
|
-
<Card
|
|
237
|
-
density="tight"
|
|
238
|
-
className={
|
|
239
|
-
"rounded-xl transition-colors " +
|
|
240
|
-
(selected
|
|
241
|
-
? "border-primary bg-[color-mix(in_oklch,var(--primary)_8%,transparent)]"
|
|
242
|
-
: "hover:border-primary")
|
|
243
|
-
}
|
|
244
|
-
>
|
|
245
|
-
<CardContent solo>
|
|
246
|
-
<Flex align="start" gap="md">
|
|
247
|
-
<Flex direction="col" gap="xs">
|
|
248
|
-
{selectMode ? (
|
|
249
|
-
<Checkbox
|
|
250
|
-
checked={selected}
|
|
251
|
-
onCheckedChange={onToggle}
|
|
252
|
-
aria-label={`選択 ${item.name}`}
|
|
253
|
-
className="size-5"
|
|
254
|
-
/>
|
|
255
|
-
) : null}
|
|
256
|
-
<Flex direction="col" gap="sm" className="min-w-0 flex-1">
|
|
257
|
-
<Text as="div" size="sm" weight="bold" truncate>
|
|
258
|
-
{item.name}
|
|
259
|
-
</Text>
|
|
260
|
-
<Flex wrap align="center" gap="sm">
|
|
261
|
-
<MonoCode>{item.rc}</MonoCode>
|
|
262
|
-
<MonoCode>JAN {item.jan}</MonoCode>
|
|
263
|
-
</Flex>
|
|
264
|
-
<Flex align="center" justify="between" gap="sm">
|
|
265
|
-
<Badge tone={st.tone} variant="outline" className="rounded-full">
|
|
266
|
-
{st.label}
|
|
267
|
-
</Badge>
|
|
268
|
-
<Text size="xs" tone="muted" tabular className="shrink-0">
|
|
269
|
-
×{item.qty} · {item.receivedAt}
|
|
270
|
-
</Text>
|
|
271
|
-
</Flex>
|
|
272
|
-
</Flex>
|
|
273
|
-
</Flex>
|
|
274
|
-
</Flex>
|
|
275
|
-
</CardContent>
|
|
276
|
-
</Card>
|
|
277
|
-
);
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
function PackingListCard({ packing, onTap }: { packing: Packing; onTap?: () => void }) {
|
|
281
|
-
const st = PACKING_STATUS[packing.status];
|
|
282
|
-
return (
|
|
283
|
-
<Card
|
|
284
|
-
density="tight"
|
|
285
|
-
role={onTap ? "button" : undefined}
|
|
286
|
-
tabIndex={onTap ? 0 : undefined}
|
|
287
|
-
onClick={onTap}
|
|
288
|
-
className={
|
|
289
|
-
"rounded-xl transition-colors " + (onTap ? "hover:border-primary cursor-pointer" : "")
|
|
290
|
-
}
|
|
291
|
-
>
|
|
292
|
-
<CardContent solo>
|
|
293
|
-
<Flex direction="col" gap="xs">
|
|
294
|
-
<Flex align="center" justify="between" gap="sm">
|
|
295
|
-
<Text as="code" size="sm" weight="bold" tabular>
|
|
296
|
-
{packing.code}
|
|
297
|
-
</Text>
|
|
298
|
-
<Badge tone={st.tone} variant="outline" className="rounded-full">
|
|
299
|
-
{st.label}
|
|
300
|
-
</Badge>
|
|
301
|
-
</Flex>
|
|
302
|
-
<Flex align="center" justify="between" gap="sm">
|
|
303
|
-
<Text size="xs" tone="muted" truncate>
|
|
304
|
-
{packing.customer} · {packing.city}
|
|
305
|
-
</Text>
|
|
306
|
-
<Text size="xs" tone="muted" tabular className="shrink-0">
|
|
307
|
-
×{packing.items}
|
|
308
|
-
{packing.slot ? ` · ${packing.slot}` : ""}
|
|
309
|
-
</Text>
|
|
310
|
-
</Flex>
|
|
311
|
-
</Flex>
|
|
312
|
-
</CardContent>
|
|
313
|
-
</Card>
|
|
314
|
-
);
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
/** Three uppercase muted section header + right-aligned mono count. */
|
|
318
|
-
function SectionHeader({ children, count }: { children: React.ReactNode; count?: number }) {
|
|
319
|
-
return (
|
|
320
|
-
<Flex align="center" justify="between">
|
|
321
|
-
<Text size="2xs" weight="medium" tone="muted" className="tracking-wider uppercase">
|
|
322
|
-
{children}
|
|
323
|
-
</Text>
|
|
324
|
-
{count != null ? (
|
|
325
|
-
<Text size="2xs" mono tone="muted" tabular>
|
|
326
|
-
{count}
|
|
327
|
-
</Text>
|
|
328
|
-
) : null}
|
|
329
|
-
</Flex>
|
|
330
|
-
);
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
// ── Phone shell ──────────────────────────────────────────────────────────────
|
|
334
|
-
|
|
335
|
-
/**
|
|
336
|
-
* This file used to BUILD the shell: a `Card` + `CardContent flush` phone frame, a
|
|
337
|
-
* `ui-card-inset-x h-9` status row, an `h-14 border-b` header, a `flex-1 overflow-y-auto` body, a
|
|
338
|
-
* `shrink-0 border-t` action strip and a `ResponsiveGrid` tab bar. It reproduced the look and
|
|
339
|
-
* neither behaviour that matters on a device — the document still scrolled, and nothing padded out
|
|
340
|
-
* of `env(safe-area-inset-*)`. All five bands are now `MobileShell` slots.
|
|
341
|
-
*/
|
|
342
|
-
|
|
343
|
-
function StatusBar() {
|
|
344
|
-
return (
|
|
345
|
-
<>
|
|
346
|
-
<Text size="sm" weight="medium" tabular>
|
|
347
|
-
9:41
|
|
348
|
-
</Text>
|
|
349
|
-
<Text size="sm" weight="medium" tabular tone="muted">
|
|
350
|
-
Acme Handy
|
|
351
|
-
</Text>
|
|
352
|
-
</>
|
|
353
|
-
);
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
function TabBar({ active, onChange }: { active: string; onChange: (id: string) => void }) {
|
|
357
|
-
// The tab bar's own tiling — equal width, no seam, no gutter — is the `tabBar` slot's contract,
|
|
358
|
-
// so there is no grid and no column count here any more.
|
|
359
|
-
return (
|
|
360
|
-
<>
|
|
361
|
-
{TABS.map((t) => {
|
|
362
|
-
const isActive = t.id === active;
|
|
363
|
-
const Icon = t.icon;
|
|
364
|
-
return (
|
|
365
|
-
<Button
|
|
366
|
-
key={t.id}
|
|
367
|
-
variant="ghost"
|
|
368
|
-
onClick={() => onChange(t.id)}
|
|
369
|
-
aria-current={isActive ? "page" : undefined}
|
|
370
|
-
className={
|
|
371
|
-
"text-[length:var(--font-size-2xs, calc(var(--font-size-base) / var(--font-size-ratio) / var(--font-size-ratio)))] h-full flex-col rounded-none font-medium " +
|
|
372
|
-
(isActive ? "text-primary" : "text-muted-foreground")
|
|
373
|
-
}
|
|
374
|
-
>
|
|
375
|
-
<Icon className="size-5" aria-hidden="true" strokeWidth={1.5} />
|
|
376
|
-
<span className="whitespace-nowrap">{t.label}</span>
|
|
377
|
-
</Button>
|
|
378
|
-
);
|
|
379
|
-
})}
|
|
380
|
-
</>
|
|
381
|
-
);
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
// ── Sheets ───────────────────────────────────────────────────────────────────
|
|
385
|
-
|
|
386
|
-
function ItemLookupSheet({
|
|
387
|
-
open,
|
|
388
|
-
onOpenChange,
|
|
389
|
-
}: {
|
|
390
|
-
open: boolean;
|
|
391
|
-
onOpenChange: (v: boolean) => void;
|
|
392
|
-
}) {
|
|
393
|
-
const [code, setCode] = React.useState("");
|
|
394
|
-
return (
|
|
395
|
-
<Sheet open={open} onOpenChange={onOpenChange}>
|
|
396
|
-
<SheetContent side="bottom" className="rounded-t-2xl">
|
|
397
|
-
<SheetHeader>
|
|
398
|
-
<SheetTitle>Quét hoặc nhập mã</SheetTitle>
|
|
399
|
-
</SheetHeader>
|
|
400
|
-
<SheetBody>
|
|
401
|
-
<Flex direction="col" gap="md">
|
|
402
|
-
{/* Viewfinder placeholder — a Card surface, not a hand-rolled illustration */}
|
|
403
|
-
<Card variant="muted" className="border-2 border-dashed">
|
|
404
|
-
<CardContent solo>
|
|
405
|
-
<Flex direction="col" align="center" gap="sm" className="h-40 justify-center">
|
|
406
|
-
<ScanLine
|
|
407
|
-
className="size-7 text-[color:var(--attention,var(--warning))]"
|
|
408
|
-
aria-hidden="true"
|
|
409
|
-
strokeWidth={1.5}
|
|
410
|
-
/>
|
|
411
|
-
<Text size="sm" tone="muted">
|
|
412
|
-
Đưa mã vạch vào khung
|
|
413
|
-
</Text>
|
|
414
|
-
</Flex>
|
|
415
|
-
</CardContent>
|
|
416
|
-
</Card>
|
|
417
|
-
<Flex direction="col" gap="sm">
|
|
418
|
-
<Text size="sm" weight="medium">
|
|
419
|
-
Hoặc nhập mã thủ công
|
|
420
|
-
</Text>
|
|
421
|
-
<Flex gap="sm">
|
|
422
|
-
<Input
|
|
423
|
-
value={code}
|
|
424
|
-
onChange={(e) => setCode(e.target.value)}
|
|
425
|
-
placeholder="RC- / PKG- / JAN"
|
|
426
|
-
className="font-mono"
|
|
427
|
-
inputMode="text"
|
|
428
|
-
autoComplete="off"
|
|
429
|
-
/>
|
|
430
|
-
<Button
|
|
431
|
-
onClick={() => {
|
|
432
|
-
onOpenChange(false);
|
|
433
|
-
setCode("");
|
|
434
|
-
toast.success("Đã tìm thấy RC-204881 · Sữa rửa mặt Hada Labo");
|
|
435
|
-
}}
|
|
436
|
-
disabled={code.trim() === ""}
|
|
437
|
-
>
|
|
438
|
-
<Search aria-hidden="true" />
|
|
439
|
-
Tìm
|
|
440
|
-
</Button>
|
|
441
|
-
</Flex>
|
|
442
|
-
</Flex>
|
|
443
|
-
</Flex>
|
|
444
|
-
</SheetBody>
|
|
445
|
-
<SheetFooter>
|
|
446
|
-
<Button variant="outline" onClick={() => onOpenChange(false)}>
|
|
447
|
-
Đóng
|
|
448
|
-
</Button>
|
|
449
|
-
</SheetFooter>
|
|
450
|
-
</SheetContent>
|
|
451
|
-
</Sheet>
|
|
452
|
-
);
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
function PackagePickerSheet({
|
|
456
|
-
open,
|
|
457
|
-
onOpenChange,
|
|
458
|
-
count,
|
|
459
|
-
}: {
|
|
460
|
-
open: boolean;
|
|
461
|
-
onOpenChange: (v: boolean) => void;
|
|
462
|
-
count: number;
|
|
463
|
-
}) {
|
|
464
|
-
return (
|
|
465
|
-
<Sheet open={open} onOpenChange={onOpenChange}>
|
|
466
|
-
<SheetContent side="bottom" className="rounded-t-2xl">
|
|
467
|
-
<SheetHeader>
|
|
468
|
-
<SheetTitle>Gán vào kiện</SheetTitle>
|
|
469
|
-
</SheetHeader>
|
|
470
|
-
<SheetBody>
|
|
471
|
-
<Flex direction="col" gap="sm">
|
|
472
|
-
<SectionHeader count={PACKINGS.length}>Kiện đang mở</SectionHeader>
|
|
473
|
-
{PACKINGS.map((p) => (
|
|
474
|
-
<PackingListCard
|
|
475
|
-
key={p.id}
|
|
476
|
-
packing={p}
|
|
477
|
-
onTap={() => {
|
|
478
|
-
onOpenChange(false);
|
|
479
|
-
toast.success(`Đã gán ${count} item vào ${p.code}`);
|
|
480
|
-
}}
|
|
481
|
-
/>
|
|
482
|
-
))}
|
|
483
|
-
<Button
|
|
484
|
-
variant="outline"
|
|
485
|
-
onClick={() => {
|
|
486
|
-
onOpenChange(false);
|
|
487
|
-
toast.success(`Đã tạo kiện mới với ${count} item`);
|
|
488
|
-
}}
|
|
489
|
-
className="text-primary hover:border-primary h-11 w-full border-2 border-dashed"
|
|
490
|
-
>
|
|
491
|
-
<PackagePlus aria-hidden="true" strokeWidth={1.5} />
|
|
492
|
-
Tạo kiện mới với {count} item này
|
|
493
|
-
</Button>
|
|
494
|
-
</Flex>
|
|
495
|
-
</SheetBody>
|
|
496
|
-
<SheetFooter>
|
|
497
|
-
<Button variant="outline" onClick={() => onOpenChange(false)}>
|
|
498
|
-
Huỷ
|
|
499
|
-
</Button>
|
|
500
|
-
</SheetFooter>
|
|
501
|
-
</SheetContent>
|
|
502
|
-
</Sheet>
|
|
503
|
-
);
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
const DESTINATIONS = [
|
|
507
|
-
{ id: "unsorted", label: "Chưa phân loại", hint: "Để xử lý sau" },
|
|
508
|
-
{ id: "shelf", label: "Giá hàng", hint: "Lên kệ lưu trữ" },
|
|
509
|
-
{ id: "open", label: "Kiện đang mở", hint: "Gói cùng đơn hiện tại" },
|
|
510
|
-
{ id: "new", label: "Tạo kiện mới", hint: "Mở kiện mới cho item" },
|
|
511
|
-
] as const;
|
|
512
|
-
|
|
513
|
-
function ItemFormSheet({
|
|
514
|
-
open,
|
|
515
|
-
onOpenChange,
|
|
516
|
-
}: {
|
|
517
|
-
open: boolean;
|
|
518
|
-
onOpenChange: (v: boolean) => void;
|
|
519
|
-
}) {
|
|
520
|
-
const [dest, setDest] = React.useState<string>("unsorted");
|
|
521
|
-
const [qty, setQty] = React.useState("1");
|
|
522
|
-
return (
|
|
523
|
-
<Sheet open={open} onOpenChange={onOpenChange}>
|
|
524
|
-
<SheetContent side="bottom" className="max-h-[calc(80vh)] rounded-t-2xl">
|
|
525
|
-
<SheetHeader>
|
|
526
|
-
<SheetTitle>Thêm hàng mới</SheetTitle>
|
|
527
|
-
</SheetHeader>
|
|
528
|
-
<SheetBody>
|
|
529
|
-
<Flex direction="col" gap="md">
|
|
530
|
-
<Flex direction="col" gap="xs">
|
|
531
|
-
<Text size="sm" weight="medium">
|
|
532
|
-
Mã vạch
|
|
533
|
-
</Text>
|
|
534
|
-
<Input defaultValue="JAN 4987241135219" readOnly className="font-mono" />
|
|
535
|
-
</Flex>
|
|
536
|
-
<Flex direction="col" gap="xs">
|
|
537
|
-
<Text size="sm" weight="medium">
|
|
538
|
-
Tên hàng (tùy chọn)
|
|
539
|
-
</Text>
|
|
540
|
-
<Input placeholder="Nhập tên hàng" autoComplete="off" />
|
|
541
|
-
</Flex>
|
|
542
|
-
<Flex direction="col" gap="xs">
|
|
543
|
-
<Text size="sm" weight="medium">
|
|
544
|
-
Số lượng
|
|
545
|
-
</Text>
|
|
546
|
-
<Input
|
|
547
|
-
type="number"
|
|
548
|
-
value={qty}
|
|
549
|
-
min={1}
|
|
550
|
-
onChange={(e) => setQty(e.target.value)}
|
|
551
|
-
className="w-24 tabular-nums"
|
|
552
|
-
/>
|
|
553
|
-
</Flex>
|
|
554
|
-
<Flex direction="col" gap="sm">
|
|
555
|
-
<Text size="sm" weight="medium">
|
|
556
|
-
Đích đến
|
|
557
|
-
</Text>
|
|
558
|
-
<RadioGroup
|
|
559
|
-
id="handy-dest"
|
|
560
|
-
value={dest}
|
|
561
|
-
onValueChange={setDest}
|
|
562
|
-
orientation="vertical"
|
|
563
|
-
options={DESTINATIONS.map((d) => ({
|
|
564
|
-
value: d.id,
|
|
565
|
-
label: d.label,
|
|
566
|
-
description: d.hint,
|
|
567
|
-
}))}
|
|
568
|
-
/>
|
|
569
|
-
</Flex>
|
|
570
|
-
</Flex>
|
|
571
|
-
</SheetBody>
|
|
572
|
-
<SheetFooter className="flex-row">
|
|
573
|
-
<Button variant="outline" className="flex-1" onClick={() => onOpenChange(false)}>
|
|
574
|
-
Huỷ
|
|
575
|
-
</Button>
|
|
576
|
-
<Button
|
|
577
|
-
className="flex-[2]"
|
|
578
|
-
onClick={() => {
|
|
579
|
-
onOpenChange(false);
|
|
580
|
-
toast.success("Đã lưu hàng mới");
|
|
581
|
-
}}
|
|
582
|
-
>
|
|
583
|
-
Lưu
|
|
584
|
-
</Button>
|
|
585
|
-
</SheetFooter>
|
|
586
|
-
</SheetContent>
|
|
587
|
-
</Sheet>
|
|
588
|
-
);
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
// ── Tab bodies ───────────────────────────────────────────────────────────────
|
|
592
|
-
|
|
593
|
-
type ListState = "ready" | "loading" | "empty" | "error";
|
|
594
|
-
|
|
595
|
-
/**
|
|
596
|
-
* The SCROLL REGION of the inbound screen — and nothing else. The sticky bar and the tab bar are
|
|
597
|
-
* `MobileShell` bands now, so this component no longer owns a scroll box, a `flex-1`, or a border.
|
|
598
|
-
*/
|
|
599
|
-
function InboundTab({
|
|
600
|
-
state,
|
|
601
|
-
onRetry,
|
|
602
|
-
selectMode,
|
|
603
|
-
selected,
|
|
604
|
-
setSelected,
|
|
605
|
-
onScan,
|
|
606
|
-
}: {
|
|
607
|
-
state: ListState;
|
|
608
|
-
onRetry: () => void;
|
|
609
|
-
selectMode: boolean;
|
|
610
|
-
selected: Set<string>;
|
|
611
|
-
setSelected: React.Dispatch<React.SetStateAction<Set<string>>>;
|
|
612
|
-
onScan: () => void;
|
|
613
|
-
}) {
|
|
614
|
-
const [filter, setFilter] = React.useState<string>("all");
|
|
615
|
-
|
|
616
|
-
const visible = ITEMS.filter((i) =>
|
|
617
|
-
filter === "all"
|
|
618
|
-
? true
|
|
619
|
-
: filter === "unsorted"
|
|
620
|
-
? i.status === "unsorted"
|
|
621
|
-
: i.status === "shelf",
|
|
622
|
-
);
|
|
623
|
-
|
|
624
|
-
return (
|
|
625
|
-
<Flex direction="col" gap="md">
|
|
626
|
-
{/* Filter chips — horizontal scroll, count pills */}
|
|
627
|
-
<ToggleGroup
|
|
628
|
-
type="single"
|
|
629
|
-
value={filter}
|
|
630
|
-
onValueChange={(v) => {
|
|
631
|
-
if (v) setFilter(v);
|
|
632
|
-
}}
|
|
633
|
-
className="w-full overflow-x-auto"
|
|
634
|
-
>
|
|
635
|
-
<Flex justify="start" gap="sm">
|
|
636
|
-
{FILTERS.map((f) => (
|
|
637
|
-
<ToggleGroupItem
|
|
638
|
-
key={f.id}
|
|
639
|
-
value={f.id}
|
|
640
|
-
className="text-[length:var(--font-size-xs, calc(var(--font-size-base) / var(--font-size-ratio)))] h-9 shrink-0 rounded-full whitespace-nowrap"
|
|
641
|
-
// The library's OWN counter pill, not a `Text` at 70% opacity (gh#643). The
|
|
642
|
-
// hand-rolled one measured 2.15:1 on the selected chip's --primary fill, because
|
|
643
|
-
// `opacity-70` blends whatever ink it inherits back towards the fill underneath it —
|
|
644
|
-
// `tone="inherit"` cannot help with that. `.ui-toggle[data-state="on"]
|
|
645
|
-
// .ui-toggle-count` inverts instead (--primary on --primary-foreground, 6.32:1) and
|
|
646
|
-
// folds the number into the accessible name.
|
|
647
|
-
count={f.count}
|
|
648
|
-
>
|
|
649
|
-
{f.label}
|
|
650
|
-
</ToggleGroupItem>
|
|
651
|
-
))}
|
|
652
|
-
</Flex>
|
|
653
|
-
</ToggleGroup>
|
|
654
|
-
|
|
655
|
-
{state === "loading" ? (
|
|
656
|
-
<Flex direction="col" gap="md" aria-busy="true">
|
|
657
|
-
{Array.from({ length: 3 }).map((_, i) => (
|
|
658
|
-
<Card key={i} density="tight" className="rounded-xl">
|
|
659
|
-
<CardContent solo>
|
|
660
|
-
<Flex direction="col" gap="md">
|
|
661
|
-
<Skeleton className="h-4 w-3/5" />
|
|
662
|
-
<Skeleton className="h-3 w-2/5" />
|
|
663
|
-
<Skeleton className="h-5 w-24 rounded-full" />
|
|
664
|
-
</Flex>
|
|
665
|
-
</CardContent>
|
|
666
|
-
</Card>
|
|
667
|
-
))}
|
|
668
|
-
</Flex>
|
|
669
|
-
) : state === "error" ? (
|
|
670
|
-
<Alert tone="warning">
|
|
671
|
-
<AlertTitle>Không tải được danh sách</AlertTitle>
|
|
672
|
-
<AlertDescription>
|
|
673
|
-
<Flex direction="col" align="start" gap="sm">
|
|
674
|
-
Kiểm tra kết nối rồi thử lại.
|
|
675
|
-
<Button variant="outline" size="sm" onClick={onRetry}>
|
|
676
|
-
<RefreshCw aria-hidden="true" />
|
|
677
|
-
Thử lại
|
|
678
|
-
</Button>
|
|
679
|
-
</Flex>
|
|
680
|
-
</AlertDescription>
|
|
681
|
-
</Alert>
|
|
682
|
-
) : state === "empty" || visible.length === 0 ? (
|
|
683
|
-
<EmptyState
|
|
684
|
-
icon={Boxes}
|
|
685
|
-
title="Chưa có hàng trong mục này"
|
|
686
|
-
description="Quét mã để nhập hàng mới vào kho."
|
|
687
|
-
action={
|
|
688
|
-
<Button size="sm" onClick={onScan}>
|
|
689
|
-
<ScanLine aria-hidden="true" />
|
|
690
|
-
Quét / Tìm mã
|
|
691
|
-
</Button>
|
|
692
|
-
}
|
|
693
|
-
/>
|
|
694
|
-
) : (
|
|
695
|
-
<Flex direction="col" gap="md">
|
|
696
|
-
{visible.map((item) => (
|
|
697
|
-
<ItemListCard
|
|
698
|
-
key={item.id}
|
|
699
|
-
item={item}
|
|
700
|
-
selectMode={selectMode}
|
|
701
|
-
selected={selected.has(item.id)}
|
|
702
|
-
onToggle={() =>
|
|
703
|
-
setSelected((prev) => {
|
|
704
|
-
const next = new Set(prev);
|
|
705
|
-
if (next.has(item.id)) next.delete(item.id);
|
|
706
|
-
else next.add(item.id);
|
|
707
|
-
return next;
|
|
708
|
-
})
|
|
709
|
-
}
|
|
710
|
-
/>
|
|
711
|
-
))}
|
|
712
|
-
</Flex>
|
|
713
|
-
)}
|
|
714
|
-
</Flex>
|
|
715
|
-
);
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
/**
|
|
719
|
-
* The inbound screen's `actions` band: the scan-first pair at rest, the contextual pair in select
|
|
720
|
-
* mode. It lives OUTSIDE the scroll region, so it needs no `position: sticky` and no bottom padding
|
|
721
|
-
* on the list to clear it, and `MobileShell` gives it the home-indicator inset when no tab bar
|
|
722
|
-
* follows.
|
|
723
|
-
*/
|
|
724
|
-
function InboundActions({
|
|
725
|
-
selectMode,
|
|
726
|
-
selected,
|
|
727
|
-
onExitSelect,
|
|
728
|
-
onScan,
|
|
729
|
-
onAdd,
|
|
730
|
-
onAssign,
|
|
731
|
-
}: {
|
|
732
|
-
selectMode: boolean;
|
|
733
|
-
selected: Set<string>;
|
|
734
|
-
onExitSelect: () => void;
|
|
735
|
-
onScan: () => void;
|
|
736
|
-
onAdd: () => void;
|
|
737
|
-
onAssign: () => void;
|
|
738
|
-
}) {
|
|
739
|
-
if (!selectMode) {
|
|
740
|
-
return (
|
|
741
|
-
<>
|
|
742
|
-
<Button className="flex-[2]" onClick={onScan}>
|
|
743
|
-
<ScanLine aria-hidden="true" />
|
|
744
|
-
Quét / Tìm mã
|
|
745
|
-
</Button>
|
|
746
|
-
<Button variant="outline" className="flex-1" onClick={onAdd}>
|
|
747
|
-
<Plus aria-hidden="true" />
|
|
748
|
-
Thêm hàng
|
|
749
|
-
</Button>
|
|
750
|
-
</>
|
|
751
|
-
);
|
|
752
|
-
}
|
|
753
|
-
return (
|
|
754
|
-
<Flex direction="col" gap="sm" className="w-full">
|
|
755
|
-
<Flex align="center" justify="between">
|
|
756
|
-
<Text size="sm" tabular>
|
|
757
|
-
<Text as="span" weight="bold">
|
|
758
|
-
{selected.size}
|
|
759
|
-
</Text>{" "}
|
|
760
|
-
item đã chọn
|
|
761
|
-
</Text>
|
|
762
|
-
<Button variant="ghost" size="sm" onClick={onExitSelect}>
|
|
763
|
-
Xong
|
|
764
|
-
</Button>
|
|
765
|
-
</Flex>
|
|
766
|
-
<Flex gap="sm">
|
|
767
|
-
<Button className="flex-[2]" disabled={selected.size === 0} onClick={onAssign}>
|
|
768
|
-
<Package aria-hidden="true" />
|
|
769
|
-
Gán vào kiện…
|
|
770
|
-
</Button>
|
|
771
|
-
<Button variant="outline" className="flex-1" disabled={selected.size === 0}>
|
|
772
|
-
Kiện mới
|
|
773
|
-
</Button>
|
|
774
|
-
</Flex>
|
|
775
|
-
</Flex>
|
|
776
|
-
);
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
function PackingTab() {
|
|
780
|
-
const active = PACKINGS.find((p) => p.status === "active");
|
|
781
|
-
const others = PACKINGS.filter((p) => p.status !== "active");
|
|
782
|
-
return (
|
|
783
|
-
<Flex direction="col" gap="md">
|
|
784
|
-
{active ? (
|
|
785
|
-
<Card
|
|
786
|
-
density="tight"
|
|
787
|
-
accent="primary"
|
|
788
|
-
className="border-primary bg-[color-mix(in_oklch,var(--primary)_6%,transparent)]"
|
|
789
|
-
>
|
|
790
|
-
<CardContent solo>
|
|
791
|
-
<Flex direction="col" gap="xs">
|
|
792
|
-
<Flex align="center" justify="between">
|
|
793
|
-
<Text size="2xs" weight="medium" tone="muted" className="tracking-wider uppercase">
|
|
794
|
-
Kiện đang làm
|
|
795
|
-
</Text>
|
|
796
|
-
<Badge tone="info" variant="outline" className="rounded-full">
|
|
797
|
-
{PACKING_STATUS.active.label}
|
|
798
|
-
</Badge>
|
|
799
|
-
</Flex>
|
|
800
|
-
<Text as="div" size="lg" weight="bold" mono tabular>
|
|
801
|
-
{active.code}
|
|
802
|
-
</Text>
|
|
803
|
-
<Text size="xs" tone="muted" tabular as="div">
|
|
804
|
-
{active.customer} · {active.city} · ×{active.items} · {active.slot}
|
|
805
|
-
</Text>
|
|
806
|
-
</Flex>
|
|
807
|
-
</CardContent>
|
|
808
|
-
</Card>
|
|
809
|
-
) : null}
|
|
810
|
-
|
|
811
|
-
<SectionHeader count={others.length}>Kiện đang mở</SectionHeader>
|
|
812
|
-
<Flex direction="col" gap="md">
|
|
813
|
-
{others.map((p) => (
|
|
814
|
-
<PackingListCard key={p.id} packing={p} onTap={() => undefined} />
|
|
815
|
-
))}
|
|
816
|
-
</Flex>
|
|
817
|
-
</Flex>
|
|
818
|
-
);
|
|
819
|
-
}
|
|
820
|
-
|
|
821
|
-
function PackingActions({ onScan }: { onScan: () => void }) {
|
|
822
|
-
return (
|
|
823
|
-
<Flex direction="col" gap="sm" className="w-full">
|
|
824
|
-
<Button onClick={onScan}>
|
|
825
|
-
<ScanLine aria-hidden="true" />
|
|
826
|
-
Quét item vào kiện
|
|
827
|
-
</Button>
|
|
828
|
-
<Button variant="outline">
|
|
829
|
-
<Plus aria-hidden="true" />
|
|
830
|
-
Tạo kiện trống
|
|
831
|
-
</Button>
|
|
832
|
-
</Flex>
|
|
833
|
-
);
|
|
834
|
-
}
|
|
835
|
-
|
|
836
|
-
/**
|
|
837
|
-
* `seg` is lifted to the page: the segmented control lives in the scroll region while the verb it
|
|
838
|
-
* selects lives in the `actions` band, and the two are different MobileShell slots.
|
|
839
|
-
*/
|
|
840
|
-
function OutboundTab({ seg, setSeg }: { seg: string; setSeg: (v: string) => void }) {
|
|
841
|
-
return (
|
|
842
|
-
<Flex direction="col" gap="md">
|
|
843
|
-
{/* Segmented — outbound status */}
|
|
844
|
-
<ToggleGroup
|
|
845
|
-
type="single"
|
|
846
|
-
value={seg}
|
|
847
|
-
onValueChange={(v) => {
|
|
848
|
-
if (v) setSeg(v);
|
|
849
|
-
}}
|
|
850
|
-
className="bg-secondary/60 w-full rounded-xl"
|
|
851
|
-
>
|
|
852
|
-
<ResponsiveGrid columns={3} gap="xs">
|
|
853
|
-
<ToggleGroupItem
|
|
854
|
-
value="seal"
|
|
855
|
-
className="text-[length:var(--font-size-xs, calc(var(--font-size-base) / var(--font-size-ratio)))] h-9 rounded-xl whitespace-nowrap"
|
|
856
|
-
>
|
|
857
|
-
Chờ niêm phong
|
|
858
|
-
</ToggleGroupItem>
|
|
859
|
-
<ToggleGroupItem
|
|
860
|
-
value="handoff"
|
|
861
|
-
className="text-[length:var(--font-size-xs, calc(var(--font-size-base) / var(--font-size-ratio)))] h-9 rounded-xl whitespace-nowrap"
|
|
862
|
-
>
|
|
863
|
-
Chờ bàn giao
|
|
864
|
-
</ToggleGroupItem>
|
|
865
|
-
<ToggleGroupItem
|
|
866
|
-
value="done"
|
|
867
|
-
className="text-[length:var(--font-size-xs, calc(var(--font-size-base) / var(--font-size-ratio)))] h-9 rounded-xl whitespace-nowrap"
|
|
868
|
-
>
|
|
869
|
-
Đã bàn giao
|
|
870
|
-
</ToggleGroupItem>
|
|
871
|
-
</ResponsiveGrid>
|
|
872
|
-
</ToggleGroup>
|
|
873
|
-
|
|
874
|
-
<SectionHeader count={OUTBOUND.length}>
|
|
875
|
-
{seg === "seal"
|
|
876
|
-
? "Sẵn sàng niêm phong"
|
|
877
|
-
: seg === "handoff"
|
|
878
|
-
? "Chờ bàn giao"
|
|
879
|
-
: "Đã bàn giao"}
|
|
880
|
-
</SectionHeader>
|
|
881
|
-
<Flex direction="col" gap="md">
|
|
882
|
-
{OUTBOUND.map((p) => (
|
|
883
|
-
<Card key={p.id} density="tight" className="rounded-xl">
|
|
884
|
-
<CardContent solo>
|
|
885
|
-
<Flex direction="col" gap="md">
|
|
886
|
-
<Flex align="center" justify="between" gap="sm">
|
|
887
|
-
<Text as="code" size="sm" weight="bold" tabular>
|
|
888
|
-
{p.code}
|
|
889
|
-
</Text>
|
|
890
|
-
<Badge tone="success" variant="outline" className="rounded-full">
|
|
891
|
-
Sẵn sàng niêm phong
|
|
892
|
-
</Badge>
|
|
893
|
-
</Flex>
|
|
894
|
-
<Flex align="center" justify="between" gap="sm">
|
|
895
|
-
<Text size="xs" tone="muted" tabular truncate>
|
|
896
|
-
{p.customer} · {p.city}
|
|
897
|
-
</Text>
|
|
898
|
-
<Text size="xs" tone="muted" tabular className="shrink-0">
|
|
899
|
-
×{p.items} · {p.slot}
|
|
900
|
-
</Text>
|
|
901
|
-
</Flex>
|
|
902
|
-
<div>
|
|
903
|
-
<Descriptions columns={1}>
|
|
904
|
-
<Descriptions.Item label="Vị trí" mono>
|
|
905
|
-
{p.slot}
|
|
906
|
-
</Descriptions.Item>
|
|
907
|
-
<Descriptions.Item label="Số kiện" mono>
|
|
908
|
-
×{p.items}
|
|
909
|
-
</Descriptions.Item>
|
|
910
|
-
</Descriptions>
|
|
911
|
-
</div>
|
|
912
|
-
</Flex>
|
|
913
|
-
</CardContent>
|
|
914
|
-
</Card>
|
|
915
|
-
))}
|
|
916
|
-
</Flex>
|
|
917
|
-
</Flex>
|
|
918
|
-
);
|
|
919
|
-
}
|
|
920
|
-
|
|
921
|
-
function OutboundActions({
|
|
922
|
-
seg,
|
|
923
|
-
onSeal,
|
|
924
|
-
onHandoff,
|
|
925
|
-
}: {
|
|
926
|
-
seg: string;
|
|
927
|
-
onSeal: () => void;
|
|
928
|
-
onHandoff: () => void;
|
|
929
|
-
}) {
|
|
930
|
-
return seg === "handoff" ? (
|
|
931
|
-
<Button className="flex-1" onClick={onHandoff}>
|
|
932
|
-
<Truck aria-hidden="true" />
|
|
933
|
-
Xác nhận bàn giao
|
|
934
|
-
</Button>
|
|
935
|
-
) : (
|
|
936
|
-
<Button className="flex-1" onClick={onSeal}>
|
|
937
|
-
<Check aria-hidden="true" />
|
|
938
|
-
Quét mã kiện · Niêm phong
|
|
939
|
-
</Button>
|
|
940
|
-
);
|
|
941
|
-
}
|
|
942
|
-
|
|
943
|
-
// ── Root ─────────────────────────────────────────────────────────────────────
|
|
944
|
-
|
|
945
|
-
export default function AgencyHandyShowcase() {
|
|
946
|
-
const [tab, setTab] = React.useState<string>("inbound");
|
|
947
|
-
const [listState, setListState] = React.useState<ListState>("ready");
|
|
948
|
-
|
|
949
|
-
const [selectMode, setSelectMode] = React.useState(false);
|
|
950
|
-
const [selected, setSelected] = React.useState<Set<string>>(new Set());
|
|
951
|
-
const [seg, setSeg] = React.useState<string>("seal");
|
|
952
|
-
|
|
953
|
-
const [lookupOpen, setLookupOpen] = React.useState(false);
|
|
954
|
-
const [formOpen, setFormOpen] = React.useState(false);
|
|
955
|
-
const [pickerOpen, setPickerOpen] = React.useState(false);
|
|
956
|
-
|
|
957
|
-
const [sealOpen, setSealOpen] = React.useState(false);
|
|
958
|
-
const [handoffOpen, setHandoffOpen] = React.useState(false);
|
|
959
|
-
|
|
960
|
-
const headerTitle = tab === "inbound" ? "Nhập kho" : tab === "packing" ? "Đóng gói" : "Xuất kho";
|
|
961
|
-
|
|
962
|
-
const exitSelect = () => {
|
|
963
|
-
setSelectMode(false);
|
|
964
|
-
setSelected(new Set());
|
|
965
|
-
};
|
|
966
|
-
|
|
967
|
-
// SELECT MODE REPLACES THE APP BAR — it does not stack a second strip under it. That is the
|
|
968
|
-
// platform pattern on both iOS and Android, and it is what the `header` slot is for: one bar to
|
|
969
|
-
// read at a time. This file once rendered the title bar AND a contextual strip, because
|
|
970
|
-
// there was no bar to swap.
|
|
971
|
-
const header = selectMode ? (
|
|
972
|
-
<Flex align="center" justify="between" gap="xs" className="w-full">
|
|
973
|
-
<Button variant="ghost" size="icon-sm" aria-label="Thoát chế độ chọn" onClick={exitSelect}>
|
|
974
|
-
<X className="size-4" aria-hidden="true" strokeWidth={1.5} />
|
|
975
|
-
</Button>
|
|
976
|
-
<Text size="sm" mono tabular>
|
|
977
|
-
{selected.size} đã chọn
|
|
978
|
-
</Text>
|
|
979
|
-
<Button
|
|
980
|
-
variant="ghost"
|
|
981
|
-
size="sm"
|
|
982
|
-
onClick={() => setSelected(new Set(ITEMS.map((i) => i.id)))}
|
|
983
|
-
>
|
|
984
|
-
Chọn tất cả
|
|
985
|
-
</Button>
|
|
986
|
-
</Flex>
|
|
987
|
-
) : (
|
|
988
|
-
<Flex align="center" justify="between" gap="xs" className="w-full">
|
|
989
|
-
<Heading level={3} as="h1" className="whitespace-nowrap">
|
|
990
|
-
{headerTitle}
|
|
991
|
-
</Heading>
|
|
992
|
-
<Flex align="center" gap="xs">
|
|
993
|
-
{tab === "inbound" ? (
|
|
994
|
-
<Button
|
|
995
|
-
variant="ghost"
|
|
996
|
-
size="sm"
|
|
997
|
-
onClick={() => {
|
|
998
|
-
setSelectMode(true);
|
|
999
|
-
setSelected(new Set());
|
|
1000
|
-
}}
|
|
1001
|
-
>
|
|
1002
|
-
<Check aria-hidden="true" />
|
|
1003
|
-
Chọn
|
|
1004
|
-
</Button>
|
|
1005
|
-
) : null}
|
|
1006
|
-
{/* State switcher — exposes the 4 list states at rest (showcase affordance) */}
|
|
1007
|
-
{tab === "inbound" ? (
|
|
1008
|
-
<ToggleGroup
|
|
1009
|
-
type="single"
|
|
1010
|
-
value={listState}
|
|
1011
|
-
onValueChange={(v) => {
|
|
1012
|
-
if (v) setListState(v as ListState);
|
|
1013
|
-
}}
|
|
1014
|
-
aria-label="List state (showcase)"
|
|
1015
|
-
>
|
|
1016
|
-
<Flex gap="xs">
|
|
1017
|
-
{(["ready", "loading", "empty", "error"] as const).map((s) => (
|
|
1018
|
-
<ToggleGroupItem
|
|
1019
|
-
key={s}
|
|
1020
|
-
value={s}
|
|
1021
|
-
className="text-[length:var(--font-size-2xs, calc(var(--font-size-base) / var(--font-size-ratio) / var(--font-size-ratio)))] size-7 rounded-md uppercase"
|
|
1022
|
-
title={s}
|
|
1023
|
-
>
|
|
1024
|
-
{s[0]}
|
|
1025
|
-
</ToggleGroupItem>
|
|
1026
|
-
))}
|
|
1027
|
-
</Flex>
|
|
1028
|
-
</ToggleGroup>
|
|
1029
|
-
) : null}
|
|
1030
|
-
</Flex>
|
|
1031
|
-
</Flex>
|
|
1032
|
-
);
|
|
1033
|
-
|
|
1034
|
-
const actions =
|
|
1035
|
-
tab === "inbound" ? (
|
|
1036
|
-
<InboundActions
|
|
1037
|
-
selectMode={selectMode}
|
|
1038
|
-
selected={selected}
|
|
1039
|
-
onExitSelect={exitSelect}
|
|
1040
|
-
onScan={() => setLookupOpen(true)}
|
|
1041
|
-
onAdd={() => setFormOpen(true)}
|
|
1042
|
-
onAssign={() => setPickerOpen(true)}
|
|
1043
|
-
/>
|
|
1044
|
-
) : tab === "packing" ? (
|
|
1045
|
-
<PackingActions onScan={() => setLookupOpen(true)} />
|
|
1046
|
-
) : (
|
|
1047
|
-
<OutboundActions
|
|
1048
|
-
seg={seg}
|
|
1049
|
-
onSeal={() => setSealOpen(true)}
|
|
1050
|
-
onHandoff={() => setHandoffOpen(true)}
|
|
1051
|
-
/>
|
|
1052
|
-
);
|
|
1053
|
-
|
|
1054
|
-
return (
|
|
1055
|
-
<>
|
|
1056
|
-
<Toaster />
|
|
1057
|
-
{/* The whole phone is ONE primitive now: five bands, no Card frame, no hand-rolled scroll box,
|
|
1058
|
-
* no `min-h-screen` wrapper. The shell is the document's only scroll container and every band
|
|
1059
|
-
* pads itself out of the device safe areas. */}
|
|
1060
|
-
<MobileShell
|
|
1061
|
-
statusBar={<StatusBar />}
|
|
1062
|
-
header={header}
|
|
1063
|
-
actions={actions}
|
|
1064
|
-
tabBar={
|
|
1065
|
-
<TabBar
|
|
1066
|
-
active={tab}
|
|
1067
|
-
onChange={(id) => {
|
|
1068
|
-
setTab(id);
|
|
1069
|
-
exitSelect();
|
|
1070
|
-
}}
|
|
1071
|
-
/>
|
|
1072
|
-
}
|
|
1073
|
-
>
|
|
1074
|
-
{tab === "inbound" ? (
|
|
1075
|
-
<InboundTab
|
|
1076
|
-
state={listState}
|
|
1077
|
-
onRetry={() => setListState("ready")}
|
|
1078
|
-
selectMode={selectMode}
|
|
1079
|
-
selected={selected}
|
|
1080
|
-
setSelected={setSelected}
|
|
1081
|
-
onScan={() => setLookupOpen(true)}
|
|
1082
|
-
/>
|
|
1083
|
-
) : tab === "packing" ? (
|
|
1084
|
-
<PackingTab />
|
|
1085
|
-
) : (
|
|
1086
|
-
<OutboundTab seg={seg} setSeg={setSeg} />
|
|
1087
|
-
)}
|
|
1088
|
-
</MobileShell>
|
|
1089
|
-
|
|
1090
|
-
{/* Sheets */}
|
|
1091
|
-
<ItemLookupSheet open={lookupOpen} onOpenChange={setLookupOpen} />
|
|
1092
|
-
<ItemFormSheet open={formOpen} onOpenChange={setFormOpen} />
|
|
1093
|
-
<PackagePickerSheet open={pickerOpen} onOpenChange={setPickerOpen} count={selected.size} />
|
|
1094
|
-
|
|
1095
|
-
{/* Confirm dialogs — verb confirm, surface summary; forward step = primary */}
|
|
1096
|
-
<AlertDialog
|
|
1097
|
-
open={sealOpen}
|
|
1098
|
-
onOpenChange={setSealOpen}
|
|
1099
|
-
title="Niêm phong kiện?"
|
|
1100
|
-
description="PKG-000037 · 9 item · vị trí B-01-04. Sau khi niêm phong không thể thêm item."
|
|
1101
|
-
confirmLabel="Niêm phong"
|
|
1102
|
-
cancelLabel="Huỷ"
|
|
1103
|
-
onConfirm={() => {
|
|
1104
|
-
toast.success("Đã niêm phong PKG-000037 · 16:24");
|
|
1105
|
-
}}
|
|
1106
|
-
/>
|
|
1107
|
-
<AlertDialog
|
|
1108
|
-
open={handoffOpen}
|
|
1109
|
-
onOpenChange={setHandoffOpen}
|
|
1110
|
-
title="Xác nhận bàn giao?"
|
|
1111
|
-
description="PKG-000037 lên xe giao. Thao tác này có thể hoàn tác trong 10 phút."
|
|
1112
|
-
confirmLabel="Xác nhận"
|
|
1113
|
-
cancelLabel="Huỷ"
|
|
1114
|
-
onConfirm={() => {
|
|
1115
|
-
toast.success("Đã bàn giao PKG-000037 · 16:24");
|
|
1116
|
-
}}
|
|
1117
|
-
/>
|
|
1118
|
-
</>
|
|
1119
|
-
);
|
|
1120
|
-
}
|