@nadicodeai/ui 12.1.95 → 12.1.97
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/AGENTS.md +5 -1
- package/dist/components/accordion.d.ts +13 -0
- package/dist/components/accordion.d.ts.map +1 -1
- package/dist/components/accordion.js +13 -0
- package/dist/components/account-menu.d.ts +62 -18
- package/dist/components/account-menu.d.ts.map +1 -1
- package/dist/components/account-menu.js +32 -8
- package/dist/components/action-menu.d.ts +61 -5
- package/dist/components/action-menu.d.ts.map +1 -1
- package/dist/components/action-menu.js +31 -2
- package/dist/components/action-status.d.ts +13 -3
- package/dist/components/action-status.d.ts.map +1 -1
- package/dist/components/action-status.js +13 -3
- package/dist/components/activity-calendar.d.ts +14 -0
- package/dist/components/activity-calendar.d.ts.map +1 -1
- package/dist/components/activity-calendar.js +14 -0
- package/dist/components/activity-feed.d.ts +62 -0
- package/dist/components/activity-feed.d.ts.map +1 -0
- package/dist/components/activity-feed.js +54 -0
- package/dist/components/agent-card.d.ts +15 -0
- package/dist/components/agent-card.d.ts.map +1 -1
- package/dist/components/agent-card.js +15 -0
- package/dist/components/agent-list-row.d.ts +11 -7
- package/dist/components/agent-list-row.d.ts.map +1 -1
- package/dist/components/agent-list-row.js +10 -8
- package/dist/components/agent-orb-appearance.d.ts +5 -4
- package/dist/components/agent-orb-appearance.d.ts.map +1 -1
- package/dist/components/agent-orb.d.ts +16 -0
- package/dist/components/agent-orb.d.ts.map +1 -1
- package/dist/components/agent-orb.js +17 -0
- package/dist/components/agent-profile.d.ts +39 -10
- package/dist/components/agent-profile.d.ts.map +1 -1
- package/dist/components/agent-profile.js +40 -10
- package/dist/components/alert-dialog.d.ts +14 -0
- package/dist/components/alert-dialog.d.ts.map +1 -1
- package/dist/components/alert-dialog.js +14 -0
- package/dist/components/alert.d.ts +14 -0
- package/dist/components/alert.d.ts.map +1 -1
- package/dist/components/alert.js +14 -0
- package/dist/components/app-mark.d.ts +14 -4
- package/dist/components/app-mark.d.ts.map +1 -1
- package/dist/components/app-mark.js +16 -4
- package/dist/components/approval-row.d.ts +15 -2
- package/dist/components/approval-row.d.ts.map +1 -1
- package/dist/components/approval-row.js +15 -2
- package/dist/components/aspect-ratio.d.ts +10 -0
- package/dist/components/aspect-ratio.d.ts.map +1 -1
- package/dist/components/aspect-ratio.js +13 -1
- package/dist/components/avatar.d.ts +15 -0
- package/dist/components/avatar.d.ts.map +1 -1
- package/dist/components/avatar.js +15 -0
- package/dist/components/badge.d.ts +11 -1
- package/dist/components/badge.d.ts.map +1 -1
- package/dist/components/badge.js +10 -5
- package/dist/components/brand-field.d.ts +10 -0
- package/dist/components/brand-field.d.ts.map +1 -1
- package/dist/components/brand-field.js +10 -0
- package/dist/components/brand.d.ts +14 -0
- package/dist/components/brand.d.ts.map +1 -1
- package/dist/components/brand.js +18 -4
- package/dist/components/breadcrumb.d.ts +20 -2
- package/dist/components/breadcrumb.d.ts.map +1 -1
- package/dist/components/breadcrumb.js +13 -3
- package/dist/components/button-group.d.ts +21 -0
- package/dist/components/button-group.d.ts.map +1 -1
- package/dist/components/button-group.js +21 -0
- package/dist/components/button.d.ts +20 -0
- package/dist/components/button.d.ts.map +1 -1
- package/dist/components/button.js +20 -0
- package/dist/components/calendar.d.ts +15 -0
- package/dist/components/calendar.d.ts.map +1 -1
- package/dist/components/calendar.js +15 -0
- package/dist/components/card-row.d.ts +15 -5
- package/dist/components/card-row.d.ts.map +1 -1
- package/dist/components/card-row.js +15 -5
- package/dist/components/card.d.ts +16 -0
- package/dist/components/card.d.ts.map +1 -1
- package/dist/components/card.js +16 -0
- package/dist/components/carousel.d.ts +12 -0
- package/dist/components/carousel.d.ts.map +1 -1
- package/dist/components/carousel.js +12 -0
- package/dist/components/catalog-drawer.d.ts +29 -0
- package/dist/components/catalog-drawer.d.ts.map +1 -0
- package/dist/components/catalog-drawer.js +31 -0
- package/dist/components/catalog-entry.d.ts +49 -26
- package/dist/components/catalog-entry.d.ts.map +1 -1
- package/dist/components/catalog-entry.js +5 -27
- package/dist/components/channel-view.d.ts +23 -0
- package/dist/components/channel-view.d.ts.map +1 -1
- package/dist/components/channel-view.js +13 -4
- package/dist/components/chart-area-stacked.d.ts +11 -1
- package/dist/components/chart-area-stacked.d.ts.map +1 -1
- package/dist/components/chart-area-stacked.js +12 -2
- package/dist/components/chart-axis.d.ts.map +1 -1
- package/dist/components/chart-axis.js +2 -0
- package/dist/components/chart-bar-horizontal.d.ts +11 -1
- package/dist/components/chart-bar-horizontal.d.ts.map +1 -1
- package/dist/components/chart-bar-horizontal.js +15 -2
- package/dist/components/chart-bar-multiple.d.ts +9 -4
- package/dist/components/chart-bar-multiple.d.ts.map +1 -1
- package/dist/components/chart-bar-multiple.js +10 -5
- package/dist/components/chart-bar-stacked.d.ts +11 -1
- package/dist/components/chart-bar-stacked.d.ts.map +1 -1
- package/dist/components/chart-bar-stacked.js +12 -2
- package/dist/components/chart-card.d.ts +38 -24
- package/dist/components/chart-card.d.ts.map +1 -1
- package/dist/components/chart-card.js +21 -8
- package/dist/components/chart-date-range-control.d.ts +15 -10
- package/dist/components/chart-date-range-control.d.ts.map +1 -1
- package/dist/components/chart-date-range-control.js +16 -12
- package/dist/components/chart-date-range.d.ts +2 -1
- package/dist/components/chart-date-range.d.ts.map +1 -1
- package/dist/components/chart-date-range.js +5 -2
- package/dist/components/chart-entity-colors.d.ts +7 -0
- package/dist/components/chart-entity-colors.d.ts.map +1 -1
- package/dist/components/chart-entity-colors.js +7 -0
- package/dist/components/chart-sparkline.d.ts +10 -0
- package/dist/components/chart-sparkline.d.ts.map +1 -1
- package/dist/components/chart-sparkline.js +8 -7
- package/dist/components/chart.d.ts +10 -0
- package/dist/components/chart.d.ts.map +1 -1
- package/dist/components/chart.js +27 -4
- package/dist/components/checkbox.d.ts +15 -0
- package/dist/components/checkbox.d.ts.map +1 -1
- package/dist/components/checkbox.js +15 -0
- package/dist/components/code-block.d.ts +15 -0
- package/dist/components/code-block.d.ts.map +1 -1
- package/dist/components/code-block.js +15 -0
- package/dist/components/collapsible.d.ts +12 -0
- package/dist/components/collapsible.d.ts.map +1 -1
- package/dist/components/collapsible.js +12 -0
- package/dist/components/collection-filters.d.ts +15 -2
- package/dist/components/collection-filters.d.ts.map +1 -1
- package/dist/components/collection-filters.js +13 -1
- package/dist/components/collection-page.d.ts +29 -115
- package/dist/components/collection-page.d.ts.map +1 -1
- package/dist/components/collection-page.js +24 -139
- package/dist/components/collection-search.d.ts +14 -0
- package/dist/components/collection-search.d.ts.map +1 -1
- package/dist/components/collection-search.js +14 -0
- package/dist/components/collection-sort.d.ts +13 -3
- package/dist/components/collection-sort.d.ts.map +1 -1
- package/dist/components/collection-sort.js +17 -4
- package/dist/components/collection-toolbar.d.ts +13 -0
- package/dist/components/collection-toolbar.d.ts.map +1 -1
- package/dist/components/collection-toolbar.js +13 -0
- package/dist/components/combobox.d.ts +17 -0
- package/dist/components/combobox.d.ts.map +1 -1
- package/dist/components/combobox.js +17 -0
- package/dist/components/command.d.ts +16 -0
- package/dist/components/command.d.ts.map +1 -1
- package/dist/components/command.js +16 -0
- package/dist/components/company-card/renderer.js +2 -2
- package/dist/components/company-card.d.ts +16 -4
- package/dist/components/company-card.d.ts.map +1 -1
- package/dist/components/company-card.js +22 -10
- package/dist/components/confirm-dialog.d.ts +24 -14
- package/dist/components/confirm-dialog.d.ts.map +1 -1
- package/dist/components/confirm-dialog.js +16 -10
- package/dist/components/context-menu.d.ts +10 -0
- package/dist/components/context-menu.d.ts.map +1 -1
- package/dist/components/context-menu.js +10 -0
- package/dist/components/copy-button.d.ts +10 -0
- package/dist/components/copy-button.d.ts.map +1 -1
- package/dist/components/copy-button.js +10 -0
- package/dist/components/dashboard-shell.d.ts +14 -0
- package/dist/components/dashboard-shell.d.ts.map +1 -1
- package/dist/components/dashboard-shell.js +15 -1
- package/dist/components/data-table.d.ts +23 -1
- package/dist/components/data-table.d.ts.map +1 -1
- package/dist/components/data-table.js +63 -31
- package/dist/components/desktop-shell.d.ts +15 -0
- package/dist/components/desktop-shell.d.ts.map +1 -1
- package/dist/components/desktop-shell.js +15 -0
- package/dist/components/dialog.d.ts +16 -0
- package/dist/components/dialog.d.ts.map +1 -1
- package/dist/components/dialog.js +16 -0
- package/dist/components/diff-count.d.ts +11 -0
- package/dist/components/diff-count.d.ts.map +1 -1
- package/dist/components/diff-count.js +11 -0
- package/dist/components/disclosure-row.d.ts +12 -0
- package/dist/components/disclosure-row.d.ts.map +1 -1
- package/dist/components/disclosure-row.js +12 -0
- package/dist/components/disclosure.d.ts +15 -5
- package/dist/components/disclosure.d.ts.map +1 -1
- package/dist/components/disclosure.js +15 -5
- package/dist/components/drawer.d.ts +13 -0
- package/dist/components/drawer.d.ts.map +1 -1
- package/dist/components/drawer.js +13 -0
- package/dist/components/dropdown-menu.d.ts +17 -5
- package/dist/components/dropdown-menu.d.ts.map +1 -1
- package/dist/components/dropdown-menu.js +20 -7
- package/dist/components/empty-art.d.ts +1 -1
- package/dist/components/empty-art.d.ts.map +1 -1
- package/dist/components/empty-art.js +8 -0
- package/dist/components/empty-state.d.ts +24 -10
- package/dist/components/empty-state.d.ts.map +1 -1
- package/dist/components/empty-state.js +23 -1
- package/dist/components/entry-scene.d.ts +33 -20
- package/dist/components/entry-scene.d.ts.map +1 -1
- package/dist/components/entry-scene.js +40 -9
- package/dist/components/expandable-block.d.ts +10 -0
- package/dist/components/expandable-block.d.ts.map +1 -1
- package/dist/components/expandable-block.js +10 -0
- package/dist/components/field.d.ts +17 -0
- package/dist/components/field.d.ts.map +1 -1
- package/dist/components/field.js +17 -0
- package/dist/components/file-diff.d.ts +12 -0
- package/dist/components/file-diff.d.ts.map +1 -1
- package/dist/components/file-diff.js +12 -0
- package/dist/components/file-type-icon.d.ts +12 -0
- package/dist/components/file-type-icon.d.ts.map +1 -1
- package/dist/components/file-type-icon.js +46 -31
- package/dist/components/footer.d.ts +14 -0
- package/dist/components/footer.d.ts.map +1 -1
- package/dist/components/footer.js +14 -0
- package/dist/components/form-dialog.d.ts +10 -0
- package/dist/components/form-dialog.d.ts.map +1 -1
- package/dist/components/form-dialog.js +10 -0
- package/dist/components/form-drawer.d.ts +24 -11
- package/dist/components/form-drawer.d.ts.map +1 -1
- package/dist/components/form-drawer.js +13 -3
- package/dist/components/form.d.ts +17 -0
- package/dist/components/form.d.ts.map +1 -1
- package/dist/components/form.js +25 -5
- package/dist/components/glass-control.d.ts +13 -0
- package/dist/components/glass-control.d.ts.map +1 -1
- package/dist/components/glass-control.js +13 -0
- package/dist/components/heatmap/calendar-heatmap.d.ts.map +1 -1
- package/dist/components/heatmap/calendar-heatmap.js +6 -4
- package/dist/components/hive-scene.d.ts +14 -0
- package/dist/components/hive-scene.d.ts.map +1 -1
- package/dist/components/hive-scene.js +14 -0
- package/dist/components/house-icons.d.ts +15 -0
- package/dist/components/house-icons.d.ts.map +1 -1
- package/dist/components/house-icons.js +19 -1
- package/dist/components/hover-card.d.ts +15 -0
- package/dist/components/hover-card.d.ts.map +1 -1
- package/dist/components/hover-card.js +15 -0
- package/dist/components/identity-mark.d.ts +55 -0
- package/dist/components/identity-mark.d.ts.map +1 -0
- package/dist/components/identity-mark.js +66 -0
- package/dist/components/input-group.d.ts +16 -0
- package/dist/components/input-group.d.ts.map +1 -1
- package/dist/components/input-group.js +17 -0
- package/dist/components/input-otp.d.ts +15 -0
- package/dist/components/input-otp.d.ts.map +1 -1
- package/dist/components/input-otp.js +15 -0
- package/dist/components/input.d.ts +15 -0
- package/dist/components/input.d.ts.map +1 -1
- package/dist/components/input.js +15 -0
- package/dist/components/item.d.ts +16 -0
- package/dist/components/item.d.ts.map +1 -1
- package/dist/components/item.js +16 -0
- package/dist/components/kbd.d.ts +14 -0
- package/dist/components/kbd.d.ts.map +1 -1
- package/dist/components/kbd.js +14 -0
- package/dist/components/kpi-card.d.ts +21 -13
- package/dist/components/kpi-card.d.ts.map +1 -1
- package/dist/components/kpi-card.js +14 -3
- package/dist/components/label-system.d.ts +12 -0
- package/dist/components/label-system.d.ts.map +1 -1
- package/dist/components/label-system.js +12 -0
- package/dist/components/label.d.ts +15 -0
- package/dist/components/label.d.ts.map +1 -1
- package/dist/components/label.js +15 -0
- package/dist/components/library-shelf.d.ts +35 -0
- package/dist/components/library-shelf.d.ts.map +1 -0
- package/dist/components/library-shelf.js +40 -0
- package/dist/components/memory-item.d.ts +12 -0
- package/dist/components/memory-item.d.ts.map +1 -1
- package/dist/components/memory-item.js +12 -0
- package/dist/components/menu-choice-row.d.ts +13 -5
- package/dist/components/menu-choice-row.d.ts.map +1 -1
- package/dist/components/menu-choice-row.js +12 -6
- package/dist/components/menubar.d.ts +13 -0
- package/dist/components/menubar.d.ts.map +1 -1
- package/dist/components/menubar.js +13 -0
- package/dist/components/message-notice.d.ts +16 -0
- package/dist/components/message-notice.d.ts.map +1 -1
- package/dist/components/message-notice.js +18 -2
- package/dist/components/model-identity.d.ts +16 -3
- package/dist/components/model-identity.d.ts.map +1 -1
- package/dist/components/model-identity.js +16 -3
- package/dist/components/model-mark.d.ts +15 -2
- package/dist/components/model-mark.d.ts.map +1 -1
- package/dist/components/model-mark.js +36 -23
- package/dist/components/nadia-presence.d.ts +10 -4
- package/dist/components/nadia-presence.d.ts.map +1 -1
- package/dist/components/nadia-presence.js +10 -4
- package/dist/components/native-select.d.ts +16 -0
- package/dist/components/native-select.d.ts.map +1 -1
- package/dist/components/native-select.js +21 -0
- package/dist/components/navigation-menu.d.ts +14 -0
- package/dist/components/navigation-menu.d.ts.map +1 -1
- package/dist/components/navigation-menu.js +14 -0
- package/dist/components/notice-banner.d.ts +10 -3
- package/dist/components/notice-banner.d.ts.map +1 -1
- package/dist/components/notice-banner.js +9 -3
- package/dist/components/numbered-steps.d.ts +33 -0
- package/dist/components/numbered-steps.d.ts.map +1 -0
- package/dist/components/numbered-steps.js +23 -0
- package/dist/components/object-page.d.ts +37 -0
- package/dist/components/object-page.d.ts.map +1 -0
- package/dist/components/object-page.js +19 -0
- package/dist/components/object-workspace.d.ts +26 -36
- package/dist/components/object-workspace.d.ts.map +1 -1
- package/dist/components/object-workspace.js +27 -24
- package/dist/components/overview-page.d.ts +24 -0
- package/dist/components/overview-page.d.ts.map +1 -0
- package/dist/components/overview-page.js +26 -0
- package/dist/components/page-actions.d.ts +28 -23
- package/dist/components/page-actions.d.ts.map +1 -1
- package/dist/components/page-actions.js +20 -14
- package/dist/components/page-header.d.ts +11 -5
- package/dist/components/page-header.d.ts.map +1 -1
- package/dist/components/page-header.js +11 -5
- package/dist/components/pagination.d.ts +15 -0
- package/dist/components/pagination.d.ts.map +1 -1
- package/dist/components/pagination.js +15 -0
- package/dist/components/pairing-code.d.ts +15 -4
- package/dist/components/pairing-code.d.ts.map +1 -1
- package/dist/components/pairing-code.js +15 -4
- package/dist/components/pending-label.d.ts +12 -4
- package/dist/components/pending-label.d.ts.map +1 -1
- package/dist/components/pending-label.js +12 -4
- package/dist/components/picture-label.d.ts +15 -7
- package/dist/components/picture-label.d.ts.map +1 -1
- package/dist/components/picture-label.js +15 -7
- package/dist/components/platform-mark.d.ts +12 -3
- package/dist/components/platform-mark.d.ts.map +1 -1
- package/dist/components/platform-mark.js +12 -3
- package/dist/components/plugin-slot-boundary.d.ts +15 -0
- package/dist/components/plugin-slot-boundary.d.ts.map +1 -1
- package/dist/components/plugin-slot-boundary.js +18 -1
- package/dist/components/popover.d.ts +15 -0
- package/dist/components/popover.d.ts.map +1 -1
- package/dist/components/popover.js +15 -0
- package/dist/components/portal-sidebar-frame.d.ts +26 -12
- package/dist/components/portal-sidebar-frame.d.ts.map +1 -1
- package/dist/components/portal-sidebar-frame.js +26 -0
- package/dist/components/product-message.d.ts.map +1 -1
- package/dist/components/product-message.js +1 -0
- package/dist/components/progress.d.ts +10 -8
- package/dist/components/progress.d.ts.map +1 -1
- package/dist/components/progress.js +17 -16
- package/dist/components/qr-code.d.ts +9 -3
- package/dist/components/qr-code.d.ts.map +1 -1
- package/dist/components/qr-code.js +9 -3
- package/dist/components/radio-group.d.ts +15 -0
- package/dist/components/radio-group.d.ts.map +1 -1
- package/dist/components/radio-group.js +15 -0
- package/dist/components/reading-column.d.ts +11 -0
- package/dist/components/reading-column.d.ts.map +1 -1
- package/dist/components/reading-column.js +11 -0
- package/dist/components/record-identity.d.ts +12 -7
- package/dist/components/record-identity.d.ts.map +1 -1
- package/dist/components/record-identity.js +12 -7
- package/dist/components/record-list.d.ts +119 -0
- package/dist/components/record-list.d.ts.map +1 -0
- package/dist/components/record-list.js +161 -0
- package/dist/components/record-sheet.d.ts +36 -0
- package/dist/components/record-sheet.d.ts.map +1 -0
- package/dist/components/record-sheet.js +19 -0
- package/dist/components/record-time.d.ts +27 -11
- package/dist/components/record-time.d.ts.map +1 -1
- package/dist/components/record-time.js +35 -14
- package/dist/components/resizable.d.ts +10 -0
- package/dist/components/resizable.d.ts.map +1 -1
- package/dist/components/resizable.js +10 -0
- package/dist/components/row-edit-form.d.ts +8 -5
- package/dist/components/row-edit-form.d.ts.map +1 -1
- package/dist/components/row-edit-form.js +8 -5
- package/dist/components/run-timeline.d.ts +24 -11
- package/dist/components/run-timeline.d.ts.map +1 -1
- package/dist/components/run-timeline.js +13 -6
- package/dist/components/scope-switcher.d.ts +11 -0
- package/dist/components/scope-switcher.d.ts.map +1 -1
- package/dist/components/scope-switcher.js +20 -9
- package/dist/components/scroll-area.d.ts +12 -0
- package/dist/components/scroll-area.d.ts.map +1 -1
- package/dist/components/scroll-area.js +12 -0
- package/dist/components/select.d.ts +16 -0
- package/dist/components/select.d.ts.map +1 -1
- package/dist/components/select.js +16 -0
- package/dist/components/separator.d.ts +11 -0
- package/dist/components/separator.d.ts.map +1 -1
- package/dist/components/separator.js +11 -0
- package/dist/components/settings-facts.d.ts +18 -1
- package/dist/components/settings-facts.d.ts.map +1 -1
- package/dist/components/settings-facts.js +20 -1
- package/dist/components/settings-page.d.ts +20 -0
- package/dist/components/settings-page.d.ts.map +1 -0
- package/dist/components/settings-page.js +16 -0
- package/dist/components/settings-section.d.ts +38 -8
- package/dist/components/settings-section.d.ts.map +1 -1
- package/dist/components/settings-section.js +33 -7
- package/dist/components/sheet.d.ts +16 -0
- package/dist/components/sheet.d.ts.map +1 -1
- package/dist/components/sheet.js +16 -0
- package/dist/components/sidebar-sections.d.ts +40 -0
- package/dist/components/sidebar-sections.d.ts.map +1 -0
- package/dist/components/sidebar-sections.js +35 -0
- package/dist/components/sidebar.d.ts +14 -1
- package/dist/components/sidebar.d.ts.map +1 -1
- package/dist/components/sidebar.js +24 -5
- package/dist/components/skeleton.d.ts +10 -0
- package/dist/components/skeleton.d.ts.map +1 -1
- package/dist/components/skeleton.js +11 -1
- package/dist/components/slider.d.ts +14 -0
- package/dist/components/slider.d.ts.map +1 -1
- package/dist/components/slider.js +14 -0
- package/dist/components/sonner.d.ts +18 -0
- package/dist/components/sonner.d.ts.map +1 -1
- package/dist/components/sonner.js +23 -2
- package/dist/components/status-badge.d.ts +13 -2
- package/dist/components/status-badge.d.ts.map +1 -1
- package/dist/components/status-badge.js +21 -9
- package/dist/components/status-dot.d.ts +12 -0
- package/dist/components/status-dot.d.ts.map +1 -1
- package/dist/components/status-dot.js +12 -0
- package/dist/components/status-row.d.ts +14 -0
- package/dist/components/status-row.d.ts.map +1 -1
- package/dist/components/status-row.js +14 -0
- package/dist/components/switch.d.ts +15 -0
- package/dist/components/switch.d.ts.map +1 -1
- package/dist/components/switch.js +15 -0
- package/dist/components/table-card.d.ts +16 -3
- package/dist/components/table-card.d.ts.map +1 -1
- package/dist/components/table-card.js +16 -3
- package/dist/components/table-value.d.ts +24 -2
- package/dist/components/table-value.d.ts.map +1 -1
- package/dist/components/table-value.js +25 -3
- package/dist/components/table.d.ts +16 -0
- package/dist/components/table.d.ts.map +1 -1
- package/dist/components/table.js +17 -1
- package/dist/components/tabs.d.ts +27 -0
- package/dist/components/tabs.d.ts.map +1 -1
- package/dist/components/tabs.js +27 -0
- package/dist/components/tag.d.ts +12 -2
- package/dist/components/tag.d.ts.map +1 -1
- package/dist/components/tag.js +12 -2
- package/dist/components/text-link.d.ts +17 -0
- package/dist/components/text-link.d.ts.map +1 -1
- package/dist/components/text-link.js +17 -0
- package/dist/components/textarea.d.ts +14 -0
- package/dist/components/textarea.d.ts.map +1 -1
- package/dist/components/textarea.js +14 -0
- package/dist/components/theme-mode-switcher.d.ts +21 -0
- package/dist/components/theme-mode-switcher.d.ts.map +1 -1
- package/dist/components/theme-mode-switcher.js +23 -1
- package/dist/components/toggle-group.d.ts +13 -0
- package/dist/components/toggle-group.d.ts.map +1 -1
- package/dist/components/toggle-group.js +16 -1
- package/dist/components/toggle.d.ts +14 -0
- package/dist/components/toggle.d.ts.map +1 -1
- package/dist/components/toggle.js +14 -0
- package/dist/components/tool-icon.d.ts +14 -4
- package/dist/components/tool-icon.d.ts.map +1 -1
- package/dist/components/tool-icon.js +28 -19
- package/dist/components/tooltip.d.ts +15 -0
- package/dist/components/tooltip.d.ts.map +1 -1
- package/dist/components/tooltip.js +15 -0
- package/dist/components/trend-badge.d.ts +16 -1
- package/dist/components/trend-badge.d.ts.map +1 -1
- package/dist/components/trend-badge.js +16 -7
- package/dist/components/update-card.d.ts +36 -0
- package/dist/components/update-card.d.ts.map +1 -0
- package/dist/components/update-card.js +28 -0
- package/dist/components/usage-meter.d.ts +15 -0
- package/dist/components/usage-meter.d.ts.map +1 -1
- package/dist/components/usage-meter.js +20 -1
- package/dist/components/waiting-line.d.ts +13 -10
- package/dist/components/waiting-line.d.ts.map +1 -1
- package/dist/components/waiting-line.js +13 -10
- package/dist/eslint/index.js +9 -0
- package/dist/eslint/rules/empty-state-owner.js +145 -0
- package/dist/eslint/rules/jsx-class-utility.js +5 -0
- package/dist/eslint/rules/menu-owner.js +75 -0
- package/dist/eslint/rules/no-choice-control-wrapper.js +2 -0
- package/dist/eslint/rules/no-decorative-icon.js +164 -0
- package/dist/eslint/rules/no-deprecated-zod-api.js +1 -0
- package/dist/eslint/rules/no-shadcn-appearance-override.js +1 -0
- package/dist/eslint/rules/no-subject-derived-expectation.js +1 -1
- package/dist/eslint/rules/no-write-in-subscription.js +1 -0
- package/dist/eslint/rules/page-composition.js +232 -0
- package/dist/eslint/rules/rendered-import.js +121 -0
- package/dist/eslint/strict-design-system.js +1 -1
- package/dist/hooks/use-hydrated.d.ts +2 -0
- package/dist/hooks/use-hydrated.d.ts.map +1 -0
- package/dist/hooks/use-hydrated.js +7 -0
- package/dist/index.d.ts +15 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -10
- package/dist/internal/agent-orb.d.ts.map +1 -1
- package/dist/internal/agent-orb.js +2 -1
- package/dist/internal/assistant-ui/attachment.d.ts.map +1 -1
- package/dist/internal/assistant-ui/reasoning.d.ts.map +1 -1
- package/dist/internal/assistant-ui/reasoning.js +3 -1
- package/dist/internal/assistant-ui/thread.js +3 -1
- package/dist/internal/assistant-ui/tool-fallback.d.ts.map +1 -1
- package/dist/internal/assistant-ui/tool-fallback.js +13 -13
- package/dist/internal/assistant-ui/tool-group.d.ts.map +1 -1
- package/dist/internal/assistant-ui/tool-group.js +3 -1
- package/dist/internal/catalog-list.d.ts +14 -0
- package/dist/internal/catalog-list.d.ts.map +1 -0
- package/dist/internal/catalog-list.js +53 -0
- package/dist/internal/empty.d.ts +6 -9
- package/dist/internal/empty.d.ts.map +1 -1
- package/dist/internal/empty.js +24 -22
- package/dist/internal/footer-strip.d.ts +0 -4
- package/dist/internal/footer-strip.d.ts.map +1 -1
- package/dist/internal/footer-strip.js +0 -4
- package/dist/internal/record-menu-items.d.ts +19 -0
- package/dist/internal/record-menu-items.d.ts.map +1 -0
- package/dist/internal/record-menu-items.js +20 -0
- package/dist/internal/settings-save.d.ts +43 -0
- package/dist/internal/settings-save.d.ts.map +1 -0
- package/dist/internal/settings-save.js +147 -0
- package/dist/lib/theme-mode.d.ts +1 -1
- package/dist/lib/theme-mode.js +2 -2
- package/dist/lib/use-copy-to-clipboard.d.ts.map +1 -1
- package/dist/lib/use-copy-to-clipboard.js +1 -0
- package/dist/showcase/assets.d.ts +8 -0
- package/dist/showcase/assets.d.ts.map +1 -0
- package/dist/showcase/assets.js +13 -0
- package/dist/showcase/foundations.d.ts +2 -0
- package/dist/showcase/foundations.d.ts.map +1 -0
- package/dist/showcase/foundations.js +61 -0
- package/dist/showcase/samples.d.ts +21 -0
- package/dist/showcase/samples.d.ts.map +1 -0
- package/dist/showcase/samples.js +48 -0
- package/dist/showcase/showcase.d.ts +10 -0
- package/dist/showcase/showcase.d.ts.map +1 -0
- package/dist/showcase/showcase.js +44 -0
- package/dist/showcase/specimens/actions.d.ts +7 -0
- package/dist/showcase/specimens/actions.d.ts.map +1 -0
- package/dist/showcase/specimens/actions.js +15 -0
- package/dist/showcase/specimens/charts.d.ts +17 -0
- package/dist/showcase/specimens/charts.d.ts.map +1 -0
- package/dist/showcase/specimens/charts.js +104 -0
- package/dist/showcase/specimens/choices.d.ts +21 -0
- package/dist/showcase/specimens/choices.d.ts.map +1 -0
- package/dist/showcase/specimens/choices.js +68 -0
- package/dist/showcase/specimens/compositions.d.ts +39 -0
- package/dist/showcase/specimens/compositions.d.ts.map +1 -0
- package/dist/showcase/specimens/compositions.js +270 -0
- package/dist/showcase/specimens/data.d.ts +31 -0
- package/dist/showcase/specimens/data.d.ts.map +1 -0
- package/dist/showcase/specimens/data.js +111 -0
- package/dist/showcase/specimens/feedback.d.ts +23 -0
- package/dist/showcase/specimens/feedback.d.ts.map +1 -0
- package/dist/showcase/specimens/feedback.js +64 -0
- package/dist/showcase/specimens/index.d.ts +164 -0
- package/dist/showcase/specimens/index.d.ts.map +1 -0
- package/dist/showcase/specimens/index.js +24 -0
- package/dist/showcase/specimens/inputs.d.ts +22 -0
- package/dist/showcase/specimens/inputs.d.ts.map +1 -0
- package/dist/showcase/specimens/inputs.js +60 -0
- package/dist/showcase/specimens/menus.d.ts +20 -0
- package/dist/showcase/specimens/menus.d.ts.map +1 -0
- package/dist/showcase/specimens/menus.js +65 -0
- package/dist/showcase/specimens/navigation.d.ts +22 -0
- package/dist/showcase/specimens/navigation.d.ts.map +1 -0
- package/dist/showcase/specimens/navigation.js +103 -0
- package/dist/showcase/specimens/other.d.ts +26 -0
- package/dist/showcase/specimens/other.d.ts.map +1 -0
- package/dist/showcase/specimens/other.js +73 -0
- package/dist/showcase/specimens/specimen.d.ts +5 -0
- package/dist/showcase/specimens/specimen.d.ts.map +1 -0
- package/dist/showcase/specimens/specimen.js +1 -0
- package/dist/showcase/specimens/status.d.ts +22 -0
- package/dist/showcase/specimens/status.d.ts.map +1 -0
- package/dist/showcase/specimens/status.js +44 -0
- package/dist/showcase/usage.generated.d.ts +16 -0
- package/dist/showcase/usage.generated.d.ts.map +1 -0
- package/dist/showcase/usage.generated.js +1788 -0
- package/dist/standalone/index.js +2 -2
- package/dist/standalone/orb-page.js +1 -0
- package/dist/styles/components.css +21 -0
- package/package.json +8 -3
- package/dist/components/automation-section.d.ts +0 -78
- package/dist/components/automation-section.d.ts.map +0 -1
- package/dist/components/automation-section.js +0 -75
- package/dist/components/catalog-tile.d.ts +0 -19
- package/dist/components/catalog-tile.d.ts.map +0 -1
- package/dist/components/catalog-tile.js +0 -13
- package/dist/components/feedback-state.d.ts +0 -14
- package/dist/components/feedback-state.d.ts.map +0 -1
- package/dist/components/feedback-state.js +0 -65
- package/dist/components/installer-shell.d.ts +0 -25
- package/dist/components/installer-shell.d.ts.map +0 -1
- package/dist/components/installer-shell.js +0 -32
- package/dist/components/settings-form.d.ts +0 -9
- package/dist/components/settings-form.d.ts.map +0 -1
- package/dist/components/settings-form.js +0 -85
package/dist/eslint/index.js
CHANGED
|
@@ -3,15 +3,19 @@ import { readdirSync, readFileSync } from "node:fs";
|
|
|
3
3
|
|
|
4
4
|
import { builtinRules } from "eslint/use-at-your-own-risk";
|
|
5
5
|
|
|
6
|
+
import { emptyStateOwner } from "./rules/empty-state-owner.js";
|
|
7
|
+
import { menuOwner } from "./rules/menu-owner.js";
|
|
6
8
|
import { noAppFeatureComponent } from "./rules/no-app-feature-component.js";
|
|
7
9
|
import { noChoiceControlWrapper } from "./rules/no-choice-control-wrapper.js";
|
|
8
10
|
import { noComment } from "./rules/no-comment.js";
|
|
11
|
+
import { noDecorativeIcon } from "./rules/no-decorative-icon.js";
|
|
9
12
|
import { noDeprecatedZodApi } from "./rules/no-deprecated-zod-api.js";
|
|
10
13
|
import { noGlobalPatch } from "./rules/no-global-patch.js";
|
|
11
14
|
import { noPackageComponentRedefinition } from "./rules/no-package-component-redefinition.js";
|
|
12
15
|
import { noShadcnAppearanceOverride } from "./rules/no-shadcn-appearance-override.js";
|
|
13
16
|
import { noSubjectDerivedExpectation } from "./rules/no-subject-derived-expectation.js";
|
|
14
17
|
import { noWriteInSubscription } from "./rules/no-write-in-subscription.js";
|
|
18
|
+
import { pageComposition } from "./rules/page-composition.js";
|
|
15
19
|
import { serverActionDiscipline } from "./rules/server-action-discipline.js";
|
|
16
20
|
import { strictDesignSystemSelectors } from "./strict-design-system.js";
|
|
17
21
|
|
|
@@ -35,6 +39,7 @@ function readPublishedVersion() {
|
|
|
35
39
|
} catch {
|
|
36
40
|
continue;
|
|
37
41
|
}
|
|
42
|
+
// oxlint-disable-next-line anti-slop/no-runtime-typeof -- parses package.json at its boundary; this package has no schema library.
|
|
38
43
|
if (manifest?.name === PUBLISHING_PACKAGE && typeof manifest.version === "string") {
|
|
39
44
|
return manifest.version;
|
|
40
45
|
}
|
|
@@ -101,15 +106,19 @@ const plugin = {
|
|
|
101
106
|
configs: {},
|
|
102
107
|
rules: {
|
|
103
108
|
...strictSelectorRules,
|
|
109
|
+
"empty-state-owner": emptyStateOwner,
|
|
110
|
+
"menu-owner": menuOwner,
|
|
104
111
|
"no-app-feature-component": noAppFeatureComponent,
|
|
105
112
|
"no-choice-control-wrapper": noChoiceControlWrapper,
|
|
106
113
|
"no-comment": noComment,
|
|
114
|
+
"no-decorative-icon": noDecorativeIcon,
|
|
107
115
|
"no-deprecated-zod-api": noDeprecatedZodApi,
|
|
108
116
|
"no-global-patch": noGlobalPatch,
|
|
109
117
|
"no-package-component-redefinition": noPackageComponentRedefinition,
|
|
110
118
|
"no-shadcn-appearance-override": noShadcnAppearanceOverride,
|
|
111
119
|
"no-subject-derived-expectation": noSubjectDerivedExpectation,
|
|
112
120
|
"no-write-in-subscription": noWriteInSubscription,
|
|
121
|
+
"page-composition": pageComposition,
|
|
113
122
|
"server-action-discipline": serverActionDiscipline,
|
|
114
123
|
},
|
|
115
124
|
};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Standard tool checked first: a `no-restricted-syntax` selector can match
|
|
3
|
+
* `items.length === 0 ? <X/> : …`, but not which branch is the empty one once
|
|
4
|
+
* the test is turned around (`items.length > 0 ? <List/> : <p/>`, an early
|
|
5
|
+
* `if` whose empty branch is the next `return`), so it would either miss those
|
|
6
|
+
* or report the list branch.
|
|
7
|
+
*/
|
|
8
|
+
import { renderedImports } from "./rendered-import.js";
|
|
9
|
+
|
|
10
|
+
const OWNERS = [
|
|
11
|
+
"EmptyState",
|
|
12
|
+
"CollectionPage",
|
|
13
|
+
"RecordList",
|
|
14
|
+
"ActivityFeed",
|
|
15
|
+
"LibraryShelf",
|
|
16
|
+
"CatalogDrawer",
|
|
17
|
+
"DataTable",
|
|
18
|
+
"CommandEmpty",
|
|
19
|
+
"ComboboxEmpty",
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
const SIZE_PROPERTIES = new Set(["length", "size"]);
|
|
23
|
+
const COUNT = /^count$|[a-z0-9]Count$/;
|
|
24
|
+
|
|
25
|
+
const unwrapChain = (node) => (node.type === "ChainExpression" ? node.expression : node);
|
|
26
|
+
|
|
27
|
+
const isSize = (node) => {
|
|
28
|
+
const read = unwrapChain(node);
|
|
29
|
+
if (read.type === "Identifier") return COUNT.test(read.name);
|
|
30
|
+
if (read.type !== "MemberExpression" || read.computed) return false;
|
|
31
|
+
return SIZE_PROPERTIES.has(read.property.name) || COUNT.test(read.property.name);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const MIRRORED = { "<": ">", ">": "<", "<=": ">=", ">=": "<=" };
|
|
35
|
+
|
|
36
|
+
const EMPTY_WHEN = {
|
|
37
|
+
"===": { 0: "empty" },
|
|
38
|
+
"==": { 0: "empty" },
|
|
39
|
+
"!==": { 0: "present" },
|
|
40
|
+
"!=": { 0: "present" },
|
|
41
|
+
"<": { 1: "empty" },
|
|
42
|
+
"<=": { 0: "empty" },
|
|
43
|
+
">": { 0: "present" },
|
|
44
|
+
">=": { 1: "present" },
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
function emptiness(test) {
|
|
48
|
+
const node = unwrapChain(test);
|
|
49
|
+
if (isSize(node)) return "present";
|
|
50
|
+
if (node.type === "UnaryExpression" && node.operator === "!") {
|
|
51
|
+
const inner = emptiness(node.argument);
|
|
52
|
+
if (inner === "empty") return "present";
|
|
53
|
+
if (inner === "present") return "empty";
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
if (node.type === "LogicalExpression") {
|
|
57
|
+
const sides = [emptiness(node.left), emptiness(node.right)];
|
|
58
|
+
if (node.operator === "&&" && sides.includes("empty")) return "empty";
|
|
59
|
+
if (node.operator === "||" && sides.includes("present")) return "present";
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
if (node.type !== "BinaryExpression") return null;
|
|
63
|
+
let { operator, left, right } = node;
|
|
64
|
+
// oxlint-disable-next-line anti-slop/no-runtime-typeof -- ESTree types Literal.value as string | number | boolean | RegExp | bigint | null; only typeof picks the number.
|
|
65
|
+
if (isSize(right) && typeof left.value === "number") {
|
|
66
|
+
[left, right] = [right, left];
|
|
67
|
+
operator = MIRRORED[operator] ?? operator;
|
|
68
|
+
}
|
|
69
|
+
// oxlint-disable-next-line anti-slop/no-runtime-typeof -- ESTree types Literal.value as string | number | boolean | RegExp | bigint | null; only typeof picks the number.
|
|
70
|
+
if (!isSize(left) || typeof right.value !== "number") return null;
|
|
71
|
+
return EMPTY_WHEN[operator]?.[right.value] ?? null;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function returned(statement) {
|
|
75
|
+
if (!statement) return null;
|
|
76
|
+
if (statement.type === "ReturnStatement") return statement.argument;
|
|
77
|
+
if (statement.type === "BlockStatement") {
|
|
78
|
+
const found = statement.body.find((inner) => inner.type === "ReturnStatement");
|
|
79
|
+
return found?.argument ?? null;
|
|
80
|
+
}
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function nextStatement(statement) {
|
|
85
|
+
const body = statement.parent.body;
|
|
86
|
+
if (!Array.isArray(body)) return null;
|
|
87
|
+
return body[body.indexOf(statement) + 1] ?? null;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export const emptyStateOwner = {
|
|
91
|
+
meta: {
|
|
92
|
+
type: "problem",
|
|
93
|
+
docs: {
|
|
94
|
+
description: "An absence renders EmptyState, or a composition that draws its own.",
|
|
95
|
+
},
|
|
96
|
+
schema: [
|
|
97
|
+
{
|
|
98
|
+
type: "object",
|
|
99
|
+
properties: {
|
|
100
|
+
owners: { type: "array", items: { type: "string" }, uniqueItems: true },
|
|
101
|
+
},
|
|
102
|
+
additionalProperties: false,
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
defaultOptions: [{ owners: [] }],
|
|
106
|
+
messages: {
|
|
107
|
+
"absence-branch":
|
|
108
|
+
"An absence is EmptyState: firstUse with the section's picture, nothingYet, noResults with its clear, or failed with its retry.",
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
create(context) {
|
|
112
|
+
const owners = new Set([...OWNERS, ...context.options[0].owners]);
|
|
113
|
+
const importOf = renderedImports(context);
|
|
114
|
+
const drawnByAnOwner = (element) =>
|
|
115
|
+
owners.has(importOf(element.openingElement.name)?.name ?? "");
|
|
116
|
+
|
|
117
|
+
function checkEmptyBranch(branch) {
|
|
118
|
+
const drawsItsOwn =
|
|
119
|
+
branch?.type === "JSXFragment" ||
|
|
120
|
+
(branch?.type === "JSXElement" && !drawnByAnOwner(branch));
|
|
121
|
+
if (drawsItsOwn) context.report({ node: branch, messageId: "absence-branch" });
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return {
|
|
125
|
+
ConditionalExpression(node) {
|
|
126
|
+
const verdict = emptiness(node.test);
|
|
127
|
+
if (verdict === "empty") checkEmptyBranch(node.consequent);
|
|
128
|
+
else if (verdict === "present") checkEmptyBranch(node.alternate);
|
|
129
|
+
},
|
|
130
|
+
LogicalExpression(node) {
|
|
131
|
+
if (node.operator === "&&" && emptiness(node.left) === "empty") {
|
|
132
|
+
checkEmptyBranch(node.right);
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
IfStatement(node) {
|
|
136
|
+
const verdict = emptiness(node.test);
|
|
137
|
+
if (verdict === "empty") {
|
|
138
|
+
checkEmptyBranch(returned(node.consequent));
|
|
139
|
+
} else if (verdict === "present" && returned(node.consequent)) {
|
|
140
|
+
checkEmptyBranch(returned(node.alternate ?? nextStatement(node)));
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
},
|
|
145
|
+
};
|
|
@@ -59,6 +59,7 @@ function objectStringValues(objectExpression) {
|
|
|
59
59
|
const values = [];
|
|
60
60
|
for (const property of objectExpression.properties) {
|
|
61
61
|
if (property.type !== "Property") continue;
|
|
62
|
+
// oxlint-disable-next-line anti-slop/no-runtime-typeof -- ESTree types Literal.value as string | number | boolean | RegExp | bigint | null; only typeof picks the string.
|
|
62
63
|
if (property.value.type === "Literal" && typeof property.value.value === "string") {
|
|
63
64
|
values.push(property.value.value);
|
|
64
65
|
}
|
|
@@ -80,9 +81,11 @@ function resolvedFragments(identifier, context, { objectsOnly = false } = {}) {
|
|
|
80
81
|
|
|
81
82
|
/** Every string literal and template chunk in the subtree, in source order. */
|
|
82
83
|
function literalFragments(node, fragments, { skipPropertyKeys, context }) {
|
|
84
|
+
// oxlint-disable-next-line anti-slop/no-runtime-typeof -- walks the generic AST, where only an object whose type is a string is a node.
|
|
83
85
|
if (!node || typeof node.type !== "string") return;
|
|
84
86
|
|
|
85
87
|
if (node.type === "Literal") {
|
|
88
|
+
// oxlint-disable-next-line anti-slop/no-runtime-typeof -- ESTree types Literal.value as string | number | boolean | RegExp | bigint | null; only typeof picks the string.
|
|
86
89
|
if (typeof node.value === "string") fragments.push(node.value);
|
|
87
90
|
return;
|
|
88
91
|
}
|
|
@@ -124,6 +127,7 @@ function literalFragments(node, fragments, { skipPropertyKeys, context }) {
|
|
|
124
127
|
if (skipPropertyKeys && key === "key" && node.type === "Property" && !node.computed) continue;
|
|
125
128
|
if (Array.isArray(value)) {
|
|
126
129
|
for (const child of value) literalFragments(child, fragments, { skipPropertyKeys, context });
|
|
130
|
+
// oxlint-disable-next-line anti-slop/no-runtime-typeof -- walks the generic AST, where only an object whose type is a string is a node.
|
|
127
131
|
} else if (value && typeof value === "object") {
|
|
128
132
|
literalFragments(value, fragments, { skipPropertyKeys, context });
|
|
129
133
|
}
|
|
@@ -160,6 +164,7 @@ function spreadClassUtilities(attribute, context, includeSlots) {
|
|
|
160
164
|
if (property.type !== "Property" || property.computed) continue;
|
|
161
165
|
const name = property.key.type === "Identifier" ? property.key.name : property.key.value;
|
|
162
166
|
if (!isClassProperty(name, includeSlots) && name !== "class") continue;
|
|
167
|
+
// oxlint-disable-next-line anti-slop/no-runtime-typeof -- ESTree types Literal.value as string | number | boolean | RegExp | bigint | null; only typeof picks the string.
|
|
163
168
|
if (property.value.type !== "Literal" || typeof property.value.value !== "string") continue;
|
|
164
169
|
values.push(...property.value.value.split(/\s+/).filter(Boolean));
|
|
165
170
|
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Standard tool checked first: `no-restricted-imports` holds the menu modules
|
|
3
|
+
* and the ellipsis icons (`repo/menu-owner-imports` in the root config's
|
|
4
|
+
* product-composition blocks), but not a destructive `Button` rendered once per
|
|
5
|
+
* row: that is an import binding joined to where its element renders, which no
|
|
6
|
+
* import rule sees and a selector cannot follow through a renamed import.
|
|
7
|
+
*/
|
|
8
|
+
import { PACKAGE_BARREL, partOf, renderedImports, staticAttribute } from "./rendered-import.js";
|
|
9
|
+
|
|
10
|
+
const BUTTON = new Map([
|
|
11
|
+
[
|
|
12
|
+
"Button",
|
|
13
|
+
["@nadicodeai/ui/components/button", PACKAGE_BARREL].map((from) => ({ from, part: "Button" })),
|
|
14
|
+
],
|
|
15
|
+
]);
|
|
16
|
+
|
|
17
|
+
const FUNCTIONS = new Set(["FunctionDeclaration", "FunctionExpression", "ArrowFunctionExpression"]);
|
|
18
|
+
const ROW_CALLBACKS = new Set(["map", "flatMap"]);
|
|
19
|
+
const ROW_RENDERERS = new Set(["cell", "command"]);
|
|
20
|
+
const ROW_COMPONENT = /Row$/;
|
|
21
|
+
|
|
22
|
+
const nameOf = (key) => (key?.type === "Identifier" ? key.name : key?.value);
|
|
23
|
+
|
|
24
|
+
function drawsOneRecord(fn) {
|
|
25
|
+
const { parent } = fn;
|
|
26
|
+
if (
|
|
27
|
+
parent.type === "CallExpression" &&
|
|
28
|
+
parent.arguments[0] === fn &&
|
|
29
|
+
parent.callee.type === "MemberExpression" &&
|
|
30
|
+
!parent.callee.computed &&
|
|
31
|
+
ROW_CALLBACKS.has(parent.callee.property.name)
|
|
32
|
+
) {
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
if (parent.type === "Property" && parent.value === fn) {
|
|
36
|
+
return ROW_RENDERERS.has(nameOf(parent.key));
|
|
37
|
+
}
|
|
38
|
+
if (parent.type === "JSXExpressionContainer" && parent.parent.type === "JSXAttribute") {
|
|
39
|
+
return ROW_RENDERERS.has(parent.parent.name.name);
|
|
40
|
+
}
|
|
41
|
+
if (fn.type === "FunctionDeclaration") return ROW_COMPONENT.test(fn.id?.name ?? "");
|
|
42
|
+
return parent.type === "VariableDeclarator" && ROW_COMPONENT.test(nameOf(parent.id) ?? "");
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function insideARow(node) {
|
|
46
|
+
for (let current = node.parent; current; current = current.parent) {
|
|
47
|
+
if (FUNCTIONS.has(current.type) && drawsOneRecord(current)) return true;
|
|
48
|
+
}
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export const menuOwner = {
|
|
53
|
+
meta: {
|
|
54
|
+
type: "problem",
|
|
55
|
+
docs: {
|
|
56
|
+
description:
|
|
57
|
+
"A record's destructive command is the last item of its ActionMenu, never a destructive button in its row.",
|
|
58
|
+
},
|
|
59
|
+
schema: [],
|
|
60
|
+
messages: {
|
|
61
|
+
"row-destructive-button":
|
|
62
|
+
"A destructive command is the last item of the row's ActionMenu, after a divider.",
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
create(context) {
|
|
66
|
+
const importOf = renderedImports(context);
|
|
67
|
+
return {
|
|
68
|
+
JSXOpeningElement(node) {
|
|
69
|
+
if (partOf(importOf(node.name), BUTTON, context.filename) !== "Button") return;
|
|
70
|
+
if (staticAttribute(node, "variant") !== "destructive") return;
|
|
71
|
+
if (insideARow(node)) context.report({ node, messageId: "row-destructive-button" });
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
},
|
|
75
|
+
};
|
|
@@ -25,6 +25,7 @@ function handedTo(element, owner) {
|
|
|
25
25
|
function invoked(handler) {
|
|
26
26
|
const found = [];
|
|
27
27
|
const visit = (node) => {
|
|
28
|
+
// oxlint-disable-next-line anti-slop/no-runtime-typeof -- walks the generic AST, where only an object whose type is a string is a node.
|
|
28
29
|
if (!node || typeof node.type !== "string") return;
|
|
29
30
|
if (node.type === "Identifier") {
|
|
30
31
|
const parent = node.parent;
|
|
@@ -39,6 +40,7 @@ function invoked(handler) {
|
|
|
39
40
|
for (const [key, value] of Object.entries(node)) {
|
|
40
41
|
if (key === "parent") continue;
|
|
41
42
|
for (const child of Array.isArray(value) ? value : [value]) {
|
|
43
|
+
// oxlint-disable-next-line anti-slop/no-runtime-typeof -- walks the generic AST, where only an object whose type is a string is a node.
|
|
42
44
|
if (child && typeof child.type === "string") visit(child);
|
|
43
45
|
}
|
|
44
46
|
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Standard tool checked first: a `no-restricted-syntax` selector such as
|
|
3
|
+
* `CardTitle JSXOpeningElement` matches any element under a title, not the
|
|
4
|
+
* ones bound to an icon module, and cannot stop at a control between the two
|
|
5
|
+
* (`<CardHeader><Button><Plus/></Button></CardHeader>` is allowed). This rule
|
|
6
|
+
* joins the element to its import and reads the nearest container above it.
|
|
7
|
+
*/
|
|
8
|
+
import { renderedImports, sourceMatches, writtenName } from "./rendered-import.js";
|
|
9
|
+
|
|
10
|
+
export const noDecorativeIcon = {
|
|
11
|
+
meta: {
|
|
12
|
+
type: "problem",
|
|
13
|
+
docs: {
|
|
14
|
+
description:
|
|
15
|
+
"A title or a label carries no icon; an icon belongs to a control or a menu row.",
|
|
16
|
+
},
|
|
17
|
+
schema: [
|
|
18
|
+
{
|
|
19
|
+
type: "object",
|
|
20
|
+
properties: {
|
|
21
|
+
iconModules: { type: "array", items: { type: "string" }, uniqueItems: true },
|
|
22
|
+
headings: { type: "array", items: { type: "string" }, uniqueItems: true },
|
|
23
|
+
controls: { type: "array", items: { type: "string" }, uniqueItems: true },
|
|
24
|
+
},
|
|
25
|
+
additionalProperties: false,
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
defaultOptions: [
|
|
29
|
+
{
|
|
30
|
+
iconModules: ["lucide-react", "@nadicodeai/ui/components/house-icons"],
|
|
31
|
+
headings: [
|
|
32
|
+
"h1",
|
|
33
|
+
"h2",
|
|
34
|
+
"h3",
|
|
35
|
+
"h4",
|
|
36
|
+
"h5",
|
|
37
|
+
"h6",
|
|
38
|
+
"legend",
|
|
39
|
+
"dt",
|
|
40
|
+
"th",
|
|
41
|
+
"caption",
|
|
42
|
+
"CardTitle",
|
|
43
|
+
"CardDescription",
|
|
44
|
+
"CardHeader",
|
|
45
|
+
"DialogTitle",
|
|
46
|
+
"SheetTitle",
|
|
47
|
+
"AlertDialogTitle",
|
|
48
|
+
"DrawerTitle",
|
|
49
|
+
"FieldLabel",
|
|
50
|
+
"FieldLegend",
|
|
51
|
+
"Label",
|
|
52
|
+
"ItemTitle",
|
|
53
|
+
"TableHead",
|
|
54
|
+
],
|
|
55
|
+
controls: [
|
|
56
|
+
"button",
|
|
57
|
+
"a",
|
|
58
|
+
"Button",
|
|
59
|
+
"Link",
|
|
60
|
+
"CardAction",
|
|
61
|
+
"TabsTrigger",
|
|
62
|
+
"TabsLink",
|
|
63
|
+
"ToggleGroupItem",
|
|
64
|
+
"Toggle",
|
|
65
|
+
"SidebarMenuButton",
|
|
66
|
+
"InputGroupAddon",
|
|
67
|
+
"InputGroupButton",
|
|
68
|
+
],
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
messages: {
|
|
72
|
+
"beside-heading":
|
|
73
|
+
"A title or a label carries no icon: an identity mark starts a row or a card (IdentityMark), and an icon belongs to a control or a menu row.",
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
create(context) {
|
|
77
|
+
const [{ iconModules, headings, controls }] = context.options;
|
|
78
|
+
const headingNames = new Set(headings);
|
|
79
|
+
const controlNames = new Set(controls);
|
|
80
|
+
const importOf = renderedImports(context);
|
|
81
|
+
const isIconImport = (name) => {
|
|
82
|
+
const imported = importOf({ type: "JSXIdentifier", name });
|
|
83
|
+
return (
|
|
84
|
+
imported !== null &&
|
|
85
|
+
iconModules.some((module) => sourceMatches(imported.source, module, context.filename))
|
|
86
|
+
);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
function constantOf(name, scope) {
|
|
90
|
+
for (let current = scope; current; current = current.upper) {
|
|
91
|
+
const variable = current.set.get(name);
|
|
92
|
+
if (!variable) continue;
|
|
93
|
+
const [definition] = variable.defs;
|
|
94
|
+
const declared =
|
|
95
|
+
definition?.type === "Variable" && definition.parent.kind === "const"
|
|
96
|
+
? definition.node.init
|
|
97
|
+
: null;
|
|
98
|
+
return declared ?? null;
|
|
99
|
+
}
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function holdsAnIcon(value, scope, seen = new Set()) {
|
|
104
|
+
if (!value || seen.has(value)) return false;
|
|
105
|
+
seen.add(value);
|
|
106
|
+
switch (value.type) {
|
|
107
|
+
case "Identifier":
|
|
108
|
+
return (
|
|
109
|
+
isIconImport(value.name) || holdsAnIcon(constantOf(value.name, scope), scope, seen)
|
|
110
|
+
);
|
|
111
|
+
case "MemberExpression":
|
|
112
|
+
return holdsAnIcon(value.object, scope, seen);
|
|
113
|
+
case "ConditionalExpression":
|
|
114
|
+
return [value.consequent, value.alternate].some((branch) =>
|
|
115
|
+
holdsAnIcon(branch, scope, seen),
|
|
116
|
+
);
|
|
117
|
+
case "LogicalExpression":
|
|
118
|
+
return [value.left, value.right].some((side) => holdsAnIcon(side, scope, seen));
|
|
119
|
+
case "ObjectExpression":
|
|
120
|
+
return value.properties.some(
|
|
121
|
+
(property) => property.type === "Property" && holdsAnIcon(property.value, scope, seen),
|
|
122
|
+
);
|
|
123
|
+
case "ArrayExpression":
|
|
124
|
+
return value.elements.some((element) => holdsAnIcon(element, scope, seen));
|
|
125
|
+
default:
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function isIcon(openingElement) {
|
|
131
|
+
const imported = importOf(openingElement.name);
|
|
132
|
+
if (imported) {
|
|
133
|
+
return iconModules.some((module) =>
|
|
134
|
+
sourceMatches(imported.source, module, context.filename),
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
const { name } = openingElement;
|
|
138
|
+
if (name.type !== "JSXIdentifier" || !/^[A-Z]/.test(name.name)) return false;
|
|
139
|
+
const scope = context.sourceCode.getScope(openingElement);
|
|
140
|
+
return holdsAnIcon(constantOf(name.name, scope), scope);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return {
|
|
144
|
+
JSXOpeningElement(node) {
|
|
145
|
+
if (!isIcon(node)) return;
|
|
146
|
+
for (let current = node.parent.parent; current; current = current.parent) {
|
|
147
|
+
if (current.type === "JSXAttribute") {
|
|
148
|
+
if (headingNames.has(writtenName(current.parent.name))) {
|
|
149
|
+
context.report({ node, messageId: "beside-heading" });
|
|
150
|
+
}
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
if (current.type !== "JSXElement") continue;
|
|
154
|
+
const name = writtenName(current.openingElement.name);
|
|
155
|
+
if (controlNames.has(name)) return;
|
|
156
|
+
if (headingNames.has(name)) {
|
|
157
|
+
context.report({ node, messageId: "beside-heading" });
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
};
|
|
163
|
+
},
|
|
164
|
+
};
|
|
@@ -103,6 +103,7 @@ function memberName(node) {
|
|
|
103
103
|
return node.property.name;
|
|
104
104
|
}
|
|
105
105
|
if (node.computed && node.property.type === "Literal") {
|
|
106
|
+
// oxlint-disable-next-line anti-slop/no-runtime-typeof -- ESTree types Literal.value as string | number | boolean | RegExp | bigint | null; only typeof picks the string.
|
|
106
107
|
return typeof node.property.value === "string" ? node.property.value : undefined;
|
|
107
108
|
}
|
|
108
109
|
return undefined;
|
|
@@ -138,6 +138,7 @@ function inlineAppearanceProperties(attribute) {
|
|
|
138
138
|
: undefined;
|
|
139
139
|
if (!appearanceStyleProperties.has(name)) return false;
|
|
140
140
|
const value = staticStyleValue(property.value);
|
|
141
|
+
// oxlint-disable-next-line anti-slop/no-runtime-typeof -- staticStyleValue returns the literal's string, number or undefined; only typeof tells them apart.
|
|
141
142
|
return typeof value === "number" || (typeof value === "string" && value.trim() !== "");
|
|
142
143
|
});
|
|
143
144
|
}
|
|
@@ -43,6 +43,7 @@ import { dirname, resolve, sep } from "node:path";
|
|
|
43
43
|
function propertyName(member) {
|
|
44
44
|
if (!member.computed && member.property.type === "Identifier") return member.property.name;
|
|
45
45
|
if (member.computed && member.property.type === "Literal") {
|
|
46
|
+
// oxlint-disable-next-line anti-slop/no-runtime-typeof -- ESTree types Literal.value as string | number | boolean | RegExp | bigint | null; only typeof picks the string.
|
|
46
47
|
return typeof member.property.value === "string" ? member.property.value : undefined;
|
|
47
48
|
}
|
|
48
49
|
return undefined;
|
|
@@ -148,7 +149,6 @@ export const noSubjectDerivedExpectation = {
|
|
|
148
149
|
if (statement.type !== "ImportDeclaration") continue;
|
|
149
150
|
if (statement.importKind === "type") continue;
|
|
150
151
|
const source = statement.source.value;
|
|
151
|
-
if (typeof source !== "string") continue;
|
|
152
152
|
if (!source.startsWith("./") && !source.startsWith("../")) continue;
|
|
153
153
|
if (isHarnessModule(context.filename, source)) continue;
|
|
154
154
|
for (const specifier of statement.specifiers) {
|
|
@@ -77,6 +77,7 @@ function* writesIn(node, keys) {
|
|
|
77
77
|
for (const key of keys[node.type] ?? []) {
|
|
78
78
|
const child = node[key];
|
|
79
79
|
for (const each of Array.isArray(child) ? child : [child]) {
|
|
80
|
+
// oxlint-disable-next-line anti-slop/no-runtime-typeof -- walks the generic AST, where only an object whose type is a string is a node.
|
|
80
81
|
if (each && typeof each.type === "string") yield* writesIn(each, keys);
|
|
81
82
|
}
|
|
82
83
|
}
|