@snksergio/design-system 0.19.1 → 0.30.2
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 +39 -12
- package/dist-lib/chunks/{app-shell-Cy9be0Zx.mjs → app-shell-78w0pYdP.mjs} +849 -79
- package/dist-lib/chunks/app-shell-78w0pYdP.mjs.map +1 -0
- package/dist-lib/chunks/{app-shell-CPx9X7zP.cjs → app-shell-Cyh8AUJT.cjs} +947 -176
- package/dist-lib/chunks/app-shell-Cyh8AUJT.cjs.map +1 -0
- package/dist-lib/chunks/{clientes-showcase-mocks-ayU1SDOA.mjs → clientes-showcase-mocks-CwWGCCmf.mjs} +1 -27
- package/dist-lib/chunks/clientes-showcase-mocks-CwWGCCmf.mjs.map +1 -0
- package/dist-lib/chunks/{clientes-showcase-mocks-DygUqkkh.cjs → clientes-showcase-mocks-CwhluBTT.cjs} +1 -44
- package/dist-lib/chunks/clientes-showcase-mocks-CwhluBTT.cjs.map +1 -0
- package/dist-lib/chunks/{input-BWevV7up.cjs → input-BjUSWce3.cjs} +24 -4
- package/dist-lib/chunks/input-BjUSWce3.cjs.map +1 -0
- package/dist-lib/chunks/{input-C9eKSSEb.mjs → input-DCDU4i4S.mjs} +23 -3
- package/dist-lib/chunks/input-DCDU4i4S.mjs.map +1 -0
- package/dist-lib/chunks/kpi-delta-C_3V6uG6.cjs +148 -0
- package/dist-lib/chunks/kpi-delta-C_3V6uG6.cjs.map +1 -0
- package/dist-lib/chunks/kpi-delta-DpYuDY4h.mjs +149 -0
- package/dist-lib/chunks/kpi-delta-DpYuDY4h.mjs.map +1 -0
- package/dist-lib/chunks/{page-header-CQbTGWQ8.mjs → page-header-B6XJyIMz.mjs} +2 -2
- package/dist-lib/chunks/{page-header-CQbTGWQ8.mjs.map → page-header-B6XJyIMz.mjs.map} +1 -1
- package/dist-lib/chunks/{page-header-BZ-WrxV2.cjs → page-header-D0rpU0yn.cjs} +4 -4
- package/dist-lib/chunks/{page-header-BZ-WrxV2.cjs.map → page-header-D0rpU0yn.cjs.map} +1 -1
- package/dist-lib/chunks/{panel-pOXMw6a-.cjs → panel-B_SSIEDs.cjs} +1876 -1067
- package/dist-lib/chunks/panel-B_SSIEDs.cjs.map +1 -0
- package/dist-lib/chunks/{panel-BCUixETK.mjs → panel-CEkyoGiO.mjs} +1639 -831
- package/dist-lib/chunks/panel-CEkyoGiO.mjs.map +1 -0
- package/dist-lib/index.cjs +3819 -230
- package/dist-lib/index.cjs.map +1 -1
- package/dist-lib/index.mjs +3898 -313
- package/dist-lib/index.mjs.map +1 -1
- package/dist-lib/preview/chat.cjs +41 -42
- package/dist-lib/preview/chat.cjs.map +1 -1
- package/dist-lib/preview/chat.mjs +2 -3
- package/dist-lib/preview/chat.mjs.map +1 -1
- package/dist-lib/preview/clientes.cjs +22 -24
- package/dist-lib/preview/clientes.cjs.map +1 -1
- package/dist-lib/preview/clientes.mjs +5 -7
- package/dist-lib/preview/clientes.mjs.map +1 -1
- package/dist-lib/preview/dashboard.cjs +232 -28
- package/dist-lib/preview/dashboard.cjs.map +1 -1
- package/dist-lib/preview/dashboard.mjs +215 -11
- package/dist-lib/preview/dashboard.mjs.map +1 -1
- package/dist-lib/preview/mocks.cjs +1 -1
- package/dist-lib/preview/mocks.mjs +1 -1
- package/dist-lib/src/components/index.d.ts +14 -0
- package/dist-lib/src/components/index.d.ts.map +1 -1
- package/dist-lib/src/components/shadcn/command.d.ts.map +1 -1
- package/dist-lib/src/components/shadcn/input.d.ts.map +1 -1
- package/dist-lib/src/components/shadcn/tabs.d.ts +11 -6
- package/dist-lib/src/components/shadcn/tabs.d.ts.map +1 -1
- package/dist-lib/src/components/shadcn/tooltip.d.ts +25 -7
- package/dist-lib/src/components/shadcn/tooltip.d.ts.map +1 -1
- package/dist-lib/src/components/ui/ChoroplethMap/choropleth-map.d.ts +13 -0
- package/dist-lib/src/components/ui/ChoroplethMap/choropleth-map.d.ts.map +1 -0
- package/dist-lib/src/components/ui/ChoroplethMap/choropleth-map.styles.d.ts +95 -0
- package/dist-lib/src/components/ui/ChoroplethMap/choropleth-map.styles.d.ts.map +1 -0
- package/dist-lib/src/components/ui/ChoroplethMap/choropleth-map.types.d.ts +81 -0
- package/dist-lib/src/components/ui/ChoroplethMap/choropleth-map.types.d.ts.map +1 -0
- package/dist-lib/src/components/ui/ChoroplethMap/index.d.ts +3 -0
- package/dist-lib/src/components/ui/ChoroplethMap/index.d.ts.map +1 -0
- package/dist-lib/src/components/ui/ColorPicker/color-picker.d.ts +16 -0
- package/dist-lib/src/components/ui/ColorPicker/color-picker.d.ts.map +1 -0
- package/dist-lib/src/components/ui/ColorPicker/color-picker.presets.d.ts +13 -0
- package/dist-lib/src/components/ui/ColorPicker/color-picker.presets.d.ts.map +1 -0
- package/dist-lib/src/components/ui/ColorPicker/color-picker.styles.d.ts +135 -0
- package/dist-lib/src/components/ui/ColorPicker/color-picker.styles.d.ts.map +1 -0
- package/dist-lib/src/components/ui/ColorPicker/color-picker.types.d.ts +35 -0
- package/dist-lib/src/components/ui/ColorPicker/color-picker.types.d.ts.map +1 -0
- package/dist-lib/src/components/ui/ColorPicker/index.d.ts +6 -0
- package/dist-lib/src/components/ui/ColorPicker/index.d.ts.map +1 -0
- package/dist-lib/src/components/ui/ConversationListItem/conversation-list-item.d.ts +23 -0
- package/dist-lib/src/components/ui/ConversationListItem/conversation-list-item.d.ts.map +1 -0
- package/dist-lib/src/components/ui/ConversationListItem/conversation-list-item.styles.d.ts +173 -0
- package/dist-lib/src/components/ui/ConversationListItem/conversation-list-item.styles.d.ts.map +1 -0
- package/dist-lib/src/components/ui/ConversationListItem/conversation-list-item.types.d.ts +59 -0
- package/dist-lib/src/components/ui/ConversationListItem/conversation-list-item.types.d.ts.map +1 -0
- package/dist-lib/src/components/ui/ConversationListItem/index.d.ts +5 -0
- package/dist-lib/src/components/ui/ConversationListItem/index.d.ts.map +1 -0
- package/dist-lib/src/components/ui/DataTable/data-table.d.ts.map +1 -1
- package/dist-lib/src/components/ui/DataTable/data-table.types.d.ts +14 -1
- package/dist-lib/src/components/ui/DataTable/data-table.types.d.ts.map +1 -1
- package/dist-lib/src/components/ui/DataTable/hooks/use-column-auto-width.d.ts +9 -0
- package/dist-lib/src/components/ui/DataTable/hooks/use-column-auto-width.d.ts.map +1 -1
- package/dist-lib/src/components/ui/DataTable/hooks/use-data-table-controller.d.ts.map +1 -1
- package/dist-lib/src/components/ui/DataTable/services/saved-views.types.d.ts +9 -0
- package/dist-lib/src/components/ui/DataTable/services/saved-views.types.d.ts.map +1 -1
- package/dist-lib/src/components/ui/DataTable/utils/calculate-column-widths.d.ts +16 -0
- package/dist-lib/src/components/ui/DataTable/utils/calculate-column-widths.d.ts.map +1 -1
- package/dist-lib/src/components/ui/DatePicker/datepicker.d.ts +31 -8
- package/dist-lib/src/components/ui/DatePicker/datepicker.d.ts.map +1 -1
- package/dist-lib/src/components/ui/DatePicker/index.d.ts +1 -1
- package/dist-lib/src/components/ui/DatePicker/index.d.ts.map +1 -1
- package/dist-lib/src/components/ui/DateSeparatorChip/date-separator-chip.d.ts +18 -0
- package/dist-lib/src/components/ui/DateSeparatorChip/date-separator-chip.d.ts.map +1 -0
- package/dist-lib/src/components/ui/DateSeparatorChip/date-separator-chip.styles.d.ts +63 -0
- package/dist-lib/src/components/ui/DateSeparatorChip/date-separator-chip.styles.d.ts.map +1 -0
- package/dist-lib/src/components/ui/DateSeparatorChip/date-separator-chip.types.d.ts +21 -0
- package/dist-lib/src/components/ui/DateSeparatorChip/date-separator-chip.types.d.ts.map +1 -0
- package/dist-lib/src/components/ui/DateSeparatorChip/index.d.ts +5 -0
- package/dist-lib/src/components/ui/DateSeparatorChip/index.d.ts.map +1 -0
- package/dist-lib/src/components/ui/EmptyState/empty-state.d.ts +12 -0
- package/dist-lib/src/components/ui/EmptyState/empty-state.d.ts.map +1 -0
- package/dist-lib/src/components/ui/EmptyState/empty-state.styles.d.ts +83 -0
- package/dist-lib/src/components/ui/EmptyState/empty-state.styles.d.ts.map +1 -0
- package/dist-lib/src/components/ui/EmptyState/empty-state.types.d.ts +43 -0
- package/dist-lib/src/components/ui/EmptyState/empty-state.types.d.ts.map +1 -0
- package/dist-lib/src/components/ui/EmptyState/index.d.ts +5 -0
- package/dist-lib/src/components/ui/EmptyState/index.d.ts.map +1 -0
- package/dist-lib/src/components/ui/FileUploadField/file-upload-field.d.ts +15 -0
- package/dist-lib/src/components/ui/FileUploadField/file-upload-field.d.ts.map +1 -0
- package/dist-lib/src/components/ui/FileUploadField/file-upload-field.styles.d.ts +66 -0
- package/dist-lib/src/components/ui/FileUploadField/file-upload-field.styles.d.ts.map +1 -0
- package/dist-lib/src/components/ui/FileUploadField/file-upload-field.types.d.ts +41 -0
- package/dist-lib/src/components/ui/FileUploadField/file-upload-field.types.d.ts.map +1 -0
- package/dist-lib/src/components/ui/FileUploadField/index.d.ts +3 -0
- package/dist-lib/src/components/ui/FileUploadField/index.d.ts.map +1 -0
- package/dist-lib/src/components/ui/Kpi/kpi-delta.d.ts +4 -1
- package/dist-lib/src/components/ui/Kpi/kpi-delta.d.ts.map +1 -1
- package/dist-lib/src/components/ui/Kpi/kpi.d.ts +1 -1
- package/dist-lib/src/components/ui/Kpi/kpi.d.ts.map +1 -1
- package/dist-lib/src/components/ui/Kpi/kpi.styles.d.ts +42 -0
- package/dist-lib/src/components/ui/Kpi/kpi.styles.d.ts.map +1 -1
- package/dist-lib/src/components/ui/Kpi/kpi.types.d.ts +13 -1
- package/dist-lib/src/components/ui/Kpi/kpi.types.d.ts.map +1 -1
- package/dist-lib/src/components/ui/MarkdownText/index.d.ts +5 -0
- package/dist-lib/src/components/ui/MarkdownText/index.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MarkdownText/markdown-text.d.ts +14 -0
- package/dist-lib/src/components/ui/MarkdownText/markdown-text.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MarkdownText/markdown-text.styles.d.ts +72 -0
- package/dist-lib/src/components/ui/MarkdownText/markdown-text.styles.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MarkdownText/markdown-text.types.d.ts +26 -0
- package/dist-lib/src/components/ui/MarkdownText/markdown-text.types.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MenuSidebar/sidebar-section.d.ts.map +1 -1
- package/dist-lib/src/components/ui/MenuSidebar/sidebar.styles.d.ts +1 -0
- package/dist-lib/src/components/ui/MenuSidebar/sidebar.styles.d.ts.map +1 -1
- package/dist-lib/src/components/ui/MenuSidebar/sidebar.types.d.ts +7 -1
- package/dist-lib/src/components/ui/MenuSidebar/sidebar.types.d.ts.map +1 -1
- package/dist-lib/src/components/ui/MessageAck/index.d.ts +5 -0
- package/dist-lib/src/components/ui/MessageAck/index.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MessageAck/message-ack.d.ts +18 -0
- package/dist-lib/src/components/ui/MessageAck/message-ack.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MessageAck/message-ack.styles.d.ts +61 -0
- package/dist-lib/src/components/ui/MessageAck/message-ack.styles.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MessageAck/message-ack.types.d.ts +14 -0
- package/dist-lib/src/components/ui/MessageAck/message-ack.types.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MessageBubble/index.d.ts +5 -0
- package/dist-lib/src/components/ui/MessageBubble/index.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MessageBubble/message-bubble.d.ts +20 -0
- package/dist-lib/src/components/ui/MessageBubble/message-bubble.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MessageBubble/message-bubble.styles.d.ts +180 -0
- package/dist-lib/src/components/ui/MessageBubble/message-bubble.styles.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MessageBubble/message-bubble.types.d.ts +87 -0
- package/dist-lib/src/components/ui/MessageBubble/message-bubble.types.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MessageComposer/index.d.ts +5 -0
- package/dist-lib/src/components/ui/MessageComposer/index.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MessageComposer/message-composer.d.ts +18 -0
- package/dist-lib/src/components/ui/MessageComposer/message-composer.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MessageComposer/message-composer.styles.d.ts +113 -0
- package/dist-lib/src/components/ui/MessageComposer/message-composer.styles.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MessageComposer/message-composer.types.d.ts +49 -0
- package/dist-lib/src/components/ui/MessageComposer/message-composer.types.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MessageVariablesPicker/index.d.ts +6 -0
- package/dist-lib/src/components/ui/MessageVariablesPicker/index.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MessageVariablesPicker/message-variables-picker.d.ts +12 -0
- package/dist-lib/src/components/ui/MessageVariablesPicker/message-variables-picker.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MessageVariablesPicker/message-variables-picker.styles.d.ts +57 -0
- package/dist-lib/src/components/ui/MessageVariablesPicker/message-variables-picker.styles.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MessageVariablesPicker/message-variables-picker.types.d.ts +36 -0
- package/dist-lib/src/components/ui/MessageVariablesPicker/message-variables-picker.types.d.ts.map +1 -0
- package/dist-lib/src/components/ui/Modal/modal.d.ts +3 -1
- package/dist-lib/src/components/ui/Modal/modal.d.ts.map +1 -1
- package/dist-lib/src/components/ui/Modal/modal.styles.d.ts +7 -1
- package/dist-lib/src/components/ui/Modal/modal.styles.d.ts.map +1 -1
- package/dist-lib/src/components/ui/MonthYearPicker/index.d.ts +3 -0
- package/dist-lib/src/components/ui/MonthYearPicker/index.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MonthYearPicker/month-year-picker.d.ts +11 -0
- package/dist-lib/src/components/ui/MonthYearPicker/month-year-picker.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MonthYearPicker/month-year-picker.styles.d.ts +113 -0
- package/dist-lib/src/components/ui/MonthYearPicker/month-year-picker.styles.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MonthYearPicker/month-year-picker.types.d.ts +34 -0
- package/dist-lib/src/components/ui/MonthYearPicker/month-year-picker.types.d.ts.map +1 -0
- package/dist-lib/src/components/ui/SingleMenuSidebar/single-menu-sidebar.styles.d.ts +1 -1
- package/dist-lib/src/components/ui/Spinner/index.d.ts +3 -0
- package/dist-lib/src/components/ui/Spinner/index.d.ts.map +1 -0
- package/dist-lib/src/components/ui/Spinner/spinner.d.ts +11 -0
- package/dist-lib/src/components/ui/Spinner/spinner.d.ts.map +1 -0
- package/dist-lib/src/components/ui/Spinner/spinner.styles.d.ts +55 -0
- package/dist-lib/src/components/ui/Spinner/spinner.styles.d.ts.map +1 -0
- package/dist-lib/src/components/ui/Spinner/spinner.types.d.ts +12 -0
- package/dist-lib/src/components/ui/Spinner/spinner.types.d.ts.map +1 -0
- package/dist-lib/src/components/ui/TableToolbar/parts/table-toolbar-views.d.ts +7 -1
- package/dist-lib/src/components/ui/TableToolbar/parts/table-toolbar-views.d.ts.map +1 -1
- package/dist-lib/src/components/ui/Toast/toast.d.ts +44 -0
- package/dist-lib/src/components/ui/Toast/toast.d.ts.map +1 -0
- package/dist-lib/src/hooks/useBrand.d.ts +31 -0
- package/dist-lib/src/hooks/useBrand.d.ts.map +1 -0
- package/dist-lib/src/preview/pages/ChatV2/components/QueueColumn/queue-column.styles.d.ts +3 -3
- package/dist-lib/src/preview/pages/ClientesShowcase/clientes-showcase-mocks.d.ts +1 -1
- package/dist-lib/src/preview/pages/ClientesShowcase/clientes-showcase-mocks.d.ts.map +1 -1
- package/dist-lib/src/preview/pages/ClientesShowcase/clientes-showcase.types.d.ts +1 -1
- package/dist-lib/src/preview/pages/ClientesShowcase/clientes-showcase.types.d.ts.map +1 -1
- package/dist-lib/src/preview/pages/ClientesShowcase/components/DetailDrawer/detail-drawer.types.d.ts +1 -1
- package/dist-lib/src/preview/pages/ClientesShowcase/components/DetailDrawer/detail-drawer.types.d.ts.map +1 -1
- package/dist-lib/src/preview/pages/DashboardShowcase.d.ts.map +1 -1
- package/dist-lib/src/preview/pages/_table-data.d.ts +51 -0
- package/dist-lib/src/preview/pages/_table-data.d.ts.map +1 -0
- package/dist-lib/src/utils/tv.d.ts.map +1 -1
- package/dist-lib/theme.css +32 -0
- package/dist-lib/tokens/brands/blue/primitives/color-palette.d.ts +266 -0
- package/dist-lib/tokens/brands/blue/primitives/color-palette.d.ts.map +1 -0
- package/dist-lib/tokens/brands/blue/semantic/color-dark.d.ts +200 -0
- package/dist-lib/tokens/brands/blue/semantic/color-dark.d.ts.map +1 -0
- package/dist-lib/tokens/brands/blue/semantic/color-light.d.ts +202 -0
- package/dist-lib/tokens/brands/blue/semantic/color-light.d.ts.map +1 -0
- package/dist-lib/tokens/brands/default/semantic/typography.d.ts +4 -2
- package/dist-lib/tokens/brands/default/semantic/typography.d.ts.map +1 -1
- package/dist-lib/tokens/brands/green/primitives/color-palette.d.ts +267 -0
- package/dist-lib/tokens/brands/green/primitives/color-palette.d.ts.map +1 -0
- package/dist-lib/tokens/brands/green/semantic/color-dark.d.ts +200 -0
- package/dist-lib/tokens/brands/green/semantic/color-dark.d.ts.map +1 -0
- package/dist-lib/tokens/brands/green/semantic/color-light.d.ts +201 -0
- package/dist-lib/tokens/brands/green/semantic/color-light.d.ts.map +1 -0
- package/dist-lib/tokens/brands/pay/primitives/color-palette.d.ts +146 -0
- package/dist-lib/tokens/brands/pay/primitives/color-palette.d.ts.map +1 -0
- package/dist-lib/tokens/brands/pay/semantic/color-dark.d.ts +201 -0
- package/dist-lib/tokens/brands/pay/semantic/color-dark.d.ts.map +1 -0
- package/dist-lib/tokens/brands/pay/semantic/color-light.d.ts +199 -0
- package/dist-lib/tokens/brands/pay/semantic/color-light.d.ts.map +1 -0
- package/dist-lib/tokens.cjs +35 -0
- package/dist-lib/tokens.cjs.map +1 -1
- package/dist-lib/tokens.mjs +35 -0
- package/dist-lib/tokens.mjs.map +1 -1
- package/package.json +21 -7
- package/dist-lib/chunks/app-shell-CPx9X7zP.cjs.map +0 -1
- package/dist-lib/chunks/app-shell-Cy9be0Zx.mjs.map +0 -1
- package/dist-lib/chunks/badge-DBdk74KN.mjs +0 -840
- package/dist-lib/chunks/badge-DBdk74KN.mjs.map +0 -1
- package/dist-lib/chunks/badge-gU2wtxrn.cjs +0 -856
- package/dist-lib/chunks/badge-gU2wtxrn.cjs.map +0 -1
- package/dist-lib/chunks/chip-group-2-f_Yo7Y.cjs +0 -763
- package/dist-lib/chunks/chip-group-2-f_Yo7Y.cjs.map +0 -1
- package/dist-lib/chunks/chip-group-_e-yh1Zq.mjs +0 -747
- package/dist-lib/chunks/chip-group-_e-yh1Zq.mjs.map +0 -1
- package/dist-lib/chunks/clientes-showcase-mocks-DygUqkkh.cjs.map +0 -1
- package/dist-lib/chunks/clientes-showcase-mocks-ayU1SDOA.mjs.map +0 -1
- package/dist-lib/chunks/input-BWevV7up.cjs.map +0 -1
- package/dist-lib/chunks/input-C9eKSSEb.mjs.map +0 -1
- package/dist-lib/chunks/panel-BCUixETK.mjs.map +0 -1
- package/dist-lib/chunks/panel-pOXMw6a-.cjs.map +0 -1
|
@@ -7,12 +7,11 @@ const React = require("react");
|
|
|
7
7
|
const core = require("@dnd-kit/core");
|
|
8
8
|
const sortable = require("@dnd-kit/sortable");
|
|
9
9
|
const reactVirtual = require("@tanstack/react-virtual");
|
|
10
|
-
const
|
|
11
|
-
const badge = require("./badge-gU2wtxrn.cjs");
|
|
12
|
-
const appShell = require("./app-shell-CPx9X7zP.cjs");
|
|
10
|
+
const appShell = require("./app-shell-Cyh8AUJT.cjs");
|
|
13
11
|
const lucideReact = require("lucide-react");
|
|
12
|
+
const CheckboxPrimitive = require("@radix-ui/react-checkbox");
|
|
14
13
|
const SwitchPrimitives = require("@radix-ui/react-switch");
|
|
15
|
-
const input = require("./input-
|
|
14
|
+
const input = require("./input-BjUSWce3.cjs");
|
|
16
15
|
const AlertDialogPrimitive = require("@radix-ui/react-alert-dialog");
|
|
17
16
|
const SelectPrimitive = require("@radix-ui/react-select");
|
|
18
17
|
const ReactDOM = require("react-dom");
|
|
@@ -37,6 +36,7 @@ function _interopNamespaceDefault(e) {
|
|
|
37
36
|
return Object.freeze(n);
|
|
38
37
|
}
|
|
39
38
|
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
|
39
|
+
const CheckboxPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(CheckboxPrimitive);
|
|
40
40
|
const SwitchPrimitives__namespace = /* @__PURE__ */ _interopNamespaceDefault(SwitchPrimitives);
|
|
41
41
|
const AlertDialogPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(AlertDialogPrimitive);
|
|
42
42
|
const SelectPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(SelectPrimitive);
|
|
@@ -47,7 +47,7 @@ const AlertDialogOverlay = React__namespace.forwardRef(({ className, ...props },
|
|
|
47
47
|
AlertDialogPrimitive__namespace.Overlay,
|
|
48
48
|
{
|
|
49
49
|
ref: ref2,
|
|
50
|
-
className:
|
|
50
|
+
className: appShell.cn(
|
|
51
51
|
"fixed inset-0 z-50 bg-black/30 supports-[backdrop-filter]:backdrop-blur-sm",
|
|
52
52
|
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
53
53
|
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
@@ -63,7 +63,7 @@ const AlertDialogContent = React__namespace.forwardRef(({ className, ...props },
|
|
|
63
63
|
AlertDialogPrimitive__namespace.Content,
|
|
64
64
|
{
|
|
65
65
|
ref: ref2,
|
|
66
|
-
className:
|
|
66
|
+
className: appShell.cn(
|
|
67
67
|
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] sm:max-w-[420px]",
|
|
68
68
|
"translate-x-[-50%] translate-y-[-50%]",
|
|
69
69
|
"rounded-radius-2xl bg-bg-surface text-fg-default",
|
|
@@ -85,7 +85,7 @@ const AlertDialogHeader = ({
|
|
|
85
85
|
}) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
86
86
|
"div",
|
|
87
87
|
{
|
|
88
|
-
className:
|
|
88
|
+
className: appShell.cn(
|
|
89
89
|
"flex flex-col items-center text-center gap-gp-lg",
|
|
90
90
|
"px-pad-4xl pt-[32px] pb-pad-3xl",
|
|
91
91
|
className
|
|
@@ -103,7 +103,7 @@ const AlertDialogFooter = ({
|
|
|
103
103
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
104
104
|
"div",
|
|
105
105
|
{
|
|
106
|
-
className:
|
|
106
|
+
className: appShell.cn(
|
|
107
107
|
"flex flex-col-reverse items-stretch gap-gp-md sm:flex-row",
|
|
108
108
|
"px-pad-3xl pb-pad-3xl",
|
|
109
109
|
className
|
|
@@ -117,7 +117,7 @@ const AlertDialogTitle = React__namespace.forwardRef(({ className, ...props }, r
|
|
|
117
117
|
AlertDialogPrimitive__namespace.Title,
|
|
118
118
|
{
|
|
119
119
|
ref: ref2,
|
|
120
|
-
className:
|
|
120
|
+
className: appShell.cn(
|
|
121
121
|
"text-body-xl font-bold tracking-[-0.01em] text-fg-default leading-tight",
|
|
122
122
|
className
|
|
123
123
|
),
|
|
@@ -129,7 +129,7 @@ const AlertDialogDescription = React__namespace.forwardRef(({ className, ...prop
|
|
|
129
129
|
AlertDialogPrimitive__namespace.Description,
|
|
130
130
|
{
|
|
131
131
|
ref: ref2,
|
|
132
|
-
className:
|
|
132
|
+
className: appShell.cn(
|
|
133
133
|
"text-body-sm font-normal leading-[1.5] text-fg-muted max-w-[340px]",
|
|
134
134
|
className
|
|
135
135
|
),
|
|
@@ -139,7 +139,7 @@ const AlertDialogDescription = React__namespace.forwardRef(({ className, ...prop
|
|
|
139
139
|
AlertDialogDescription.displayName = AlertDialogPrimitive__namespace.Description.displayName;
|
|
140
140
|
const AlertDialogAction = AlertDialogPrimitive__namespace.Action;
|
|
141
141
|
const AlertDialogCancel = AlertDialogPrimitive__namespace.Cancel;
|
|
142
|
-
const alertModalIcon =
|
|
142
|
+
const alertModalIcon = appShell.tv({
|
|
143
143
|
base: [
|
|
144
144
|
"inline-flex items-center justify-center",
|
|
145
145
|
"size-[56px] shrink-0 rounded-radius-full",
|
|
@@ -212,7 +212,7 @@ function AlertModal({
|
|
|
212
212
|
] }),
|
|
213
213
|
/* @__PURE__ */ jsxRuntime.jsxs(AlertDialogFooter, { children: [
|
|
214
214
|
!hideCancel && /* @__PURE__ */ jsxRuntime.jsx(AlertDialogCancel, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
215
|
-
|
|
215
|
+
appShell.Button,
|
|
216
216
|
{
|
|
217
217
|
type: "button",
|
|
218
218
|
color: "secondary",
|
|
@@ -224,7 +224,7 @@ function AlertModal({
|
|
|
224
224
|
}
|
|
225
225
|
) }),
|
|
226
226
|
/* @__PURE__ */ jsxRuntime.jsx(AlertDialogAction, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
227
|
-
|
|
227
|
+
appShell.Button,
|
|
228
228
|
{
|
|
229
229
|
type: "button",
|
|
230
230
|
color: TONE_BUTTON_COLOR[tone],
|
|
@@ -273,7 +273,7 @@ function getContrastTextColor(bgColor) {
|
|
|
273
273
|
const blackContrast = contrastRatio(0, bgLum);
|
|
274
274
|
return whiteContrast >= blackContrast ? "white" : "black";
|
|
275
275
|
}
|
|
276
|
-
const avatarVariants =
|
|
276
|
+
const avatarVariants = appShell.tv({
|
|
277
277
|
base: [
|
|
278
278
|
"inline-flex items-center justify-center",
|
|
279
279
|
"shrink-0",
|
|
@@ -345,14 +345,14 @@ const Avatar = React.forwardRef(
|
|
|
345
345
|
}
|
|
346
346
|
);
|
|
347
347
|
Avatar.displayName = "Avatar";
|
|
348
|
-
const buttonGroupVariants =
|
|
348
|
+
const buttonGroupVariants = appShell.tv({
|
|
349
349
|
base: [
|
|
350
350
|
"inline-flex items-stretch",
|
|
351
351
|
// Permite focus ring de cada filho aparecer (z-index relativo no slot focused).
|
|
352
352
|
"isolate"
|
|
353
353
|
]
|
|
354
354
|
});
|
|
355
|
-
const buttonGroupSlot =
|
|
355
|
+
const buttonGroupSlot = appShell.tv({
|
|
356
356
|
variants: {
|
|
357
357
|
position: {
|
|
358
358
|
// Primary: arredondado só na esquerda; direita reta pra "encostar" no chevron
|
|
@@ -363,7 +363,7 @@ const buttonGroupSlot = chipGroup.tv({
|
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
365
|
});
|
|
366
|
-
const buttonGroupChevronSize =
|
|
366
|
+
const buttonGroupChevronSize = appShell.tv({
|
|
367
367
|
variants: {
|
|
368
368
|
size: {
|
|
369
369
|
"2xs": "size-form-xs px-0",
|
|
@@ -385,7 +385,7 @@ const ButtonGroupRoot = React.forwardRef(
|
|
|
385
385
|
{
|
|
386
386
|
ref: ref2,
|
|
387
387
|
role: "group",
|
|
388
|
-
className:
|
|
388
|
+
className: appShell.cn(buttonGroupVariants(), className),
|
|
389
389
|
children
|
|
390
390
|
}
|
|
391
391
|
) });
|
|
@@ -396,11 +396,11 @@ const ButtonGroupPrimary = React.forwardRef(
|
|
|
396
396
|
const ctx = React.useContext(ButtonGroupContext);
|
|
397
397
|
const merged = mergeWithContext(ctx, props);
|
|
398
398
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
399
|
-
|
|
399
|
+
appShell.Button,
|
|
400
400
|
{
|
|
401
401
|
ref: ref2,
|
|
402
402
|
...merged,
|
|
403
|
-
className:
|
|
403
|
+
className: appShell.cn(buttonGroupSlot({ position: "primary" }), className)
|
|
404
404
|
}
|
|
405
405
|
);
|
|
406
406
|
}
|
|
@@ -411,11 +411,11 @@ const ButtonGroupChevron = React.forwardRef(
|
|
|
411
411
|
const merged = mergeWithContext(ctx, props);
|
|
412
412
|
const effectiveSize = merged.size ?? "md";
|
|
413
413
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
414
|
-
|
|
414
|
+
appShell.Button,
|
|
415
415
|
{
|
|
416
416
|
ref: ref2,
|
|
417
417
|
...merged,
|
|
418
|
-
className:
|
|
418
|
+
className: appShell.cn(
|
|
419
419
|
buttonGroupSlot({ position: "chevron" }),
|
|
420
420
|
buttonGroupChevronSize({ size: effectiveSize }),
|
|
421
421
|
// Anula gap do Button (não tem children) + reset svg size pra default 14px
|
|
@@ -441,7 +441,598 @@ const ButtonGroup = Object.assign(ButtonGroupRoot, {
|
|
|
441
441
|
Primary: ButtonGroupPrimary,
|
|
442
442
|
Chevron: ButtonGroupChevron
|
|
443
443
|
});
|
|
444
|
-
const
|
|
444
|
+
const Checkbox = React__namespace.forwardRef(({ className, ...props }, ref2) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
445
|
+
CheckboxPrimitive__namespace.Root,
|
|
446
|
+
{
|
|
447
|
+
ref: ref2,
|
|
448
|
+
className: appShell.cn(
|
|
449
|
+
"peer relative flex size-4 shrink-0 items-center justify-center cursor-pointer",
|
|
450
|
+
"rounded-radius-xs",
|
|
451
|
+
"bg-bg-input dark:bg-bg-muted",
|
|
452
|
+
"border-[1.5px] border-border-input",
|
|
453
|
+
"transition-[background-color,border-color,box-shadow] outline-none",
|
|
454
|
+
"hover:border-border-default",
|
|
455
|
+
"focus-visible:shadow-sh-ring",
|
|
456
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
457
|
+
"data-[state=checked]:bg-bg-brand data-[state=checked]:border-border-brand",
|
|
458
|
+
"data-[state=indeterminate]:bg-bg-brand data-[state=indeterminate]:border-border-brand",
|
|
459
|
+
className
|
|
460
|
+
),
|
|
461
|
+
...props,
|
|
462
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
463
|
+
CheckboxPrimitive__namespace.Indicator,
|
|
464
|
+
{
|
|
465
|
+
className: appShell.cn("grid place-content-center text-fg-on-brand"),
|
|
466
|
+
children: props.checked === "indeterminate" ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Minus, { className: "size-3", strokeWidth: 3 }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "size-3", strokeWidth: 3 })
|
|
467
|
+
}
|
|
468
|
+
)
|
|
469
|
+
}
|
|
470
|
+
));
|
|
471
|
+
Checkbox.displayName = CheckboxPrimitive__namespace.Root.displayName;
|
|
472
|
+
const formFieldRoot = appShell.tv({
|
|
473
|
+
base: "flex flex-col gap-[7px] w-full"
|
|
474
|
+
});
|
|
475
|
+
const formFieldLabel = appShell.tv({
|
|
476
|
+
base: [
|
|
477
|
+
"text-body-sm font-semibold tracking-[0.01em] leading-none",
|
|
478
|
+
"text-fg-default dark:text-fg-muted",
|
|
479
|
+
"select-none"
|
|
480
|
+
],
|
|
481
|
+
variants: {
|
|
482
|
+
disabled: {
|
|
483
|
+
true: "opacity-50 cursor-not-allowed"
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
});
|
|
487
|
+
const formFieldRequired = appShell.tv({
|
|
488
|
+
base: "ml-[2px] text-fg-danger"
|
|
489
|
+
});
|
|
490
|
+
const formFieldMessage = appShell.tv({
|
|
491
|
+
base: "text-caption-sm leading-snug",
|
|
492
|
+
variants: {
|
|
493
|
+
state: {
|
|
494
|
+
default: "text-fg-muted",
|
|
495
|
+
error: "text-fg-danger",
|
|
496
|
+
warning: "text-fg-warning",
|
|
497
|
+
success: "text-fg-success"
|
|
498
|
+
}
|
|
499
|
+
},
|
|
500
|
+
defaultVariants: { state: "default" }
|
|
501
|
+
});
|
|
502
|
+
function FormField({
|
|
503
|
+
label,
|
|
504
|
+
required: required2,
|
|
505
|
+
helperText,
|
|
506
|
+
state = "default",
|
|
507
|
+
errorMessage,
|
|
508
|
+
warningMessage,
|
|
509
|
+
successMessage,
|
|
510
|
+
className,
|
|
511
|
+
id: idProp,
|
|
512
|
+
children,
|
|
513
|
+
hideLabel,
|
|
514
|
+
disabled
|
|
515
|
+
}) {
|
|
516
|
+
const autoId = React.useId();
|
|
517
|
+
const id = idProp ?? autoId;
|
|
518
|
+
let message = helperText;
|
|
519
|
+
let messageState = "default";
|
|
520
|
+
if (state === "error" && errorMessage) {
|
|
521
|
+
message = errorMessage;
|
|
522
|
+
messageState = "error";
|
|
523
|
+
} else if (state === "warning" && warningMessage) {
|
|
524
|
+
message = warningMessage;
|
|
525
|
+
messageState = "warning";
|
|
526
|
+
} else if (state === "success" && successMessage) {
|
|
527
|
+
message = successMessage;
|
|
528
|
+
messageState = "success";
|
|
529
|
+
}
|
|
530
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: appShell.cn(formFieldRoot(), className), children: [
|
|
531
|
+
label && !hideLabel && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
532
|
+
"label",
|
|
533
|
+
{
|
|
534
|
+
htmlFor: id,
|
|
535
|
+
className: formFieldLabel({ disabled }),
|
|
536
|
+
children: [
|
|
537
|
+
label,
|
|
538
|
+
required2 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: formFieldRequired(), "aria-hidden": "true", children: "*" })
|
|
539
|
+
]
|
|
540
|
+
}
|
|
541
|
+
),
|
|
542
|
+
children({ id, state }),
|
|
543
|
+
message && /* @__PURE__ */ jsxRuntime.jsx(
|
|
544
|
+
"p",
|
|
545
|
+
{
|
|
546
|
+
className: formFieldMessage({ state: messageState }),
|
|
547
|
+
role: messageState === "error" ? "alert" : void 0,
|
|
548
|
+
children: message
|
|
549
|
+
}
|
|
550
|
+
)
|
|
551
|
+
] });
|
|
552
|
+
}
|
|
553
|
+
function renderAddon(content, key) {
|
|
554
|
+
if (typeof content === "string") {
|
|
555
|
+
return /* @__PURE__ */ jsxRuntime.jsx(appShell.InputGroupAddon, { align: key === "start" ? "inline-start" : "inline-end", children: /* @__PURE__ */ jsxRuntime.jsx(appShell.InputGroupText, { children: content }) }, key);
|
|
556
|
+
}
|
|
557
|
+
return /* @__PURE__ */ jsxRuntime.jsx(appShell.InputGroupAddon, { align: key === "start" ? "inline-start" : "inline-end", children: content }, key);
|
|
558
|
+
}
|
|
559
|
+
const FormFieldInput = React.forwardRef(
|
|
560
|
+
({
|
|
561
|
+
label,
|
|
562
|
+
required: required2,
|
|
563
|
+
helperText,
|
|
564
|
+
state,
|
|
565
|
+
errorMessage,
|
|
566
|
+
warningMessage,
|
|
567
|
+
successMessage,
|
|
568
|
+
className,
|
|
569
|
+
id,
|
|
570
|
+
startAddon,
|
|
571
|
+
endAddon,
|
|
572
|
+
...inputProps
|
|
573
|
+
}, ref2) => {
|
|
574
|
+
const hasAddon = startAddon !== void 0 || endAddon !== void 0;
|
|
575
|
+
const { size, ...inputHtmlProps } = inputProps;
|
|
576
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
577
|
+
FormField,
|
|
578
|
+
{
|
|
579
|
+
label,
|
|
580
|
+
required: required2,
|
|
581
|
+
helperText,
|
|
582
|
+
state,
|
|
583
|
+
errorMessage,
|
|
584
|
+
warningMessage,
|
|
585
|
+
successMessage,
|
|
586
|
+
className,
|
|
587
|
+
id,
|
|
588
|
+
disabled: inputProps.disabled,
|
|
589
|
+
children: ({ id: fieldId, state: fieldState }) => hasAddon ? /* @__PURE__ */ jsxRuntime.jsxs(appShell.InputGroup, { state: fieldState, size: size ?? void 0, children: [
|
|
590
|
+
startAddon !== void 0 && renderAddon(startAddon, "start"),
|
|
591
|
+
/* @__PURE__ */ jsxRuntime.jsx(appShell.InputGroupInput, { ref: ref2, id: fieldId, ...inputHtmlProps }),
|
|
592
|
+
endAddon !== void 0 && renderAddon(endAddon, "end")
|
|
593
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
594
|
+
input.Input,
|
|
595
|
+
{
|
|
596
|
+
ref: ref2,
|
|
597
|
+
id: fieldId,
|
|
598
|
+
state: fieldState,
|
|
599
|
+
size,
|
|
600
|
+
...inputHtmlProps
|
|
601
|
+
}
|
|
602
|
+
)
|
|
603
|
+
}
|
|
604
|
+
);
|
|
605
|
+
}
|
|
606
|
+
);
|
|
607
|
+
FormFieldInput.displayName = "FormFieldInput";
|
|
608
|
+
const textareaVariants = classVarianceAuthority.cva(
|
|
609
|
+
[
|
|
610
|
+
"flex min-h-[100px] w-full resize-y",
|
|
611
|
+
"bg-bg-input dark:bg-bg-muted",
|
|
612
|
+
"hover:bg-bg-input-hover dark:hover:bg-bg-muted-hover",
|
|
613
|
+
"border border-border-input rounded-radius-lg",
|
|
614
|
+
"px-pad-xl py-pad-lg",
|
|
615
|
+
"text-body-sm font-normal leading-[1.5] text-fg-default",
|
|
616
|
+
"placeholder:text-fg-muted placeholder:opacity-70",
|
|
617
|
+
"transition-[color,box-shadow,background-color,border-color] outline-none",
|
|
618
|
+
"disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-bg-input dark:disabled:hover:bg-bg-muted"
|
|
619
|
+
],
|
|
620
|
+
{
|
|
621
|
+
variants: {
|
|
622
|
+
state: {
|
|
623
|
+
default: "focus-visible:border-border-brand focus-visible:shadow-sh-ring",
|
|
624
|
+
error: "border-border-danger-muted focus-visible:border-border-danger-muted focus-visible:shadow-sh-ring-danger",
|
|
625
|
+
warning: "border-border-warning-muted focus-visible:border-border-warning-muted focus-visible:shadow-sh-ring-warning",
|
|
626
|
+
success: "border-border-success-muted focus-visible:border-border-success-muted focus-visible:shadow-sh-ring-success"
|
|
627
|
+
}
|
|
628
|
+
},
|
|
629
|
+
defaultVariants: {
|
|
630
|
+
state: "default"
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
);
|
|
634
|
+
const Textarea = React__namespace.forwardRef(
|
|
635
|
+
({ className, state, ...props }, ref2) => {
|
|
636
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
637
|
+
"textarea",
|
|
638
|
+
{
|
|
639
|
+
className: appShell.cn(textareaVariants({ state }), className),
|
|
640
|
+
ref: ref2,
|
|
641
|
+
...props
|
|
642
|
+
}
|
|
643
|
+
);
|
|
644
|
+
}
|
|
645
|
+
);
|
|
646
|
+
Textarea.displayName = "Textarea";
|
|
647
|
+
const FormFieldTextarea = React.forwardRef(
|
|
648
|
+
({
|
|
649
|
+
label,
|
|
650
|
+
required: required2,
|
|
651
|
+
helperText,
|
|
652
|
+
state,
|
|
653
|
+
errorMessage,
|
|
654
|
+
warningMessage,
|
|
655
|
+
successMessage,
|
|
656
|
+
className,
|
|
657
|
+
id,
|
|
658
|
+
...textareaProps
|
|
659
|
+
}, ref2) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
660
|
+
FormField,
|
|
661
|
+
{
|
|
662
|
+
label,
|
|
663
|
+
required: required2,
|
|
664
|
+
helperText,
|
|
665
|
+
state,
|
|
666
|
+
errorMessage,
|
|
667
|
+
warningMessage,
|
|
668
|
+
successMessage,
|
|
669
|
+
className,
|
|
670
|
+
id,
|
|
671
|
+
disabled: textareaProps.disabled,
|
|
672
|
+
children: ({ id: fieldId, state: fieldState }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
673
|
+
Textarea,
|
|
674
|
+
{
|
|
675
|
+
ref: ref2,
|
|
676
|
+
id: fieldId,
|
|
677
|
+
state: fieldState,
|
|
678
|
+
...textareaProps
|
|
679
|
+
}
|
|
680
|
+
)
|
|
681
|
+
}
|
|
682
|
+
)
|
|
683
|
+
);
|
|
684
|
+
FormFieldTextarea.displayName = "FormFieldTextarea";
|
|
685
|
+
const Select = SelectPrimitive__namespace.Root;
|
|
686
|
+
const SelectValue = SelectPrimitive__namespace.Value;
|
|
687
|
+
const SelectTrigger = React__namespace.forwardRef(({ className, children, state = "default", ...props }, ref2) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
688
|
+
SelectPrimitive__namespace.Trigger,
|
|
689
|
+
{
|
|
690
|
+
ref: ref2,
|
|
691
|
+
className: appShell.cn(
|
|
692
|
+
"flex min-h-form-lg w-full items-center justify-between gap-gp-md",
|
|
693
|
+
"rounded-radius-lg px-pad-xl",
|
|
694
|
+
"bg-bg-input dark:bg-bg-muted",
|
|
695
|
+
"hover:bg-bg-input-hover dark:hover:bg-bg-muted-hover",
|
|
696
|
+
"border border-border-input",
|
|
697
|
+
"text-body-sm font-normal text-fg-default",
|
|
698
|
+
"transition-[color,box-shadow,background-color,border-color] outline-none",
|
|
699
|
+
"data-[placeholder]:text-fg-muted data-[placeholder]:opacity-70",
|
|
700
|
+
state === "default" && "focus-visible:border-border-brand data-[state=open]:border-border-brand focus-visible:shadow-sh-ring data-[state=open]:shadow-sh-ring",
|
|
701
|
+
state === "error" && "border-border-danger-muted focus-visible:border-border-danger-muted data-[state=open]:border-border-danger-muted focus-visible:shadow-sh-ring-danger data-[state=open]:shadow-sh-ring-danger",
|
|
702
|
+
state === "warning" && "border-border-warning-muted focus-visible:border-border-warning-muted data-[state=open]:border-border-warning-muted focus-visible:shadow-sh-ring-warning data-[state=open]:shadow-sh-ring-warning",
|
|
703
|
+
state === "success" && "border-border-success-muted focus-visible:border-border-success-muted data-[state=open]:border-border-success-muted focus-visible:shadow-sh-ring-success data-[state=open]:shadow-sh-ring-success",
|
|
704
|
+
"disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-bg-input dark:disabled:hover:bg-bg-muted",
|
|
705
|
+
"[&>span]:line-clamp-1",
|
|
706
|
+
className
|
|
707
|
+
),
|
|
708
|
+
...props,
|
|
709
|
+
children: [
|
|
710
|
+
children,
|
|
711
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Icon, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "size-4 text-fg-muted shrink-0" }) })
|
|
712
|
+
]
|
|
713
|
+
}
|
|
714
|
+
));
|
|
715
|
+
SelectTrigger.displayName = SelectPrimitive__namespace.Trigger.displayName;
|
|
716
|
+
const SelectScrollUpButton = React__namespace.forwardRef(({ className, ...props }, ref2) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
717
|
+
SelectPrimitive__namespace.ScrollUpButton,
|
|
718
|
+
{
|
|
719
|
+
ref: ref2,
|
|
720
|
+
className: appShell.cn(
|
|
721
|
+
"flex cursor-default items-center justify-center py-pad-xs",
|
|
722
|
+
className
|
|
723
|
+
),
|
|
724
|
+
...props,
|
|
725
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronUp, { className: "h-4 w-4" })
|
|
726
|
+
}
|
|
727
|
+
));
|
|
728
|
+
SelectScrollUpButton.displayName = SelectPrimitive__namespace.ScrollUpButton.displayName;
|
|
729
|
+
const SelectScrollDownButton = React__namespace.forwardRef(({ className, ...props }, ref2) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
730
|
+
SelectPrimitive__namespace.ScrollDownButton,
|
|
731
|
+
{
|
|
732
|
+
ref: ref2,
|
|
733
|
+
className: appShell.cn(
|
|
734
|
+
"flex cursor-default items-center justify-center py-pad-xs",
|
|
735
|
+
className
|
|
736
|
+
),
|
|
737
|
+
...props,
|
|
738
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-4 w-4" })
|
|
739
|
+
}
|
|
740
|
+
));
|
|
741
|
+
SelectScrollDownButton.displayName = SelectPrimitive__namespace.ScrollDownButton.displayName;
|
|
742
|
+
const SelectContent = React__namespace.forwardRef(({ className, children, position: position2 = "popper", ...props }, ref2) => /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
743
|
+
SelectPrimitive__namespace.Content,
|
|
744
|
+
{
|
|
745
|
+
ref: ref2,
|
|
746
|
+
className: appShell.cn(
|
|
747
|
+
"relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden",
|
|
748
|
+
"rounded-[12px] bg-bg-dropdown border border-border-default shadow-sh-lg outline-float",
|
|
749
|
+
"before:pointer-events-none before:absolute before:inset-0 before:-z-10 before:rounded-[inherit] before:backdrop-blur-2xl before:backdrop-saturate-150",
|
|
750
|
+
"text-fg-default",
|
|
751
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
752
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
753
|
+
"origin-[--radix-select-content-transform-origin]",
|
|
754
|
+
position2 === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
755
|
+
className
|
|
756
|
+
),
|
|
757
|
+
position: position2,
|
|
758
|
+
...props,
|
|
759
|
+
children: [
|
|
760
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectScrollUpButton, {}),
|
|
761
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
762
|
+
SelectPrimitive__namespace.Viewport,
|
|
763
|
+
{
|
|
764
|
+
className: appShell.cn(
|
|
765
|
+
"p-pad-sm",
|
|
766
|
+
position2 === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
767
|
+
),
|
|
768
|
+
children
|
|
769
|
+
}
|
|
770
|
+
),
|
|
771
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectScrollDownButton, {})
|
|
772
|
+
]
|
|
773
|
+
}
|
|
774
|
+
) }));
|
|
775
|
+
SelectContent.displayName = SelectPrimitive__namespace.Content.displayName;
|
|
776
|
+
const SelectLabel = React__namespace.forwardRef(({ className, ...props }, ref2) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
777
|
+
SelectPrimitive__namespace.Label,
|
|
778
|
+
{
|
|
779
|
+
ref: ref2,
|
|
780
|
+
className: appShell.cn("py-pad-sm pl-8 pr-2 text-body-md font-medium text-fg-muted", className),
|
|
781
|
+
...props
|
|
782
|
+
}
|
|
783
|
+
));
|
|
784
|
+
SelectLabel.displayName = SelectPrimitive__namespace.Label.displayName;
|
|
785
|
+
const SelectItem = React__namespace.forwardRef(({ className, children, ...props }, ref2) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
786
|
+
SelectPrimitive__namespace.Item,
|
|
787
|
+
{
|
|
788
|
+
ref: ref2,
|
|
789
|
+
className: appShell.cn(
|
|
790
|
+
"relative flex w-full cursor-default select-none items-center gap-pad-md",
|
|
791
|
+
"rounded-radius-sm py-pad-md pl-8 pr-pad-lg",
|
|
792
|
+
"text-body-sm font-medium text-fg-muted",
|
|
793
|
+
"outline-none transition-colors",
|
|
794
|
+
"focus:bg-bg-muted focus:text-fg-default",
|
|
795
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
796
|
+
"[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:text-fg-muted",
|
|
797
|
+
"focus:[&_svg]:text-fg-default",
|
|
798
|
+
className
|
|
799
|
+
),
|
|
800
|
+
...props,
|
|
801
|
+
children: [
|
|
802
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-4 w-4" }) }) }),
|
|
803
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemText, { children })
|
|
804
|
+
]
|
|
805
|
+
}
|
|
806
|
+
));
|
|
807
|
+
SelectItem.displayName = SelectPrimitive__namespace.Item.displayName;
|
|
808
|
+
const SelectSeparator = React__namespace.forwardRef(({ className, ...props }, ref2) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
809
|
+
SelectPrimitive__namespace.Separator,
|
|
810
|
+
{
|
|
811
|
+
ref: ref2,
|
|
812
|
+
className: appShell.cn("-mx-1 my-1 h-px bg-border", className),
|
|
813
|
+
...props
|
|
814
|
+
}
|
|
815
|
+
));
|
|
816
|
+
SelectSeparator.displayName = SelectPrimitive__namespace.Separator.displayName;
|
|
817
|
+
function FormFieldSelect({
|
|
818
|
+
label,
|
|
819
|
+
required: required2,
|
|
820
|
+
helperText,
|
|
821
|
+
state,
|
|
822
|
+
errorMessage,
|
|
823
|
+
warningMessage,
|
|
824
|
+
successMessage,
|
|
825
|
+
className,
|
|
826
|
+
id,
|
|
827
|
+
options,
|
|
828
|
+
placeholder: placeholder2,
|
|
829
|
+
value,
|
|
830
|
+
defaultValue,
|
|
831
|
+
onValueChange,
|
|
832
|
+
disabled,
|
|
833
|
+
triggerClassName,
|
|
834
|
+
contentClassName
|
|
835
|
+
}) {
|
|
836
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
837
|
+
FormField,
|
|
838
|
+
{
|
|
839
|
+
label,
|
|
840
|
+
required: required2,
|
|
841
|
+
helperText,
|
|
842
|
+
state,
|
|
843
|
+
errorMessage,
|
|
844
|
+
warningMessage,
|
|
845
|
+
successMessage,
|
|
846
|
+
className,
|
|
847
|
+
id,
|
|
848
|
+
disabled,
|
|
849
|
+
children: ({ id: fieldId, state: fieldState }) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
850
|
+
Select,
|
|
851
|
+
{
|
|
852
|
+
value,
|
|
853
|
+
defaultValue,
|
|
854
|
+
onValueChange,
|
|
855
|
+
disabled,
|
|
856
|
+
children: [
|
|
857
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
858
|
+
SelectTrigger,
|
|
859
|
+
{
|
|
860
|
+
id: fieldId,
|
|
861
|
+
state: fieldState,
|
|
862
|
+
className: triggerClassName,
|
|
863
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, { placeholder: placeholder2 })
|
|
864
|
+
}
|
|
865
|
+
),
|
|
866
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectContent, { className: contentClassName, children: options.map((opt) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
867
|
+
SelectItem,
|
|
868
|
+
{
|
|
869
|
+
value: opt.value,
|
|
870
|
+
disabled: opt.disabled,
|
|
871
|
+
children: opt.label
|
|
872
|
+
},
|
|
873
|
+
opt.value
|
|
874
|
+
)) })
|
|
875
|
+
]
|
|
876
|
+
}
|
|
877
|
+
)
|
|
878
|
+
}
|
|
879
|
+
);
|
|
880
|
+
}
|
|
881
|
+
const FormFieldCheckbox = React.forwardRef(
|
|
882
|
+
({
|
|
883
|
+
label,
|
|
884
|
+
required: required2,
|
|
885
|
+
helperText,
|
|
886
|
+
state = "default",
|
|
887
|
+
errorMessage,
|
|
888
|
+
warningMessage,
|
|
889
|
+
successMessage,
|
|
890
|
+
className,
|
|
891
|
+
id: idProp,
|
|
892
|
+
disabled,
|
|
893
|
+
...checkboxProps
|
|
894
|
+
}, ref2) => {
|
|
895
|
+
const autoId = React.useId();
|
|
896
|
+
const id = idProp ?? autoId;
|
|
897
|
+
let message = helperText;
|
|
898
|
+
let messageState = "default";
|
|
899
|
+
if (state === "error" && errorMessage) {
|
|
900
|
+
message = errorMessage;
|
|
901
|
+
messageState = "error";
|
|
902
|
+
} else if (state === "warning" && warningMessage) {
|
|
903
|
+
message = warningMessage;
|
|
904
|
+
messageState = "warning";
|
|
905
|
+
} else if (state === "success" && successMessage) {
|
|
906
|
+
message = successMessage;
|
|
907
|
+
messageState = "success";
|
|
908
|
+
}
|
|
909
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: appShell.cn(formFieldRoot(), "gap-[5px]", className), children: [
|
|
910
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-gp-md", children: [
|
|
911
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
912
|
+
Checkbox,
|
|
913
|
+
{
|
|
914
|
+
ref: ref2,
|
|
915
|
+
id,
|
|
916
|
+
disabled,
|
|
917
|
+
...checkboxProps
|
|
918
|
+
}
|
|
919
|
+
),
|
|
920
|
+
label && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
921
|
+
"label",
|
|
922
|
+
{
|
|
923
|
+
htmlFor: id,
|
|
924
|
+
className: appShell.cn(formFieldLabel({ disabled }), "cursor-pointer"),
|
|
925
|
+
children: [
|
|
926
|
+
label,
|
|
927
|
+
required2 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: formFieldRequired(), "aria-hidden": "true", children: "*" })
|
|
928
|
+
]
|
|
929
|
+
}
|
|
930
|
+
)
|
|
931
|
+
] }),
|
|
932
|
+
message && /* @__PURE__ */ jsxRuntime.jsx(
|
|
933
|
+
"p",
|
|
934
|
+
{
|
|
935
|
+
className: appShell.cn(formFieldMessage({ state: messageState }), "pl-[26px]"),
|
|
936
|
+
role: messageState === "error" ? "alert" : void 0,
|
|
937
|
+
children: message
|
|
938
|
+
}
|
|
939
|
+
)
|
|
940
|
+
] });
|
|
941
|
+
}
|
|
942
|
+
);
|
|
943
|
+
FormFieldCheckbox.displayName = "FormFieldCheckbox";
|
|
944
|
+
const Switch = React__namespace.forwardRef(({ className, ...props }, ref2) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
945
|
+
SwitchPrimitives__namespace.Root,
|
|
946
|
+
{
|
|
947
|
+
className: appShell.cn(
|
|
948
|
+
"peer relative inline-flex h-[24px] w-[42px] shrink-0 cursor-pointer items-center",
|
|
949
|
+
"rounded-radius-full",
|
|
950
|
+
"transition-[background-color,box-shadow] duration-150 outline-none",
|
|
951
|
+
"data-[state=unchecked]:bg-bg-emphasis dark:data-[state=unchecked]:bg-bg-accent",
|
|
952
|
+
"data-[state=checked]:bg-bg-brand",
|
|
953
|
+
"focus-visible:shadow-sh-ring",
|
|
954
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
955
|
+
className
|
|
956
|
+
),
|
|
957
|
+
...props,
|
|
958
|
+
ref: ref2,
|
|
959
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
960
|
+
SwitchPrimitives__namespace.Thumb,
|
|
961
|
+
{
|
|
962
|
+
className: appShell.cn(
|
|
963
|
+
"pointer-events-none block size-[20px] rounded-radius-full bg-white",
|
|
964
|
+
"shadow-[0_1px_2px_rgba(0,0,0,0.10)]",
|
|
965
|
+
"transition-transform duration-[180ms] ease-[cubic-bezier(0.4,0,0.2,1)]",
|
|
966
|
+
"data-[state=unchecked]:translate-x-[2px]",
|
|
967
|
+
"data-[state=checked]:translate-x-[20px]"
|
|
968
|
+
)
|
|
969
|
+
}
|
|
970
|
+
)
|
|
971
|
+
}
|
|
972
|
+
));
|
|
973
|
+
Switch.displayName = SwitchPrimitives__namespace.Root.displayName;
|
|
974
|
+
const FormFieldSwitch = React.forwardRef(
|
|
975
|
+
({
|
|
976
|
+
label,
|
|
977
|
+
required: required2,
|
|
978
|
+
helperText,
|
|
979
|
+
state = "default",
|
|
980
|
+
errorMessage,
|
|
981
|
+
warningMessage,
|
|
982
|
+
successMessage,
|
|
983
|
+
className,
|
|
984
|
+
id: idProp,
|
|
985
|
+
disabled,
|
|
986
|
+
switchPosition = "end",
|
|
987
|
+
...switchProps
|
|
988
|
+
}, ref2) => {
|
|
989
|
+
const autoId = React.useId();
|
|
990
|
+
const id = idProp ?? autoId;
|
|
991
|
+
let message = helperText;
|
|
992
|
+
let messageState = "default";
|
|
993
|
+
if (state === "error" && errorMessage) {
|
|
994
|
+
message = errorMessage;
|
|
995
|
+
messageState = "error";
|
|
996
|
+
} else if (state === "warning" && warningMessage) {
|
|
997
|
+
message = warningMessage;
|
|
998
|
+
messageState = "warning";
|
|
999
|
+
} else if (state === "success" && successMessage) {
|
|
1000
|
+
message = successMessage;
|
|
1001
|
+
messageState = "success";
|
|
1002
|
+
}
|
|
1003
|
+
const switchEl = /* @__PURE__ */ jsxRuntime.jsx(Switch, { ref: ref2, id, disabled, ...switchProps });
|
|
1004
|
+
const labelEl = label && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1005
|
+
"label",
|
|
1006
|
+
{
|
|
1007
|
+
htmlFor: id,
|
|
1008
|
+
className: appShell.cn(formFieldLabel({ disabled }), "cursor-pointer flex-1"),
|
|
1009
|
+
children: [
|
|
1010
|
+
label,
|
|
1011
|
+
required2 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: formFieldRequired(), "aria-hidden": "true", children: "*" })
|
|
1012
|
+
]
|
|
1013
|
+
}
|
|
1014
|
+
);
|
|
1015
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: appShell.cn(formFieldRoot(), "gap-[5px]", className), children: [
|
|
1016
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-gp-md", children: switchPosition === "start" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1017
|
+
switchEl,
|
|
1018
|
+
labelEl
|
|
1019
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1020
|
+
labelEl,
|
|
1021
|
+
switchEl
|
|
1022
|
+
] }) }),
|
|
1023
|
+
message && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1024
|
+
"p",
|
|
1025
|
+
{
|
|
1026
|
+
className: formFieldMessage({ state: messageState }),
|
|
1027
|
+
role: messageState === "error" ? "alert" : void 0,
|
|
1028
|
+
children: message
|
|
1029
|
+
}
|
|
1030
|
+
)
|
|
1031
|
+
] });
|
|
1032
|
+
}
|
|
1033
|
+
);
|
|
1034
|
+
FormFieldSwitch.displayName = "FormFieldSwitch";
|
|
1035
|
+
const comboboxStyles = appShell.tv({
|
|
445
1036
|
slots: {
|
|
446
1037
|
trigger: [
|
|
447
1038
|
"flex min-h-form-lg w-full items-center justify-between gap-gp-md",
|
|
@@ -536,7 +1127,7 @@ const Combobox = React.forwardRef(
|
|
|
536
1127
|
onValueChange?.(option.value);
|
|
537
1128
|
setOpen(false);
|
|
538
1129
|
},
|
|
539
|
-
className:
|
|
1130
|
+
className: appShell.cn(
|
|
540
1131
|
isSelected && "text-fg-default font-medium [&_svg]:text-fg-brand"
|
|
541
1132
|
),
|
|
542
1133
|
children: [
|
|
@@ -551,10 +1142,715 @@ const Combobox = React.forwardRef(
|
|
|
551
1142
|
] })
|
|
552
1143
|
}
|
|
553
1144
|
)
|
|
554
|
-
] });
|
|
555
|
-
}
|
|
556
|
-
);
|
|
557
|
-
Combobox.displayName = "Combobox";
|
|
1145
|
+
] });
|
|
1146
|
+
}
|
|
1147
|
+
);
|
|
1148
|
+
Combobox.displayName = "Combobox";
|
|
1149
|
+
const tableStyles = appShell.tv({
|
|
1150
|
+
slots: {
|
|
1151
|
+
/* Root grid container. Aplica container-type pra container queries.
|
|
1152
|
+
flex flex-col: scroll child usa flex-1 min-h-0 pra esticar quando há altura forçada
|
|
1153
|
+
(consumer aplica `max-h-[Npx]` no Table) ou pegar altura natural quando não há. */
|
|
1154
|
+
root: [
|
|
1155
|
+
"relative flex flex-col w-full",
|
|
1156
|
+
"bg-bg-table border border-border-table rounded-radius-xl shadow-sh-sm",
|
|
1157
|
+
"overflow-hidden",
|
|
1158
|
+
"[container-type:inline-size]"
|
|
1159
|
+
],
|
|
1160
|
+
/* Container que faz o scroll (envolve head + body).
|
|
1161
|
+
flex-1 + min-h-0: estica até preencher o root quando há altura forçada;
|
|
1162
|
+
caso contrário, altura natural do conteúdo (flex-1 sem espaço extra = no-op).
|
|
1163
|
+
overflow-auto: scroll-X sempre disponível (colunas largas); scroll-Y só ativa
|
|
1164
|
+
quando o conteúdo excede a altura (que só acontece com max-h externo).
|
|
1165
|
+
scrollbar-thin: classe global do projeto (globals.css) — alpha responsivo light/dark. */
|
|
1166
|
+
scroll: [
|
|
1167
|
+
"flex-1 min-h-0 overflow-auto relative",
|
|
1168
|
+
"scrollbar-thin"
|
|
1169
|
+
],
|
|
1170
|
+
/* Header row (flex de TableHeadCell). Sticky default. */
|
|
1171
|
+
head: [
|
|
1172
|
+
"flex w-max min-w-full",
|
|
1173
|
+
"bg-bg-table-head border-b border-border-table",
|
|
1174
|
+
"z-20"
|
|
1175
|
+
],
|
|
1176
|
+
/* Cell do header — type, padding, alinhamento. */
|
|
1177
|
+
headCell: [
|
|
1178
|
+
"relative flex items-center gap-gp-md shrink-0",
|
|
1179
|
+
"h-[42px] px-pad-2xl",
|
|
1180
|
+
"text-body-sm font-semibold leading-none",
|
|
1181
|
+
"text-fg-muted",
|
|
1182
|
+
"select-none",
|
|
1183
|
+
"hover:text-fg-default"
|
|
1184
|
+
],
|
|
1185
|
+
/* Body container — contém as rows. */
|
|
1186
|
+
body: [
|
|
1187
|
+
"flex flex-col w-max min-w-full"
|
|
1188
|
+
],
|
|
1189
|
+
/* Row (flex de TableCell). */
|
|
1190
|
+
row: [
|
|
1191
|
+
"group/row relative flex w-full",
|
|
1192
|
+
"border-b border-border-table last:border-b-0",
|
|
1193
|
+
"bg-bg-table",
|
|
1194
|
+
"transition-colors duration-150"
|
|
1195
|
+
],
|
|
1196
|
+
/* Cell — content cell padrão. */
|
|
1197
|
+
cell: [
|
|
1198
|
+
"flex items-center shrink-0",
|
|
1199
|
+
"px-pad-2xl",
|
|
1200
|
+
"text-body-sm font-normal text-fg-default",
|
|
1201
|
+
"whitespace-nowrap overflow-hidden"
|
|
1202
|
+
],
|
|
1203
|
+
/* Drag handle do resize — barrinha invisível no edge direito.
|
|
1204
|
+
Apenas a linha dentro do header (after:). Sem projeção pra baixo (before:)
|
|
1205
|
+
porque pseudo-elements absolute COM h-screen ainda contam pro scrollHeight
|
|
1206
|
+
do ancestral com overflow-auto, esticando o body verticalmente. */
|
|
1207
|
+
resizeHandle: [
|
|
1208
|
+
"absolute right-0 top-0 bottom-0 w-[6px] cursor-col-resize z-10",
|
|
1209
|
+
// Linha 1px vertical dentro do header — aparece no hover do TH
|
|
1210
|
+
"after:content-[''] after:absolute after:left-1/2 after:-translate-x-1/2",
|
|
1211
|
+
"after:top-[8px] after:bottom-[8px] after:w-px after:bg-transparent",
|
|
1212
|
+
"after:transition-all after:duration-150",
|
|
1213
|
+
"group-hover/headcell:after:bg-border-default",
|
|
1214
|
+
// Hover direto no handle → linha brand 2px full-height
|
|
1215
|
+
"hover:after:bg-bg-brand hover:after:w-[2px] hover:after:top-0 hover:after:bottom-0",
|
|
1216
|
+
// DRAG ATIVO → mantém linha brand visível independente do :hover
|
|
1217
|
+
"data-[dragging=true]:after:bg-bg-brand data-[dragging=true]:after:w-[2px] data-[dragging=true]:after:top-0 data-[dragging=true]:after:bottom-0"
|
|
1218
|
+
],
|
|
1219
|
+
/* Ícone de sort no head cell. */
|
|
1220
|
+
sortIcon: [
|
|
1221
|
+
"shrink-0 size-icon-xs",
|
|
1222
|
+
"transition-opacity duration-150"
|
|
1223
|
+
],
|
|
1224
|
+
/* Ícone de tipo de coluna no head (Hash, User, AtSign…). */
|
|
1225
|
+
typeIcon: [
|
|
1226
|
+
"shrink-0 size-[13px] text-fg-muted opacity-70",
|
|
1227
|
+
"group-hover/headcell:opacity-100"
|
|
1228
|
+
],
|
|
1229
|
+
/* Badge brand com índice de sort (1, 2, 3). */
|
|
1230
|
+
sortBadge: [
|
|
1231
|
+
"inline-flex items-center justify-center shrink-0",
|
|
1232
|
+
"min-w-[18px] h-[18px] px-[5px]",
|
|
1233
|
+
"rounded-radius-xs bg-bg-brand text-fg-on-brand",
|
|
1234
|
+
"text-caption-xs font-bold leading-none tabular-nums"
|
|
1235
|
+
],
|
|
1236
|
+
/* Stack absolute na borda direita do head cell — agrupa sort e headMenu.
|
|
1237
|
+
Largura dinâmica: encolhe quando itens estão "hidden", cresce quando aparecem no hover. */
|
|
1238
|
+
headRightStack: [
|
|
1239
|
+
"absolute right-pad-md top-1/2 -translate-y-1/2 z-[1]",
|
|
1240
|
+
// 8px de respiro da borda direita
|
|
1241
|
+
"inline-flex items-center gap-gp-xs",
|
|
1242
|
+
"bg-bg-table-head pl-pad-xs",
|
|
1243
|
+
"pointer-events-none"
|
|
1244
|
+
],
|
|
1245
|
+
/* Sort ativo (asc/desc) — sempre visível quando isSorted=true. */
|
|
1246
|
+
headSortActive: [
|
|
1247
|
+
"inline-flex items-center gap-gp-xs shrink-0",
|
|
1248
|
+
"text-fg-default"
|
|
1249
|
+
],
|
|
1250
|
+
/* Sort hint (sortable mas inativo) — display:none default, inline-flex no hover.
|
|
1251
|
+
Como é display:none, NÃO ocupa espaço no stack até aparecer. */
|
|
1252
|
+
headSortHint: [
|
|
1253
|
+
"hidden group-hover/headcell:inline-flex items-center shrink-0",
|
|
1254
|
+
"text-fg-muted opacity-60"
|
|
1255
|
+
],
|
|
1256
|
+
/* Head menu wrapper — display:none default, inline-flex no hover.
|
|
1257
|
+
Tem pointer-events:auto pra restaurar interatividade (parent stack tem pointer-events:none). */
|
|
1258
|
+
headMenuItem: [
|
|
1259
|
+
// Esconde por padrao; revela quando:
|
|
1260
|
+
// 1. hover no header (group-hover) — UX padrao
|
|
1261
|
+
// 2. focus interno (focus-within) — keyboard navigation
|
|
1262
|
+
// 3. dropdown interno aberto (:has data-state=open) — mantem visivel
|
|
1263
|
+
// enquanto user move cursor pra dentro do menu portal
|
|
1264
|
+
// 4. data-menu-active=true no botao — mantem visivel durante a janela
|
|
1265
|
+
// de close animation (~200ms) pra portal nao perder a ancora
|
|
1266
|
+
"hidden items-center shrink-0",
|
|
1267
|
+
"group-hover/headcell:inline-flex",
|
|
1268
|
+
"focus-within:inline-flex",
|
|
1269
|
+
"has-[[data-state=open]]:inline-flex",
|
|
1270
|
+
"has-[[data-menu-active=true]]:inline-flex",
|
|
1271
|
+
"pointer-events-auto"
|
|
1272
|
+
],
|
|
1273
|
+
/* Card mode — wrapper de cada row no modo card. */
|
|
1274
|
+
cardWrap: [
|
|
1275
|
+
"flex flex-col w-full p-pad-card-sm gap-gp-md",
|
|
1276
|
+
"border-b border-border-table last:border-b-0",
|
|
1277
|
+
"bg-bg-table"
|
|
1278
|
+
],
|
|
1279
|
+
/* Card mode — header do card (primary + checkbox + actions). */
|
|
1280
|
+
cardHeader: [
|
|
1281
|
+
"flex items-center justify-between gap-gp-md"
|
|
1282
|
+
],
|
|
1283
|
+
/* Card mode — body items (label/value). */
|
|
1284
|
+
cardItem: [
|
|
1285
|
+
"flex flex-col gap-gp-2xs"
|
|
1286
|
+
],
|
|
1287
|
+
/* Card mode — label da coluna acima do valor. */
|
|
1288
|
+
cardLabel: [
|
|
1289
|
+
"text-body-xs uppercase tracking-wider text-fg-muted"
|
|
1290
|
+
],
|
|
1291
|
+
/* Card mode — valor abaixo do label. */
|
|
1292
|
+
cardValue: [
|
|
1293
|
+
"text-body-md text-fg-default"
|
|
1294
|
+
]
|
|
1295
|
+
},
|
|
1296
|
+
variants: {
|
|
1297
|
+
// ⚠️ Alturas de row por densidade. DEVEM casar com `DENSITY_ROW_HEIGHT` em
|
|
1298
|
+
// `DataTable/data-table.constants.ts` (usado pela estimativa do virtualizer).
|
|
1299
|
+
// Mudou aqui → mudar lá, senão o scroll virtual desalinha.
|
|
1300
|
+
density: {
|
|
1301
|
+
compact: { row: "h-[40px]", cell: "py-0", headCell: "" },
|
|
1302
|
+
standard: { row: "h-[56px]", cell: "py-0", headCell: "" },
|
|
1303
|
+
comfortable: { row: "h-[64px]", cell: "py-0", headCell: "" }
|
|
1304
|
+
},
|
|
1305
|
+
sticky: {
|
|
1306
|
+
true: { head: "sticky top-0" },
|
|
1307
|
+
false: {}
|
|
1308
|
+
},
|
|
1309
|
+
selected: {
|
|
1310
|
+
true: {
|
|
1311
|
+
row: [
|
|
1312
|
+
"bg-bg-table-row-selected hover:bg-bg-table-row-selected-hover",
|
|
1313
|
+
"before:content-[''] before:absolute before:left-0 before:top-0 before:bottom-0 before:w-[3px] before:bg-bg-brand before:z-[5] before:pointer-events-none"
|
|
1314
|
+
].join(" "),
|
|
1315
|
+
cardWrap: "bg-bg-table-row-selected hover:bg-bg-table-row-selected-hover"
|
|
1316
|
+
},
|
|
1317
|
+
false: {
|
|
1318
|
+
row: "hover:bg-bg-table-row-hover",
|
|
1319
|
+
cardWrap: "hover:bg-bg-table-row-hover"
|
|
1320
|
+
}
|
|
1321
|
+
},
|
|
1322
|
+
clickable: {
|
|
1323
|
+
true: { row: "cursor-pointer", cardWrap: "cursor-pointer" },
|
|
1324
|
+
false: {}
|
|
1325
|
+
},
|
|
1326
|
+
pinned: {
|
|
1327
|
+
// `bg-inherit` cobre o conteúdo scrollado nos estados normais (row bg opaco).
|
|
1328
|
+
// Quando a row está destacada (`data-highlighted` via group/row), o bg da row
|
|
1329
|
+
// é color-mix com transparent → trocamos pro token SÓLIDO pra não vazar.
|
|
1330
|
+
// Hover usa variante de grupo ARBITRÁRIA única (`[[data-highlighted]:hover]`)
|
|
1331
|
+
// — encadear dois `group-*/row` geraria descendente aninhado (não casa).
|
|
1332
|
+
left: {
|
|
1333
|
+
headCell: "sticky z-10 bg-bg-table-head",
|
|
1334
|
+
cell: "sticky z-[5] bg-inherit group-data-[highlighted]/row:bg-bg-table-row-selected-solid group-[[data-highlighted]:hover]/row:bg-bg-table-row-selected-hover-solid"
|
|
1335
|
+
},
|
|
1336
|
+
right: {
|
|
1337
|
+
headCell: "sticky z-10 bg-bg-table-head",
|
|
1338
|
+
cell: "sticky z-[5] bg-inherit group-data-[highlighted]/row:bg-bg-table-row-selected-solid group-[[data-highlighted]:hover]/row:bg-bg-table-row-selected-hover-solid"
|
|
1339
|
+
}
|
|
1340
|
+
},
|
|
1341
|
+
align: {
|
|
1342
|
+
left: { cell: "justify-start text-left", headCell: "justify-start text-left" },
|
|
1343
|
+
center: { cell: "justify-center text-center", headCell: "justify-center text-center" },
|
|
1344
|
+
right: { cell: "justify-end text-right", headCell: "justify-end text-right" }
|
|
1345
|
+
},
|
|
1346
|
+
sortable: {
|
|
1347
|
+
true: { headCell: "cursor-pointer hover:text-fg-default" },
|
|
1348
|
+
false: {}
|
|
1349
|
+
},
|
|
1350
|
+
ellipsis: {
|
|
1351
|
+
true: { cell: "overflow-hidden [&>*]:truncate" },
|
|
1352
|
+
false: {}
|
|
1353
|
+
},
|
|
1354
|
+
cellBorders: {
|
|
1355
|
+
true: {
|
|
1356
|
+
// `:has(+ [data-purpose='actions'])`: a cell ANTES da coluna actions
|
|
1357
|
+
// perde border-right — evita o divider visual encostado na actions.
|
|
1358
|
+
headCell: "border-r border-border-table last:border-r-0 has-[+_[data-purpose='actions']]:border-r-0",
|
|
1359
|
+
cell: "border-r border-border-table last:border-r-0 has-[+_[data-purpose='actions']]:border-r-0"
|
|
1360
|
+
},
|
|
1361
|
+
false: {}
|
|
1362
|
+
},
|
|
1363
|
+
/** Variant pra cells de coluna especial (selection / actions).
|
|
1364
|
+
*
|
|
1365
|
+
* - `selection`: remove padding pra checkbox 28px caber em 56px e centralizar.
|
|
1366
|
+
* - `actions`: header em branco (sem texto/menu), sem border-right, padding
|
|
1367
|
+
* horizontal mínimo. Usado quando `type: "actions"` no DataTableColumnDef.
|
|
1368
|
+
* Border-right removida via `!border-r-0` (override do cellBorders=true). */
|
|
1369
|
+
purpose: {
|
|
1370
|
+
default: {},
|
|
1371
|
+
selection: {
|
|
1372
|
+
// Sem padding + centralizado: checkbox 28px fica no meio dos 56px.
|
|
1373
|
+
// justify-center sobrescreve o align default (left) — coluna de seleção
|
|
1374
|
+
// sempre centraliza, sem o consumer precisar passar align="center".
|
|
1375
|
+
headCell: "px-0 py-0 justify-center",
|
|
1376
|
+
cell: "px-0 py-0 justify-center"
|
|
1377
|
+
},
|
|
1378
|
+
actions: {
|
|
1379
|
+
headCell: "!border-r-0 px-pad-md",
|
|
1380
|
+
cell: "!border-r-0 px-pad-md"
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
},
|
|
1384
|
+
defaultVariants: {
|
|
1385
|
+
density: "standard",
|
|
1386
|
+
sticky: true,
|
|
1387
|
+
selected: false,
|
|
1388
|
+
clickable: false,
|
|
1389
|
+
align: "left",
|
|
1390
|
+
sortable: false,
|
|
1391
|
+
ellipsis: false,
|
|
1392
|
+
cellBorders: true,
|
|
1393
|
+
purpose: "default"
|
|
1394
|
+
}
|
|
1395
|
+
});
|
|
1396
|
+
const DEFAULT_MIN = 60;
|
|
1397
|
+
const DEFAULT_MAX = 800;
|
|
1398
|
+
function useColumnResize({
|
|
1399
|
+
currentWidth,
|
|
1400
|
+
minWidth = DEFAULT_MIN,
|
|
1401
|
+
maxWidth = DEFAULT_MAX,
|
|
1402
|
+
onResize,
|
|
1403
|
+
onResizeEnd,
|
|
1404
|
+
onResizeLiveDOM
|
|
1405
|
+
}) {
|
|
1406
|
+
const [isDragging2, setIsDragging] = React.useState(false);
|
|
1407
|
+
const onResizeRef = React.useRef(onResize);
|
|
1408
|
+
const onResizeEndRef = React.useRef(onResizeEnd);
|
|
1409
|
+
const onResizeLiveDOMRef = React.useRef(onResizeLiveDOM);
|
|
1410
|
+
const minRef = React.useRef(minWidth);
|
|
1411
|
+
const maxRef = React.useRef(maxWidth);
|
|
1412
|
+
onResizeRef.current = onResize;
|
|
1413
|
+
onResizeEndRef.current = onResizeEnd;
|
|
1414
|
+
onResizeLiveDOMRef.current = onResizeLiveDOM;
|
|
1415
|
+
minRef.current = minWidth;
|
|
1416
|
+
maxRef.current = maxWidth;
|
|
1417
|
+
const stateRef = React.useRef({ startX: 0, startWidth: 0, lastWidth: currentWidth, dragging: false });
|
|
1418
|
+
stateRef.current.lastWidth = currentWidth;
|
|
1419
|
+
const handlersRef = React.useRef(null);
|
|
1420
|
+
if (!handlersRef.current) {
|
|
1421
|
+
handlersRef.current = {
|
|
1422
|
+
move: (e) => {
|
|
1423
|
+
if (!stateRef.current.dragging) return;
|
|
1424
|
+
const delta = e.clientX - stateRef.current.startX;
|
|
1425
|
+
const next = Math.min(
|
|
1426
|
+
maxRef.current,
|
|
1427
|
+
Math.max(minRef.current, stateRef.current.startWidth + delta)
|
|
1428
|
+
);
|
|
1429
|
+
stateRef.current.lastWidth = next;
|
|
1430
|
+
onResizeLiveDOMRef.current?.(next);
|
|
1431
|
+
onResizeRef.current?.(next);
|
|
1432
|
+
},
|
|
1433
|
+
up: () => {
|
|
1434
|
+
if (!stateRef.current.dragging) return;
|
|
1435
|
+
stateRef.current.dragging = false;
|
|
1436
|
+
setIsDragging(false);
|
|
1437
|
+
document.removeEventListener("mousemove", handlersRef.current.move);
|
|
1438
|
+
document.removeEventListener("mouseup", handlersRef.current.up);
|
|
1439
|
+
document.body.style.cursor = "";
|
|
1440
|
+
document.body.style.userSelect = "";
|
|
1441
|
+
onResizeEndRef.current?.(stateRef.current.lastWidth);
|
|
1442
|
+
}
|
|
1443
|
+
};
|
|
1444
|
+
}
|
|
1445
|
+
const onMouseDown = React.useCallback(
|
|
1446
|
+
(e) => {
|
|
1447
|
+
e.preventDefault();
|
|
1448
|
+
e.stopPropagation();
|
|
1449
|
+
stateRef.current = {
|
|
1450
|
+
startX: e.clientX,
|
|
1451
|
+
startWidth: currentWidth,
|
|
1452
|
+
lastWidth: currentWidth,
|
|
1453
|
+
dragging: true
|
|
1454
|
+
};
|
|
1455
|
+
setIsDragging(true);
|
|
1456
|
+
document.addEventListener("mousemove", handlersRef.current.move);
|
|
1457
|
+
document.addEventListener("mouseup", handlersRef.current.up);
|
|
1458
|
+
document.body.style.cursor = "col-resize";
|
|
1459
|
+
document.body.style.userSelect = "none";
|
|
1460
|
+
},
|
|
1461
|
+
[currentWidth]
|
|
1462
|
+
);
|
|
1463
|
+
React.useEffect(() => {
|
|
1464
|
+
return () => {
|
|
1465
|
+
if (stateRef.current.dragging && handlersRef.current) {
|
|
1466
|
+
document.removeEventListener("mousemove", handlersRef.current.move);
|
|
1467
|
+
document.removeEventListener("mouseup", handlersRef.current.up);
|
|
1468
|
+
document.body.style.cursor = "";
|
|
1469
|
+
document.body.style.userSelect = "";
|
|
1470
|
+
}
|
|
1471
|
+
};
|
|
1472
|
+
}, []);
|
|
1473
|
+
return {
|
|
1474
|
+
onMouseDown,
|
|
1475
|
+
isDragging: isDragging2
|
|
1476
|
+
};
|
|
1477
|
+
}
|
|
1478
|
+
const TableContext = React.createContext({
|
|
1479
|
+
density: "standard",
|
|
1480
|
+
cellBorders: true,
|
|
1481
|
+
resizingField: null,
|
|
1482
|
+
setResizingField: () => {
|
|
1483
|
+
},
|
|
1484
|
+
isScrolled: false
|
|
1485
|
+
});
|
|
1486
|
+
function useTableContext() {
|
|
1487
|
+
return React.useContext(TableContext);
|
|
1488
|
+
}
|
|
1489
|
+
const styles$4 = tableStyles();
|
|
1490
|
+
function Table({
|
|
1491
|
+
density = "standard",
|
|
1492
|
+
cardBreakpoint = 768,
|
|
1493
|
+
cellBorders = true,
|
|
1494
|
+
ariaLabel,
|
|
1495
|
+
className,
|
|
1496
|
+
scrollRef: externalScrollRef,
|
|
1497
|
+
children
|
|
1498
|
+
}) {
|
|
1499
|
+
const cardCss = cardBreakpoint === false ? void 0 : { "--table-card-bp": `${cardBreakpoint}px` };
|
|
1500
|
+
const [resizingField, setResizingField] = React.useState(null);
|
|
1501
|
+
const [isScrolled, setIsScrolled] = React.useState(false);
|
|
1502
|
+
const internalScrollRef = React.useRef(null);
|
|
1503
|
+
const scrollRef = externalScrollRef ?? internalScrollRef;
|
|
1504
|
+
React.useEffect(() => {
|
|
1505
|
+
const el = scrollRef.current;
|
|
1506
|
+
if (!el) return;
|
|
1507
|
+
const onScroll = () => setIsScrolled(el.scrollTop > 0);
|
|
1508
|
+
el.addEventListener("scroll", onScroll, { passive: true });
|
|
1509
|
+
onScroll();
|
|
1510
|
+
return () => el.removeEventListener("scroll", onScroll);
|
|
1511
|
+
}, [scrollRef]);
|
|
1512
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1513
|
+
TableContext.Provider,
|
|
1514
|
+
{
|
|
1515
|
+
value: { density, cellBorders, resizingField, setResizingField, isScrolled },
|
|
1516
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1517
|
+
"div",
|
|
1518
|
+
{
|
|
1519
|
+
role: "grid",
|
|
1520
|
+
"aria-label": ariaLabel,
|
|
1521
|
+
"data-density": density,
|
|
1522
|
+
"data-resizing-col": resizingField ?? void 0,
|
|
1523
|
+
className: appShell.cn(styles$4.root(), className),
|
|
1524
|
+
style: cardCss,
|
|
1525
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref: scrollRef, className: styles$4.scroll(), children })
|
|
1526
|
+
}
|
|
1527
|
+
)
|
|
1528
|
+
}
|
|
1529
|
+
);
|
|
1530
|
+
}
|
|
1531
|
+
function TableHead({
|
|
1532
|
+
sticky = true,
|
|
1533
|
+
className,
|
|
1534
|
+
rootProps,
|
|
1535
|
+
children
|
|
1536
|
+
}) {
|
|
1537
|
+
const { isScrolled } = useTableContext();
|
|
1538
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1539
|
+
"div",
|
|
1540
|
+
{
|
|
1541
|
+
...rootProps,
|
|
1542
|
+
role: "rowgroup",
|
|
1543
|
+
"data-scrolled": isScrolled ? "true" : void 0,
|
|
1544
|
+
className: appShell.cn(tableStyles({ sticky }).head(), className),
|
|
1545
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { role: "row", className: "flex w-full", children })
|
|
1546
|
+
}
|
|
1547
|
+
);
|
|
1548
|
+
}
|
|
1549
|
+
function TableBody({
|
|
1550
|
+
className,
|
|
1551
|
+
style: style2,
|
|
1552
|
+
rootProps,
|
|
1553
|
+
virtualized,
|
|
1554
|
+
children
|
|
1555
|
+
}) {
|
|
1556
|
+
const virtualStyle = virtualized ? {
|
|
1557
|
+
height: virtualized.totalHeight,
|
|
1558
|
+
position: "relative",
|
|
1559
|
+
minWidth: "100%",
|
|
1560
|
+
...style2
|
|
1561
|
+
} : style2;
|
|
1562
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1563
|
+
"div",
|
|
1564
|
+
{
|
|
1565
|
+
...rootProps,
|
|
1566
|
+
role: "rowgroup",
|
|
1567
|
+
className: appShell.cn(
|
|
1568
|
+
styles$4.body(),
|
|
1569
|
+
virtualized && "!block",
|
|
1570
|
+
className
|
|
1571
|
+
),
|
|
1572
|
+
style: virtualStyle,
|
|
1573
|
+
children
|
|
1574
|
+
}
|
|
1575
|
+
);
|
|
1576
|
+
}
|
|
1577
|
+
const TableRow = React.forwardRef(function TableRow2({
|
|
1578
|
+
selected = false,
|
|
1579
|
+
open = false,
|
|
1580
|
+
focused = false,
|
|
1581
|
+
clickable,
|
|
1582
|
+
onClick,
|
|
1583
|
+
className,
|
|
1584
|
+
rootProps,
|
|
1585
|
+
children
|
|
1586
|
+
}, ref2) {
|
|
1587
|
+
const { density } = useTableContext();
|
|
1588
|
+
const isClickable = clickable ?? !!onClick;
|
|
1589
|
+
const highlighted = selected || open;
|
|
1590
|
+
const solidPinned = highlighted || focused;
|
|
1591
|
+
const dataState = selected && open ? "selected open" : selected ? "selected" : open ? "open" : void 0;
|
|
1592
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1593
|
+
"div",
|
|
1594
|
+
{
|
|
1595
|
+
...rootProps,
|
|
1596
|
+
ref: ref2,
|
|
1597
|
+
role: "row",
|
|
1598
|
+
"aria-selected": selected || void 0,
|
|
1599
|
+
"data-state": dataState,
|
|
1600
|
+
"data-focused": focused || void 0,
|
|
1601
|
+
"data-highlighted": solidPinned || void 0,
|
|
1602
|
+
tabIndex: focused ? 0 : -1,
|
|
1603
|
+
className: appShell.cn(
|
|
1604
|
+
"group/row",
|
|
1605
|
+
tableStyles({ selected: highlighted, clickable: isClickable, density }).row(),
|
|
1606
|
+
// Focus visual — bg tinted (match checkbox selected) + borda brand interna.
|
|
1607
|
+
// A borda vem de um overlay ::after com z-[7] (ACIMA do pinned cell z-[5]):
|
|
1608
|
+
// `outline` no row era pintado SOB as sticky cells (bg opaco) e quebrava
|
|
1609
|
+
// no topo/embaixo na coluna fixa. O overlay desenha por cima, contínuo.
|
|
1610
|
+
focused && "bg-bg-table-row-selected hover:bg-bg-table-row-selected-hover z-[6] relative after:content-[''] after:absolute after:inset-0 after:z-[7] after:pointer-events-none after:border-2 after:border-bg-brand",
|
|
1611
|
+
className
|
|
1612
|
+
),
|
|
1613
|
+
onClick,
|
|
1614
|
+
children
|
|
1615
|
+
}
|
|
1616
|
+
);
|
|
1617
|
+
});
|
|
1618
|
+
const TableCell = React.forwardRef(function TableCell2({
|
|
1619
|
+
field,
|
|
1620
|
+
tooltip,
|
|
1621
|
+
width,
|
|
1622
|
+
pinned,
|
|
1623
|
+
pinOffset,
|
|
1624
|
+
align = "left",
|
|
1625
|
+
ellipsis = false,
|
|
1626
|
+
label,
|
|
1627
|
+
className,
|
|
1628
|
+
rootProps,
|
|
1629
|
+
purpose = "default",
|
|
1630
|
+
children
|
|
1631
|
+
}, ref2) {
|
|
1632
|
+
const { density, cellBorders, resizingField } = useTableContext();
|
|
1633
|
+
const isResizingThisCol = field !== void 0 && resizingField === field;
|
|
1634
|
+
const style2 = {};
|
|
1635
|
+
if (width !== void 0) {
|
|
1636
|
+
style2.width = width;
|
|
1637
|
+
style2.minWidth = width;
|
|
1638
|
+
style2.maxWidth = width;
|
|
1639
|
+
}
|
|
1640
|
+
if (pinned === "left" && pinOffset !== void 0) style2.left = pinOffset;
|
|
1641
|
+
if (pinned === "right" && pinOffset !== void 0) style2.right = pinOffset;
|
|
1642
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1643
|
+
"div",
|
|
1644
|
+
{
|
|
1645
|
+
...rootProps,
|
|
1646
|
+
ref: ref2,
|
|
1647
|
+
role: "gridcell",
|
|
1648
|
+
"data-pinned": pinned,
|
|
1649
|
+
"data-label": label,
|
|
1650
|
+
"data-field": field,
|
|
1651
|
+
"data-purpose": purpose,
|
|
1652
|
+
"data-resize-active": isResizingThisCol ? "true" : void 0,
|
|
1653
|
+
title: tooltip,
|
|
1654
|
+
className: appShell.cn(
|
|
1655
|
+
tableStyles({ pinned, align, ellipsis, density, cellBorders, purpose }).cell(),
|
|
1656
|
+
// Linha brand 2px alinhada com o centro do resize handle do header (~2px do edge)
|
|
1657
|
+
isResizingThisCol && "relative after:absolute after:right-[2px] after:top-0 after:bottom-0 after:w-[2px] after:bg-bg-brand after:pointer-events-none",
|
|
1658
|
+
className
|
|
1659
|
+
),
|
|
1660
|
+
style: style2,
|
|
1661
|
+
children
|
|
1662
|
+
}
|
|
1663
|
+
);
|
|
1664
|
+
});
|
|
1665
|
+
const TableHeadCell = React.forwardRef(function TableHeadCell2({
|
|
1666
|
+
field,
|
|
1667
|
+
width,
|
|
1668
|
+
pinned,
|
|
1669
|
+
pinOffset,
|
|
1670
|
+
align = "left",
|
|
1671
|
+
sortable: sortable2 = false,
|
|
1672
|
+
sortDirection = null,
|
|
1673
|
+
sortIndex = 1,
|
|
1674
|
+
onSortClick,
|
|
1675
|
+
icon: Icon,
|
|
1676
|
+
headMenu,
|
|
1677
|
+
resizable,
|
|
1678
|
+
onResize,
|
|
1679
|
+
onResizeEnd,
|
|
1680
|
+
className,
|
|
1681
|
+
style: extraStyle,
|
|
1682
|
+
rootProps,
|
|
1683
|
+
purpose = "default",
|
|
1684
|
+
children
|
|
1685
|
+
}, forwardedRef) {
|
|
1686
|
+
const { density, cellBorders, setResizingField } = useTableContext();
|
|
1687
|
+
const headCellRef = React.useRef(null);
|
|
1688
|
+
const setRefs = React.useCallback((el) => {
|
|
1689
|
+
headCellRef.current = el;
|
|
1690
|
+
if (typeof forwardedRef === "function") forwardedRef(el);
|
|
1691
|
+
else if (forwardedRef) forwardedRef.current = el;
|
|
1692
|
+
}, [forwardedRef]);
|
|
1693
|
+
const resize = useColumnResize({
|
|
1694
|
+
currentWidth: width ?? 160,
|
|
1695
|
+
// Live DOM update — escreve `style.width` direto nas cells com `data-field`
|
|
1696
|
+
// correspondente, escopado ao `[role="grid"]` ancestral. Síncrono, sem React,
|
|
1697
|
+
// zero re-render durante o drag. Documented hook API via `onResizeLiveDOM`
|
|
1698
|
+
// (vs `onResize` que vai pro state externo, normalmente debounced ao mouseup).
|
|
1699
|
+
onResizeLiveDOM: field ? (w) => {
|
|
1700
|
+
const grid = headCellRef.current?.closest('[role="grid"]');
|
|
1701
|
+
grid?.querySelectorAll(`[data-field="${field}"]`).forEach((el) => {
|
|
1702
|
+
el.style.width = `${w}px`;
|
|
1703
|
+
el.style.minWidth = `${w}px`;
|
|
1704
|
+
el.style.maxWidth = `${w}px`;
|
|
1705
|
+
});
|
|
1706
|
+
} : void 0,
|
|
1707
|
+
onResize,
|
|
1708
|
+
onResizeEnd
|
|
1709
|
+
});
|
|
1710
|
+
React.useEffect(() => {
|
|
1711
|
+
if (resize.isDragging && field) {
|
|
1712
|
+
setResizingField(field);
|
|
1713
|
+
return () => setResizingField(null);
|
|
1714
|
+
}
|
|
1715
|
+
}, [resize.isDragging, field, setResizingField]);
|
|
1716
|
+
const style2 = {};
|
|
1717
|
+
if (width !== void 0) {
|
|
1718
|
+
style2.width = width;
|
|
1719
|
+
style2.minWidth = width;
|
|
1720
|
+
style2.maxWidth = width;
|
|
1721
|
+
}
|
|
1722
|
+
if (pinned === "left" && pinOffset !== void 0) style2.left = pinOffset;
|
|
1723
|
+
if (pinned === "right" && pinOffset !== void 0) style2.right = pinOffset;
|
|
1724
|
+
const ariaSort = sortable2 ? sortDirection === "asc" ? "ascending" : sortDirection === "desc" ? "descending" : "none" : void 0;
|
|
1725
|
+
const isSorted = sortDirection === "asc" || sortDirection === "desc";
|
|
1726
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1727
|
+
"div",
|
|
1728
|
+
{
|
|
1729
|
+
...rootProps,
|
|
1730
|
+
ref: setRefs,
|
|
1731
|
+
role: "columnheader",
|
|
1732
|
+
"aria-sort": ariaSort,
|
|
1733
|
+
"data-pinned": pinned,
|
|
1734
|
+
"data-sort": sortDirection ?? void 0,
|
|
1735
|
+
"data-field": field,
|
|
1736
|
+
"data-purpose": purpose,
|
|
1737
|
+
className: appShell.cn(
|
|
1738
|
+
"group/headcell",
|
|
1739
|
+
tableStyles({ pinned, align, sortable: sortable2, density, cellBorders, purpose }).headCell(),
|
|
1740
|
+
className
|
|
1741
|
+
),
|
|
1742
|
+
style: { ...style2, ...extraStyle },
|
|
1743
|
+
onClick: sortable2 ? onSortClick : void 0,
|
|
1744
|
+
children: [
|
|
1745
|
+
Icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: styles$4.typeIcon(), size: 13, strokeWidth: 1.7, "aria-hidden": true }),
|
|
1746
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1747
|
+
"span",
|
|
1748
|
+
{
|
|
1749
|
+
className: appShell.cn(
|
|
1750
|
+
"flex-1 min-w-0",
|
|
1751
|
+
// Coluna de seleção (checkbox) centraliza por padrão — sem precisar
|
|
1752
|
+
// de align="center" no consumer (alinha com o purpose="selection").
|
|
1753
|
+
align === "center" || purpose === "selection" ? "flex items-center justify-center" : align === "right" ? appShell.cn(
|
|
1754
|
+
"truncate text-right",
|
|
1755
|
+
// Reserva espaço pro headRightStack APENAS quando sort está
|
|
1756
|
+
// ATIVO (sort badge + indicator visíveis permanentemente).
|
|
1757
|
+
// Para hover-only icons (sortable hint sem sort + headMenu),
|
|
1758
|
+
// NÃO reserva espaço — headRightStack tem `bg-bg-table-head`
|
|
1759
|
+
// que mascara o texto durante hover. Texto right-aligned
|
|
1760
|
+
// encosta corretamente na borda quando sem hover (antes
|
|
1761
|
+
// ficava com ~60px de "vazio" reservado pros ícones invisíveis).
|
|
1762
|
+
isSorted && "pr-[60px]"
|
|
1763
|
+
) : "truncate text-left"
|
|
1764
|
+
),
|
|
1765
|
+
children
|
|
1766
|
+
}
|
|
1767
|
+
),
|
|
1768
|
+
(sortable2 || headMenu) && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: styles$4.headRightStack(), children: [
|
|
1769
|
+
isSorted && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: styles$4.headSortActive(), children: [
|
|
1770
|
+
sortIndex !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles$4.sortBadge(), children: sortIndex }),
|
|
1771
|
+
/* @__PURE__ */ jsxRuntime.jsx(SortIndicator, { direction: sortDirection })
|
|
1772
|
+
] }),
|
|
1773
|
+
sortable2 && !isSorted && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles$4.headSortHint(), children: /* @__PURE__ */ jsxRuntime.jsx(SortIndicator, { direction: null }) }),
|
|
1774
|
+
headMenu && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles$4.headMenuItem(), children: headMenu })
|
|
1775
|
+
] }),
|
|
1776
|
+
resizable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1777
|
+
"div",
|
|
1778
|
+
{
|
|
1779
|
+
className: styles$4.resizeHandle(),
|
|
1780
|
+
"data-dragging": resize.isDragging,
|
|
1781
|
+
onPointerDown: (e) => e.stopPropagation(),
|
|
1782
|
+
onMouseDown: resize.onMouseDown,
|
|
1783
|
+
onClick: (e) => e.stopPropagation(),
|
|
1784
|
+
onMouseEnter: () => field && setResizingField(field),
|
|
1785
|
+
onMouseLeave: () => {
|
|
1786
|
+
if (!resize.isDragging) setResizingField(null);
|
|
1787
|
+
},
|
|
1788
|
+
"aria-hidden": true
|
|
1789
|
+
}
|
|
1790
|
+
)
|
|
1791
|
+
]
|
|
1792
|
+
}
|
|
1793
|
+
);
|
|
1794
|
+
});
|
|
1795
|
+
function SortIndicator({ direction }) {
|
|
1796
|
+
if (direction === "asc") return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowUp, { className: styles$4.sortIcon(), "aria-hidden": true });
|
|
1797
|
+
if (direction === "desc") return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowDown, { className: styles$4.sortIcon(), "aria-hidden": true });
|
|
1798
|
+
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowUpDown, { className: styles$4.sortIcon(), "aria-hidden": true });
|
|
1799
|
+
}
|
|
1800
|
+
const styles$3 = tableStyles();
|
|
1801
|
+
function TableCardRow({
|
|
1802
|
+
header,
|
|
1803
|
+
headerActions,
|
|
1804
|
+
items,
|
|
1805
|
+
selected = false,
|
|
1806
|
+
open = false,
|
|
1807
|
+
clickable,
|
|
1808
|
+
onClick,
|
|
1809
|
+
className
|
|
1810
|
+
}) {
|
|
1811
|
+
const isClickable = clickable ?? !!onClick;
|
|
1812
|
+
const highlighted = selected || open;
|
|
1813
|
+
const handleClick = (e) => {
|
|
1814
|
+
if (!onClick) return;
|
|
1815
|
+
if (e.target.closest(
|
|
1816
|
+
'button, a, input, label, [role="menu"], [role="menuitem"], [data-slot="card-actions"]'
|
|
1817
|
+
)) {
|
|
1818
|
+
return;
|
|
1819
|
+
}
|
|
1820
|
+
onClick(e);
|
|
1821
|
+
};
|
|
1822
|
+
const dataState = selected && open ? "selected open" : selected ? "selected" : open ? "open" : void 0;
|
|
1823
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1824
|
+
"div",
|
|
1825
|
+
{
|
|
1826
|
+
role: "article",
|
|
1827
|
+
"aria-selected": selected || void 0,
|
|
1828
|
+
"data-state": dataState,
|
|
1829
|
+
className: appShell.cn(
|
|
1830
|
+
tableStyles({ selected: highlighted, clickable: isClickable }).cardWrap(),
|
|
1831
|
+
className
|
|
1832
|
+
),
|
|
1833
|
+
onClick: handleClick,
|
|
1834
|
+
children: [
|
|
1835
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles$3.cardHeader(), children: [
|
|
1836
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-gp-md min-w-0", children: header }),
|
|
1837
|
+
headerActions && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1838
|
+
"div",
|
|
1839
|
+
{
|
|
1840
|
+
className: "flex items-center gap-gp-xs shrink-0",
|
|
1841
|
+
"data-slot": "card-actions",
|
|
1842
|
+
children: headerActions
|
|
1843
|
+
}
|
|
1844
|
+
)
|
|
1845
|
+
] }),
|
|
1846
|
+
items.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-gp-md", children: items.map((item, i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles$3.cardItem(), children: [
|
|
1847
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: styles$3.cardLabel(), children: item.label }),
|
|
1848
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: styles$3.cardValue(), children: item.value })
|
|
1849
|
+
] }, item.key ?? i)) })
|
|
1850
|
+
]
|
|
1851
|
+
}
|
|
1852
|
+
);
|
|
1853
|
+
}
|
|
558
1854
|
const DEFAULT_COLUMN_WIDTH$1 = 160;
|
|
559
1855
|
function useColumnWidths(columns) {
|
|
560
1856
|
return React.useMemo(() => {
|
|
@@ -587,14 +1883,14 @@ function useColumnWidths(columns) {
|
|
|
587
1883
|
}
|
|
588
1884
|
const SELECTION_COLUMN_WIDTH = 56;
|
|
589
1885
|
const TABLE_HEADER_HEIGHT = 42;
|
|
590
|
-
const toolbarRoot =
|
|
1886
|
+
const toolbarRoot = appShell.tv({
|
|
591
1887
|
base: [
|
|
592
1888
|
"flex items-center justify-between flex-wrap",
|
|
593
1889
|
"gap-gp-md md:gap-gp-2xl"
|
|
594
1890
|
// 8px → 16px
|
|
595
1891
|
]
|
|
596
1892
|
});
|
|
597
|
-
const toolbarLeft =
|
|
1893
|
+
const toolbarLeft = appShell.tv({
|
|
598
1894
|
base: [
|
|
599
1895
|
"flex flex-1 items-center flex-wrap min-w-0",
|
|
600
1896
|
"gap-gp-sm md:gap-[10px]",
|
|
@@ -606,7 +1902,7 @@ const toolbarLeft = chipGroup.tv({
|
|
|
606
1902
|
"max-md:hidden"
|
|
607
1903
|
]
|
|
608
1904
|
});
|
|
609
|
-
const toolbarActions =
|
|
1905
|
+
const toolbarActions = appShell.tv({
|
|
610
1906
|
base: [
|
|
611
1907
|
"flex items-center flex-wrap shrink-0",
|
|
612
1908
|
"gap-gp-sm md:gap-gp-md",
|
|
@@ -617,10 +1913,10 @@ const toolbarActions = chipGroup.tv({
|
|
|
617
1913
|
"max-md:w-full max-md:flex-1"
|
|
618
1914
|
]
|
|
619
1915
|
});
|
|
620
|
-
const toolbarDivider =
|
|
1916
|
+
const toolbarDivider = appShell.tv({
|
|
621
1917
|
base: "w-[1px] h-[24px] bg-border-default shrink-0 mx-[6px] self-center"
|
|
622
1918
|
});
|
|
623
|
-
const toolbarSearch =
|
|
1919
|
+
const toolbarSearch = appShell.tv({
|
|
624
1920
|
base: [
|
|
625
1921
|
"relative flex items-center gap-gp-md cursor-text",
|
|
626
1922
|
"h-form-lg px-[14px] rounded-radius-lg",
|
|
@@ -644,21 +1940,21 @@ const toolbarSearch = chipGroup.tv({
|
|
|
644
1940
|
},
|
|
645
1941
|
defaultVariants: { expanded: false }
|
|
646
1942
|
});
|
|
647
|
-
const toolbarSearchInput =
|
|
1943
|
+
const toolbarSearchInput = appShell.tv({
|
|
648
1944
|
base: [
|
|
649
1945
|
"flex-1 min-w-0 bg-transparent border-0 outline-none",
|
|
650
1946
|
"text-body-sm font-normal text-fg-default",
|
|
651
1947
|
"placeholder:text-fg-muted"
|
|
652
1948
|
]
|
|
653
1949
|
});
|
|
654
|
-
const toolbarToolDot =
|
|
1950
|
+
const toolbarToolDot = appShell.tv({
|
|
655
1951
|
base: [
|
|
656
1952
|
"absolute -top-[4px] -right-[4px] z-[2] pointer-events-none",
|
|
657
1953
|
"size-[13px] rounded-radius-full",
|
|
658
1954
|
"bg-bg-brand border-2 border-bg-canvas"
|
|
659
1955
|
]
|
|
660
1956
|
});
|
|
661
|
-
const toolbarSegmented =
|
|
1957
|
+
const toolbarSegmented = appShell.tv({
|
|
662
1958
|
base: [
|
|
663
1959
|
"items-center gap-[2px] p-[3px]",
|
|
664
1960
|
"bg-bg-muted rounded-radius-lg",
|
|
@@ -672,7 +1968,7 @@ const toolbarSegmented = chipGroup.tv({
|
|
|
672
1968
|
},
|
|
673
1969
|
defaultVariants: { fluid: false }
|
|
674
1970
|
});
|
|
675
|
-
const toolbarSegmentedButton =
|
|
1971
|
+
const toolbarSegmentedButton = appShell.tv({
|
|
676
1972
|
base: [
|
|
677
1973
|
"grid place-items-center",
|
|
678
1974
|
"h-[34px] min-w-[36px] px-pad-md",
|
|
@@ -696,7 +1992,7 @@ const toolbarSegmentedButton = chipGroup.tv({
|
|
|
696
1992
|
},
|
|
697
1993
|
defaultVariants: { isActive: false, fluid: false }
|
|
698
1994
|
});
|
|
699
|
-
const toolbarTabs =
|
|
1995
|
+
const toolbarTabs = appShell.tv({
|
|
700
1996
|
base: [
|
|
701
1997
|
"items-center gap-[2px] p-[3px]",
|
|
702
1998
|
"bg-bg-muted rounded-radius-lg",
|
|
@@ -711,7 +2007,7 @@ const toolbarTabs = chipGroup.tv({
|
|
|
711
2007
|
},
|
|
712
2008
|
defaultVariants: { fluid: false }
|
|
713
2009
|
});
|
|
714
|
-
const toolbarTabWrap =
|
|
2010
|
+
const toolbarTabWrap = appShell.tv({
|
|
715
2011
|
base: [
|
|
716
2012
|
"relative inline-flex items-center",
|
|
717
2013
|
"rounded-radius-md",
|
|
@@ -729,7 +2025,7 @@ const toolbarTabWrap = chipGroup.tv({
|
|
|
729
2025
|
},
|
|
730
2026
|
defaultVariants: { isActive: false, fluid: false }
|
|
731
2027
|
});
|
|
732
|
-
const toolbarTabButton =
|
|
2028
|
+
const toolbarTabButton = appShell.tv({
|
|
733
2029
|
base: [
|
|
734
2030
|
"inline-flex items-center gap-gp-sm h-[34px] px-[14px]",
|
|
735
2031
|
"rounded-radius-md border-0 bg-transparent cursor-pointer outline-none",
|
|
@@ -750,7 +2046,7 @@ const toolbarTabButton = chipGroup.tv({
|
|
|
750
2046
|
},
|
|
751
2047
|
defaultVariants: { isActive: false, fluid: false }
|
|
752
2048
|
});
|
|
753
|
-
const toolbarTabClose =
|
|
2049
|
+
const toolbarTabClose = appShell.tv({
|
|
754
2050
|
base: [
|
|
755
2051
|
"grid place-items-center size-[18px] -ml-[18px]",
|
|
756
2052
|
"rounded-radius-full border-0 bg-transparent text-fg-muted cursor-pointer",
|
|
@@ -761,7 +2057,7 @@ const toolbarTabClose = chipGroup.tv({
|
|
|
761
2057
|
"[&_svg]:size-[11px]"
|
|
762
2058
|
]
|
|
763
2059
|
});
|
|
764
|
-
const toolbarApplied =
|
|
2060
|
+
const toolbarApplied = appShell.tv({
|
|
765
2061
|
// Mobile: scroll horizontal (flex-nowrap + overflow-x-auto) em vez de quebrar
|
|
766
2062
|
// os chips em várias linhas e empurrar a tabela pra baixo. Scrollbar oculta.
|
|
767
2063
|
// sm+: volta ao flex-wrap normal.
|
|
@@ -784,7 +2080,7 @@ const toolbarApplied = chipGroup.tv({
|
|
|
784
2080
|
separator: true
|
|
785
2081
|
}
|
|
786
2082
|
});
|
|
787
|
-
const toolbarAppliedChip =
|
|
2083
|
+
const toolbarAppliedChip = appShell.tv({
|
|
788
2084
|
base: [
|
|
789
2085
|
"inline-flex items-center gap-gp-md",
|
|
790
2086
|
"h-form-md pl-pad-sm pr-pad-lg",
|
|
@@ -804,7 +2100,7 @@ const toolbarAppliedChip = chipGroup.tv({
|
|
|
804
2100
|
}
|
|
805
2101
|
}
|
|
806
2102
|
});
|
|
807
|
-
const toolbarAppliedChipRemove =
|
|
2103
|
+
const toolbarAppliedChipRemove = appShell.tv({
|
|
808
2104
|
base: [
|
|
809
2105
|
"grid place-items-center size-[18px] shrink-0",
|
|
810
2106
|
"rounded-radius-full border-0 bg-transparent text-fg-subtle cursor-pointer outline-none",
|
|
@@ -814,13 +2110,13 @@ const toolbarAppliedChipRemove = chipGroup.tv({
|
|
|
814
2110
|
"[&_svg]:size-[14px]"
|
|
815
2111
|
]
|
|
816
2112
|
});
|
|
817
|
-
const toolbarAppliedChipName =
|
|
2113
|
+
const toolbarAppliedChipName = appShell.tv({
|
|
818
2114
|
base: "font-semibold text-fg-default"
|
|
819
2115
|
});
|
|
820
|
-
const toolbarAppliedChipOp =
|
|
2116
|
+
const toolbarAppliedChipOp = appShell.tv({
|
|
821
2117
|
base: "text-fg-muted text-caption-sm"
|
|
822
2118
|
});
|
|
823
|
-
const toolbarAppliedChipValue =
|
|
2119
|
+
const toolbarAppliedChipValue = appShell.tv({
|
|
824
2120
|
base: [
|
|
825
2121
|
"inline-flex items-center h-[22px] px-pad-md",
|
|
826
2122
|
"rounded-radius-sm",
|
|
@@ -828,7 +2124,7 @@ const toolbarAppliedChipValue = chipGroup.tv({
|
|
|
828
2124
|
"text-body-xs font-medium text-fg-default"
|
|
829
2125
|
]
|
|
830
2126
|
});
|
|
831
|
-
const toolbarAppliedClearLink =
|
|
2127
|
+
const toolbarAppliedClearLink = appShell.tv({
|
|
832
2128
|
base: [
|
|
833
2129
|
"ml-pad-sm text-body-xs font-medium text-fg-brand cursor-pointer outline-none",
|
|
834
2130
|
"bg-transparent border-0 p-0",
|
|
@@ -838,14 +2134,14 @@ const toolbarAppliedClearLink = chipGroup.tv({
|
|
|
838
2134
|
"disabled:opacity-50 disabled:pointer-events-none"
|
|
839
2135
|
]
|
|
840
2136
|
});
|
|
841
|
-
const bulkBarRoot =
|
|
2137
|
+
const bulkBarRoot = appShell.tv({
|
|
842
2138
|
base: [
|
|
843
2139
|
"flex items-center flex-wrap gap-gp-xl",
|
|
844
2140
|
"py-[10px] px-[14px] rounded-radius-xl",
|
|
845
2141
|
"bg-bg-brand-subtle border border-border-brand text-fg-brand"
|
|
846
2142
|
]
|
|
847
2143
|
});
|
|
848
|
-
const bulkBarCount =
|
|
2144
|
+
const bulkBarCount = appShell.tv({
|
|
849
2145
|
base: [
|
|
850
2146
|
"inline-flex items-center gap-gp-md shrink-0",
|
|
851
2147
|
"text-body-sm font-semibold",
|
|
@@ -853,13 +2149,13 @@ const bulkBarCount = chipGroup.tv({
|
|
|
853
2149
|
"[&_svg]:size-[14px]"
|
|
854
2150
|
]
|
|
855
2151
|
});
|
|
856
|
-
const bulkBarActions =
|
|
2152
|
+
const bulkBarActions = appShell.tv({
|
|
857
2153
|
base: [
|
|
858
2154
|
"flex items-center flex-wrap gap-gp-sm flex-1 min-w-0",
|
|
859
2155
|
"[&>*]:shrink-0"
|
|
860
2156
|
]
|
|
861
2157
|
});
|
|
862
|
-
const bulkBarClear =
|
|
2158
|
+
const bulkBarClear = appShell.tv({
|
|
863
2159
|
base: [
|
|
864
2160
|
"shrink-0 ml-auto",
|
|
865
2161
|
"bg-transparent border-0 p-0 cursor-pointer outline-none",
|
|
@@ -875,7 +2171,7 @@ function ToolbarDivider({ className, ...props }) {
|
|
|
875
2171
|
"span",
|
|
876
2172
|
{
|
|
877
2173
|
"aria-hidden": "true",
|
|
878
|
-
className:
|
|
2174
|
+
className: appShell.cn(toolbarDivider(), className),
|
|
879
2175
|
...props
|
|
880
2176
|
}
|
|
881
2177
|
);
|
|
@@ -894,9 +2190,9 @@ function TableToolbar({
|
|
|
894
2190
|
className
|
|
895
2191
|
}) {
|
|
896
2192
|
if (bulkBar) {
|
|
897
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
2193
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: appShell.cn("w-full", className), children: bulkBar });
|
|
898
2194
|
}
|
|
899
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
2195
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: appShell.cn(toolbarRoot(), className), children: [
|
|
900
2196
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: toolbarLeft(), children: [
|
|
901
2197
|
viewToggle,
|
|
902
2198
|
viewToggle && savedViews && /* @__PURE__ */ jsxRuntime.jsx(ToolbarDivider, {}),
|
|
@@ -925,7 +2221,7 @@ const ToolbarSearch = React.forwardRef(
|
|
|
925
2221
|
}, ref2) => {
|
|
926
2222
|
const hasValue = Boolean(value);
|
|
927
2223
|
const expanded = autoExpand ? hasValue : false;
|
|
928
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("label", { className:
|
|
2224
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: appShell.cn(toolbarSearch({ expanded }), wrapperClassName), children: [
|
|
929
2225
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { strokeWidth: 1.8, "aria-hidden": "true" }),
|
|
930
2226
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
931
2227
|
"input",
|
|
@@ -935,7 +2231,7 @@ const ToolbarSearch = React.forwardRef(
|
|
|
935
2231
|
value,
|
|
936
2232
|
placeholder: placeholder2,
|
|
937
2233
|
"aria-label": ariaLabel,
|
|
938
|
-
className:
|
|
2234
|
+
className: appShell.cn(toolbarSearchInput(), className),
|
|
939
2235
|
...inputProps
|
|
940
2236
|
}
|
|
941
2237
|
)
|
|
@@ -956,7 +2252,7 @@ function ToolbarSegmented({
|
|
|
956
2252
|
{
|
|
957
2253
|
role: "radiogroup",
|
|
958
2254
|
"aria-label": ariaLabel,
|
|
959
|
-
className:
|
|
2255
|
+
className: appShell.cn(toolbarSegmented({ fluid }), className),
|
|
960
2256
|
children: items.map((item) => {
|
|
961
2257
|
const isActive2 = item.value === value;
|
|
962
2258
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -993,13 +2289,13 @@ function ToolbarTabs({
|
|
|
993
2289
|
{
|
|
994
2290
|
role: "tablist",
|
|
995
2291
|
"aria-label": ariaLabel,
|
|
996
|
-
className:
|
|
2292
|
+
className: appShell.cn(toolbarTabs({ fluid }), className),
|
|
997
2293
|
children: tabs.map((tab2) => {
|
|
998
2294
|
const isActive2 = tab2.id === activeId;
|
|
999
2295
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1000
2296
|
"div",
|
|
1001
2297
|
{
|
|
1002
|
-
className:
|
|
2298
|
+
className: appShell.cn("group/wrap", toolbarTabWrap({ isActive: isActive2, fluid })),
|
|
1003
2299
|
children: [
|
|
1004
2300
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1005
2301
|
"button",
|
|
@@ -1044,14 +2340,14 @@ const ToolbarToolButton = React.forwardRef(
|
|
|
1044
2340
|
}, ref2) => {
|
|
1045
2341
|
const iconOnly = !label;
|
|
1046
2342
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1047
|
-
|
|
2343
|
+
appShell.Button,
|
|
1048
2344
|
{
|
|
1049
2345
|
ref: ref2,
|
|
1050
2346
|
color: isActive2 ? "primary" : "secondary",
|
|
1051
2347
|
variant: isActive2 ? "soft" : "outline",
|
|
1052
2348
|
size: iconOnly ? "icon-md" : "md",
|
|
1053
2349
|
iconLeft: iconOnly ? void 0 : icon,
|
|
1054
|
-
className:
|
|
2350
|
+
className: appShell.cn(
|
|
1055
2351
|
"relative",
|
|
1056
2352
|
// Active: Button primary soft não tem border — adicionamos brand
|
|
1057
2353
|
isActive2 && "border-border-brand hover:border-border-brand",
|
|
@@ -1068,13 +2364,13 @@ const ToolbarToolButton = React.forwardRef(
|
|
|
1068
2364
|
);
|
|
1069
2365
|
ToolbarToolButton.displayName = "ToolbarToolButton";
|
|
1070
2366
|
const ToolbarSaveButton = React.forwardRef(({ className, isOpen, children, ...rest }, ref2) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1071
|
-
|
|
2367
|
+
appShell.Button,
|
|
1072
2368
|
{
|
|
1073
2369
|
ref: ref2,
|
|
1074
2370
|
color: "secondary",
|
|
1075
2371
|
variant: "ghost",
|
|
1076
2372
|
size: "icon-md",
|
|
1077
|
-
className:
|
|
2373
|
+
className: appShell.cn(
|
|
1078
2374
|
isOpen && "bg-bg-muted text-fg-default",
|
|
1079
2375
|
className
|
|
1080
2376
|
),
|
|
@@ -1113,7 +2409,7 @@ function ToolbarApplied({
|
|
|
1113
2409
|
}) {
|
|
1114
2410
|
if (filters.length === 0) return null;
|
|
1115
2411
|
const resolveOp = (op) => opLabels?.[op] ?? DEFAULT_OP_LABELS[op] ?? String(op);
|
|
1116
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
2412
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: appShell.cn(toolbarApplied({ separator }), className), children: [
|
|
1117
2413
|
filters.map((f) => {
|
|
1118
2414
|
const isPendingOpen = pendingOpenId === f.id;
|
|
1119
2415
|
const defaultChip = /* @__PURE__ */ jsxRuntime.jsxs("span", { className: toolbarAppliedChip({ interactive: !!renderChip }), children: [
|
|
@@ -1146,7 +2442,7 @@ function ToolbarApplied({
|
|
|
1146
2442
|
{
|
|
1147
2443
|
type: "button",
|
|
1148
2444
|
onClick: onClearAll,
|
|
1149
|
-
className:
|
|
2445
|
+
className: appShell.cn(toolbarAppliedClearLink(), "shrink-0"),
|
|
1150
2446
|
children: clearLabel
|
|
1151
2447
|
}
|
|
1152
2448
|
)
|
|
@@ -1160,7 +2456,7 @@ function MenuItem({ item, idx }) {
|
|
|
1160
2456
|
variant: item.destructive ? "destructive" : "default",
|
|
1161
2457
|
disabled: item.disabled,
|
|
1162
2458
|
onSelect: () => item.onClick?.(),
|
|
1163
|
-
className:
|
|
2459
|
+
className: appShell.cn(item.active && "bg-bg-brand-subtle text-fg-brand"),
|
|
1164
2460
|
children: [
|
|
1165
2461
|
item.icon,
|
|
1166
2462
|
item.label
|
|
@@ -1173,7 +2469,7 @@ function ActionInput({
|
|
|
1173
2469
|
action,
|
|
1174
2470
|
className
|
|
1175
2471
|
}) {
|
|
1176
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("label", { className:
|
|
2472
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: appShell.cn(toolbarSearch(), className), children: [
|
|
1177
2473
|
action.icon,
|
|
1178
2474
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1179
2475
|
"input",
|
|
@@ -1227,7 +2523,7 @@ function ToolbarActions({
|
|
|
1227
2523
|
return null;
|
|
1228
2524
|
}
|
|
1229
2525
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1230
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
2526
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: appShell.cn("hidden items-center gap-gp-sm md:flex", className), children: [
|
|
1231
2527
|
actions.map((a) => /* @__PURE__ */ jsxRuntime.jsx(InlineAction, { action: a }, a.id)),
|
|
1232
2528
|
extraItems && extraItems.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(appShell.DropdownMenu, { children: [
|
|
1233
2529
|
/* @__PURE__ */ jsxRuntime.jsx(appShell.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1328,7 +2624,7 @@ function BulkActionsBar({
|
|
|
1328
2624
|
{
|
|
1329
2625
|
role: "toolbar",
|
|
1330
2626
|
"aria-label": "Ações em massa",
|
|
1331
|
-
className:
|
|
2627
|
+
className: appShell.cn(bulkBarRoot(), className),
|
|
1332
2628
|
children: [
|
|
1333
2629
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: bulkBarCount(), children: [
|
|
1334
2630
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { strokeWidth: 2.4 }),
|
|
@@ -1351,7 +2647,7 @@ function BulkActionButton({
|
|
|
1351
2647
|
}) {
|
|
1352
2648
|
const darkOverrides = variant === "danger" ? "border border-border-danger-muted" : "dark:bg-transparent dark:shadow-sh-none";
|
|
1353
2649
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1354
|
-
|
|
2650
|
+
appShell.Button,
|
|
1355
2651
|
{
|
|
1356
2652
|
color: variant === "danger" ? "critical" : "primary",
|
|
1357
2653
|
variant: variant === "danger" ? "soft" : "outline",
|
|
@@ -1360,7 +2656,7 @@ function BulkActionButton({
|
|
|
1360
2656
|
iconLeft: icon,
|
|
1361
2657
|
onClick,
|
|
1362
2658
|
disabled,
|
|
1363
|
-
className:
|
|
2659
|
+
className: appShell.cn(darkOverrides, className),
|
|
1364
2660
|
...rest,
|
|
1365
2661
|
children
|
|
1366
2662
|
}
|
|
@@ -1468,7 +2764,7 @@ function ColsPanel({
|
|
|
1468
2764
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1469
2765
|
"div",
|
|
1470
2766
|
{
|
|
1471
|
-
className:
|
|
2767
|
+
className: appShell.cn(
|
|
1472
2768
|
"flex-1 min-h-0 overflow-y-auto p-[6px] flex flex-col gap-[2px]",
|
|
1473
2769
|
"[scrollbar-width:thin] [scrollbar-color:var(--color-border-default)_transparent]",
|
|
1474
2770
|
"[&::-webkit-scrollbar]:w-[6px]",
|
|
@@ -1491,7 +2787,7 @@ function ColsPanel({
|
|
|
1491
2787
|
onDragOver: (e) => handleDragOver(e, index),
|
|
1492
2788
|
onDrop: (e) => handleDrop(e, index),
|
|
1493
2789
|
onDragEnd: handleDragEnd,
|
|
1494
|
-
className:
|
|
2790
|
+
className: appShell.cn(
|
|
1495
2791
|
"group/row flex items-center gap-gp-lg px-pad-md py-[4px] rounded-radius-md",
|
|
1496
2792
|
"transition-[opacity,box-shadow] duration-150",
|
|
1497
2793
|
"hover:bg-bg-muted",
|
|
@@ -1513,7 +2809,7 @@ function ColsPanel({
|
|
|
1513
2809
|
}
|
|
1514
2810
|
),
|
|
1515
2811
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1516
|
-
|
|
2812
|
+
Checkbox,
|
|
1517
2813
|
{
|
|
1518
2814
|
id: `col-vis-${col.key}`,
|
|
1519
2815
|
checked,
|
|
@@ -1538,7 +2834,7 @@ function ColsPanel({
|
|
|
1538
2834
|
"aria-pressed": isPinned,
|
|
1539
2835
|
"aria-label": typeof col.label === "string" ? isPinned ? `Desfixar ${col.label}` : `Fixar ${col.label}` : void 0,
|
|
1540
2836
|
title: isPinned ? "Desfixar coluna" : "Fixar coluna",
|
|
1541
|
-
className:
|
|
2837
|
+
className: appShell.cn(
|
|
1542
2838
|
"grid place-items-center size-[28px] shrink-0",
|
|
1543
2839
|
"rounded-radius-md bg-transparent text-fg-muted",
|
|
1544
2840
|
"transition-[opacity,background-color,color] duration-150",
|
|
@@ -1593,7 +2889,7 @@ function ColsPopover({
|
|
|
1593
2889
|
appShell.PopoverContent,
|
|
1594
2890
|
{
|
|
1595
2891
|
align,
|
|
1596
|
-
className:
|
|
2892
|
+
className: appShell.cn(
|
|
1597
2893
|
"w-[320px] max-w-[calc(100vw-32px)] max-h-[min(480px,calc(100vh-80px))] p-0 flex flex-col min-h-0 overflow-hidden",
|
|
1598
2894
|
className
|
|
1599
2895
|
),
|
|
@@ -1642,7 +2938,7 @@ function SortPanel({
|
|
|
1642
2938
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1643
2939
|
"div",
|
|
1644
2940
|
{
|
|
1645
|
-
className:
|
|
2941
|
+
className: appShell.cn(
|
|
1646
2942
|
"flex-1 min-h-0 overflow-y-auto",
|
|
1647
2943
|
"[scrollbar-width:thin] [scrollbar-color:var(--color-border-default)_transparent]",
|
|
1648
2944
|
"[&::-webkit-scrollbar]:w-[6px]",
|
|
@@ -1664,7 +2960,7 @@ function SortPanel({
|
|
|
1664
2960
|
{
|
|
1665
2961
|
type: "button",
|
|
1666
2962
|
onClick: () => toggleDir(i),
|
|
1667
|
-
className:
|
|
2963
|
+
className: appShell.cn(
|
|
1668
2964
|
"inline-flex items-center gap-gp-xs h-[22px] px-pad-md shrink-0",
|
|
1669
2965
|
"rounded-radius-sm bg-bg-muted text-fg-default text-caption-sm font-medium",
|
|
1670
2966
|
"outline-none cursor-pointer",
|
|
@@ -1684,7 +2980,7 @@ function SortPanel({
|
|
|
1684
2980
|
type: "button",
|
|
1685
2981
|
onClick: () => remove(i),
|
|
1686
2982
|
"aria-label": "Remover critério",
|
|
1687
|
-
className:
|
|
2983
|
+
className: appShell.cn(
|
|
1688
2984
|
"grid place-items-center size-[22px] shrink-0",
|
|
1689
2985
|
"rounded-radius-sm bg-transparent text-fg-muted",
|
|
1690
2986
|
"outline-none cursor-pointer",
|
|
@@ -1711,7 +3007,7 @@ function SortPanel({
|
|
|
1711
3007
|
{
|
|
1712
3008
|
type: "button",
|
|
1713
3009
|
onClick: () => addSort(col.key),
|
|
1714
|
-
className:
|
|
3010
|
+
className: appShell.cn(
|
|
1715
3011
|
"group/add flex items-center gap-gp-md w-full",
|
|
1716
3012
|
"px-pad-md py-pad-sm rounded-radius-md",
|
|
1717
3013
|
"bg-transparent border-0 cursor-pointer outline-none text-left",
|
|
@@ -1762,7 +3058,7 @@ function SortPopover({
|
|
|
1762
3058
|
appShell.PopoverContent,
|
|
1763
3059
|
{
|
|
1764
3060
|
align,
|
|
1765
|
-
className:
|
|
3061
|
+
className: appShell.cn(
|
|
1766
3062
|
"w-[300px] max-w-[calc(100vw-32px)] max-h-[min(480px,calc(100vh-80px))] p-0 flex flex-col min-h-0 overflow-hidden",
|
|
1767
3063
|
className
|
|
1768
3064
|
),
|
|
@@ -1813,7 +3109,7 @@ function ViewsPopover({
|
|
|
1813
3109
|
align,
|
|
1814
3110
|
role: "dialog",
|
|
1815
3111
|
"aria-label": "Visualizações",
|
|
1816
|
-
className:
|
|
3112
|
+
className: appShell.cn(
|
|
1817
3113
|
"w-[280px] max-w-[calc(100vw-32px)] max-h-[min(480px,calc(100vh-80px))] p-0 flex flex-col min-h-0 overflow-hidden",
|
|
1818
3114
|
className
|
|
1819
3115
|
),
|
|
@@ -1831,7 +3127,7 @@ function ViewsPopover({
|
|
|
1831
3127
|
role: "tab",
|
|
1832
3128
|
"aria-selected": tab2 === "all",
|
|
1833
3129
|
onClick: () => setTab("all"),
|
|
1834
|
-
className:
|
|
3130
|
+
className: appShell.cn(
|
|
1835
3131
|
"flex-1 h-form-sm px-pad-lg rounded-radius-sm",
|
|
1836
3132
|
"text-body-xs font-medium cursor-pointer outline-none focus-visible:shadow-sh-ring",
|
|
1837
3133
|
"transition-[background-color,color,box-shadow] duration-150",
|
|
@@ -1847,7 +3143,7 @@ function ViewsPopover({
|
|
|
1847
3143
|
role: "tab",
|
|
1848
3144
|
"aria-selected": tab2 === "mine",
|
|
1849
3145
|
onClick: () => setTab("mine"),
|
|
1850
|
-
className:
|
|
3146
|
+
className: appShell.cn(
|
|
1851
3147
|
"flex-1 h-form-sm px-pad-lg rounded-radius-sm",
|
|
1852
3148
|
"text-body-xs font-medium cursor-pointer outline-none focus-visible:shadow-sh-ring",
|
|
1853
3149
|
"transition-[background-color,color,box-shadow] duration-150",
|
|
@@ -1884,7 +3180,7 @@ function ViewsPopover({
|
|
|
1884
3180
|
"div",
|
|
1885
3181
|
{
|
|
1886
3182
|
role: "list",
|
|
1887
|
-
className:
|
|
3183
|
+
className: appShell.cn(
|
|
1888
3184
|
"flex-1 min-h-0 overflow-y-auto p-pad-md flex flex-col gap-[2px]",
|
|
1889
3185
|
"[scrollbar-width:thin] [scrollbar-color:var(--color-border-default)_transparent]",
|
|
1890
3186
|
"[&::-webkit-scrollbar]:w-[6px]",
|
|
@@ -1898,7 +3194,7 @@ function ViewsPopover({
|
|
|
1898
3194
|
"div",
|
|
1899
3195
|
{
|
|
1900
3196
|
role: "listitem",
|
|
1901
|
-
className:
|
|
3197
|
+
className: appShell.cn(
|
|
1902
3198
|
"group/view flex items-stretch gap-[2px] rounded-radius-md",
|
|
1903
3199
|
isActive2 && "bg-bg-brand-subtle"
|
|
1904
3200
|
),
|
|
@@ -1908,7 +3204,7 @@ function ViewsPopover({
|
|
|
1908
3204
|
{
|
|
1909
3205
|
type: "button",
|
|
1910
3206
|
onClick: () => onApply?.(view),
|
|
1911
|
-
className:
|
|
3207
|
+
className: appShell.cn(
|
|
1912
3208
|
"flex-1 flex items-center gap-gp-md min-w-0",
|
|
1913
3209
|
"px-pad-md py-pad-sm rounded-radius-md",
|
|
1914
3210
|
"bg-transparent border-0 cursor-pointer outline-none text-left",
|
|
@@ -1919,7 +3215,7 @@ function ViewsPopover({
|
|
|
1919
3215
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1920
3216
|
"span",
|
|
1921
3217
|
{
|
|
1922
|
-
className:
|
|
3218
|
+
className: appShell.cn(
|
|
1923
3219
|
"flex-1 text-body-sm font-normal truncate",
|
|
1924
3220
|
isActive2 ? "font-semibold" : "font-medium"
|
|
1925
3221
|
),
|
|
@@ -1940,224 +3236,58 @@ function ViewsPopover({
|
|
|
1940
3236
|
onClick: () => onDelete(view.id),
|
|
1941
3237
|
"aria-label": typeof view.name === "string" ? `Excluir ${view.name}` : "Excluir",
|
|
1942
3238
|
title: "Excluir",
|
|
1943
|
-
className:
|
|
3239
|
+
className: appShell.cn(
|
|
1944
3240
|
"grid place-items-center size-[28px] shrink-0 self-center",
|
|
1945
3241
|
"mr-pad-sm",
|
|
1946
3242
|
// respiro da borda direita (= sandbox)
|
|
1947
3243
|
"rounded-radius-md bg-transparent text-fg-muted",
|
|
1948
3244
|
"outline-none cursor-pointer",
|
|
1949
|
-
"transition-[opacity,background-color,color] duration-150",
|
|
1950
|
-
"opacity-0 group-hover/view:opacity-100",
|
|
1951
|
-
"hover:bg-bg-danger-muted hover:text-fg-danger",
|
|
1952
|
-
"focus-visible:opacity-100 focus-visible:bg-bg-muted",
|
|
1953
|
-
"[&_svg]:size-[14px]"
|
|
1954
|
-
),
|
|
1955
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { strokeWidth: 1.8 })
|
|
1956
|
-
}
|
|
1957
|
-
)
|
|
1958
|
-
]
|
|
1959
|
-
},
|
|
1960
|
-
view.id
|
|
1961
|
-
);
|
|
1962
|
-
})
|
|
1963
|
-
}
|
|
1964
|
-
),
|
|
1965
|
-
!hideCreate && onCreate && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-none p-pad-md border-t border-border-default", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1966
|
-
"button",
|
|
1967
|
-
{
|
|
1968
|
-
type: "button",
|
|
1969
|
-
onClick: onCreate,
|
|
1970
|
-
className:
|
|
1971
|
-
"flex items-center justify-center gap-gp-sm w-full",
|
|
1972
|
-
"h-form-md px-pad-xl rounded-radius-lg",
|
|
1973
|
-
"bg-bg-surface dark:bg-bg-muted",
|
|
1974
|
-
"border border-border-subtle dark:border-border-input",
|
|
1975
|
-
"shadow-sh-sm dark:shadow-sh-none",
|
|
1976
|
-
"text-body-sm font-semibold text-fg-default dark:text-fg-muted",
|
|
1977
|
-
"outline-none cursor-pointer",
|
|
1978
|
-
"transition-[background-color,color,box-shadow] duration-150",
|
|
1979
|
-
"hover:bg-bg-muted-hover hover:text-fg-default",
|
|
1980
|
-
"focus-visible:shadow-sh-ring",
|
|
1981
|
-
"[&_svg]:size-[14px]"
|
|
1982
|
-
),
|
|
1983
|
-
children: [
|
|
1984
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { strokeWidth: 2.2 }),
|
|
1985
|
-
createLabel
|
|
1986
|
-
]
|
|
1987
|
-
}
|
|
1988
|
-
) })
|
|
1989
|
-
]
|
|
1990
|
-
}
|
|
1991
|
-
)
|
|
1992
|
-
] });
|
|
1993
|
-
}
|
|
1994
|
-
const Switch = React__namespace.forwardRef(({ className, ...props }, ref2) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1995
|
-
SwitchPrimitives__namespace.Root,
|
|
1996
|
-
{
|
|
1997
|
-
className: chipGroup.cn(
|
|
1998
|
-
"peer relative inline-flex h-[24px] w-[42px] shrink-0 cursor-pointer items-center",
|
|
1999
|
-
"rounded-radius-full",
|
|
2000
|
-
"transition-[background-color,box-shadow] duration-150 outline-none",
|
|
2001
|
-
"data-[state=unchecked]:bg-bg-emphasis dark:data-[state=unchecked]:bg-bg-accent",
|
|
2002
|
-
"data-[state=checked]:bg-bg-brand",
|
|
2003
|
-
"focus-visible:shadow-sh-ring",
|
|
2004
|
-
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
2005
|
-
className
|
|
2006
|
-
),
|
|
2007
|
-
...props,
|
|
2008
|
-
ref: ref2,
|
|
2009
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2010
|
-
SwitchPrimitives__namespace.Thumb,
|
|
2011
|
-
{
|
|
2012
|
-
className: chipGroup.cn(
|
|
2013
|
-
"pointer-events-none block size-[20px] rounded-radius-full bg-white",
|
|
2014
|
-
"shadow-[0_1px_2px_rgba(0,0,0,0.10)]",
|
|
2015
|
-
"transition-transform duration-[180ms] ease-[cubic-bezier(0.4,0,0.2,1)]",
|
|
2016
|
-
"data-[state=unchecked]:translate-x-[2px]",
|
|
2017
|
-
"data-[state=checked]:translate-x-[20px]"
|
|
2018
|
-
)
|
|
2019
|
-
}
|
|
2020
|
-
)
|
|
2021
|
-
}
|
|
2022
|
-
));
|
|
2023
|
-
Switch.displayName = SwitchPrimitives__namespace.Root.displayName;
|
|
2024
|
-
const formFieldRoot = chipGroup.tv({
|
|
2025
|
-
base: "flex flex-col gap-[7px] w-full"
|
|
2026
|
-
});
|
|
2027
|
-
const formFieldLabel = chipGroup.tv({
|
|
2028
|
-
base: [
|
|
2029
|
-
"text-body-sm font-semibold tracking-[0.01em] leading-none",
|
|
2030
|
-
"text-fg-default dark:text-fg-muted",
|
|
2031
|
-
"select-none"
|
|
2032
|
-
],
|
|
2033
|
-
variants: {
|
|
2034
|
-
disabled: {
|
|
2035
|
-
true: "opacity-50 cursor-not-allowed"
|
|
2036
|
-
}
|
|
2037
|
-
}
|
|
2038
|
-
});
|
|
2039
|
-
const formFieldRequired = chipGroup.tv({
|
|
2040
|
-
base: "ml-[2px] text-fg-danger"
|
|
2041
|
-
});
|
|
2042
|
-
const formFieldMessage = chipGroup.tv({
|
|
2043
|
-
base: "text-caption-sm leading-snug",
|
|
2044
|
-
variants: {
|
|
2045
|
-
state: {
|
|
2046
|
-
default: "text-fg-muted",
|
|
2047
|
-
error: "text-fg-danger",
|
|
2048
|
-
warning: "text-fg-warning",
|
|
2049
|
-
success: "text-fg-success"
|
|
2050
|
-
}
|
|
2051
|
-
},
|
|
2052
|
-
defaultVariants: { state: "default" }
|
|
2053
|
-
});
|
|
2054
|
-
function FormField({
|
|
2055
|
-
label,
|
|
2056
|
-
required: required2,
|
|
2057
|
-
helperText,
|
|
2058
|
-
state = "default",
|
|
2059
|
-
errorMessage,
|
|
2060
|
-
warningMessage,
|
|
2061
|
-
successMessage,
|
|
2062
|
-
className,
|
|
2063
|
-
id: idProp,
|
|
2064
|
-
children,
|
|
2065
|
-
hideLabel,
|
|
2066
|
-
disabled
|
|
2067
|
-
}) {
|
|
2068
|
-
const autoId = React.useId();
|
|
2069
|
-
const id = idProp ?? autoId;
|
|
2070
|
-
let message = helperText;
|
|
2071
|
-
let messageState = "default";
|
|
2072
|
-
if (state === "error" && errorMessage) {
|
|
2073
|
-
message = errorMessage;
|
|
2074
|
-
messageState = "error";
|
|
2075
|
-
} else if (state === "warning" && warningMessage) {
|
|
2076
|
-
message = warningMessage;
|
|
2077
|
-
messageState = "warning";
|
|
2078
|
-
} else if (state === "success" && successMessage) {
|
|
2079
|
-
message = successMessage;
|
|
2080
|
-
messageState = "success";
|
|
2081
|
-
}
|
|
2082
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chipGroup.cn(formFieldRoot(), className), children: [
|
|
2083
|
-
label && !hideLabel && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2084
|
-
"label",
|
|
2085
|
-
{
|
|
2086
|
-
htmlFor: id,
|
|
2087
|
-
className: formFieldLabel({ disabled }),
|
|
2088
|
-
children: [
|
|
2089
|
-
label,
|
|
2090
|
-
required2 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: formFieldRequired(), "aria-hidden": "true", children: "*" })
|
|
3245
|
+
"transition-[opacity,background-color,color] duration-150",
|
|
3246
|
+
"opacity-0 group-hover/view:opacity-100",
|
|
3247
|
+
"hover:bg-bg-danger-muted hover:text-fg-danger",
|
|
3248
|
+
"focus-visible:opacity-100 focus-visible:bg-bg-muted",
|
|
3249
|
+
"[&_svg]:size-[14px]"
|
|
3250
|
+
),
|
|
3251
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { strokeWidth: 1.8 })
|
|
3252
|
+
}
|
|
3253
|
+
)
|
|
3254
|
+
]
|
|
3255
|
+
},
|
|
3256
|
+
view.id
|
|
3257
|
+
);
|
|
3258
|
+
})
|
|
3259
|
+
}
|
|
3260
|
+
),
|
|
3261
|
+
!hideCreate && onCreate && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-none p-pad-md border-t border-border-default", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3262
|
+
"button",
|
|
3263
|
+
{
|
|
3264
|
+
type: "button",
|
|
3265
|
+
onClick: onCreate,
|
|
3266
|
+
className: appShell.cn(
|
|
3267
|
+
"flex items-center justify-center gap-gp-sm w-full",
|
|
3268
|
+
"h-form-md px-pad-xl rounded-radius-lg",
|
|
3269
|
+
"bg-bg-surface dark:bg-bg-muted",
|
|
3270
|
+
"border border-border-subtle dark:border-border-input",
|
|
3271
|
+
"shadow-sh-sm dark:shadow-sh-none",
|
|
3272
|
+
"text-body-sm font-semibold text-fg-default dark:text-fg-muted",
|
|
3273
|
+
"outline-none cursor-pointer",
|
|
3274
|
+
"transition-[background-color,color,box-shadow] duration-150",
|
|
3275
|
+
"hover:bg-bg-muted-hover hover:text-fg-default",
|
|
3276
|
+
"focus-visible:shadow-sh-ring",
|
|
3277
|
+
"[&_svg]:size-[14px]"
|
|
3278
|
+
),
|
|
3279
|
+
children: [
|
|
3280
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { strokeWidth: 2.2 }),
|
|
3281
|
+
createLabel
|
|
3282
|
+
]
|
|
3283
|
+
}
|
|
3284
|
+
) })
|
|
2091
3285
|
]
|
|
2092
3286
|
}
|
|
2093
|
-
),
|
|
2094
|
-
children({ id, state }),
|
|
2095
|
-
message && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2096
|
-
"p",
|
|
2097
|
-
{
|
|
2098
|
-
className: formFieldMessage({ state: messageState }),
|
|
2099
|
-
role: messageState === "error" ? "alert" : void 0,
|
|
2100
|
-
children: message
|
|
2101
|
-
}
|
|
2102
3287
|
)
|
|
2103
3288
|
] });
|
|
2104
3289
|
}
|
|
2105
|
-
|
|
2106
|
-
if (typeof content === "string") {
|
|
2107
|
-
return /* @__PURE__ */ jsxRuntime.jsx(appShell.InputGroupAddon, { align: key === "start" ? "inline-start" : "inline-end", children: /* @__PURE__ */ jsxRuntime.jsx(appShell.InputGroupText, { children: content }) }, key);
|
|
2108
|
-
}
|
|
2109
|
-
return /* @__PURE__ */ jsxRuntime.jsx(appShell.InputGroupAddon, { align: key === "start" ? "inline-start" : "inline-end", children: content }, key);
|
|
2110
|
-
}
|
|
2111
|
-
const FormFieldInput = React.forwardRef(
|
|
2112
|
-
({
|
|
2113
|
-
label,
|
|
2114
|
-
required: required2,
|
|
2115
|
-
helperText,
|
|
2116
|
-
state,
|
|
2117
|
-
errorMessage,
|
|
2118
|
-
warningMessage,
|
|
2119
|
-
successMessage,
|
|
2120
|
-
className,
|
|
2121
|
-
id,
|
|
2122
|
-
startAddon,
|
|
2123
|
-
endAddon,
|
|
2124
|
-
...inputProps
|
|
2125
|
-
}, ref2) => {
|
|
2126
|
-
const hasAddon = startAddon !== void 0 || endAddon !== void 0;
|
|
2127
|
-
const { size, ...inputHtmlProps } = inputProps;
|
|
2128
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2129
|
-
FormField,
|
|
2130
|
-
{
|
|
2131
|
-
label,
|
|
2132
|
-
required: required2,
|
|
2133
|
-
helperText,
|
|
2134
|
-
state,
|
|
2135
|
-
errorMessage,
|
|
2136
|
-
warningMessage,
|
|
2137
|
-
successMessage,
|
|
2138
|
-
className,
|
|
2139
|
-
id,
|
|
2140
|
-
disabled: inputProps.disabled,
|
|
2141
|
-
children: ({ id: fieldId, state: fieldState }) => hasAddon ? /* @__PURE__ */ jsxRuntime.jsxs(appShell.InputGroup, { state: fieldState, size: size ?? void 0, children: [
|
|
2142
|
-
startAddon !== void 0 && renderAddon(startAddon, "start"),
|
|
2143
|
-
/* @__PURE__ */ jsxRuntime.jsx(appShell.InputGroupInput, { ref: ref2, id: fieldId, ...inputHtmlProps }),
|
|
2144
|
-
endAddon !== void 0 && renderAddon(endAddon, "end")
|
|
2145
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2146
|
-
input.Input,
|
|
2147
|
-
{
|
|
2148
|
-
ref: ref2,
|
|
2149
|
-
id: fieldId,
|
|
2150
|
-
state: fieldState,
|
|
2151
|
-
size,
|
|
2152
|
-
...inputHtmlProps
|
|
2153
|
-
}
|
|
2154
|
-
)
|
|
2155
|
-
}
|
|
2156
|
-
);
|
|
2157
|
-
}
|
|
2158
|
-
);
|
|
2159
|
-
FormFieldInput.displayName = "FormFieldInput";
|
|
2160
|
-
const dialog = chipGroup.tv({
|
|
3290
|
+
const dialog = appShell.tv({
|
|
2161
3291
|
base: [
|
|
2162
3292
|
// Override do DialogContent default (grid + p-pad-4xl + rounded-radius-base + shadow-sh-xl)
|
|
2163
3293
|
"!gap-0 !p-0",
|
|
@@ -2171,7 +3301,7 @@ const dialog = chipGroup.tv({
|
|
|
2171
3301
|
"flex flex-col overflow-hidden"
|
|
2172
3302
|
]
|
|
2173
3303
|
});
|
|
2174
|
-
const closeBtn =
|
|
3304
|
+
const closeBtn = appShell.tv({
|
|
2175
3305
|
base: [
|
|
2176
3306
|
"absolute top-[14px] right-[14px] z-[1]",
|
|
2177
3307
|
"grid place-items-center size-[28px]",
|
|
@@ -2183,7 +3313,7 @@ const closeBtn = chipGroup.tv({
|
|
|
2183
3313
|
"dark:hover:bg-bg-muted-hover"
|
|
2184
3314
|
]
|
|
2185
3315
|
});
|
|
2186
|
-
const head =
|
|
3316
|
+
const head = appShell.tv({
|
|
2187
3317
|
base: [
|
|
2188
3318
|
"flex items-center gap-[14px]",
|
|
2189
3319
|
// sandbox 14px (não tem na escala)
|
|
@@ -2192,7 +3322,7 @@ const head = chipGroup.tv({
|
|
|
2192
3322
|
"border-b border-border-default"
|
|
2193
3323
|
]
|
|
2194
3324
|
});
|
|
2195
|
-
const headIcon =
|
|
3325
|
+
const headIcon = appShell.tv({
|
|
2196
3326
|
base: [
|
|
2197
3327
|
"shrink-0 grid place-items-center size-form-lg",
|
|
2198
3328
|
// 40×40 — sandbox
|
|
@@ -2201,7 +3331,7 @@ const headIcon = chipGroup.tv({
|
|
|
2201
3331
|
"dark:bg-bg-accent dark:border-border-subtle"
|
|
2202
3332
|
]
|
|
2203
3333
|
});
|
|
2204
|
-
const headTitleWrap =
|
|
3334
|
+
const headTitleWrap = appShell.tv({
|
|
2205
3335
|
base: [
|
|
2206
3336
|
"flex-1 min-w-0",
|
|
2207
3337
|
// Reserva espaço pro X close do DialogContent (absolute right-4 / size ~24px)
|
|
@@ -2209,7 +3339,7 @@ const headTitleWrap = chipGroup.tv({
|
|
|
2209
3339
|
"pr-pad-3xl"
|
|
2210
3340
|
]
|
|
2211
3341
|
});
|
|
2212
|
-
const title =
|
|
3342
|
+
const title = appShell.tv({
|
|
2213
3343
|
base: [
|
|
2214
3344
|
"m-0 mb-[2px]",
|
|
2215
3345
|
// leading-[1.3] balanceia o bloco verticalmente com o icon container 40px
|
|
@@ -2219,13 +3349,13 @@ const title = chipGroup.tv({
|
|
|
2219
3349
|
"tracking-[-0.01em]"
|
|
2220
3350
|
]
|
|
2221
3351
|
});
|
|
2222
|
-
const sub =
|
|
3352
|
+
const sub = appShell.tv({
|
|
2223
3353
|
base: "m-0 text-body-xs font-normal text-fg-muted leading-[1.45]"
|
|
2224
3354
|
});
|
|
2225
|
-
const body =
|
|
3355
|
+
const body = appShell.tv({
|
|
2226
3356
|
base: "flex flex-col gap-[18px] px-pad-4xl py-[22px]"
|
|
2227
3357
|
});
|
|
2228
|
-
const toggleRow =
|
|
3358
|
+
const toggleRow = appShell.tv({
|
|
2229
3359
|
base: [
|
|
2230
3360
|
"flex items-center gap-gp-xl",
|
|
2231
3361
|
// 12px — sandbox
|
|
@@ -2241,7 +3371,7 @@ const toggleRow = chipGroup.tv({
|
|
|
2241
3371
|
}
|
|
2242
3372
|
}
|
|
2243
3373
|
});
|
|
2244
|
-
const toggleIcon =
|
|
3374
|
+
const toggleIcon = appShell.tv({
|
|
2245
3375
|
base: [
|
|
2246
3376
|
"shrink-0 grid place-items-center size-form-md rounded-radius-lg",
|
|
2247
3377
|
// 36×36 / radius-lg=10px
|
|
@@ -2255,16 +3385,16 @@ const toggleIcon = chipGroup.tv({
|
|
|
2255
3385
|
}
|
|
2256
3386
|
}
|
|
2257
3387
|
});
|
|
2258
|
-
const toggleText =
|
|
3388
|
+
const toggleText = appShell.tv({
|
|
2259
3389
|
base: "flex-1 min-w-0 flex flex-col gap-[3px]"
|
|
2260
3390
|
});
|
|
2261
|
-
const toggleLabel =
|
|
3391
|
+
const toggleLabel = appShell.tv({
|
|
2262
3392
|
base: "text-body-md font-semibold text-fg-default leading-[1.3]"
|
|
2263
3393
|
});
|
|
2264
|
-
const toggleDesc =
|
|
3394
|
+
const toggleDesc = appShell.tv({
|
|
2265
3395
|
base: "text-body-xs font-normal text-fg-muted leading-[1.45]"
|
|
2266
3396
|
});
|
|
2267
|
-
const foot =
|
|
3397
|
+
const foot = appShell.tv({
|
|
2268
3398
|
base: [
|
|
2269
3399
|
"flex items-center justify-end gap-gp-lg",
|
|
2270
3400
|
// 10px — sandbox
|
|
@@ -2324,7 +3454,7 @@ function AddViewModal({ open, onClose, onSubmit }) {
|
|
|
2324
3454
|
] }),
|
|
2325
3455
|
/* @__PURE__ */ jsxRuntime.jsxs("footer", { className: foot(), children: [
|
|
2326
3456
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2327
|
-
|
|
3457
|
+
appShell.Button,
|
|
2328
3458
|
{
|
|
2329
3459
|
color: "secondary",
|
|
2330
3460
|
variant: "outline",
|
|
@@ -2334,7 +3464,7 @@ function AddViewModal({ open, onClose, onSubmit }) {
|
|
|
2334
3464
|
}
|
|
2335
3465
|
),
|
|
2336
3466
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2337
|
-
|
|
3467
|
+
appShell.Button,
|
|
2338
3468
|
{
|
|
2339
3469
|
color: "primary",
|
|
2340
3470
|
variant: "filled",
|
|
@@ -2359,11 +3489,14 @@ function TableToolbarViews({
|
|
|
2359
3489
|
myOwnerKey = "me",
|
|
2360
3490
|
divider,
|
|
2361
3491
|
hideDivider,
|
|
2362
|
-
soloLabel = "Default"
|
|
3492
|
+
soloLabel = "Default",
|
|
3493
|
+
allowCreate = true
|
|
2363
3494
|
}) {
|
|
2364
3495
|
const maxCustomTabs = Math.max(0, maxTabs - 1);
|
|
2365
3496
|
const initialIds = React.useMemo(
|
|
2366
|
-
|
|
3497
|
+
// Só auto-pina views do próprio usuário (owner === myOwnerKey). As de outros
|
|
3498
|
+
// (públicas) só viram tab quando explicitamente aplicadas (via activeViewId).
|
|
3499
|
+
() => views.filter((v) => v.owner === myOwnerKey).slice(0, maxCustomTabs).map((v) => v.id),
|
|
2367
3500
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2368
3501
|
[]
|
|
2369
3502
|
);
|
|
@@ -2379,11 +3512,13 @@ function TableToolbarViews({
|
|
|
2379
3512
|
let next = prev.filter((id) => !removedIds.includes(id));
|
|
2380
3513
|
for (const id of addedIds) {
|
|
2381
3514
|
if (next.length >= maxCustomTabs) break;
|
|
3515
|
+
const v = views.find((vv) => vv.id === id);
|
|
3516
|
+
if (v && v.owner !== myOwnerKey) continue;
|
|
2382
3517
|
next = [...next, id];
|
|
2383
3518
|
}
|
|
2384
3519
|
return next;
|
|
2385
3520
|
});
|
|
2386
|
-
}, [views, maxCustomTabs]);
|
|
3521
|
+
}, [views, maxCustomTabs, myOwnerKey]);
|
|
2387
3522
|
const [addModalOpen, setAddModalOpen] = React.useState(false);
|
|
2388
3523
|
const [popoverOpen, setPopoverOpen] = React.useState(false);
|
|
2389
3524
|
const [confirmDeleteView, setConfirmDeleteView] = React.useState(null);
|
|
@@ -2392,7 +3527,10 @@ function TableToolbarViews({
|
|
|
2392
3527
|
const customTabs = renderIds.map((id) => views.find((v) => v.id === id)).filter((v) => !!v).map((v) => ({
|
|
2393
3528
|
id: v.id,
|
|
2394
3529
|
name: typeof v.name === "string" ? v.name : String(v.name),
|
|
2395
|
-
|
|
3530
|
+
// Mostra o "X" (desfixar/fechar) nas views do usuário E na view ATIVA no
|
|
3531
|
+
// momento — assim dá pra fechar uma view pública de outro que foi aplicada
|
|
3532
|
+
// (o X só desfixa/deseleciona; não deleta a view de ninguém).
|
|
3533
|
+
custom: v.owner === myOwnerKey || v.id === activeViewId
|
|
2396
3534
|
}));
|
|
2397
3535
|
const defaultName = customTabs.length === 0 ? soloLabel : "Default";
|
|
2398
3536
|
return [{ id: DEFAULT_VIEW_ID, name: defaultName, custom: false }, ...customTabs];
|
|
@@ -2445,7 +3583,7 @@ function TableToolbarViews({
|
|
|
2445
3583
|
ariaLabel: "Visões salvas"
|
|
2446
3584
|
}
|
|
2447
3585
|
),
|
|
2448
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3586
|
+
allowCreate && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2449
3587
|
ViewsPopover,
|
|
2450
3588
|
{
|
|
2451
3589
|
open: popoverOpen,
|
|
@@ -2459,7 +3597,7 @@ function TableToolbarViews({
|
|
|
2459
3597
|
onCreate: handleCreateClick
|
|
2460
3598
|
}
|
|
2461
3599
|
),
|
|
2462
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3600
|
+
allowCreate && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2463
3601
|
AddViewModal,
|
|
2464
3602
|
{
|
|
2465
3603
|
open: addModalOpen,
|
|
@@ -2605,165 +3743,33 @@ const SYMBOL_OP = {
|
|
|
2605
3743
|
};
|
|
2606
3744
|
const PHRASE_OP = {
|
|
2607
3745
|
contains: "contains",
|
|
2608
|
-
notContains: "not contains",
|
|
2609
|
-
startsWith: "starts with",
|
|
2610
|
-
endsWith: "ends with"
|
|
2611
|
-
};
|
|
2612
|
-
function quoteIfNeeded(v) {
|
|
2613
|
-
return /[\s",[\]]/.test(v) ? `"${v.replace(/"/g, '\\"')}"` : v;
|
|
2614
|
-
}
|
|
2615
|
-
function serializeList(value) {
|
|
2616
|
-
const arr = Array.isArray(value) ? value : value === "" ? [] : [value];
|
|
2617
|
-
return `[${arr.map((v) => quoteIfNeeded(String(v))).join(", ")}]`;
|
|
2618
|
-
}
|
|
2619
|
-
function entriesToSql(entries, logicOperator = "AND") {
|
|
2620
|
-
return entries.map((e) => {
|
|
2621
|
-
if (e.op === "isEmpty") return `${e.field} is empty`;
|
|
2622
|
-
if (e.op === "isNotEmpty") return `${e.field} is not empty`;
|
|
2623
|
-
if (e.op === "isAnyOf") return `${e.field} in ${serializeList(e.value)}`;
|
|
2624
|
-
if (e.op === "isNoneOf")
|
|
2625
|
-
return `${e.field} not in ${serializeList(e.value)}`;
|
|
2626
|
-
if (e.op === "between")
|
|
2627
|
-
return `${e.field} between ${serializeList(e.value)}`;
|
|
2628
|
-
const v = quoteIfNeeded(String(Array.isArray(e.value) ? e.value.join(",") : e.value));
|
|
2629
|
-
const sym = SYMBOL_OP[e.op];
|
|
2630
|
-
if (sym) return `${e.field} ${sym} ${v}`;
|
|
2631
|
-
const phrase = PHRASE_OP[e.op];
|
|
2632
|
-
return `${e.field} ${phrase ?? "contains"} ${v}`;
|
|
2633
|
-
}).join(` ${logicOperator} `);
|
|
2634
|
-
}
|
|
2635
|
-
const Select = SelectPrimitive__namespace.Root;
|
|
2636
|
-
const SelectValue = SelectPrimitive__namespace.Value;
|
|
2637
|
-
const SelectTrigger = React__namespace.forwardRef(({ className, children, state = "default", ...props }, ref2) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2638
|
-
SelectPrimitive__namespace.Trigger,
|
|
2639
|
-
{
|
|
2640
|
-
ref: ref2,
|
|
2641
|
-
className: chipGroup.cn(
|
|
2642
|
-
"flex min-h-form-lg w-full items-center justify-between gap-gp-md",
|
|
2643
|
-
"rounded-radius-lg px-pad-xl",
|
|
2644
|
-
"bg-bg-input dark:bg-bg-muted",
|
|
2645
|
-
"hover:bg-bg-input-hover dark:hover:bg-bg-muted-hover",
|
|
2646
|
-
"border border-border-input",
|
|
2647
|
-
"text-body-sm font-normal text-fg-default",
|
|
2648
|
-
"transition-[color,box-shadow,background-color,border-color] outline-none",
|
|
2649
|
-
"data-[placeholder]:text-fg-muted data-[placeholder]:opacity-70",
|
|
2650
|
-
state === "default" && "focus-visible:border-border-brand data-[state=open]:border-border-brand focus-visible:shadow-sh-ring data-[state=open]:shadow-sh-ring",
|
|
2651
|
-
state === "error" && "border-border-danger-muted focus-visible:border-border-danger-muted data-[state=open]:border-border-danger-muted focus-visible:shadow-sh-ring-danger data-[state=open]:shadow-sh-ring-danger",
|
|
2652
|
-
state === "warning" && "border-border-warning-muted focus-visible:border-border-warning-muted data-[state=open]:border-border-warning-muted focus-visible:shadow-sh-ring-warning data-[state=open]:shadow-sh-ring-warning",
|
|
2653
|
-
state === "success" && "border-border-success-muted focus-visible:border-border-success-muted data-[state=open]:border-border-success-muted focus-visible:shadow-sh-ring-success data-[state=open]:shadow-sh-ring-success",
|
|
2654
|
-
"disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-bg-input dark:disabled:hover:bg-bg-muted",
|
|
2655
|
-
"[&>span]:line-clamp-1",
|
|
2656
|
-
className
|
|
2657
|
-
),
|
|
2658
|
-
...props,
|
|
2659
|
-
children: [
|
|
2660
|
-
children,
|
|
2661
|
-
/* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Icon, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "size-4 text-fg-muted shrink-0" }) })
|
|
2662
|
-
]
|
|
2663
|
-
}
|
|
2664
|
-
));
|
|
2665
|
-
SelectTrigger.displayName = SelectPrimitive__namespace.Trigger.displayName;
|
|
2666
|
-
const SelectScrollUpButton = React__namespace.forwardRef(({ className, ...props }, ref2) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2667
|
-
SelectPrimitive__namespace.ScrollUpButton,
|
|
2668
|
-
{
|
|
2669
|
-
ref: ref2,
|
|
2670
|
-
className: chipGroup.cn(
|
|
2671
|
-
"flex cursor-default items-center justify-center py-pad-xs",
|
|
2672
|
-
className
|
|
2673
|
-
),
|
|
2674
|
-
...props,
|
|
2675
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronUp, { className: "h-4 w-4" })
|
|
2676
|
-
}
|
|
2677
|
-
));
|
|
2678
|
-
SelectScrollUpButton.displayName = SelectPrimitive__namespace.ScrollUpButton.displayName;
|
|
2679
|
-
const SelectScrollDownButton = React__namespace.forwardRef(({ className, ...props }, ref2) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2680
|
-
SelectPrimitive__namespace.ScrollDownButton,
|
|
2681
|
-
{
|
|
2682
|
-
ref: ref2,
|
|
2683
|
-
className: chipGroup.cn(
|
|
2684
|
-
"flex cursor-default items-center justify-center py-pad-xs",
|
|
2685
|
-
className
|
|
2686
|
-
),
|
|
2687
|
-
...props,
|
|
2688
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-4 w-4" })
|
|
2689
|
-
}
|
|
2690
|
-
));
|
|
2691
|
-
SelectScrollDownButton.displayName = SelectPrimitive__namespace.ScrollDownButton.displayName;
|
|
2692
|
-
const SelectContent = React__namespace.forwardRef(({ className, children, position: position2 = "popper", ...props }, ref2) => /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2693
|
-
SelectPrimitive__namespace.Content,
|
|
2694
|
-
{
|
|
2695
|
-
ref: ref2,
|
|
2696
|
-
className: chipGroup.cn(
|
|
2697
|
-
"relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden",
|
|
2698
|
-
"rounded-[12px] bg-bg-dropdown border border-border-default shadow-sh-lg outline-float",
|
|
2699
|
-
"before:pointer-events-none before:absolute before:inset-0 before:-z-10 before:rounded-[inherit] before:backdrop-blur-2xl before:backdrop-saturate-150",
|
|
2700
|
-
"text-fg-default",
|
|
2701
|
-
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
2702
|
-
"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
2703
|
-
"origin-[--radix-select-content-transform-origin]",
|
|
2704
|
-
position2 === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
2705
|
-
className
|
|
2706
|
-
),
|
|
2707
|
-
position: position2,
|
|
2708
|
-
...props,
|
|
2709
|
-
children: [
|
|
2710
|
-
/* @__PURE__ */ jsxRuntime.jsx(SelectScrollUpButton, {}),
|
|
2711
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2712
|
-
SelectPrimitive__namespace.Viewport,
|
|
2713
|
-
{
|
|
2714
|
-
className: chipGroup.cn(
|
|
2715
|
-
"p-pad-sm",
|
|
2716
|
-
position2 === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
2717
|
-
),
|
|
2718
|
-
children
|
|
2719
|
-
}
|
|
2720
|
-
),
|
|
2721
|
-
/* @__PURE__ */ jsxRuntime.jsx(SelectScrollDownButton, {})
|
|
2722
|
-
]
|
|
2723
|
-
}
|
|
2724
|
-
) }));
|
|
2725
|
-
SelectContent.displayName = SelectPrimitive__namespace.Content.displayName;
|
|
2726
|
-
const SelectLabel = React__namespace.forwardRef(({ className, ...props }, ref2) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2727
|
-
SelectPrimitive__namespace.Label,
|
|
2728
|
-
{
|
|
2729
|
-
ref: ref2,
|
|
2730
|
-
className: chipGroup.cn("py-pad-sm pl-8 pr-2 text-body-md font-medium text-fg-muted", className),
|
|
2731
|
-
...props
|
|
2732
|
-
}
|
|
2733
|
-
));
|
|
2734
|
-
SelectLabel.displayName = SelectPrimitive__namespace.Label.displayName;
|
|
2735
|
-
const SelectItem = React__namespace.forwardRef(({ className, children, ...props }, ref2) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2736
|
-
SelectPrimitive__namespace.Item,
|
|
2737
|
-
{
|
|
2738
|
-
ref: ref2,
|
|
2739
|
-
className: chipGroup.cn(
|
|
2740
|
-
"relative flex w-full cursor-default select-none items-center gap-pad-md",
|
|
2741
|
-
"rounded-radius-sm py-pad-md pl-8 pr-pad-lg",
|
|
2742
|
-
"text-body-sm font-medium text-fg-muted",
|
|
2743
|
-
"outline-none transition-colors",
|
|
2744
|
-
"focus:bg-bg-muted focus:text-fg-default",
|
|
2745
|
-
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
2746
|
-
"[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:text-fg-muted",
|
|
2747
|
-
"focus:[&_svg]:text-fg-default",
|
|
2748
|
-
className
|
|
2749
|
-
),
|
|
2750
|
-
...props,
|
|
2751
|
-
children: [
|
|
2752
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-4 w-4" }) }) }),
|
|
2753
|
-
/* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemText, { children })
|
|
2754
|
-
]
|
|
2755
|
-
}
|
|
2756
|
-
));
|
|
2757
|
-
SelectItem.displayName = SelectPrimitive__namespace.Item.displayName;
|
|
2758
|
-
const SelectSeparator = React__namespace.forwardRef(({ className, ...props }, ref2) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2759
|
-
SelectPrimitive__namespace.Separator,
|
|
2760
|
-
{
|
|
2761
|
-
ref: ref2,
|
|
2762
|
-
className: chipGroup.cn("-mx-1 my-1 h-px bg-border", className),
|
|
2763
|
-
...props
|
|
2764
|
-
}
|
|
2765
|
-
));
|
|
2766
|
-
SelectSeparator.displayName = SelectPrimitive__namespace.Separator.displayName;
|
|
3746
|
+
notContains: "not contains",
|
|
3747
|
+
startsWith: "starts with",
|
|
3748
|
+
endsWith: "ends with"
|
|
3749
|
+
};
|
|
3750
|
+
function quoteIfNeeded(v) {
|
|
3751
|
+
return /[\s",[\]]/.test(v) ? `"${v.replace(/"/g, '\\"')}"` : v;
|
|
3752
|
+
}
|
|
3753
|
+
function serializeList(value) {
|
|
3754
|
+
const arr = Array.isArray(value) ? value : value === "" ? [] : [value];
|
|
3755
|
+
return `[${arr.map((v) => quoteIfNeeded(String(v))).join(", ")}]`;
|
|
3756
|
+
}
|
|
3757
|
+
function entriesToSql(entries, logicOperator = "AND") {
|
|
3758
|
+
return entries.map((e) => {
|
|
3759
|
+
if (e.op === "isEmpty") return `${e.field} is empty`;
|
|
3760
|
+
if (e.op === "isNotEmpty") return `${e.field} is not empty`;
|
|
3761
|
+
if (e.op === "isAnyOf") return `${e.field} in ${serializeList(e.value)}`;
|
|
3762
|
+
if (e.op === "isNoneOf")
|
|
3763
|
+
return `${e.field} not in ${serializeList(e.value)}`;
|
|
3764
|
+
if (e.op === "between")
|
|
3765
|
+
return `${e.field} between ${serializeList(e.value)}`;
|
|
3766
|
+
const v = quoteIfNeeded(String(Array.isArray(e.value) ? e.value.join(",") : e.value));
|
|
3767
|
+
const sym = SYMBOL_OP[e.op];
|
|
3768
|
+
if (sym) return `${e.field} ${sym} ${v}`;
|
|
3769
|
+
const phrase = PHRASE_OP[e.op];
|
|
3770
|
+
return `${e.field} ${phrase ?? "contains"} ${v}`;
|
|
3771
|
+
}).join(` ${logicOperator} `);
|
|
3772
|
+
}
|
|
2767
3773
|
const DEFAULT_FILTER_OPERATORS = [
|
|
2768
3774
|
{ id: "equals", label: "é" },
|
|
2769
3775
|
{ id: "neq", label: "não é" },
|
|
@@ -2792,12 +3798,12 @@ function isFilterEntryActive(entry) {
|
|
|
2792
3798
|
}
|
|
2793
3799
|
return true;
|
|
2794
3800
|
}
|
|
2795
|
-
const FIELD_BASE =
|
|
3801
|
+
const FIELD_BASE = appShell.cn(
|
|
2796
3802
|
"min-h-form-md h-form-md min-w-0 w-full",
|
|
2797
3803
|
"rounded-radius-md",
|
|
2798
3804
|
"text-body-sm font-normal"
|
|
2799
3805
|
);
|
|
2800
|
-
const INPUT_FIELD =
|
|
3806
|
+
const INPUT_FIELD = appShell.cn(
|
|
2801
3807
|
FIELD_BASE,
|
|
2802
3808
|
"px-pad-xl",
|
|
2803
3809
|
"bg-bg-input dark:bg-bg-muted",
|
|
@@ -2838,7 +3844,7 @@ function FilterRowEditor({
|
|
|
2838
3844
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2839
3845
|
"div",
|
|
2840
3846
|
{
|
|
2841
|
-
className:
|
|
3847
|
+
className: appShell.cn(
|
|
2842
3848
|
// Mobile: vertical (1 select por linha). sm+: horizontal alinhado.
|
|
2843
3849
|
"flex flex-col sm:flex-row sm:items-center gap-gp-md"
|
|
2844
3850
|
),
|
|
@@ -2857,7 +3863,7 @@ function FilterRowEditor({
|
|
|
2857
3863
|
const nextOp = opValid2 ? filter.op : newOperators[0]?.id ?? filter.op;
|
|
2858
3864
|
onChange({ ...filter, columnKey: v, op: nextOp, value: "" });
|
|
2859
3865
|
},
|
|
2860
|
-
className:
|
|
3866
|
+
className: appShell.cn(FIELD_BASE, "px-pad-xl gap-gp-md"),
|
|
2861
3867
|
align: "start",
|
|
2862
3868
|
"aria-label": "Campo",
|
|
2863
3869
|
searchPlaceholder: "Buscar campo…",
|
|
@@ -2873,7 +3879,7 @@ function FilterRowEditor({
|
|
|
2873
3879
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2874
3880
|
SelectTrigger,
|
|
2875
3881
|
{
|
|
2876
|
-
className:
|
|
3882
|
+
className: appShell.cn(FIELD_BASE, "px-pad-xl gap-gp-md"),
|
|
2877
3883
|
"aria-label": "Operador",
|
|
2878
3884
|
children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, {})
|
|
2879
3885
|
}
|
|
@@ -2891,7 +3897,7 @@ function FilterRowEditor({
|
|
|
2891
3897
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2892
3898
|
SelectTrigger,
|
|
2893
3899
|
{
|
|
2894
|
-
className:
|
|
3900
|
+
className: appShell.cn(FIELD_BASE, "px-pad-xl gap-gp-md"),
|
|
2895
3901
|
"aria-label": "Valor",
|
|
2896
3902
|
children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, { placeholder: "Selecione…" })
|
|
2897
3903
|
}
|
|
@@ -2911,7 +3917,7 @@ function FilterRowEditor({
|
|
|
2911
3917
|
}
|
|
2912
3918
|
) }),
|
|
2913
3919
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2914
|
-
|
|
3920
|
+
appShell.Button,
|
|
2915
3921
|
{
|
|
2916
3922
|
color: "secondary",
|
|
2917
3923
|
variant: "ghost",
|
|
@@ -3044,7 +4050,7 @@ function FilterPanel({
|
|
|
3044
4050
|
role: "tab",
|
|
3045
4051
|
"aria-selected": mode === "visual",
|
|
3046
4052
|
onClick: () => setMode("visual"),
|
|
3047
|
-
className:
|
|
4053
|
+
className: appShell.cn(
|
|
3048
4054
|
"h-[30px] px-pad-lg rounded-radius-sm text-body-xs font-medium cursor-pointer outline-none focus-visible:shadow-sh-ring",
|
|
3049
4055
|
"transition-[background-color,color,box-shadow] duration-150",
|
|
3050
4056
|
mode === "visual" ? "bg-bg-accent text-fg-default font-semibold shadow-sh-sm" : "bg-transparent text-fg-muted hover:text-fg-default"
|
|
@@ -3059,7 +4065,7 @@ function FilterPanel({
|
|
|
3059
4065
|
role: "tab",
|
|
3060
4066
|
"aria-selected": mode === "advanced",
|
|
3061
4067
|
onClick: () => setMode("advanced"),
|
|
3062
|
-
className:
|
|
4068
|
+
className: appShell.cn(
|
|
3063
4069
|
"h-[30px] px-pad-lg rounded-radius-sm text-body-xs font-medium cursor-pointer outline-none focus-visible:shadow-sh-ring",
|
|
3064
4070
|
"transition-[background-color,color,box-shadow] duration-150",
|
|
3065
4071
|
mode === "advanced" ? "bg-bg-accent text-fg-default font-semibold shadow-sh-sm" : "bg-transparent text-fg-muted hover:text-fg-default"
|
|
@@ -3086,7 +4092,7 @@ function FilterPanel({
|
|
|
3086
4092
|
{
|
|
3087
4093
|
type: "button",
|
|
3088
4094
|
onClick: addRow,
|
|
3089
|
-
className:
|
|
4095
|
+
className: appShell.cn(
|
|
3090
4096
|
"inline-flex items-center gap-gp-sm h-form-md px-pad-2xl rounded-radius-lg",
|
|
3091
4097
|
"bg-bg-brand text-fg-on-brand",
|
|
3092
4098
|
"text-body-sm font-semibold cursor-pointer outline-none",
|
|
@@ -3104,7 +4110,7 @@ function FilterPanel({
|
|
|
3104
4110
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3105
4111
|
"div",
|
|
3106
4112
|
{
|
|
3107
|
-
className:
|
|
4113
|
+
className: appShell.cn(
|
|
3108
4114
|
"flex-1 min-h-0 overflow-y-auto",
|
|
3109
4115
|
"[scrollbar-width:thin] [scrollbar-color:var(--color-border-default)_transparent]",
|
|
3110
4116
|
"[&::-webkit-scrollbar]:w-[6px]",
|
|
@@ -3138,7 +4144,7 @@ function FilterPanel({
|
|
|
3138
4144
|
{
|
|
3139
4145
|
type: "button",
|
|
3140
4146
|
onClick: addRow,
|
|
3141
|
-
className:
|
|
4147
|
+
className: appShell.cn(
|
|
3142
4148
|
"flex items-center justify-center gap-gp-sm w-full",
|
|
3143
4149
|
"min-h-form-md px-pad-xl rounded-radius-md",
|
|
3144
4150
|
"bg-transparent text-fg-muted",
|
|
@@ -3186,25 +4192,25 @@ function FilterPanel({
|
|
|
3186
4192
|
placeholder: `-- Ex:
|
|
3187
4193
|
status = "active"
|
|
3188
4194
|
AND value > 1000`,
|
|
3189
|
-
className:
|
|
4195
|
+
className: appShell.cn(
|
|
3190
4196
|
"w-full px-pad-xl py-pad-md rounded-radius-md",
|
|
3191
4197
|
"bg-bg-input dark:bg-bg-muted",
|
|
3192
4198
|
"border",
|
|
3193
|
-
advancedError ? "border-border-
|
|
4199
|
+
advancedError ? "border-border-danger-muted" : "border-border-input",
|
|
3194
4200
|
"text-body-xs font-normal font-mono text-fg-default placeholder:text-fg-muted",
|
|
3195
4201
|
"outline-none resize-y",
|
|
3196
4202
|
"transition-[border-color,box-shadow] duration-150",
|
|
3197
|
-
advancedError ? "focus:border-border-
|
|
4203
|
+
advancedError ? "focus:border-border-danger-muted focus:shadow-sh-ring-danger" : "focus:border-border-brand focus:shadow-sh-ring"
|
|
3198
4204
|
)
|
|
3199
4205
|
}
|
|
3200
4206
|
),
|
|
3201
|
-
advancedError && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-caption-sm text-fg-
|
|
4207
|
+
advancedError && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-caption-sm text-fg-danger", children: advancedError }),
|
|
3202
4208
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3203
4209
|
"button",
|
|
3204
4210
|
{
|
|
3205
4211
|
type: "button",
|
|
3206
4212
|
onClick: applyAdvanced,
|
|
3207
|
-
className:
|
|
4213
|
+
className: appShell.cn(
|
|
3208
4214
|
"self-end px-pad-xl h-form-md rounded-radius-md",
|
|
3209
4215
|
"bg-bg-brand text-fg-on-brand",
|
|
3210
4216
|
"text-body-xs font-semibold",
|
|
@@ -3222,7 +4228,7 @@ AND value > 1000`,
|
|
|
3222
4228
|
type: "button",
|
|
3223
4229
|
onClick: clearAll,
|
|
3224
4230
|
disabled: filters.length === 0,
|
|
3225
|
-
className:
|
|
4231
|
+
className: appShell.cn(
|
|
3226
4232
|
"text-body-xs font-medium text-fg-brand bg-transparent border-0 p-0 cursor-pointer outline-none",
|
|
3227
4233
|
"hover:underline focus-visible:underline underline-offset-2",
|
|
3228
4234
|
"disabled:opacity-50 disabled:pointer-events-none disabled:no-underline"
|
|
@@ -3253,7 +4259,7 @@ function FilterPopover({
|
|
|
3253
4259
|
appShell.PopoverContent,
|
|
3254
4260
|
{
|
|
3255
4261
|
align,
|
|
3256
|
-
className:
|
|
4262
|
+
className: appShell.cn(
|
|
3257
4263
|
"w-[560px] max-w-[calc(100vw-32px)] max-h-[min(480px,calc(100vh-80px))] p-0 flex flex-col min-h-0 overflow-hidden",
|
|
3258
4264
|
className
|
|
3259
4265
|
),
|
|
@@ -3262,7 +4268,7 @@ function FilterPopover({
|
|
|
3262
4268
|
)
|
|
3263
4269
|
] });
|
|
3264
4270
|
}
|
|
3265
|
-
const MENU_ITEM =
|
|
4271
|
+
const MENU_ITEM = appShell.cn(
|
|
3266
4272
|
"group/row relative flex items-center gap-pad-lg w-full",
|
|
3267
4273
|
"px-pad-lg py-pad-md rounded-radius-sm",
|
|
3268
4274
|
"bg-transparent border-0 cursor-pointer outline-none text-left",
|
|
@@ -3341,7 +4347,7 @@ function ToolbarSettingsMenu({
|
|
|
3341
4347
|
mobileViews.onSelect(item.id);
|
|
3342
4348
|
onBack();
|
|
3343
4349
|
},
|
|
3344
|
-
className:
|
|
4350
|
+
className: appShell.cn(
|
|
3345
4351
|
MENU_ITEM,
|
|
3346
4352
|
isActive2 && "bg-bg-brand-subtle text-fg-brand [&_svg]:text-fg-brand hover:bg-bg-brand-subtle hover:text-fg-brand"
|
|
3347
4353
|
),
|
|
@@ -3364,7 +4370,7 @@ function ToolbarSettingsMenu({
|
|
|
3364
4370
|
appShell.PopoverContent,
|
|
3365
4371
|
{
|
|
3366
4372
|
align,
|
|
3367
|
-
className:
|
|
4373
|
+
className: appShell.cn(
|
|
3368
4374
|
"w-[320px] max-w-[calc(100vw-32px)] max-h-[min(520px,calc(100vh-80px))] p-0 flex flex-col min-h-0 overflow-hidden",
|
|
3369
4375
|
wide && "md:w-[550px]",
|
|
3370
4376
|
className
|
|
@@ -3383,7 +4389,7 @@ function ToolbarSettingsMenu({
|
|
|
3383
4389
|
{
|
|
3384
4390
|
type: "button",
|
|
3385
4391
|
onClick: () => setView(e.view),
|
|
3386
|
-
className:
|
|
4392
|
+
className: appShell.cn(MENU_ITEM, e.mobileOnly && "md:hidden"),
|
|
3387
4393
|
children: [
|
|
3388
4394
|
/* @__PURE__ */ jsxRuntime.jsx(Icon, { strokeWidth: 1.8 }),
|
|
3389
4395
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 truncate", children: e.label }),
|
|
@@ -3396,17 +4402,17 @@ function ToolbarSettingsMenu({
|
|
|
3396
4402
|
}),
|
|
3397
4403
|
mobileViewToggle && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "md:hidden flex flex-col", children: [
|
|
3398
4404
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: MENU_SEP }),
|
|
3399
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
4405
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: appShell.cn(MENU_LABEL, "pb-pad-lg"), children: viewToggleLabel }),
|
|
3400
4406
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: MENU_FIELD, children: mobileViewToggle })
|
|
3401
4407
|
] }),
|
|
3402
4408
|
mobileDisplayToggle && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "md:hidden flex flex-col", children: [
|
|
3403
4409
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: MENU_SEP }),
|
|
3404
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
4410
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: appShell.cn(MENU_LABEL, "pb-pad-lg"), children: mobileDisplayLabel }),
|
|
3405
4411
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: MENU_FIELD, children: mobileDisplayToggle })
|
|
3406
4412
|
] }),
|
|
3407
4413
|
density && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
|
|
3408
4414
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: MENU_SEP }),
|
|
3409
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
4415
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: appShell.cn(MENU_LABEL, "pb-pad-lg"), children: densityLabel }),
|
|
3410
4416
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: MENU_FIELD, children: density })
|
|
3411
4417
|
] })
|
|
3412
4418
|
] })
|
|
@@ -3415,7 +4421,7 @@ function ToolbarSettingsMenu({
|
|
|
3415
4421
|
)
|
|
3416
4422
|
] });
|
|
3417
4423
|
}
|
|
3418
|
-
const floatingPanelStyles =
|
|
4424
|
+
const floatingPanelStyles = appShell.tv({
|
|
3419
4425
|
slots: {
|
|
3420
4426
|
root: [
|
|
3421
4427
|
"fixed z-50 flex flex-col overflow-hidden",
|
|
@@ -3642,390 +4648,125 @@ function FloatingPanel({
|
|
|
3642
4648
|
"aria-labelledby": title2 ? titleId : void 0,
|
|
3643
4649
|
"aria-describedby": description ? descId : void 0,
|
|
3644
4650
|
style: maximized ? void 0 : { width: widthValue },
|
|
3645
|
-
className:
|
|
3646
|
-
children: [
|
|
3647
|
-
resizable && !maximized && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3648
|
-
"button",
|
|
3649
|
-
{
|
|
3650
|
-
ref: handleRef,
|
|
3651
|
-
type: "button",
|
|
3652
|
-
"aria-label": "Redimensionar panel",
|
|
3653
|
-
"data-dragging": dragging || void 0,
|
|
3654
|
-
onMouseDown: (e) => {
|
|
3655
|
-
setDragging(true);
|
|
3656
|
-
resize.onResizeStart(e);
|
|
3657
|
-
},
|
|
3658
|
-
className: s.handle()
|
|
3659
|
-
}
|
|
3660
|
-
),
|
|
3661
|
-
(title2 || description || titleSlot || headerActions || !hideClose || maximizable) && /* @__PURE__ */ jsxRuntime.jsxs("header", { className: s.header(), children: [
|
|
3662
|
-
titleSlot ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 min-w-0", children: titleSlot }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: s.headerText(), children: [
|
|
3663
|
-
title2 && /* @__PURE__ */ jsxRuntime.jsxs("h2", { id: titleId, className: s.headerTitle(), children: [
|
|
3664
|
-
TitleIcon && /* @__PURE__ */ jsxRuntime.jsx(TitleIcon, { className: s.headerTitleIcon(), strokeWidth: 1.8 }),
|
|
3665
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: title2 })
|
|
3666
|
-
] }),
|
|
3667
|
-
description && /* @__PURE__ */ jsxRuntime.jsx("p", { id: descId, className: s.headerDescription(), children: description })
|
|
3668
|
-
] }),
|
|
3669
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: s.headerActions(), children: [
|
|
3670
|
-
headerActions,
|
|
3671
|
-
maximizable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3672
|
-
chipGroup.Button,
|
|
3673
|
-
{
|
|
3674
|
-
type: "button",
|
|
3675
|
-
variant: "soft",
|
|
3676
|
-
color: "secondary",
|
|
3677
|
-
size: "icon-sm",
|
|
3678
|
-
"aria-label": maximized ? "Restaurar tamanho" : "Maximizar",
|
|
3679
|
-
onClick: () => setMaximized((m) => !m),
|
|
3680
|
-
className: "max-md:hidden",
|
|
3681
|
-
children: maximized ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Minimize2, {}) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Maximize2, {})
|
|
3682
|
-
}
|
|
3683
|
-
),
|
|
3684
|
-
!hideClose && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3685
|
-
chipGroup.Button,
|
|
3686
|
-
{
|
|
3687
|
-
type: "button",
|
|
3688
|
-
variant: "soft",
|
|
3689
|
-
color: "secondary",
|
|
3690
|
-
size: "icon-sm",
|
|
3691
|
-
"aria-label": "Fechar",
|
|
3692
|
-
onClick: () => onOpenChange(false),
|
|
3693
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, {})
|
|
3694
|
-
}
|
|
3695
|
-
)
|
|
3696
|
-
] })
|
|
3697
|
-
] }),
|
|
3698
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: s.body(), children }),
|
|
3699
|
-
footer && /* @__PURE__ */ jsxRuntime.jsx("footer", { className: s.footer(), children: footer })
|
|
3700
|
-
]
|
|
3701
|
-
}
|
|
3702
|
-
)
|
|
3703
|
-
] }),
|
|
3704
|
-
document.body
|
|
3705
|
-
);
|
|
3706
|
-
}
|
|
3707
|
-
const partStyles = chipGroup.tv({
|
|
3708
|
-
slots: {
|
|
3709
|
-
section: "border-b border-border-default last:border-b-0",
|
|
3710
|
-
head: [
|
|
3711
|
-
"flex items-center justify-between w-full",
|
|
3712
|
-
"px-[18px] py-[14px]",
|
|
3713
|
-
"bg-transparent border-0 cursor-pointer text-left",
|
|
3714
|
-
"text-body-sm font-semibold text-fg-default",
|
|
3715
|
-
"transition-colors duration-150",
|
|
3716
|
-
"hover:bg-bg-muted focus-visible:outline-none focus-visible:bg-bg-muted"
|
|
3717
|
-
],
|
|
3718
|
-
headStatic: "px-[18px] pt-pad-xl pb-pad-md text-body-sm font-semibold text-fg-default",
|
|
3719
|
-
chev: "size-[14px] text-fg-muted transition-transform duration-200 shrink-0",
|
|
3720
|
-
body: "flex flex-col gap-gp-md px-[18px] pb-pad-2xl",
|
|
3721
|
-
field: "flex items-baseline justify-between gap-gp-md text-body-sm",
|
|
3722
|
-
fieldLabel: "text-body-xs font-normal text-fg-muted shrink-0",
|
|
3723
|
-
fieldValue: "text-fg-default font-medium text-right break-words min-w-0"
|
|
3724
|
-
}
|
|
3725
|
-
});
|
|
3726
|
-
function FloatingPanelSection({
|
|
3727
|
-
title: title2,
|
|
3728
|
-
children,
|
|
3729
|
-
collapsible = true,
|
|
3730
|
-
defaultOpen = true
|
|
3731
|
-
}) {
|
|
3732
|
-
const s = partStyles();
|
|
3733
|
-
const [open, setOpen] = React.useState(defaultOpen);
|
|
3734
|
-
if (!collapsible) {
|
|
3735
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: s.section(), children: [
|
|
3736
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: s.headStatic(), children: title2 }),
|
|
3737
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: s.body(), children })
|
|
3738
|
-
] });
|
|
3739
|
-
}
|
|
3740
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: s.section(), children: [
|
|
3741
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3742
|
-
"button",
|
|
3743
|
-
{
|
|
3744
|
-
type: "button",
|
|
3745
|
-
className: s.head(),
|
|
3746
|
-
onClick: () => setOpen((o) => !o),
|
|
3747
|
-
"aria-expanded": open,
|
|
3748
|
-
children: [
|
|
3749
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: title2 }),
|
|
3750
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: chipGroup.cn(s.chev(), open && "rotate-180") })
|
|
3751
|
-
]
|
|
3752
|
-
}
|
|
3753
|
-
),
|
|
3754
|
-
open && /* @__PURE__ */ jsxRuntime.jsx("div", { className: s.body(), children })
|
|
3755
|
-
] });
|
|
3756
|
-
}
|
|
3757
|
-
function FloatingPanelField({ label, value }) {
|
|
3758
|
-
const s = partStyles();
|
|
3759
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: s.field(), children: [
|
|
3760
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: s.fieldLabel(), children: label }),
|
|
3761
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: s.fieldValue(), children: value || "—" })
|
|
3762
|
-
] });
|
|
3763
|
-
}
|
|
3764
|
-
const textareaVariants = classVarianceAuthority.cva(
|
|
3765
|
-
[
|
|
3766
|
-
"flex min-h-[100px] w-full resize-y",
|
|
3767
|
-
"bg-bg-input dark:bg-bg-muted",
|
|
3768
|
-
"hover:bg-bg-input-hover dark:hover:bg-bg-muted-hover",
|
|
3769
|
-
"border border-border-input rounded-radius-lg",
|
|
3770
|
-
"px-pad-xl py-pad-lg",
|
|
3771
|
-
"text-body-sm font-normal leading-[1.5] text-fg-default",
|
|
3772
|
-
"placeholder:text-fg-muted placeholder:opacity-70",
|
|
3773
|
-
"transition-[color,box-shadow,background-color,border-color] outline-none",
|
|
3774
|
-
"disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-bg-input dark:disabled:hover:bg-bg-muted"
|
|
3775
|
-
],
|
|
3776
|
-
{
|
|
3777
|
-
variants: {
|
|
3778
|
-
state: {
|
|
3779
|
-
default: "focus-visible:border-border-brand focus-visible:shadow-sh-ring",
|
|
3780
|
-
error: "border-border-danger-muted focus-visible:border-border-danger-muted focus-visible:shadow-sh-ring-danger",
|
|
3781
|
-
warning: "border-border-warning-muted focus-visible:border-border-warning-muted focus-visible:shadow-sh-ring-warning",
|
|
3782
|
-
success: "border-border-success-muted focus-visible:border-border-success-muted focus-visible:shadow-sh-ring-success"
|
|
3783
|
-
}
|
|
3784
|
-
},
|
|
3785
|
-
defaultVariants: {
|
|
3786
|
-
state: "default"
|
|
3787
|
-
}
|
|
3788
|
-
}
|
|
3789
|
-
);
|
|
3790
|
-
const Textarea = React__namespace.forwardRef(
|
|
3791
|
-
({ className, state, ...props }, ref2) => {
|
|
3792
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3793
|
-
"textarea",
|
|
3794
|
-
{
|
|
3795
|
-
className: chipGroup.cn(textareaVariants({ state }), className),
|
|
3796
|
-
ref: ref2,
|
|
3797
|
-
...props
|
|
3798
|
-
}
|
|
3799
|
-
);
|
|
3800
|
-
}
|
|
3801
|
-
);
|
|
3802
|
-
Textarea.displayName = "Textarea";
|
|
3803
|
-
const FormFieldTextarea = React.forwardRef(
|
|
3804
|
-
({
|
|
3805
|
-
label,
|
|
3806
|
-
required: required2,
|
|
3807
|
-
helperText,
|
|
3808
|
-
state,
|
|
3809
|
-
errorMessage,
|
|
3810
|
-
warningMessage,
|
|
3811
|
-
successMessage,
|
|
3812
|
-
className,
|
|
3813
|
-
id,
|
|
3814
|
-
...textareaProps
|
|
3815
|
-
}, ref2) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3816
|
-
FormField,
|
|
3817
|
-
{
|
|
3818
|
-
label,
|
|
3819
|
-
required: required2,
|
|
3820
|
-
helperText,
|
|
3821
|
-
state,
|
|
3822
|
-
errorMessage,
|
|
3823
|
-
warningMessage,
|
|
3824
|
-
successMessage,
|
|
3825
|
-
className,
|
|
3826
|
-
id,
|
|
3827
|
-
disabled: textareaProps.disabled,
|
|
3828
|
-
children: ({ id: fieldId, state: fieldState }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3829
|
-
Textarea,
|
|
3830
|
-
{
|
|
3831
|
-
ref: ref2,
|
|
3832
|
-
id: fieldId,
|
|
3833
|
-
state: fieldState,
|
|
3834
|
-
...textareaProps
|
|
3835
|
-
}
|
|
3836
|
-
)
|
|
3837
|
-
}
|
|
3838
|
-
)
|
|
3839
|
-
);
|
|
3840
|
-
FormFieldTextarea.displayName = "FormFieldTextarea";
|
|
3841
|
-
function FormFieldSelect({
|
|
3842
|
-
label,
|
|
3843
|
-
required: required2,
|
|
3844
|
-
helperText,
|
|
3845
|
-
state,
|
|
3846
|
-
errorMessage,
|
|
3847
|
-
warningMessage,
|
|
3848
|
-
successMessage,
|
|
3849
|
-
className,
|
|
3850
|
-
id,
|
|
3851
|
-
options,
|
|
3852
|
-
placeholder: placeholder2,
|
|
3853
|
-
value,
|
|
3854
|
-
defaultValue,
|
|
3855
|
-
onValueChange,
|
|
3856
|
-
disabled,
|
|
3857
|
-
triggerClassName,
|
|
3858
|
-
contentClassName
|
|
3859
|
-
}) {
|
|
3860
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3861
|
-
FormField,
|
|
3862
|
-
{
|
|
3863
|
-
label,
|
|
3864
|
-
required: required2,
|
|
3865
|
-
helperText,
|
|
3866
|
-
state,
|
|
3867
|
-
errorMessage,
|
|
3868
|
-
warningMessage,
|
|
3869
|
-
successMessage,
|
|
3870
|
-
className,
|
|
3871
|
-
id,
|
|
3872
|
-
disabled,
|
|
3873
|
-
children: ({ id: fieldId, state: fieldState }) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3874
|
-
Select,
|
|
3875
|
-
{
|
|
3876
|
-
value,
|
|
3877
|
-
defaultValue,
|
|
3878
|
-
onValueChange,
|
|
3879
|
-
disabled,
|
|
4651
|
+
className: appShell.cn(s.root(), className),
|
|
3880
4652
|
children: [
|
|
3881
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3882
|
-
|
|
4653
|
+
resizable && !maximized && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4654
|
+
"button",
|
|
3883
4655
|
{
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
4656
|
+
ref: handleRef,
|
|
4657
|
+
type: "button",
|
|
4658
|
+
"aria-label": "Redimensionar panel",
|
|
4659
|
+
"data-dragging": dragging || void 0,
|
|
4660
|
+
onMouseDown: (e) => {
|
|
4661
|
+
setDragging(true);
|
|
4662
|
+
resize.onResizeStart(e);
|
|
4663
|
+
},
|
|
4664
|
+
className: s.handle()
|
|
3888
4665
|
}
|
|
3889
4666
|
),
|
|
3890
|
-
/* @__PURE__ */ jsxRuntime.
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
4667
|
+
(title2 || description || titleSlot || headerActions || !hideClose || maximizable) && /* @__PURE__ */ jsxRuntime.jsxs("header", { className: s.header(), children: [
|
|
4668
|
+
titleSlot ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 min-w-0", children: titleSlot }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: s.headerText(), children: [
|
|
4669
|
+
title2 && /* @__PURE__ */ jsxRuntime.jsxs("h2", { id: titleId, className: s.headerTitle(), children: [
|
|
4670
|
+
TitleIcon && /* @__PURE__ */ jsxRuntime.jsx(TitleIcon, { className: s.headerTitleIcon(), strokeWidth: 1.8 }),
|
|
4671
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: title2 })
|
|
4672
|
+
] }),
|
|
4673
|
+
description && /* @__PURE__ */ jsxRuntime.jsx("p", { id: descId, className: s.headerDescription(), children: description })
|
|
4674
|
+
] }),
|
|
4675
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: s.headerActions(), children: [
|
|
4676
|
+
headerActions,
|
|
4677
|
+
maximizable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4678
|
+
appShell.Button,
|
|
4679
|
+
{
|
|
4680
|
+
type: "button",
|
|
4681
|
+
variant: "soft",
|
|
4682
|
+
color: "secondary",
|
|
4683
|
+
size: "icon-sm",
|
|
4684
|
+
"aria-label": maximized ? "Restaurar tamanho" : "Maximizar",
|
|
4685
|
+
onClick: () => setMaximized((m) => !m),
|
|
4686
|
+
className: "max-md:hidden",
|
|
4687
|
+
children: maximized ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Minimize2, {}) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Maximize2, {})
|
|
4688
|
+
}
|
|
4689
|
+
),
|
|
4690
|
+
!hideClose && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4691
|
+
appShell.Button,
|
|
4692
|
+
{
|
|
4693
|
+
type: "button",
|
|
4694
|
+
variant: "soft",
|
|
4695
|
+
color: "secondary",
|
|
4696
|
+
size: "icon-sm",
|
|
4697
|
+
"aria-label": "Fechar",
|
|
4698
|
+
onClick: () => onOpenChange(false),
|
|
4699
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, {})
|
|
4700
|
+
}
|
|
4701
|
+
)
|
|
4702
|
+
] })
|
|
4703
|
+
] }),
|
|
4704
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: s.body(), children }),
|
|
4705
|
+
footer && /* @__PURE__ */ jsxRuntime.jsx("footer", { className: s.footer(), children: footer })
|
|
3899
4706
|
]
|
|
3900
4707
|
}
|
|
3901
4708
|
)
|
|
3902
|
-
}
|
|
4709
|
+
] }),
|
|
4710
|
+
document.body
|
|
3903
4711
|
);
|
|
3904
4712
|
}
|
|
3905
|
-
const
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("
|
|
3934
|
-
/* @__PURE__ */ jsxRuntime.
|
|
3935
|
-
|
|
3936
|
-
badge.Checkbox,
|
|
3937
|
-
{
|
|
3938
|
-
ref: ref2,
|
|
3939
|
-
id,
|
|
3940
|
-
disabled,
|
|
3941
|
-
...checkboxProps
|
|
3942
|
-
}
|
|
3943
|
-
),
|
|
3944
|
-
label && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3945
|
-
"label",
|
|
3946
|
-
{
|
|
3947
|
-
htmlFor: id,
|
|
3948
|
-
className: chipGroup.cn(formFieldLabel({ disabled }), "cursor-pointer"),
|
|
3949
|
-
children: [
|
|
3950
|
-
label,
|
|
3951
|
-
required2 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: formFieldRequired(), "aria-hidden": "true", children: "*" })
|
|
3952
|
-
]
|
|
3953
|
-
}
|
|
3954
|
-
)
|
|
3955
|
-
] }),
|
|
3956
|
-
message && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3957
|
-
"p",
|
|
3958
|
-
{
|
|
3959
|
-
className: chipGroup.cn(formFieldMessage({ state: messageState }), "pl-[26px]"),
|
|
3960
|
-
role: messageState === "error" ? "alert" : void 0,
|
|
3961
|
-
children: message
|
|
3962
|
-
}
|
|
3963
|
-
)
|
|
4713
|
+
const partStyles = appShell.tv({
|
|
4714
|
+
slots: {
|
|
4715
|
+
section: "border-b border-border-default last:border-b-0",
|
|
4716
|
+
head: [
|
|
4717
|
+
"flex items-center justify-between w-full",
|
|
4718
|
+
"px-[18px] py-[14px]",
|
|
4719
|
+
"bg-transparent border-0 cursor-pointer text-left",
|
|
4720
|
+
"text-body-sm font-semibold text-fg-default",
|
|
4721
|
+
"transition-colors duration-150",
|
|
4722
|
+
"hover:bg-bg-muted focus-visible:outline-none focus-visible:bg-bg-muted"
|
|
4723
|
+
],
|
|
4724
|
+
headStatic: "px-[18px] pt-pad-xl pb-pad-md text-body-sm font-semibold text-fg-default",
|
|
4725
|
+
chev: "size-[14px] text-fg-muted transition-transform duration-200 shrink-0",
|
|
4726
|
+
body: "flex flex-col gap-gp-md px-[18px] pb-pad-2xl",
|
|
4727
|
+
field: "flex items-baseline justify-between gap-gp-md text-body-sm",
|
|
4728
|
+
fieldLabel: "text-body-xs font-normal text-fg-muted shrink-0",
|
|
4729
|
+
fieldValue: "text-fg-default font-medium text-right break-words min-w-0"
|
|
4730
|
+
}
|
|
4731
|
+
});
|
|
4732
|
+
function FloatingPanelSection({
|
|
4733
|
+
title: title2,
|
|
4734
|
+
children,
|
|
4735
|
+
collapsible = true,
|
|
4736
|
+
defaultOpen = true
|
|
4737
|
+
}) {
|
|
4738
|
+
const s = partStyles();
|
|
4739
|
+
const [open, setOpen] = React.useState(defaultOpen);
|
|
4740
|
+
if (!collapsible) {
|
|
4741
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: s.section(), children: [
|
|
4742
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: s.headStatic(), children: title2 }),
|
|
4743
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: s.body(), children })
|
|
3964
4744
|
] });
|
|
3965
4745
|
}
|
|
3966
|
-
)
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
({
|
|
3970
|
-
label,
|
|
3971
|
-
required: required2,
|
|
3972
|
-
helperText,
|
|
3973
|
-
state = "default",
|
|
3974
|
-
errorMessage,
|
|
3975
|
-
warningMessage,
|
|
3976
|
-
successMessage,
|
|
3977
|
-
className,
|
|
3978
|
-
id: idProp,
|
|
3979
|
-
disabled,
|
|
3980
|
-
switchPosition = "end",
|
|
3981
|
-
...switchProps
|
|
3982
|
-
}, ref2) => {
|
|
3983
|
-
const autoId = React.useId();
|
|
3984
|
-
const id = idProp ?? autoId;
|
|
3985
|
-
let message = helperText;
|
|
3986
|
-
let messageState = "default";
|
|
3987
|
-
if (state === "error" && errorMessage) {
|
|
3988
|
-
message = errorMessage;
|
|
3989
|
-
messageState = "error";
|
|
3990
|
-
} else if (state === "warning" && warningMessage) {
|
|
3991
|
-
message = warningMessage;
|
|
3992
|
-
messageState = "warning";
|
|
3993
|
-
} else if (state === "success" && successMessage) {
|
|
3994
|
-
message = successMessage;
|
|
3995
|
-
messageState = "success";
|
|
3996
|
-
}
|
|
3997
|
-
const switchEl = /* @__PURE__ */ jsxRuntime.jsx(Switch, { ref: ref2, id, disabled, ...switchProps });
|
|
3998
|
-
const labelEl = label && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3999
|
-
"label",
|
|
4746
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: s.section(), children: [
|
|
4747
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4748
|
+
"button",
|
|
4000
4749
|
{
|
|
4001
|
-
|
|
4002
|
-
className:
|
|
4750
|
+
type: "button",
|
|
4751
|
+
className: s.head(),
|
|
4752
|
+
onClick: () => setOpen((o) => !o),
|
|
4753
|
+
"aria-expanded": open,
|
|
4003
4754
|
children: [
|
|
4004
|
-
|
|
4005
|
-
|
|
4755
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: title2 }),
|
|
4756
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: appShell.cn(s.chev(), open && "rotate-180") })
|
|
4006
4757
|
]
|
|
4007
4758
|
}
|
|
4008
|
-
)
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
{
|
|
4020
|
-
className: formFieldMessage({ state: messageState }),
|
|
4021
|
-
role: messageState === "error" ? "alert" : void 0,
|
|
4022
|
-
children: message
|
|
4023
|
-
}
|
|
4024
|
-
)
|
|
4025
|
-
] });
|
|
4026
|
-
}
|
|
4027
|
-
);
|
|
4028
|
-
FormFieldSwitch.displayName = "FormFieldSwitch";
|
|
4759
|
+
),
|
|
4760
|
+
open && /* @__PURE__ */ jsxRuntime.jsx("div", { className: s.body(), children })
|
|
4761
|
+
] });
|
|
4762
|
+
}
|
|
4763
|
+
function FloatingPanelField({ label, value }) {
|
|
4764
|
+
const s = partStyles();
|
|
4765
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: s.field(), children: [
|
|
4766
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: s.fieldLabel(), children: label }),
|
|
4767
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: s.fieldValue(), children: value || "—" })
|
|
4768
|
+
] });
|
|
4769
|
+
}
|
|
4029
4770
|
class ColumnTypeRegistry {
|
|
4030
4771
|
constructor() {
|
|
4031
4772
|
__publicField(this, "types", /* @__PURE__ */ new Map());
|
|
@@ -4061,7 +4802,7 @@ class ColumnTypeRegistry {
|
|
|
4061
4802
|
}
|
|
4062
4803
|
}
|
|
4063
4804
|
const columnTypeRegistry = new ColumnTypeRegistry();
|
|
4064
|
-
const FILTER_FIELD_CLASS =
|
|
4805
|
+
const FILTER_FIELD_CLASS = appShell.cn(
|
|
4065
4806
|
// Box-model
|
|
4066
4807
|
"flex min-h-form-md h-form-md w-full items-center justify-between gap-gp-md",
|
|
4067
4808
|
"rounded-radius-md px-pad-xl",
|
|
@@ -4075,7 +4816,7 @@ const FILTER_FIELD_CLASS = chipGroup.cn(
|
|
|
4075
4816
|
"focus-visible:border-border-brand focus-visible:shadow-sh-ring",
|
|
4076
4817
|
"data-[state=open]:border-border-brand data-[state=open]:shadow-sh-ring"
|
|
4077
4818
|
);
|
|
4078
|
-
const FILTER_FIELD_SIZE =
|
|
4819
|
+
const FILTER_FIELD_SIZE = appShell.cn(
|
|
4079
4820
|
"min-h-form-md h-form-md rounded-radius-md"
|
|
4080
4821
|
);
|
|
4081
4822
|
function FastSingleSelectList({
|
|
@@ -4094,7 +4835,7 @@ function FastSingleSelectList({
|
|
|
4094
4835
|
role: "option",
|
|
4095
4836
|
"aria-selected": isSel,
|
|
4096
4837
|
onClick: () => onSelect(opt.value),
|
|
4097
|
-
className:
|
|
4838
|
+
className: appShell.cn(
|
|
4098
4839
|
"flex items-center gap-gp-md w-full px-pad-md py-pad-sm rounded-radius-md",
|
|
4099
4840
|
"text-body-md text-fg-default text-left cursor-pointer",
|
|
4100
4841
|
"hover:bg-bg-muted focus-visible:bg-bg-muted focus-visible:outline-none",
|
|
@@ -4104,7 +4845,7 @@ function FastSingleSelectList({
|
|
|
4104
4845
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4105
4846
|
lucideReact.Check,
|
|
4106
4847
|
{
|
|
4107
|
-
className:
|
|
4848
|
+
className: appShell.cn(
|
|
4108
4849
|
"size-icon-sm shrink-0 text-fg-brand",
|
|
4109
4850
|
isSel ? "opacity-100" : "opacity-0"
|
|
4110
4851
|
),
|
|
@@ -4312,73 +5053,73 @@ function Calendar({
|
|
|
4312
5053
|
reactDayPicker.DayPicker,
|
|
4313
5054
|
{
|
|
4314
5055
|
showOutsideDays,
|
|
4315
|
-
className:
|
|
5056
|
+
className: appShell.cn(
|
|
4316
5057
|
"group/calendar bg-transparent p-0 [--cell-size:2.5rem]",
|
|
4317
5058
|
className
|
|
4318
5059
|
),
|
|
4319
5060
|
captionLayout,
|
|
4320
5061
|
classNames: {
|
|
4321
|
-
root:
|
|
4322
|
-
months:
|
|
4323
|
-
month:
|
|
4324
|
-
nav:
|
|
5062
|
+
root: appShell.cn("w-full", defaultClassNames.root),
|
|
5063
|
+
months: appShell.cn("relative flex flex-col gap-gp-2xl sm:flex-row sm:gap-gp-4xl", defaultClassNames.months),
|
|
5064
|
+
month: appShell.cn("flex w-full flex-col gap-gp-2xl", defaultClassNames.month),
|
|
5065
|
+
nav: appShell.cn(
|
|
4325
5066
|
"absolute inset-x-0 top-0 flex w-full items-center justify-between",
|
|
4326
5067
|
defaultClassNames.nav
|
|
4327
5068
|
),
|
|
4328
|
-
button_previous:
|
|
5069
|
+
button_previous: appShell.cn(
|
|
4329
5070
|
"inline-flex items-center justify-center size-[--cell-size] rounded-full text-fg-muted hover:bg-bg-muted transition-colors select-none aria-disabled:opacity-30",
|
|
4330
5071
|
defaultClassNames.button_previous
|
|
4331
5072
|
),
|
|
4332
|
-
button_next:
|
|
5073
|
+
button_next: appShell.cn(
|
|
4333
5074
|
"inline-flex items-center justify-center size-[--cell-size] rounded-full text-fg-muted hover:bg-bg-muted transition-colors select-none aria-disabled:opacity-30",
|
|
4334
5075
|
defaultClassNames.button_next
|
|
4335
5076
|
),
|
|
4336
|
-
month_caption:
|
|
5077
|
+
month_caption: appShell.cn(
|
|
4337
5078
|
"flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",
|
|
4338
5079
|
defaultClassNames.month_caption
|
|
4339
5080
|
),
|
|
4340
|
-
caption_label:
|
|
5081
|
+
caption_label: appShell.cn(
|
|
4341
5082
|
"text-body-md font-medium font-semibold select-none",
|
|
4342
5083
|
captionLayout === "dropdown" ? "hidden" : "",
|
|
4343
5084
|
defaultClassNames.caption_label
|
|
4344
5085
|
),
|
|
4345
|
-
dropdowns:
|
|
5086
|
+
dropdowns: appShell.cn(
|
|
4346
5087
|
"flex items-center gap-gp-md",
|
|
4347
5088
|
defaultClassNames.dropdowns
|
|
4348
5089
|
),
|
|
4349
|
-
dropdown:
|
|
5090
|
+
dropdown: appShell.cn(
|
|
4350
5091
|
"cursor-pointer appearance-none bg-transparent text-body-md font-medium font-semibold text-fg-default outline-none",
|
|
4351
5092
|
defaultClassNames.dropdown
|
|
4352
5093
|
),
|
|
4353
|
-
months_dropdown:
|
|
4354
|
-
years_dropdown:
|
|
5094
|
+
months_dropdown: appShell.cn("", defaultClassNames.months_dropdown),
|
|
5095
|
+
years_dropdown: appShell.cn("", defaultClassNames.years_dropdown),
|
|
4355
5096
|
table: "w-full border-collapse",
|
|
4356
|
-
weekdays:
|
|
4357
|
-
weekday:
|
|
5097
|
+
weekdays: appShell.cn("flex", defaultClassNames.weekdays),
|
|
5098
|
+
weekday: appShell.cn(
|
|
4358
5099
|
"flex-1 min-w-8 max-w-12 text-body-sm font-normal text-fg-muted select-none text-center",
|
|
4359
5100
|
defaultClassNames.weekday
|
|
4360
5101
|
),
|
|
4361
|
-
week:
|
|
4362
|
-
day:
|
|
5102
|
+
week: appShell.cn("mt-gp-md flex w-full", defaultClassNames.week),
|
|
5103
|
+
day: appShell.cn(
|
|
4363
5104
|
// flex-1: cada dia ocupa 1/7 igual ao header de weekdays (que usa flex-1).
|
|
4364
5105
|
// Sem isso o dia dimensionava por aspect-square e desalinhava das colunas.
|
|
4365
5106
|
"group/day relative flex-1 aspect-square min-w-8 max-w-12 p-0 text-center select-none",
|
|
4366
5107
|
defaultClassNames.day
|
|
4367
5108
|
),
|
|
4368
|
-
range_start:
|
|
4369
|
-
range_end:
|
|
4370
|
-
range_middle:
|
|
4371
|
-
today:
|
|
4372
|
-
outside:
|
|
5109
|
+
range_start: appShell.cn("rounded-l-full", defaultClassNames.range_start),
|
|
5110
|
+
range_end: appShell.cn("rounded-r-full", defaultClassNames.range_end),
|
|
5111
|
+
range_middle: appShell.cn("", defaultClassNames.range_middle),
|
|
5112
|
+
today: appShell.cn("", defaultClassNames.today),
|
|
5113
|
+
outside: appShell.cn(
|
|
4373
5114
|
"text-fg-subtle opacity-40",
|
|
4374
5115
|
defaultClassNames.outside
|
|
4375
5116
|
),
|
|
4376
|
-
disabled:
|
|
4377
|
-
hidden:
|
|
5117
|
+
disabled: appShell.cn("text-fg-disabled opacity-50", defaultClassNames.disabled),
|
|
5118
|
+
hidden: appShell.cn("invisible", defaultClassNames.hidden),
|
|
4378
5119
|
...classNames
|
|
4379
5120
|
},
|
|
4380
5121
|
components: {
|
|
4381
|
-
Root: ({ className: rootCn, rootRef, ...rootProps }) => /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "calendar", ref: rootRef, className:
|
|
5122
|
+
Root: ({ className: rootCn, rootRef, ...rootProps }) => /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "calendar", ref: rootRef, className: appShell.cn(rootCn), ...rootProps }),
|
|
4382
5123
|
Chevron: ({ orientation }) => {
|
|
4383
5124
|
if (orientation === "left") return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeftIcon, { className: "size-4" });
|
|
4384
5125
|
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRightIcon, { className: "size-4" });
|
|
@@ -4413,7 +5154,7 @@ function CalendarDayButton({
|
|
|
4413
5154
|
"data-range-start": isRangeStart || void 0,
|
|
4414
5155
|
"data-range-end": isRangeEnd || void 0,
|
|
4415
5156
|
"data-range-middle": isRangeMiddle || void 0,
|
|
4416
|
-
className:
|
|
5157
|
+
className: appShell.cn(
|
|
4417
5158
|
"relative flex aspect-square w-full items-center justify-center text-body-md font-normal leading-none outline-none transition-colors",
|
|
4418
5159
|
// Default shape
|
|
4419
5160
|
"rounded-full",
|
|
@@ -4650,7 +5391,7 @@ function MultiSelectDropdown({
|
|
|
4650
5391
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4651
5392
|
"label",
|
|
4652
5393
|
{
|
|
4653
|
-
className:
|
|
5394
|
+
className: appShell.cn(
|
|
4654
5395
|
"flex items-center gap-gp-md w-full",
|
|
4655
5396
|
"px-pad-md py-pad-sm rounded-radius-md",
|
|
4656
5397
|
"text-body-md text-fg-default text-left cursor-pointer",
|
|
@@ -4659,7 +5400,7 @@ function MultiSelectDropdown({
|
|
|
4659
5400
|
),
|
|
4660
5401
|
children: [
|
|
4661
5402
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4662
|
-
|
|
5403
|
+
Checkbox,
|
|
4663
5404
|
{
|
|
4664
5405
|
checked: isChecked,
|
|
4665
5406
|
onCheckedChange: () => toggle(opt.value),
|
|
@@ -5348,9 +6089,9 @@ const BadgeColumnType = {
|
|
|
5348
6089
|
const opt = findOption(value, options);
|
|
5349
6090
|
if (!opt) {
|
|
5350
6091
|
if (value == null) return null;
|
|
5351
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6092
|
+
return /* @__PURE__ */ jsxRuntime.jsx(appShell.Chip, { size: "sm", children: String(value) });
|
|
5352
6093
|
}
|
|
5353
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6094
|
+
return /* @__PURE__ */ jsxRuntime.jsx(appShell.Chip, { size: "sm", color: resolveChipColor(opt.color), children: opt.label });
|
|
5354
6095
|
},
|
|
5355
6096
|
formatValue: (v) => v == null ? "" : String(v),
|
|
5356
6097
|
defaultAlign: "left",
|
|
@@ -5394,7 +6135,7 @@ const TagsColumnType = {
|
|
|
5394
6135
|
className: "flex items-center gap-gp-md p-pad-xs rounded-radius-sm hover:bg-bg-muted cursor-pointer",
|
|
5395
6136
|
children: [
|
|
5396
6137
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5397
|
-
|
|
6138
|
+
Checkbox,
|
|
5398
6139
|
{
|
|
5399
6140
|
checked: selected.has(String(o.value)),
|
|
5400
6141
|
onCheckedChange: () => toggle(String(o.value))
|
|
@@ -5421,7 +6162,7 @@ const TagsColumnType = {
|
|
|
5421
6162
|
className: "flex items-center gap-gp-md p-pad-xs rounded-radius-sm hover:bg-bg-muted cursor-pointer",
|
|
5422
6163
|
children: [
|
|
5423
6164
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5424
|
-
|
|
6165
|
+
Checkbox,
|
|
5425
6166
|
{
|
|
5426
6167
|
checked: selected.has(String(o.value)),
|
|
5427
6168
|
onCheckedChange: () => toggle(String(o.value))
|
|
@@ -5455,7 +6196,7 @@ const TagsColumnType = {
|
|
|
5455
6196
|
if (arr.length === 0) return null;
|
|
5456
6197
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex items-center flex-wrap gap-gp-2xs", children: arr.map((v) => {
|
|
5457
6198
|
const opt = findOption(v, options);
|
|
5458
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6199
|
+
return /* @__PURE__ */ jsxRuntime.jsx(appShell.Chip, { size: "sm", color: resolveChipColor(opt?.color), children: opt?.label ?? v }, v);
|
|
5459
6200
|
}) });
|
|
5460
6201
|
},
|
|
5461
6202
|
formatValue: (v) => toStringArray(v).join(", "),
|
|
@@ -5737,7 +6478,7 @@ function ToolbarSimpleFilterDrawer({
|
|
|
5737
6478
|
titleIcon: lucideReact.SlidersHorizontal,
|
|
5738
6479
|
footer: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between w-full", children: [
|
|
5739
6480
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5740
|
-
|
|
6481
|
+
appShell.Button,
|
|
5741
6482
|
{
|
|
5742
6483
|
variant: "ghost",
|
|
5743
6484
|
color: "secondary",
|
|
@@ -5749,7 +6490,7 @@ function ToolbarSimpleFilterDrawer({
|
|
|
5749
6490
|
}
|
|
5750
6491
|
),
|
|
5751
6492
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5752
|
-
|
|
6493
|
+
appShell.Button,
|
|
5753
6494
|
{
|
|
5754
6495
|
variant: "filled",
|
|
5755
6496
|
color: "primary",
|
|
@@ -5797,7 +6538,7 @@ const Pagination = ({
|
|
|
5797
6538
|
{
|
|
5798
6539
|
role: "navigation",
|
|
5799
6540
|
"aria-label": "Paginação",
|
|
5800
|
-
className:
|
|
6541
|
+
className: appShell.cn("inline-flex items-center gap-gp-xs", className),
|
|
5801
6542
|
...props
|
|
5802
6543
|
}
|
|
5803
6544
|
);
|
|
@@ -5806,7 +6547,7 @@ const PaginationContent = React__namespace.forwardRef(({ className, ...props },
|
|
|
5806
6547
|
"ul",
|
|
5807
6548
|
{
|
|
5808
6549
|
ref: ref2,
|
|
5809
|
-
className:
|
|
6550
|
+
className: appShell.cn(
|
|
5810
6551
|
"inline-flex items-center gap-[2px]",
|
|
5811
6552
|
"bg-bg-muted rounded-radius-lg p-[3px] mx-gp-sm h-form-md",
|
|
5812
6553
|
className
|
|
@@ -5815,7 +6556,7 @@ const PaginationContent = React__namespace.forwardRef(({ className, ...props },
|
|
|
5815
6556
|
}
|
|
5816
6557
|
));
|
|
5817
6558
|
PaginationContent.displayName = "PaginationContent";
|
|
5818
|
-
const PaginationItem = React__namespace.forwardRef(({ className, ...props }, ref2) => /* @__PURE__ */ jsxRuntime.jsx("li", { ref: ref2, className:
|
|
6559
|
+
const PaginationItem = React__namespace.forwardRef(({ className, ...props }, ref2) => /* @__PURE__ */ jsxRuntime.jsx("li", { ref: ref2, className: appShell.cn("", className), ...props }));
|
|
5819
6560
|
PaginationItem.displayName = "PaginationItem";
|
|
5820
6561
|
const paginationLinkVariants = classVarianceAuthority.cva(
|
|
5821
6562
|
[
|
|
@@ -5842,7 +6583,7 @@ const PaginationLink = React__namespace.forwardRef(({ className, isActive: isAct
|
|
|
5842
6583
|
ref: ref2,
|
|
5843
6584
|
type,
|
|
5844
6585
|
"aria-current": isActive2 ? "page" : void 0,
|
|
5845
|
-
className:
|
|
6586
|
+
className: appShell.cn(paginationLinkVariants({ isActive: isActive2 }), className),
|
|
5846
6587
|
...props
|
|
5847
6588
|
}
|
|
5848
6589
|
));
|
|
@@ -5864,7 +6605,7 @@ const PaginationPrevious = React__namespace.forwardRef(
|
|
|
5864
6605
|
ref: ref2,
|
|
5865
6606
|
type,
|
|
5866
6607
|
"aria-label": ariaLabel ?? "Página anterior",
|
|
5867
|
-
className:
|
|
6608
|
+
className: appShell.cn(paginationNavVariants(), className),
|
|
5868
6609
|
...props,
|
|
5869
6610
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, {})
|
|
5870
6611
|
}
|
|
@@ -5878,7 +6619,7 @@ const PaginationNext = React__namespace.forwardRef(
|
|
|
5878
6619
|
ref: ref2,
|
|
5879
6620
|
type,
|
|
5880
6621
|
"aria-label": ariaLabel ?? "Próxima página",
|
|
5881
|
-
className:
|
|
6622
|
+
className: appShell.cn(paginationNavVariants(), className),
|
|
5882
6623
|
...props,
|
|
5883
6624
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, {})
|
|
5884
6625
|
}
|
|
@@ -5892,7 +6633,7 @@ const PaginationFirst = React__namespace.forwardRef(
|
|
|
5892
6633
|
ref: ref2,
|
|
5893
6634
|
type,
|
|
5894
6635
|
"aria-label": ariaLabel ?? "Primeira página",
|
|
5895
|
-
className:
|
|
6636
|
+
className: appShell.cn(paginationNavVariants(), className),
|
|
5896
6637
|
...props,
|
|
5897
6638
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsLeft, {})
|
|
5898
6639
|
}
|
|
@@ -5906,7 +6647,7 @@ const PaginationLast = React__namespace.forwardRef(
|
|
|
5906
6647
|
ref: ref2,
|
|
5907
6648
|
type,
|
|
5908
6649
|
"aria-label": ariaLabel ?? "Última página",
|
|
5909
|
-
className:
|
|
6650
|
+
className: appShell.cn(paginationNavVariants(), className),
|
|
5910
6651
|
...props,
|
|
5911
6652
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsRight, {})
|
|
5912
6653
|
}
|
|
@@ -5920,7 +6661,7 @@ const PaginationEllipsis = ({
|
|
|
5920
6661
|
"span",
|
|
5921
6662
|
{
|
|
5922
6663
|
"aria-hidden": "true",
|
|
5923
|
-
className:
|
|
6664
|
+
className: appShell.cn(
|
|
5924
6665
|
"inline-flex items-center justify-center min-w-[22px] h-[30px]",
|
|
5925
6666
|
"text-body-sm font-normal text-fg-muted tracking-wider select-none",
|
|
5926
6667
|
className
|
|
@@ -5967,7 +6708,7 @@ function FooterTable({
|
|
|
5967
6708
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5968
6709
|
"footer",
|
|
5969
6710
|
{
|
|
5970
|
-
className:
|
|
6711
|
+
className: appShell.cn(
|
|
5971
6712
|
// Mobile: só a paginação, centralizada (o bloco esquerdo some).
|
|
5972
6713
|
"flex flex-col sm:flex-row max-sm:items-center sm:items-center sm:justify-between",
|
|
5973
6714
|
"gap-gp-2xl",
|
|
@@ -6072,7 +6813,7 @@ function FooterTableSkeleton({
|
|
|
6072
6813
|
{
|
|
6073
6814
|
"aria-busy": "true",
|
|
6074
6815
|
"aria-label": "Carregando paginação",
|
|
6075
|
-
className:
|
|
6816
|
+
className: appShell.cn(
|
|
6076
6817
|
"flex flex-col sm:flex-row sm:items-center sm:justify-between",
|
|
6077
6818
|
"gap-gp-2xl",
|
|
6078
6819
|
className
|
|
@@ -6093,36 +6834,36 @@ function FooterTableSkeleton({
|
|
|
6093
6834
|
}
|
|
6094
6835
|
);
|
|
6095
6836
|
}
|
|
6096
|
-
const root =
|
|
6837
|
+
const root = appShell.tv({
|
|
6097
6838
|
base: [
|
|
6098
6839
|
"flex flex-1 min-h-0 overflow-hidden"
|
|
6099
6840
|
// Sem moldura outer — kanban assume a área disponível
|
|
6100
6841
|
]
|
|
6101
6842
|
});
|
|
6102
|
-
const board =
|
|
6843
|
+
const board = appShell.tv({
|
|
6103
6844
|
base: [
|
|
6104
6845
|
"flex flex-1 gap-gp-2xl p-0",
|
|
6105
6846
|
"overflow-x-auto overflow-y-hidden scrollbar-thin"
|
|
6106
6847
|
]
|
|
6107
6848
|
});
|
|
6108
|
-
const column =
|
|
6849
|
+
const column = appShell.tv({
|
|
6109
6850
|
base: [
|
|
6110
6851
|
"flex flex-col w-[296px] shrink-0 max-h-full",
|
|
6111
6852
|
"bg-bg-muted rounded-radius-xl",
|
|
6112
6853
|
"overflow-hidden"
|
|
6113
6854
|
]
|
|
6114
6855
|
});
|
|
6115
|
-
const columnHead =
|
|
6856
|
+
const columnHead = appShell.tv({
|
|
6116
6857
|
base: [
|
|
6117
6858
|
"flex items-center gap-gp-md",
|
|
6118
6859
|
"px-pad-xl pt-pad-xl pb-pad-sm",
|
|
6119
6860
|
"bg-transparent"
|
|
6120
6861
|
]
|
|
6121
6862
|
});
|
|
6122
|
-
const columnDot =
|
|
6863
|
+
const columnDot = appShell.tv({
|
|
6123
6864
|
base: "size-[8px] rounded-radius-full shrink-0"
|
|
6124
6865
|
});
|
|
6125
|
-
const columnTitle =
|
|
6866
|
+
const columnTitle = appShell.tv({
|
|
6126
6867
|
base: [
|
|
6127
6868
|
"m-0 text-body-md font-medium text-fg-default",
|
|
6128
6869
|
// Não expande (badge fica grudado à direita do título)
|
|
@@ -6130,7 +6871,7 @@ const columnTitle = chipGroup.tv({
|
|
|
6130
6871
|
"whitespace-nowrap overflow-hidden text-ellipsis"
|
|
6131
6872
|
]
|
|
6132
6873
|
});
|
|
6133
|
-
const columnCount =
|
|
6874
|
+
const columnCount = appShell.tv({
|
|
6134
6875
|
base: [
|
|
6135
6876
|
"inline-flex items-center justify-center shrink-0",
|
|
6136
6877
|
"min-w-[20px] h-[20px] px-pad-sm",
|
|
@@ -6139,27 +6880,27 @@ const columnCount = chipGroup.tv({
|
|
|
6139
6880
|
"[font-variant-numeric:tabular-nums]"
|
|
6140
6881
|
]
|
|
6141
6882
|
});
|
|
6142
|
-
const columnActionsSpacer =
|
|
6883
|
+
const columnActionsSpacer = appShell.tv({
|
|
6143
6884
|
base: "ml-auto inline-flex items-center gap-gp-2xs"
|
|
6144
6885
|
});
|
|
6145
|
-
const columnBody =
|
|
6886
|
+
const columnBody = appShell.tv({
|
|
6146
6887
|
base: [
|
|
6147
6888
|
"flex flex-1 flex-col gap-gp-md min-h-0",
|
|
6148
6889
|
"px-pad-md pt-sp-xs pb-pad-md",
|
|
6149
6890
|
"overflow-y-auto overflow-x-hidden scrollbar-thin"
|
|
6150
6891
|
]
|
|
6151
6892
|
});
|
|
6152
|
-
const columnEmpty =
|
|
6893
|
+
const columnEmpty = appShell.tv({
|
|
6153
6894
|
base: [
|
|
6154
6895
|
"flex flex-1 flex-col items-center justify-center gap-gp-sm",
|
|
6155
6896
|
"py-pad-3xl px-pad-xl",
|
|
6156
6897
|
"text-center text-body-sm font-normal text-fg-subtle"
|
|
6157
6898
|
]
|
|
6158
6899
|
});
|
|
6159
|
-
const columnEmptyIcon =
|
|
6900
|
+
const columnEmptyIcon = appShell.tv({
|
|
6160
6901
|
base: "size-icon-md text-fg-subtle opacity-70"
|
|
6161
6902
|
});
|
|
6162
|
-
const columnAdd =
|
|
6903
|
+
const columnAdd = appShell.tv({
|
|
6163
6904
|
base: [
|
|
6164
6905
|
"inline-flex items-center justify-center gap-gp-sm",
|
|
6165
6906
|
"mx-pad-md mb-pad-md mt-sp-2xs",
|
|
@@ -6172,7 +6913,7 @@ const columnAdd = chipGroup.tv({
|
|
|
6172
6913
|
"focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring-brand"
|
|
6173
6914
|
]
|
|
6174
6915
|
});
|
|
6175
|
-
const card =
|
|
6916
|
+
const card = appShell.tv({
|
|
6176
6917
|
base: [
|
|
6177
6918
|
"group/kanban-card",
|
|
6178
6919
|
"relative flex flex-col gap-gp-md",
|
|
@@ -6216,7 +6957,7 @@ const card = chipGroup.tv({
|
|
|
6216
6957
|
{ selected: true, reserveCheck: true, class: "!pl-[36px]" }
|
|
6217
6958
|
]
|
|
6218
6959
|
});
|
|
6219
|
-
const cardCheck =
|
|
6960
|
+
const cardCheck = appShell.tv({
|
|
6220
6961
|
base: [
|
|
6221
6962
|
"absolute top-[18px] left-[12px] z-[1]",
|
|
6222
6963
|
"opacity-0 transition-opacity duration-150",
|
|
@@ -6227,7 +6968,7 @@ const cardCheck = chipGroup.tv({
|
|
|
6227
6968
|
selected: { true: "!opacity-100" }
|
|
6228
6969
|
}
|
|
6229
6970
|
});
|
|
6230
|
-
const cardMenuSlot =
|
|
6971
|
+
const cardMenuSlot = appShell.tv({
|
|
6231
6972
|
base: [
|
|
6232
6973
|
"absolute top-[6px] right-[6px] z-[2]",
|
|
6233
6974
|
"opacity-0",
|
|
@@ -6236,53 +6977,53 @@ const cardMenuSlot = chipGroup.tv({
|
|
|
6236
6977
|
"group-focus-visible/kanban-card:opacity-100"
|
|
6237
6978
|
]
|
|
6238
6979
|
});
|
|
6239
|
-
const cardHead =
|
|
6980
|
+
const cardHead = appShell.tv({
|
|
6240
6981
|
base: "flex items-center gap-gp-md pr-[28px]"
|
|
6241
6982
|
});
|
|
6242
|
-
const cardTitleWrap =
|
|
6983
|
+
const cardTitleWrap = appShell.tv({
|
|
6243
6984
|
base: "flex-1 min-w-0 flex flex-col gap-gp-2xs"
|
|
6244
6985
|
});
|
|
6245
|
-
const cardTitle =
|
|
6986
|
+
const cardTitle = appShell.tv({
|
|
6246
6987
|
base: [
|
|
6247
6988
|
"text-body-md font-medium text-fg-default leading-[1.3]",
|
|
6248
6989
|
"whitespace-nowrap overflow-hidden text-ellipsis"
|
|
6249
6990
|
]
|
|
6250
6991
|
});
|
|
6251
|
-
const cardSubtitle =
|
|
6992
|
+
const cardSubtitle = appShell.tv({
|
|
6252
6993
|
base: "text-caption-sm text-fg-muted [font-variant-numeric:tabular-nums]"
|
|
6253
6994
|
});
|
|
6254
|
-
const cardDesc =
|
|
6995
|
+
const cardDesc = appShell.tv({
|
|
6255
6996
|
base: [
|
|
6256
6997
|
"m-0 text-body-sm font-normal leading-[1.45] text-fg-muted",
|
|
6257
6998
|
"[display:-webkit-box] [-webkit-line-clamp:2] [-webkit-box-orient:vertical]",
|
|
6258
6999
|
"overflow-hidden"
|
|
6259
7000
|
]
|
|
6260
7001
|
});
|
|
6261
|
-
const cardMeta =
|
|
7002
|
+
const cardMeta = appShell.tv({
|
|
6262
7003
|
base: "flex items-center justify-between gap-gp-md"
|
|
6263
7004
|
});
|
|
6264
|
-
const cardValue =
|
|
7005
|
+
const cardValue = appShell.tv({
|
|
6265
7006
|
base: "text-body-sm font-semibold text-fg-default [font-variant-numeric:tabular-nums]"
|
|
6266
7007
|
});
|
|
6267
|
-
const cardFoot =
|
|
7008
|
+
const cardFoot = appShell.tv({
|
|
6268
7009
|
base: [
|
|
6269
7010
|
"flex items-center justify-between gap-gp-md",
|
|
6270
7011
|
"pt-pad-md border-t border-border-subtle"
|
|
6271
7012
|
]
|
|
6272
7013
|
});
|
|
6273
|
-
const cardDragging =
|
|
7014
|
+
const cardDragging = appShell.tv({
|
|
6274
7015
|
base: "opacity-40 cursor-grabbing"
|
|
6275
7016
|
});
|
|
6276
|
-
const columnDropTarget =
|
|
7017
|
+
const columnDropTarget = appShell.tv({
|
|
6277
7018
|
base: "outline outline-2 outline-offset-[-2px] outline-border-brand bg-bg-brand-subtle/30 transition-[outline,background-color] duration-150"
|
|
6278
7019
|
});
|
|
6279
|
-
const columnDropInvalidDimmed =
|
|
7020
|
+
const columnDropInvalidDimmed = appShell.tv({
|
|
6280
7021
|
base: "opacity-50 transition-opacity duration-200"
|
|
6281
7022
|
});
|
|
6282
|
-
const columnDropInvalidOver =
|
|
7023
|
+
const columnDropInvalidOver = appShell.tv({
|
|
6283
7024
|
base: "cursor-not-allowed"
|
|
6284
7025
|
});
|
|
6285
|
-
const dropPlaceholder =
|
|
7026
|
+
const dropPlaceholder = appShell.tv({
|
|
6286
7027
|
base: [
|
|
6287
7028
|
"h-[36px] flex items-center justify-center shrink-0",
|
|
6288
7029
|
"rounded-radius-md border border-dashed border-border-brand",
|
|
@@ -6440,7 +7181,7 @@ function Kanban({
|
|
|
6440
7181
|
col.id
|
|
6441
7182
|
);
|
|
6442
7183
|
}) });
|
|
6443
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
7184
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: appShell.cn(root(), className), role: "region", "aria-label": "Quadro Kanban", children: enableDnD ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6444
7185
|
core.DndContext,
|
|
6445
7186
|
{
|
|
6446
7187
|
sensors,
|
|
@@ -6451,7 +7192,7 @@ function Kanban({
|
|
|
6451
7192
|
onDragCancel: handleDragCancel,
|
|
6452
7193
|
children: [
|
|
6453
7194
|
boardContent,
|
|
6454
|
-
/* @__PURE__ */ jsxRuntime.jsx(core.DragOverlay, { dropAnimation: null, children: activeCard && /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
7195
|
+
/* @__PURE__ */ jsxRuntime.jsx(core.DragOverlay, { dropAnimation: null, children: activeCard && /* @__PURE__ */ jsxRuntime.jsx("div", { className: appShell.cn(card({ selected: false, open: false }), "rotate-2 opacity-90 shadow-sh-lg"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6455
7196
|
KanbanCardContent,
|
|
6456
7197
|
{
|
|
6457
7198
|
card: activeCard,
|
|
@@ -6503,7 +7244,7 @@ function KanbanColumnInner({
|
|
|
6503
7244
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6504
7245
|
"section",
|
|
6505
7246
|
{
|
|
6506
|
-
className:
|
|
7247
|
+
className: appShell.cn(
|
|
6507
7248
|
column(),
|
|
6508
7249
|
showInvalidDim && columnDropInvalidDimmed(),
|
|
6509
7250
|
showInvalidOver && columnDropInvalidOver(),
|
|
@@ -6524,7 +7265,7 @@ function KanbanColumnInner({
|
|
|
6524
7265
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: columnCount(), children: count }),
|
|
6525
7266
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: columnActionsSpacer(), children: [
|
|
6526
7267
|
onAddCard && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6527
|
-
|
|
7268
|
+
appShell.Button,
|
|
6528
7269
|
{
|
|
6529
7270
|
variant: "ghost",
|
|
6530
7271
|
color: "secondary",
|
|
@@ -6599,7 +7340,7 @@ function renderColumnMenu({
|
|
|
6599
7340
|
}
|
|
6600
7341
|
if (onColumnMenu) {
|
|
6601
7342
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6602
|
-
|
|
7343
|
+
appShell.Button,
|
|
6603
7344
|
{
|
|
6604
7345
|
variant: "ghost",
|
|
6605
7346
|
color: "secondary",
|
|
@@ -6659,7 +7400,7 @@ function KanbanCardOuter({
|
|
|
6659
7400
|
"article",
|
|
6660
7401
|
{
|
|
6661
7402
|
ref: enableDnD ? setNodeRef : void 0,
|
|
6662
|
-
className:
|
|
7403
|
+
className: appShell.cn(
|
|
6663
7404
|
card({ selected, open, reserveCheck: showCheckbox }),
|
|
6664
7405
|
isBeingDragged && cardDragging(),
|
|
6665
7406
|
enableDnD && "cursor-grab active:cursor-grabbing"
|
|
@@ -6670,7 +7411,7 @@ function KanbanCardOuter({
|
|
|
6670
7411
|
...a11yProps,
|
|
6671
7412
|
children: [
|
|
6672
7413
|
showCheckbox && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cardCheck({ selected }), onClick: handleStop, onPointerDown: handleStop, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6673
|
-
|
|
7414
|
+
Checkbox,
|
|
6674
7415
|
{
|
|
6675
7416
|
checked: selected,
|
|
6676
7417
|
onCheckedChange: () => onToggleSelect?.(card$1.id),
|
|
@@ -6724,7 +7465,7 @@ function renderCardMenu({
|
|
|
6724
7465
|
}
|
|
6725
7466
|
if (onCardMenu) {
|
|
6726
7467
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cardMenuSlot(), onClick: handleStop, onPointerDown: handleStop, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6727
|
-
|
|
7468
|
+
appShell.Button,
|
|
6728
7469
|
{
|
|
6729
7470
|
variant: "ghost",
|
|
6730
7471
|
color: "secondary",
|
|
@@ -6748,7 +7489,7 @@ function KanbanAutoMenu({
|
|
|
6748
7489
|
}) {
|
|
6749
7490
|
return /* @__PURE__ */ jsxRuntime.jsxs(appShell.DropdownMenu, { children: [
|
|
6750
7491
|
/* @__PURE__ */ jsxRuntime.jsx(appShell.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6751
|
-
|
|
7492
|
+
appShell.Button,
|
|
6752
7493
|
{
|
|
6753
7494
|
variant: "ghost",
|
|
6754
7495
|
color: "secondary",
|
|
@@ -15536,7 +16277,7 @@ const ConnectedDroppable = connect(makeMapStateToProps, mapDispatchToProps, (sta
|
|
|
15536
16277
|
context: StoreContext,
|
|
15537
16278
|
areStatePropsEqual: isStrictEqual
|
|
15538
16279
|
})(Droppable);
|
|
15539
|
-
const listStyles =
|
|
16280
|
+
const listStyles = appShell.tv({
|
|
15540
16281
|
slots: {
|
|
15541
16282
|
root: "flex flex-col",
|
|
15542
16283
|
/* grupos */
|
|
@@ -15650,7 +16391,7 @@ function ListItem({
|
|
|
15650
16391
|
ref: innerRef,
|
|
15651
16392
|
role: "article",
|
|
15652
16393
|
"aria-selected": state.selected || void 0,
|
|
15653
|
-
className:
|
|
16394
|
+
className: appShell.cn(s.item(), className),
|
|
15654
16395
|
onClick: onClick ? handleClick : void 0,
|
|
15655
16396
|
...draggableProps,
|
|
15656
16397
|
children: [
|
|
@@ -15665,7 +16406,7 @@ function ListItem({
|
|
|
15665
16406
|
}
|
|
15666
16407
|
),
|
|
15667
16408
|
selectable && /* @__PURE__ */ jsxRuntime.jsx("span", { className: s.checkbox(), onClick: stop, onPointerDown: stop, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
15668
|
-
|
|
16409
|
+
Checkbox,
|
|
15669
16410
|
{
|
|
15670
16411
|
checked: state.selected,
|
|
15671
16412
|
onCheckedChange: () => onToggleSelect?.(item.id),
|
|
@@ -15683,7 +16424,7 @@ function ListItem({
|
|
|
15683
16424
|
item.meta && item.meta.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: s.metaRow(), children: item.meta.map((m, i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15684
16425
|
"div",
|
|
15685
16426
|
{
|
|
15686
|
-
className:
|
|
16427
|
+
className: appShell.cn(s.metaCol(), m.align === "end" && "items-end text-right"),
|
|
15687
16428
|
children: [
|
|
15688
16429
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: s.metaLabel(), children: m.label }),
|
|
15689
16430
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: s.metaValue(), children: m.value })
|
|
@@ -15700,7 +16441,7 @@ function ListItem({
|
|
|
15700
16441
|
}
|
|
15701
16442
|
function ListAutoMenu({ items }) {
|
|
15702
16443
|
return /* @__PURE__ */ jsxRuntime.jsxs(appShell.DropdownMenu, { children: [
|
|
15703
|
-
/* @__PURE__ */ jsxRuntime.jsx(appShell.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16444
|
+
/* @__PURE__ */ jsxRuntime.jsx(appShell.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(appShell.Button, { variant: "ghost", color: "secondary", size: "icon-2xs", "aria-label": "Ações", title: "Ações", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreHorizontal, {}) }) }),
|
|
15704
16445
|
/* @__PURE__ */ jsxRuntime.jsx(appShell.DropdownMenuContent, { align: "end", sideOffset: 4, children: items.map(
|
|
15705
16446
|
(item, idx) => item.separator ? /* @__PURE__ */ jsxRuntime.jsx(appShell.DropdownMenuSeparator, {}, `sep-${idx}`) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15706
16447
|
appShell.DropdownMenuItem,
|
|
@@ -15800,7 +16541,7 @@ function StandardLayout({
|
|
|
15800
16541
|
{
|
|
15801
16542
|
ref: provided.innerRef,
|
|
15802
16543
|
...provided.droppableProps,
|
|
15803
|
-
className:
|
|
16544
|
+
className: appShell.cn(s.root({ density }), snapshot.isDraggingOver && s.dropZoneActive()),
|
|
15804
16545
|
children: [
|
|
15805
16546
|
rows,
|
|
15806
16547
|
provided.placeholder
|
|
@@ -15848,7 +16589,7 @@ function GroupSection({
|
|
|
15848
16589
|
},
|
|
15849
16590
|
item.id
|
|
15850
16591
|
));
|
|
15851
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className:
|
|
16592
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: appShell.cn(s.group(), groupSurface && s.groupPanel()), children: [
|
|
15852
16593
|
/* @__PURE__ */ jsxRuntime.jsxs("header", { className: s.groupHeader(), children: [
|
|
15853
16594
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15854
16595
|
"button",
|
|
@@ -15861,7 +16602,7 @@ function GroupSection({
|
|
|
15861
16602
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
15862
16603
|
lucideReact.ChevronDown,
|
|
15863
16604
|
{
|
|
15864
|
-
className:
|
|
16605
|
+
className: appShell.cn("size-[16px] transition-transform", !open && "-rotate-90")
|
|
15865
16606
|
}
|
|
15866
16607
|
)
|
|
15867
16608
|
}
|
|
@@ -15875,7 +16616,7 @@ function GroupSection({
|
|
|
15875
16616
|
{
|
|
15876
16617
|
ref: provided.innerRef,
|
|
15877
16618
|
...provided.droppableProps,
|
|
15878
|
-
className:
|
|
16619
|
+
className: appShell.cn(
|
|
15879
16620
|
s.groupBody({ density }),
|
|
15880
16621
|
"min-h-[44px]",
|
|
15881
16622
|
snapshot.isDraggingOver && s.dropZoneActive()
|
|
@@ -16135,7 +16876,7 @@ function NestedTree({
|
|
|
16135
16876
|
isOpen && /* @__PURE__ */ jsxRuntime.jsx(
|
|
16136
16877
|
"div",
|
|
16137
16878
|
{
|
|
16138
|
-
className:
|
|
16879
|
+
className: appShell.cn(
|
|
16139
16880
|
"pl-pad-xl",
|
|
16140
16881
|
branchContainer(branchHighlight, node.id, trail, subtree)
|
|
16141
16882
|
),
|
|
@@ -16196,7 +16937,7 @@ function ExpandToggle({
|
|
|
16196
16937
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16197
16938
|
lucideReact.ChevronRight,
|
|
16198
16939
|
{
|
|
16199
|
-
className:
|
|
16940
|
+
className: appShell.cn("size-[16px] transition-transform", open && "rotate-90")
|
|
16200
16941
|
}
|
|
16201
16942
|
)
|
|
16202
16943
|
}
|
|
@@ -16364,13 +17105,13 @@ function List({
|
|
|
16364
17105
|
[layout, onMove, onReorder]
|
|
16365
17106
|
);
|
|
16366
17107
|
if (loading) {
|
|
16367
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
16368
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
16369
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
17108
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: appShell.cn(s.root({ density }), className), children: Array.from({ length: skeletonCount }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: s.skeleton(), children: [
|
|
17109
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: appShell.cn(s.skeletonBar(), "w-1/3 mb-gp-md") }),
|
|
17110
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: appShell.cn(s.skeletonBar(), "w-2/3") })
|
|
16370
17111
|
] }, i)) });
|
|
16371
17112
|
}
|
|
16372
17113
|
if (!items.length) {
|
|
16373
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
17114
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: appShell.cn(s.root({ density }), className), children: emptyState ?? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: s.emptyState(), children: [
|
|
16374
17115
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Inbox, { className: "size-icon-md opacity-70", "aria-hidden": true }),
|
|
16375
17116
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Nada por aqui ainda." })
|
|
16376
17117
|
] }) });
|
|
@@ -16427,11 +17168,11 @@ function List({
|
|
|
16427
17168
|
}
|
|
16428
17169
|
);
|
|
16429
17170
|
if (!dndEnabled) {
|
|
16430
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
17171
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: appShell.cn("w-full", className), children: layoutEl });
|
|
16431
17172
|
}
|
|
16432
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
17173
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: appShell.cn("w-full", className), children: /* @__PURE__ */ jsxRuntime.jsx(DragDropContext, { onDragEnd: handleDragEnd, children: layoutEl }) });
|
|
16433
17174
|
}
|
|
16434
|
-
const dataTableStyles =
|
|
17175
|
+
const dataTableStyles = appShell.tv({
|
|
16435
17176
|
slots: {
|
|
16436
17177
|
root: [
|
|
16437
17178
|
// 16px (gp-2xl) entre toolbar e tabela
|
|
@@ -16686,6 +17427,16 @@ function applyFormatter(row, column2) {
|
|
|
16686
17427
|
const DEFAULT_COLUMN_WIDTH = 160;
|
|
16687
17428
|
const CELL_PADDING_PX = 32;
|
|
16688
17429
|
const DEFAULT_SAMPLE_SIZE = 20;
|
|
17430
|
+
const HEADER_ICON_PX = 13 + 8;
|
|
17431
|
+
const HEADER_SORT_AFFORDANCE_PX = 24;
|
|
17432
|
+
function measureHeaderMinWidth(col, typeDef) {
|
|
17433
|
+
const headerText = String(col.headerName ?? String(col.field));
|
|
17434
|
+
const hasHeaderIcon = col.icon !== void 0 || typeDef?.defaultIcon !== void 0;
|
|
17435
|
+
const isSortable = col.sortable ?? typeDef?.defaultSortable ?? false;
|
|
17436
|
+
const hasHeadMenu = col.enableColumnFilter === true;
|
|
17437
|
+
const overhead = CELL_PADDING_PX + (hasHeaderIcon ? HEADER_ICON_PX : 0) + (isSortable || hasHeadMenu ? HEADER_SORT_AFFORDANCE_PX : 0);
|
|
17438
|
+
return measureTextWidth(headerText) + overhead;
|
|
17439
|
+
}
|
|
16689
17440
|
function calculateColumnWidths(columns, rows, options) {
|
|
16690
17441
|
const { containerWidth, autoFit, sampleSize = DEFAULT_SAMPLE_SIZE } = options;
|
|
16691
17442
|
if (containerWidth <= 0) return {};
|
|
@@ -16693,10 +17444,6 @@ function calculateColumnWidths(columns, rows, options) {
|
|
|
16693
17444
|
let totalContentWidth = 0;
|
|
16694
17445
|
for (const col of columns) {
|
|
16695
17446
|
const field = String(col.field);
|
|
16696
|
-
if (col.width !== void 0) {
|
|
16697
|
-
totalContentWidth += col.width;
|
|
16698
|
-
continue;
|
|
16699
|
-
}
|
|
16700
17447
|
if (col.type === "actions") {
|
|
16701
17448
|
const w = col.minWidth ?? ACTIONS_COLUMN_WIDTH;
|
|
16702
17449
|
widths[field] = w;
|
|
@@ -16704,10 +17451,16 @@ function calculateColumnWidths(columns, rows, options) {
|
|
|
16704
17451
|
continue;
|
|
16705
17452
|
}
|
|
16706
17453
|
const typeDef = col.type ? columnTypeRegistry.get(col.type) : void 0;
|
|
17454
|
+
if (col.width !== void 0) {
|
|
17455
|
+
let w = Math.max(col.width, measureHeaderMinWidth(col, typeDef));
|
|
17456
|
+
if (col.maxWidth !== void 0 && w > col.maxWidth) w = col.maxWidth;
|
|
17457
|
+
widths[field] = Math.round(w);
|
|
17458
|
+
totalContentWidth += w;
|
|
17459
|
+
continue;
|
|
17460
|
+
}
|
|
16707
17461
|
let calculatedWidth = typeDef?.defaultWidth ?? DEFAULT_COLUMN_WIDTH;
|
|
16708
17462
|
if (autoFit) {
|
|
16709
|
-
|
|
16710
|
-
let maxWidth = measureTextWidth(headerText) + CELL_PADDING_PX;
|
|
17463
|
+
let maxWidth = measureHeaderMinWidth(col, typeDef);
|
|
16711
17464
|
const sample = rows.slice(0, sampleSize);
|
|
16712
17465
|
for (const row of sample) {
|
|
16713
17466
|
const text = applyFormatter(row, col);
|
|
@@ -16727,33 +17480,63 @@ function calculateColumnWidths(columns, rows, options) {
|
|
|
16727
17480
|
totalContentWidth += calculatedWidth;
|
|
16728
17481
|
}
|
|
16729
17482
|
if (totalContentWidth < containerWidth) {
|
|
16730
|
-
const remainingSpace = containerWidth - totalContentWidth;
|
|
16731
17483
|
const isFixed = (col) => col.type === "actions" || col.type === "checkbox";
|
|
16732
|
-
const
|
|
16733
|
-
|
|
16734
|
-
|
|
16735
|
-
const targets = flexibleColumns.length > 0 ? flexibleColumns : autoFit ? columns.filter((col) => !isFixed(col)) : [];
|
|
17484
|
+
const nonFixed = columns.filter((col) => !isFixed(col));
|
|
17485
|
+
const hasFlexible = nonFixed.some((col) => col.width === void 0);
|
|
17486
|
+
const targets = hasFlexible || autoFit ? nonFixed : [];
|
|
16736
17487
|
if (targets.length > 0) {
|
|
16737
|
-
const
|
|
16738
|
-
let
|
|
16739
|
-
|
|
16740
|
-
|
|
16741
|
-
const isLast = index === targets.length - 1;
|
|
16742
|
-
const extra = isLast ? remainingSpace - distributed : extraPerColumn;
|
|
16743
|
-
const current = widths[field] ?? col.width ?? 0;
|
|
16744
|
-
let next = current + extra;
|
|
16745
|
-
if (col.maxWidth !== void 0 && next > col.maxWidth) {
|
|
16746
|
-
next = col.maxWidth;
|
|
16747
|
-
}
|
|
16748
|
-
widths[field] = Math.round(next);
|
|
16749
|
-
distributed += extra;
|
|
17488
|
+
const baseWidth = (col) => widths[String(col.field)] ?? col.width ?? DEFAULT_COLUMN_WIDTH;
|
|
17489
|
+
let growable = targets.filter((col) => {
|
|
17490
|
+
const f = String(col.field);
|
|
17491
|
+
return col.maxWidth === void 0 || (widths[f] ?? 0) < col.maxWidth;
|
|
16750
17492
|
});
|
|
17493
|
+
let remaining = containerWidth - totalContentWidth;
|
|
17494
|
+
let guard2 = 0;
|
|
17495
|
+
while (remaining >= 1 && growable.length > 0 && guard2 < 16) {
|
|
17496
|
+
guard2 += 1;
|
|
17497
|
+
const totalWeight = growable.reduce((sum, col) => sum + baseWidth(col), 0);
|
|
17498
|
+
if (totalWeight <= 0) break;
|
|
17499
|
+
let consumedThisPass = 0;
|
|
17500
|
+
const stillGrowable = [];
|
|
17501
|
+
for (const col of growable) {
|
|
17502
|
+
const f = String(col.field);
|
|
17503
|
+
const current = widths[f] ?? col.width ?? 0;
|
|
17504
|
+
const share = baseWidth(col) / totalWeight * remaining;
|
|
17505
|
+
const next = current + share;
|
|
17506
|
+
if (col.maxWidth !== void 0 && next >= col.maxWidth) {
|
|
17507
|
+
consumedThisPass += col.maxWidth - current;
|
|
17508
|
+
widths[f] = col.maxWidth;
|
|
17509
|
+
} else {
|
|
17510
|
+
consumedThisPass += share;
|
|
17511
|
+
widths[f] = next;
|
|
17512
|
+
stillGrowable.push(col);
|
|
17513
|
+
}
|
|
17514
|
+
}
|
|
17515
|
+
remaining -= consumedThisPass;
|
|
17516
|
+
growable = stillGrowable;
|
|
17517
|
+
if (consumedThisPass < 0.5) break;
|
|
17518
|
+
}
|
|
17519
|
+
let lastFlexField;
|
|
17520
|
+
let roundedTotal = 0;
|
|
17521
|
+
for (const col of targets) {
|
|
17522
|
+
const f = String(col.field);
|
|
17523
|
+
widths[f] = Math.round(widths[f] ?? col.width ?? 0);
|
|
17524
|
+
roundedTotal += widths[f];
|
|
17525
|
+
const maxed = col.maxWidth !== void 0 && widths[f] >= col.maxWidth;
|
|
17526
|
+
if (!maxed) lastFlexField = f;
|
|
17527
|
+
}
|
|
17528
|
+
if (lastFlexField !== void 0) {
|
|
17529
|
+
const residue = Math.round(containerWidth) - roundedTotal;
|
|
17530
|
+
if (residue !== 0) {
|
|
17531
|
+
widths[lastFlexField] = Math.max(0, widths[lastFlexField] + residue);
|
|
17532
|
+
}
|
|
17533
|
+
}
|
|
16751
17534
|
}
|
|
16752
17535
|
}
|
|
16753
17536
|
return widths;
|
|
16754
17537
|
}
|
|
16755
17538
|
function useColumnAutoWidth(containerRef, columns, rows, options) {
|
|
16756
|
-
const { enabled, sampleSize, reservedWidth = 0 } = options;
|
|
17539
|
+
const { enabled, sampleSize, reservedWidth = 0, recalcKey } = options;
|
|
16757
17540
|
const [autoWidths, setAutoWidths] = React.useState({});
|
|
16758
17541
|
const rafIdRef = React.useRef(null);
|
|
16759
17542
|
const columnsRef = React.useRef(columns);
|
|
@@ -16819,6 +17602,9 @@ function useColumnAutoWidth(containerRef, columns, rows, options) {
|
|
|
16819
17602
|
containerRef,
|
|
16820
17603
|
sampleSize,
|
|
16821
17604
|
reservedWidth,
|
|
17605
|
+
// Re-attach quando o elemento observado desmonta/remonta sem trocar a ref
|
|
17606
|
+
// (toggle de view Tabela↔Lista). Sem isso o observer fica no node antigo.
|
|
17607
|
+
recalcKey,
|
|
16822
17608
|
columns.length,
|
|
16823
17609
|
rows.length,
|
|
16824
17610
|
// Inclui campos das columns pra recalcular quando consumer muda a schema
|
|
@@ -17639,13 +18425,25 @@ function useDataTableController(props, ref2) {
|
|
|
17639
18425
|
[props.persistId]
|
|
17640
18426
|
);
|
|
17641
18427
|
const scrollContainerRef = React.useRef(null);
|
|
18428
|
+
const [internalViewMode, setInternalViewMode] = React.useState(
|
|
18429
|
+
// Hidrata do localStorage (v3+) com fallback pra prop `defaultViewMode`
|
|
18430
|
+
persistedInitial?.viewMode ?? props.defaultViewMode ?? "table"
|
|
18431
|
+
);
|
|
18432
|
+
const viewMode = props.viewMode ?? internalViewMode;
|
|
17642
18433
|
const autoFitEnabled = props.autoFit !== false;
|
|
17643
18434
|
const selectionReservedWidth = props.selectionConfig?.enabled ? SELECTION_COLUMN_WIDTH : 0;
|
|
17644
18435
|
const { autoWidths } = useColumnAutoWidth(
|
|
17645
18436
|
scrollContainerRef,
|
|
17646
18437
|
props.columns,
|
|
17647
18438
|
props.rows ?? [],
|
|
17648
|
-
{
|
|
18439
|
+
{
|
|
18440
|
+
enabled: autoFitEnabled,
|
|
18441
|
+
reservedWidth: selectionReservedWidth,
|
|
18442
|
+
// Re-attach/re-medir quando o corpo da tabela remonta (toggle de view).
|
|
18443
|
+
// Só "table" carrega o scrollRef observado; usar viewMode garante que ao
|
|
18444
|
+
// voltar pra Tabela o observer reata no node novo e re-mede do zero.
|
|
18445
|
+
recalcKey: viewMode
|
|
18446
|
+
}
|
|
17649
18447
|
);
|
|
17650
18448
|
const cols = useDataTableColumns({
|
|
17651
18449
|
columns: props.columns,
|
|
@@ -17691,11 +18489,6 @@ function useDataTableController(props, ref2) {
|
|
|
17691
18489
|
onDensityChange: props.onDensityChange,
|
|
17692
18490
|
initialDensity: persistedInitial?.density
|
|
17693
18491
|
});
|
|
17694
|
-
const [internalViewMode, setInternalViewMode] = React.useState(
|
|
17695
|
-
// Hidrata do localStorage (v3+) com fallback pra prop `defaultViewMode`
|
|
17696
|
-
persistedInitial?.viewMode ?? props.defaultViewMode ?? "table"
|
|
17697
|
-
);
|
|
17698
|
-
const viewMode = props.viewMode ?? internalViewMode;
|
|
17699
18492
|
const setViewMode = React.useCallback((mode) => {
|
|
17700
18493
|
if (props.viewMode === void 0) setInternalViewMode(mode);
|
|
17701
18494
|
props.onViewModeChange?.(mode);
|
|
@@ -17878,7 +18671,7 @@ function useDataTableController(props, ref2) {
|
|
|
17878
18671
|
hiddenColumns: state.hiddenColumns,
|
|
17879
18672
|
columnOrder: state.columnOrder
|
|
17880
18673
|
});
|
|
17881
|
-
|
|
18674
|
+
if (state.viewMode !== void 0) setViewMode(state.viewMode);
|
|
17882
18675
|
setGroupBy(state.groupBy);
|
|
17883
18676
|
setExpandedRowIds(state.expandedRowIds ?? []);
|
|
17884
18677
|
savedViews.setCurrentViewId(id);
|
|
@@ -17976,7 +18769,6 @@ function useDataTableController(props, ref2) {
|
|
|
17976
18769
|
hiddenColumns: snapshot.hiddenColumns ?? [],
|
|
17977
18770
|
columnOrder: snapshot.columnOrder ?? props.columns.map((c) => String(c.field))
|
|
17978
18771
|
});
|
|
17979
|
-
setViewMode(snapshot.viewMode ?? "table");
|
|
17980
18772
|
setGroupBy(snapshot.groupBy);
|
|
17981
18773
|
setExpandedRowIds(snapshot.expandedRowIds ?? []);
|
|
17982
18774
|
filters.setFilterModel(snapshot.filterModel ?? { items: [], logicOperator: "AND" });
|
|
@@ -18312,7 +19104,7 @@ function DataTableNoResults({
|
|
|
18312
19104
|
onClearFilters
|
|
18313
19105
|
} = {}) {
|
|
18314
19106
|
const resolvedAction = action ?? (onClearFilters ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
18315
|
-
|
|
19107
|
+
appShell.Button,
|
|
18316
19108
|
{
|
|
18317
19109
|
size: "sm",
|
|
18318
19110
|
variant: "outline",
|
|
@@ -18365,7 +19157,7 @@ function DataTableColumnMenu({
|
|
|
18365
19157
|
}, [open, keepMounted]);
|
|
18366
19158
|
return /* @__PURE__ */ jsxRuntime.jsxs(appShell.DropdownMenu, { open, onOpenChange: setOpen, children: [
|
|
18367
19159
|
/* @__PURE__ */ jsxRuntime.jsx(appShell.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
18368
|
-
|
|
19160
|
+
appShell.Button,
|
|
18369
19161
|
{
|
|
18370
19162
|
size: "icon-2xs",
|
|
18371
19163
|
variant: "ghost",
|
|
@@ -18461,7 +19253,7 @@ function DataTableActionsCell({
|
|
|
18461
19253
|
};
|
|
18462
19254
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-gp-2xs justify-end w-full", children: [
|
|
18463
19255
|
inlineActions.map((a) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
18464
|
-
|
|
19256
|
+
appShell.Button,
|
|
18465
19257
|
{
|
|
18466
19258
|
size: "icon-2xs",
|
|
18467
19259
|
variant: "ghost",
|
|
@@ -18479,7 +19271,7 @@ function DataTableActionsCell({
|
|
|
18479
19271
|
)),
|
|
18480
19272
|
menuActions.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(appShell.DropdownMenu, { children: [
|
|
18481
19273
|
/* @__PURE__ */ jsxRuntime.jsx(appShell.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
18482
|
-
|
|
19274
|
+
appShell.Button,
|
|
18483
19275
|
{
|
|
18484
19276
|
size: "icon-2xs",
|
|
18485
19277
|
variant: "ghost",
|
|
@@ -18542,7 +19334,7 @@ function DataTableSortableHeadCell({
|
|
|
18542
19334
|
position: isDragging2 ? "relative" : void 0
|
|
18543
19335
|
};
|
|
18544
19336
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
18545
|
-
|
|
19337
|
+
TableHeadCell,
|
|
18546
19338
|
{
|
|
18547
19339
|
...headCellProps,
|
|
18548
19340
|
ref: setNodeRef,
|
|
@@ -18594,19 +19386,19 @@ function DataTableTotalizerRow({
|
|
|
18594
19386
|
"div",
|
|
18595
19387
|
{
|
|
18596
19388
|
role: "row",
|
|
18597
|
-
className:
|
|
19389
|
+
className: appShell.cn(
|
|
18598
19390
|
"flex w-max min-w-full",
|
|
18599
19391
|
"sticky bottom-0 z-[8]",
|
|
18600
19392
|
"bg-bg-table-head border-t border-border-table",
|
|
18601
19393
|
"h-[42px]"
|
|
18602
19394
|
),
|
|
18603
19395
|
children: [
|
|
18604
|
-
hasSelection && /* @__PURE__ */ jsxRuntime.jsx(
|
|
19396
|
+
hasSelection && /* @__PURE__ */ jsxRuntime.jsx(TableCell, { width: 56, align: "center", className: "!px-0" }),
|
|
18605
19397
|
columns.map((col) => {
|
|
18606
19398
|
const field = String(col.field);
|
|
18607
19399
|
const content = renderAggregate(col, rows, overrides?.[field]);
|
|
18608
19400
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
18609
|
-
|
|
19401
|
+
TableCell,
|
|
18610
19402
|
{
|
|
18611
19403
|
field,
|
|
18612
19404
|
width: columnWidths[field],
|
|
@@ -18838,7 +19630,7 @@ function DataTableTreeToggle({
|
|
|
18838
19630
|
e.stopPropagation();
|
|
18839
19631
|
onToggle();
|
|
18840
19632
|
},
|
|
18841
|
-
className:
|
|
19633
|
+
className: appShell.cn(
|
|
18842
19634
|
"shrink-0 flex items-center justify-center",
|
|
18843
19635
|
"size-icon-md rounded-radius-sm",
|
|
18844
19636
|
"text-fg-muted hover:text-fg-strong hover:bg-bg-muted",
|
|
@@ -18848,7 +19640,7 @@ function DataTableTreeToggle({
|
|
|
18848
19640
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
18849
19641
|
lucideReact.ChevronRight,
|
|
18850
19642
|
{
|
|
18851
|
-
className:
|
|
19643
|
+
className: appShell.cn(
|
|
18852
19644
|
"size-icon-sm transition-transform duration-150",
|
|
18853
19645
|
isExpanded && "rotate-90"
|
|
18854
19646
|
),
|
|
@@ -18870,7 +19662,7 @@ function DataTableTreeToggle({
|
|
|
18870
19662
|
}
|
|
18871
19663
|
);
|
|
18872
19664
|
}
|
|
18873
|
-
const cellAddonsStyles =
|
|
19665
|
+
const cellAddonsStyles = appShell.tv({
|
|
18874
19666
|
slots: {
|
|
18875
19667
|
/** Wrapper raiz da célula com add-ons — `group` habilita reveal no hover. */
|
|
18876
19668
|
root: "group/cell-addon flex items-center gap-gp-xs w-full min-w-0",
|
|
@@ -18890,7 +19682,7 @@ const cellAddonsStyles = chipGroup.tv({
|
|
|
18890
19682
|
],
|
|
18891
19683
|
/** Conteúdo do popover do "Ler mais". Largura via token semântico
|
|
18892
19684
|
* (tooltip-lg = 320px) — reveal de texto é conceitualmente um tooltip. */
|
|
18893
|
-
readMorePopover: "flex flex-col gap-gp-md p-pad-lg max-w-
|
|
19685
|
+
readMorePopover: "flex flex-col gap-gp-md p-pad-lg max-w-tooltip-lg text-body-sm text-fg-default whitespace-pre-wrap break-words"
|
|
18894
19686
|
}
|
|
18895
19687
|
});
|
|
18896
19688
|
const styles$2 = cellAddonsStyles();
|
|
@@ -19008,7 +19800,7 @@ function DataTableRowInner({
|
|
|
19008
19800
|
handlers
|
|
19009
19801
|
}) {
|
|
19010
19802
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
19011
|
-
|
|
19803
|
+
TableRow,
|
|
19012
19804
|
{
|
|
19013
19805
|
ref: (el) => handlers.current.registerRef(index, el),
|
|
19014
19806
|
selected,
|
|
@@ -19022,8 +19814,8 @@ function DataTableRowInner({
|
|
|
19022
19814
|
},
|
|
19023
19815
|
className: rowClassName,
|
|
19024
19816
|
children: [
|
|
19025
|
-
selectionEnabled && /* @__PURE__ */ jsxRuntime.jsx(
|
|
19026
|
-
|
|
19817
|
+
selectionEnabled && /* @__PURE__ */ jsxRuntime.jsx(TableCell, { width: SELECTION_COLUMN_WIDTH, align: "center", purpose: "selection", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
19818
|
+
Checkbox,
|
|
19027
19819
|
{
|
|
19028
19820
|
checked: selected,
|
|
19029
19821
|
onCheckedChange: () => handlers.current.toggleRowSelection(row),
|
|
@@ -19095,7 +19887,7 @@ function DataTableRowInner({
|
|
|
19095
19887
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
19096
19888
|
lucideReact.ChevronRight,
|
|
19097
19889
|
{
|
|
19098
|
-
className:
|
|
19890
|
+
className: appShell.cn(
|
|
19099
19891
|
"shrink-0 size-icon-sm text-fg-muted transition-transform duration-150",
|
|
19100
19892
|
expanded && "rotate-90"
|
|
19101
19893
|
),
|
|
@@ -19127,7 +19919,7 @@ function DataTableRowInner({
|
|
|
19127
19919
|
const hasAddons = addonsEligible && (col.readMore != null || col.copyable != null);
|
|
19128
19920
|
const effectiveEllipsis = isTreeCol || hasAddons ? false : col.ellipsis ?? typeDef?.defaultEllipsis;
|
|
19129
19921
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19130
|
-
|
|
19922
|
+
TableCell,
|
|
19131
19923
|
{
|
|
19132
19924
|
field,
|
|
19133
19925
|
width: columnWidths[field],
|
|
@@ -19170,7 +19962,7 @@ function DataTableGroupHeaderRow({
|
|
|
19170
19962
|
"data-group-key": group.key,
|
|
19171
19963
|
"aria-expanded": group.isExpanded,
|
|
19172
19964
|
style: style2,
|
|
19173
|
-
className:
|
|
19965
|
+
className: appShell.cn(
|
|
19174
19966
|
"flex w-full min-w-full",
|
|
19175
19967
|
"bg-bg-subtle",
|
|
19176
19968
|
"border-b border-border-table",
|
|
@@ -19201,7 +19993,7 @@ function DataTableGroupHeaderRow({
|
|
|
19201
19993
|
"data-group-key": group.key,
|
|
19202
19994
|
"aria-expanded": group.isExpanded,
|
|
19203
19995
|
style: style2,
|
|
19204
|
-
className:
|
|
19996
|
+
className: appShell.cn(
|
|
19205
19997
|
"flex w-max min-w-full h-[42px]",
|
|
19206
19998
|
"bg-bg-subtle hover:bg-bg-muted",
|
|
19207
19999
|
"border-b border-border-table",
|
|
@@ -19229,7 +20021,7 @@ function DataTableGroupHeaderRow({
|
|
|
19229
20021
|
"div",
|
|
19230
20022
|
{
|
|
19231
20023
|
"data-field": field,
|
|
19232
|
-
className:
|
|
20024
|
+
className: appShell.cn(
|
|
19233
20025
|
"shrink-0 flex items-center px-pad-2xl gap-gp-md",
|
|
19234
20026
|
"text-body-md font-medium text-fg-strong",
|
|
19235
20027
|
isPinned && "sticky z-[5] bg-bg-subtle"
|
|
@@ -19278,7 +20070,7 @@ function DataTableGroupContentRow({
|
|
|
19278
20070
|
"data-group-content": "true",
|
|
19279
20071
|
"data-group-key": group.key,
|
|
19280
20072
|
style: style2,
|
|
19281
|
-
className:
|
|
20073
|
+
className: appShell.cn(
|
|
19282
20074
|
"flex w-full min-w-full",
|
|
19283
20075
|
"bg-bg-table",
|
|
19284
20076
|
"border-b border-border-table",
|
|
@@ -19361,7 +20153,7 @@ function DataTableRowExpansion({
|
|
|
19361
20153
|
role: "row",
|
|
19362
20154
|
"data-row-expansion": "true",
|
|
19363
20155
|
style: style2,
|
|
19364
|
-
className:
|
|
20156
|
+
className: appShell.cn(
|
|
19365
20157
|
"flex w-full min-w-full",
|
|
19366
20158
|
"bg-bg-subtle",
|
|
19367
20159
|
"border-b border-border-table",
|
|
@@ -19831,7 +20623,7 @@ function DataTableInternal(props, ref2) {
|
|
|
19831
20623
|
const selectionConfig = props.selectionConfig ?? { enabled: false };
|
|
19832
20624
|
const isKanban = viewMode === "kanban" && Boolean(props.kanbanConfig);
|
|
19833
20625
|
const isList = viewMode === "list" && Boolean(props.listConfig);
|
|
19834
|
-
useGrabToScroll(scrollContainerRef, props.grabToScroll
|
|
20626
|
+
useGrabToScroll(scrollContainerRef, props.grabToScroll !== false);
|
|
19835
20627
|
const [isFullscreen, setIsFullscreen] = React.useState(false);
|
|
19836
20628
|
const enableFullscreen = toolbarConfig.enableFullscreen === true;
|
|
19837
20629
|
const toggleFullscreen = React.useCallback(() => {
|
|
@@ -19882,8 +20674,8 @@ function DataTableInternal(props, ref2) {
|
|
|
19882
20674
|
const cfg = props.listConfig;
|
|
19883
20675
|
if (!isList || !cfg) return [];
|
|
19884
20676
|
const getRowId = contextValue.getRowId;
|
|
19885
|
-
const rows = rowsAllPagesProcessed;
|
|
19886
20677
|
const pathFn = cfg.getPath ?? props.getTreeDataPath;
|
|
20678
|
+
const rows = cfg.paginated && !(cfg.hierarchical && pathFn) ? rowsToRender : rowsAllPagesProcessed;
|
|
19887
20679
|
if (cfg.hierarchical && pathFn) {
|
|
19888
20680
|
const pathOf = pathFn;
|
|
19889
20681
|
const shells = /* @__PURE__ */ new Map();
|
|
@@ -19912,6 +20704,7 @@ function DataTableInternal(props, ref2) {
|
|
|
19912
20704
|
props.listConfig,
|
|
19913
20705
|
props.getTreeDataPath,
|
|
19914
20706
|
rowsAllPagesProcessed,
|
|
20707
|
+
rowsToRender,
|
|
19915
20708
|
contextValue.getRowId
|
|
19916
20709
|
]);
|
|
19917
20710
|
const listDefaultExpandedIds = React.useMemo(() => {
|
|
@@ -20167,7 +20960,10 @@ function DataTableInternal(props, ref2) {
|
|
|
20167
20960
|
...savedViews.views.map((v) => ({
|
|
20168
20961
|
id: v.id,
|
|
20169
20962
|
name: v.name,
|
|
20170
|
-
|
|
20963
|
+
// Preserva o dono vindo do service (backend real). Ausente = "me"
|
|
20964
|
+
// (compat com o mock, que nao tem multi-user).
|
|
20965
|
+
owner: v.owner ?? "me",
|
|
20966
|
+
ownerName: v.ownerName
|
|
20171
20967
|
}))
|
|
20172
20968
|
],
|
|
20173
20969
|
[props.defaultViews, savedViews.views]
|
|
@@ -20464,22 +21260,22 @@ function DataTableInternal(props, ref2) {
|
|
|
20464
21260
|
collisionDetection: core.closestCenter,
|
|
20465
21261
|
onDragEnd: handleColumnDragEnd,
|
|
20466
21262
|
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
20467
|
-
|
|
21263
|
+
Table,
|
|
20468
21264
|
{
|
|
20469
21265
|
density: density.density,
|
|
20470
21266
|
cardBreakpoint: props.cardBreakpoint ?? DEFAULT_CARD_BREAKPOINT,
|
|
20471
21267
|
className: "min-h-0 max-h-full",
|
|
20472
21268
|
scrollRef: scrollContainerRef,
|
|
20473
21269
|
children: [
|
|
20474
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
21270
|
+
/* @__PURE__ */ jsxRuntime.jsxs(TableHead, { children: [
|
|
20475
21271
|
selectionConfig.enabled && /* @__PURE__ */ jsxRuntime.jsx(
|
|
20476
|
-
|
|
21272
|
+
TableHeadCell,
|
|
20477
21273
|
{
|
|
20478
21274
|
width: SELECTION_COLUMN_WIDTH,
|
|
20479
21275
|
align: "center",
|
|
20480
21276
|
purpose: "selection",
|
|
20481
21277
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
20482
|
-
|
|
21278
|
+
Checkbox,
|
|
20483
21279
|
{
|
|
20484
21280
|
checked: selection.isPageSelected(rowsToRender) ? true : selection.isPageIndeterminate(rowsToRender) ? "indeterminate" : false,
|
|
20485
21281
|
onCheckedChange: () => selection.togglePage(rowsToRender),
|
|
@@ -20522,7 +21318,7 @@ function DataTableInternal(props, ref2) {
|
|
|
20522
21318
|
icon: isActions ? void 0 : col.icon ?? (col.type ? columnTypeRegistry.get(col.type).defaultIcon : void 0),
|
|
20523
21319
|
headMenu: !isActions ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
20524
21320
|
col.enableColumnFilter && /* @__PURE__ */ jsxRuntime.jsx(
|
|
20525
|
-
|
|
21321
|
+
appShell.Button,
|
|
20526
21322
|
{
|
|
20527
21323
|
size: "icon-2xs",
|
|
20528
21324
|
variant: "ghost",
|
|
@@ -20565,7 +21361,7 @@ function DataTableInternal(props, ref2) {
|
|
|
20565
21361
|
)
|
|
20566
21362
|
] }),
|
|
20567
21363
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
20568
|
-
|
|
21364
|
+
TableBody,
|
|
20569
21365
|
{
|
|
20570
21366
|
virtualized: virtualize ? { totalHeight: rowVirtualizer.getTotalSize() } : void 0,
|
|
20571
21367
|
children: [
|
|
@@ -20726,14 +21522,14 @@ function DataTableInternal(props, ref2) {
|
|
|
20726
21522
|
const isSel = selection.isRowSelected(row);
|
|
20727
21523
|
const rowId = contextValue.getRowId(row);
|
|
20728
21524
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
20729
|
-
|
|
21525
|
+
TableCardRow,
|
|
20730
21526
|
{
|
|
20731
21527
|
selected: isSel,
|
|
20732
21528
|
clickable: !!props.onRowClick,
|
|
20733
21529
|
onClick: props.onRowClick ? () => props.onRowClick?.(row) : void 0,
|
|
20734
21530
|
header: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
20735
21531
|
selectionConfig.enabled && /* @__PURE__ */ jsxRuntime.jsx(
|
|
20736
|
-
|
|
21532
|
+
Checkbox,
|
|
20737
21533
|
{
|
|
20738
21534
|
checked: isSel,
|
|
20739
21535
|
onCheckedChange: () => selection.toggleRow(row),
|
|
@@ -20756,7 +21552,7 @@ function DataTableInternal(props, ref2) {
|
|
|
20756
21552
|
return /* @__PURE__ */ jsxRuntime.jsx(DataTableProvider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
20757
21553
|
"div",
|
|
20758
21554
|
{
|
|
20759
|
-
className:
|
|
21555
|
+
className: appShell.cn(
|
|
20760
21556
|
dataTableStyles({ fullscreen: isFullscreen }).root(),
|
|
20761
21557
|
props.className
|
|
20762
21558
|
),
|
|
@@ -20781,7 +21577,8 @@ function DataTableInternal(props, ref2) {
|
|
|
20781
21577
|
});
|
|
20782
21578
|
},
|
|
20783
21579
|
soloLabel: toolbarConfig.title,
|
|
20784
|
-
hideDivider: true
|
|
21580
|
+
hideDivider: true,
|
|
21581
|
+
allowCreate: props.allowCreateView !== false
|
|
20785
21582
|
}
|
|
20786
21583
|
) : void 0,
|
|
20787
21584
|
refresh: toolbarConfig.enableRefresh !== false ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -21219,7 +22016,7 @@ function DataTableInternal(props, ref2) {
|
|
|
21219
22016
|
}
|
|
21220
22017
|
}
|
|
21221
22018
|
) : isCardMode ? cardBody : tableBody,
|
|
21222
|
-
!isKanban && !isList && !useTreeData && paginationConfig.enabled !== false && (isLoading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$1.footerWrap(), children: /* @__PURE__ */ jsxRuntime.jsx(FooterTableSkeleton, {}) }) : !isDataEmpty && /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$1.footerWrap(), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
22019
|
+
!isKanban && (!isList || props.listConfig?.paginated && !props.listConfig?.hierarchical) && !useTreeData && paginationConfig.enabled !== false && (isLoading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$1.footerWrap(), children: /* @__PURE__ */ jsxRuntime.jsx(FooterTableSkeleton, {}) }) : !isDataEmpty && /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$1.footerWrap(), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
21223
22020
|
FooterTable,
|
|
21224
22021
|
{
|
|
21225
22022
|
totalCount: totalAfterFilter,
|
|
@@ -21251,7 +22048,7 @@ function DataTableFloatingBulkBar({
|
|
|
21251
22048
|
] }),
|
|
21252
22049
|
actions && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-gp-sm", children: actions }),
|
|
21253
22050
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21254
|
-
|
|
22051
|
+
appShell.Button,
|
|
21255
22052
|
{
|
|
21256
22053
|
size: "icon-xs",
|
|
21257
22054
|
variant: "ghost",
|
|
@@ -21313,7 +22110,7 @@ const SheetPortal = SheetPrimitive__namespace.Portal;
|
|
|
21313
22110
|
const SheetOverlay = React__namespace.forwardRef(({ className, ...props }, ref2) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
21314
22111
|
SheetPrimitive__namespace.Overlay,
|
|
21315
22112
|
{
|
|
21316
|
-
className:
|
|
22113
|
+
className: appShell.cn(
|
|
21317
22114
|
"fixed inset-0 z-50 bg-overlay-scrim data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
21318
22115
|
className
|
|
21319
22116
|
),
|
|
@@ -21344,7 +22141,7 @@ const SheetContent = React__namespace.forwardRef(({ side = "right", className, c
|
|
|
21344
22141
|
SheetPrimitive__namespace.Content,
|
|
21345
22142
|
{
|
|
21346
22143
|
ref: ref2,
|
|
21347
|
-
className:
|
|
22144
|
+
className: appShell.cn(sheetVariants({ side }), className),
|
|
21348
22145
|
...props,
|
|
21349
22146
|
children: [
|
|
21350
22147
|
children,
|
|
@@ -21361,7 +22158,7 @@ const SheetTitle = React__namespace.forwardRef(({ className, ...props }, ref2) =
|
|
|
21361
22158
|
SheetPrimitive__namespace.Title,
|
|
21362
22159
|
{
|
|
21363
22160
|
ref: ref2,
|
|
21364
|
-
className:
|
|
22161
|
+
className: appShell.cn("text-body-lg font-medium font-semibold text-fg-default", className),
|
|
21365
22162
|
...props
|
|
21366
22163
|
}
|
|
21367
22164
|
));
|
|
@@ -21370,12 +22167,12 @@ const SheetDescription = React__namespace.forwardRef(({ className, ...props }, r
|
|
|
21370
22167
|
SheetPrimitive__namespace.Description,
|
|
21371
22168
|
{
|
|
21372
22169
|
ref: ref2,
|
|
21373
|
-
className:
|
|
22170
|
+
className: appShell.cn("text-body-md text-fg-muted", className),
|
|
21374
22171
|
...props
|
|
21375
22172
|
}
|
|
21376
22173
|
));
|
|
21377
22174
|
SheetDescription.displayName = SheetPrimitive__namespace.Description.displayName;
|
|
21378
|
-
const panelContainer =
|
|
22175
|
+
const panelContainer = appShell.tv({
|
|
21379
22176
|
base: [
|
|
21380
22177
|
"flex flex-col overflow-hidden",
|
|
21381
22178
|
"rounded-radius-xl border border-border-default",
|
|
@@ -21404,30 +22201,30 @@ const panelContainer = chipGroup.tv({
|
|
|
21404
22201
|
}
|
|
21405
22202
|
}
|
|
21406
22203
|
});
|
|
21407
|
-
const panelHeader =
|
|
22204
|
+
const panelHeader = appShell.tv({
|
|
21408
22205
|
base: [
|
|
21409
22206
|
"flex items-center justify-between gap-gp-xl flex-none",
|
|
21410
22207
|
"px-[20px] py-[18px]",
|
|
21411
22208
|
"border-b border-border-default"
|
|
21412
22209
|
]
|
|
21413
22210
|
});
|
|
21414
|
-
const panelHeaderText =
|
|
22211
|
+
const panelHeaderText = appShell.tv({
|
|
21415
22212
|
base: "flex flex-col gap-gp-2xs min-w-0"
|
|
21416
22213
|
});
|
|
21417
|
-
const panelTitle =
|
|
22214
|
+
const panelTitle = appShell.tv({
|
|
21418
22215
|
base: [
|
|
21419
22216
|
"flex items-center gap-gp-md min-w-0",
|
|
21420
22217
|
"text-body-lg font-bold text-fg-default tracking-[-0.01em]",
|
|
21421
22218
|
"truncate"
|
|
21422
22219
|
]
|
|
21423
22220
|
});
|
|
21424
|
-
const panelTitleIcon =
|
|
22221
|
+
const panelTitleIcon = appShell.tv({
|
|
21425
22222
|
base: "size-[18px] text-fg-brand shrink-0"
|
|
21426
22223
|
});
|
|
21427
|
-
const panelDescription =
|
|
22224
|
+
const panelDescription = appShell.tv({
|
|
21428
22225
|
base: "text-body-md text-fg-muted"
|
|
21429
22226
|
});
|
|
21430
|
-
const panelClose =
|
|
22227
|
+
const panelClose = appShell.tv({
|
|
21431
22228
|
base: [
|
|
21432
22229
|
"grid place-items-center shrink-0",
|
|
21433
22230
|
"w-form-sm h-form-sm rounded-radius-md",
|
|
@@ -21439,7 +22236,7 @@ const panelClose = chipGroup.tv({
|
|
|
21439
22236
|
"dark:hover:bg-bg-muted-hover"
|
|
21440
22237
|
]
|
|
21441
22238
|
});
|
|
21442
|
-
const panelBody =
|
|
22239
|
+
const panelBody = appShell.tv({
|
|
21443
22240
|
base: [
|
|
21444
22241
|
// min-h-0 garante que o flex-1 encolha e o scroll ative (em vez de empurrar
|
|
21445
22242
|
// header/footer). Scroll automático independente de viewport.
|
|
@@ -21451,7 +22248,7 @@ const panelBody = chipGroup.tv({
|
|
|
21451
22248
|
"scrollbar-thin"
|
|
21452
22249
|
]
|
|
21453
22250
|
});
|
|
21454
|
-
const panelFooter =
|
|
22251
|
+
const panelFooter = appShell.tv({
|
|
21455
22252
|
base: [
|
|
21456
22253
|
// Botões fluidos lado a lado; quebram pra empilhados quando não cabem.
|
|
21457
22254
|
"flex flex-wrap items-center gap-gp-md flex-none",
|
|
@@ -21467,7 +22264,7 @@ function PanelHeader({
|
|
|
21467
22264
|
hideClose,
|
|
21468
22265
|
className
|
|
21469
22266
|
}) {
|
|
21470
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("header", { className:
|
|
22267
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("header", { className: appShell.cn(panelHeader(), className), children: [
|
|
21471
22268
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: panelHeaderText(), children: [
|
|
21472
22269
|
title2 && /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs("h2", { className: panelTitle(), children: [
|
|
21473
22270
|
TitleIcon && /* @__PURE__ */ jsxRuntime.jsx(TitleIcon, { className: panelTitleIcon(), strokeWidth: 1.8 }),
|
|
@@ -21479,10 +22276,10 @@ function PanelHeader({
|
|
|
21479
22276
|
] });
|
|
21480
22277
|
}
|
|
21481
22278
|
function PanelBody({ children, className }) {
|
|
21482
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
22279
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: appShell.cn(panelBody(), className), children });
|
|
21483
22280
|
}
|
|
21484
22281
|
function PanelFooter({ children, className }) {
|
|
21485
|
-
return /* @__PURE__ */ jsxRuntime.jsx("footer", { className:
|
|
22282
|
+
return /* @__PURE__ */ jsxRuntime.jsx("footer", { className: appShell.cn(panelFooter(), className), children });
|
|
21486
22283
|
}
|
|
21487
22284
|
const SIZE_MAP = {
|
|
21488
22285
|
sm: "w-[320px]",
|
|
@@ -21504,7 +22301,7 @@ function slideAnimation(side) {
|
|
|
21504
22301
|
bottom: "md:data-[state=closed]:slide-out-to-bottom-12 md:data-[state=open]:slide-in-from-bottom-12"
|
|
21505
22302
|
}[side];
|
|
21506
22303
|
const mobile = "max-md:data-[state=closed]:slide-out-to-bottom-12 max-md:data-[state=open]:slide-in-from-bottom-12";
|
|
21507
|
-
return
|
|
22304
|
+
return appShell.cn(
|
|
21508
22305
|
"ease-[cubic-bezier(0.4,0,0.2,1)]",
|
|
21509
22306
|
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
21510
22307
|
"data-[state=closed]:duration-[220ms] data-[state=open]:duration-[220ms]",
|
|
@@ -21536,7 +22333,7 @@ function Panel({
|
|
|
21536
22333
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
21537
22334
|
SheetPrimitive__namespace.Content,
|
|
21538
22335
|
{
|
|
21539
|
-
className:
|
|
22336
|
+
className: appShell.cn(
|
|
21540
22337
|
"fixed z-50 bg-bg-surface dark:bg-bg-canvas text-fg-default shadow-sh-2xl",
|
|
21541
22338
|
sizeClass,
|
|
21542
22339
|
panelContainer({ side }),
|
|
@@ -21568,6 +22365,8 @@ exports.Avatar = Avatar;
|
|
|
21568
22365
|
exports.BulkActionButton = BulkActionButton;
|
|
21569
22366
|
exports.BulkActionsBar = BulkActionsBar;
|
|
21570
22367
|
exports.ButtonGroup = ButtonGroup;
|
|
22368
|
+
exports.Calendar = Calendar;
|
|
22369
|
+
exports.Checkbox = Checkbox;
|
|
21571
22370
|
exports.ColsPanel = ColsPanel;
|
|
21572
22371
|
exports.ColsPopover = ColsPopover;
|
|
21573
22372
|
exports.Combobox = Combobox;
|
|
@@ -21608,8 +22407,16 @@ exports.SheetTrigger = SheetTrigger;
|
|
|
21608
22407
|
exports.SortPanel = SortPanel;
|
|
21609
22408
|
exports.SortPopover = SortPopover;
|
|
21610
22409
|
exports.TABLE_HEADER_HEIGHT = TABLE_HEADER_HEIGHT;
|
|
22410
|
+
exports.Table = Table;
|
|
22411
|
+
exports.TableBody = TableBody;
|
|
22412
|
+
exports.TableCardRow = TableCardRow;
|
|
22413
|
+
exports.TableCell = TableCell;
|
|
22414
|
+
exports.TableHead = TableHead;
|
|
22415
|
+
exports.TableHeadCell = TableHeadCell;
|
|
22416
|
+
exports.TableRow = TableRow;
|
|
21611
22417
|
exports.TableToolbar = TableToolbar;
|
|
21612
22418
|
exports.TableToolbarViews = TableToolbarViews;
|
|
22419
|
+
exports.Textarea = Textarea;
|
|
21613
22420
|
exports.ToolbarApplied = ToolbarApplied;
|
|
21614
22421
|
exports.ToolbarDivider = ToolbarDivider;
|
|
21615
22422
|
exports.ToolbarSaveButton = ToolbarSaveButton;
|
|
@@ -21623,11 +22430,13 @@ exports.ViewsPopover = ViewsPopover;
|
|
|
21623
22430
|
exports.avatarVariants = avatarVariants;
|
|
21624
22431
|
exports.columnTypeRegistry = columnTypeRegistry;
|
|
21625
22432
|
exports.floatingPanelStyles = floatingPanelStyles;
|
|
22433
|
+
exports.getContrastTextColor = getContrastTextColor;
|
|
21626
22434
|
exports.isFilterEntryActive = isFilterEntryActive;
|
|
21627
22435
|
exports.panelContainer = panelContainer;
|
|
21628
22436
|
exports.presetView = presetView;
|
|
21629
22437
|
exports.savedViewsMockService = savedViewsMockService;
|
|
22438
|
+
exports.useColumnResize = useColumnResize;
|
|
21630
22439
|
exports.useColumnWidths = useColumnWidths;
|
|
21631
22440
|
exports.useDataTableContext = useDataTableContext;
|
|
21632
22441
|
exports.useFloatingPanelResize = useFloatingPanelResize;
|
|
21633
|
-
//# sourceMappingURL=panel-
|
|
22442
|
+
//# sourceMappingURL=panel-B_SSIEDs.cjs.map
|