@12-apps/ui 6.1.0 → 6.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components-catalog.md +8 -0
- package/dist/{chunk-35VGGLOC.js → chunk-CEKPLUQV.js} +2 -2
- package/dist/{chunk-35VGGLOC.js.map → chunk-CEKPLUQV.js.map} +1 -1
- package/dist/{chunk-62XQWGXU.js → chunk-MXPXKORR.js} +19 -17
- package/dist/chunk-MXPXKORR.js.map +1 -0
- package/dist/{chunk-7XLEWBKL.js → chunk-N554AFDB.js} +7 -10
- package/dist/chunk-N554AFDB.js.map +1 -0
- package/dist/{chunk-JDO7W4D4.js → chunk-R5ZQZSEQ.js} +2 -20
- package/dist/{chunk-JDO7W4D4.js.map → chunk-R5ZQZSEQ.js.map} +1 -1
- package/dist/{chunk-R4TYXKDD.js → chunk-TPQRIPCN.js} +52 -48
- package/dist/chunk-TPQRIPCN.js.map +1 -0
- package/dist/copy.js +1 -0
- package/dist/copy.js.map +1 -0
- package/dist/data-display/CardKit.js +277 -0
- package/dist/data-display/CardKit.js.map +1 -0
- package/dist/data-display/DataViews.js +664 -616
- package/dist/data-display/DataViews.js.map +1 -1
- package/dist/data-display/SectionOnboarding.js +3 -3
- package/dist/data-display/SectionOnboarding.js.map +1 -1
- package/dist/feedback/ConfirmAction.js +3 -5
- package/dist/form/CategorySelect.js +1 -1
- package/dist/form/CepField.js +1 -1
- package/dist/form/total-form.js +8 -4
- package/dist/form/total-form.js.map +1 -1
- package/dist/layout/ContentToolbar.js +1 -1
- package/dist/layout/TableFilter.js +1 -1
- package/dist/pt-BR.js +222 -0
- package/dist/pt-BR.js.map +1 -0
- package/dist/types/components/data-display/CardKit/CardKebab.d.ts +23 -0
- package/dist/types/components/data-display/CardKit/CardKebab.d.ts.map +1 -0
- package/dist/types/components/data-display/CardKit/CardKit.types.d.ts +55 -0
- package/dist/types/components/data-display/CardKit/CardKit.types.d.ts.map +1 -0
- package/dist/types/components/data-display/CardKit/card-actions-context.d.ts +51 -0
- package/dist/types/components/data-display/CardKit/card-actions-context.d.ts.map +1 -0
- package/dist/types/components/data-display/CardKit/index.d.ts +15 -0
- package/dist/types/components/data-display/CardKit/index.d.ts.map +1 -0
- package/dist/types/components/data-display/CardKit/list-card-parts.d.ts +60 -0
- package/dist/types/components/data-display/CardKit/list-card-parts.d.ts.map +1 -0
- package/dist/types/components/data-display/CardKit/row-actions-to-menu.d.ts +17 -0
- package/dist/types/components/data-display/CardKit/row-actions-to-menu.d.ts.map +1 -0
- package/dist/types/components/data-display/CardKit/use-remove-confirm.d.ts +65 -0
- package/dist/types/components/data-display/CardKit/use-remove-confirm.d.ts.map +1 -0
- package/dist/types/components/data-display/CardKit/use-row-confirm.d.ts +60 -0
- package/dist/types/components/data-display/CardKit/use-row-confirm.d.ts.map +1 -0
- package/dist/types/components/data-display/DataViews/DataViewsBoard.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/DeleteViewDialog.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/ManageViewsDialog.d.ts +4 -1
- package/dist/types/components/data-display/DataViews/ManageViewsDialog.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/SaveViewModal.d.ts +0 -5
- package/dist/types/components/data-display/DataViews/SaveViewModal.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/base-card.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/base-list-card-gutters.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-bar-controls.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-category-pill.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-columns-tab.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-copy-context.d.ts +17 -0
- package/dist/types/components/data-display/DataViews/data-views-copy-context.d.ts.map +1 -0
- package/dist/types/components/data-display/DataViews/data-views-copy.d.ts +205 -0
- package/dist/types/components/data-display/DataViews/data-views-copy.d.ts.map +1 -0
- package/dist/types/components/data-display/DataViews/data-views-display-panel.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-display-tabs.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-export.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-filter-panel.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-grid-helpers.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-more-fields.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-more-filters.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-range-pill.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-range-presets.d.ts +3 -2
- package/dist/types/components/data-display/DataViews/data-views-range-presets.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-scopes.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-search.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-select-all-strip.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-table-parts.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-view-nav.d.ts +1 -1
- package/dist/types/components/data-display/DataViews/data-views-view-nav.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/index.d.ts +2 -0
- package/dist/types/components/data-display/DataViews/index.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/save-view-preview.d.ts +10 -0
- package/dist/types/components/data-display/DataViews/save-view-preview.d.ts.map +1 -0
- package/dist/types/components/data-display/DataViews/use-saved-views-controller.d.ts.map +1 -1
- package/dist/types/components/data-display/SectionOnboarding/SectionOnboarding.types.d.ts +6 -5
- package/dist/types/components/data-display/SectionOnboarding/SectionOnboarding.types.d.ts.map +1 -1
- package/dist/types/components/feedback/ConfirmAction/ConfirmAction.hooks.d.ts +1 -3
- package/dist/types/components/feedback/ConfirmAction/ConfirmAction.hooks.d.ts.map +1 -1
- package/dist/types/components/feedback/ConfirmAction/ConfirmAction.parts.d.ts +4 -1
- package/dist/types/components/feedback/ConfirmAction/ConfirmAction.parts.d.ts.map +1 -1
- package/dist/types/components/feedback/ConfirmAction/ConfirmAction.types.d.ts +9 -1
- package/dist/types/components/feedback/ConfirmAction/ConfirmAction.types.d.ts.map +1 -1
- package/dist/types/components/feedback/ConfirmAction/ConfirmButton.d.ts +2 -1
- package/dist/types/components/feedback/ConfirmAction/ConfirmButton.d.ts.map +1 -1
- package/dist/types/components/feedback/ConfirmAction/index.d.ts +2 -2
- package/dist/types/components/feedback/ConfirmAction/index.d.ts.map +1 -1
- package/dist/types/components/feedback/ConfirmAction/with-confirmation.d.ts +5 -1
- package/dist/types/components/feedback/ConfirmAction/with-confirmation.d.ts.map +1 -1
- package/dist/types/components/form/CategorySelect/CategoryPanel.d.ts +4 -1
- package/dist/types/components/form/CategorySelect/CategoryPanel.d.ts.map +1 -1
- package/dist/types/components/form/CategorySelect/CategoryPanelFoot.d.ts +5 -2
- package/dist/types/components/form/CategorySelect/CategoryPanelFoot.d.ts.map +1 -1
- package/dist/types/components/form/CategorySelect/CategoryPanelHead.d.ts +5 -2
- package/dist/types/components/form/CategorySelect/CategoryPanelHead.d.ts.map +1 -1
- package/dist/types/components/form/CategorySelect/CategoryPanelList.d.ts +3 -0
- package/dist/types/components/form/CategorySelect/CategoryPanelList.d.ts.map +1 -1
- package/dist/types/components/form/CategorySelect/CategorySelect.types.d.ts +5 -0
- package/dist/types/components/form/CategorySelect/CategorySelect.types.d.ts.map +1 -1
- package/dist/types/components/form/CategorySelect/CategoryTrigger.d.ts +4 -1
- package/dist/types/components/form/CategorySelect/CategoryTrigger.d.ts.map +1 -1
- package/dist/types/components/form/CepField/CepField.d.ts +1 -1
- package/dist/types/components/form/CepField/CepField.d.ts.map +1 -1
- package/dist/types/components/form/CepField/CepField.types.d.ts +3 -0
- package/dist/types/components/form/CepField/CepField.types.d.ts.map +1 -1
- package/dist/types/components/form/total-form/Fields/CategoryField.d.ts +4 -1
- package/dist/types/components/form/total-form/Fields/CategoryField.d.ts.map +1 -1
- package/dist/types/components/form/total-form/Fields/CepField.d.ts +4 -1
- package/dist/types/components/form/total-form/Fields/CepField.d.ts.map +1 -1
- package/dist/types/components/layout/ContentToolbar/ContentToolbar.types.d.ts +6 -1
- package/dist/types/components/layout/ContentToolbar/ContentToolbar.types.d.ts.map +1 -1
- package/dist/types/components/layout/ContentToolbar/SavedViewsMenu.d.ts.map +1 -1
- package/dist/types/copy.d.ts +99 -0
- package/dist/types/copy.d.ts.map +1 -0
- package/dist/types/pt-BR.d.ts +28 -0
- package/dist/types/pt-BR.d.ts.map +1 -0
- package/dist/types/utils/export-rows.d.ts +31 -0
- package/dist/types/utils/export-rows.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/index.d.ts.map +1 -1
- package/dist/utils.js +50 -0
- package/dist/utils.js.map +1 -1
- package/package.json +14 -2
- package/src/components/data-display/CardKit/CardKebab.tsx +43 -0
- package/src/components/data-display/CardKit/CardKit.md +87 -0
- package/src/components/data-display/CardKit/CardKit.types.ts +60 -0
- package/src/components/data-display/CardKit/card-actions-context.tsx +98 -0
- package/src/components/data-display/CardKit/index.ts +19 -0
- package/src/components/data-display/CardKit/list-card-parts.tsx +163 -0
- package/src/components/data-display/CardKit/row-actions-to-menu.ts +29 -0
- package/src/components/data-display/CardKit/use-remove-confirm.tsx +111 -0
- package/src/components/data-display/CardKit/use-row-confirm.tsx +96 -0
- package/src/components/data-display/DataViews/DataViewsBoard.tsx +7 -4
- package/src/components/data-display/DataViews/DeleteViewDialog.tsx +6 -4
- package/src/components/data-display/DataViews/ManageViewsDialog.tsx +26 -10
- package/src/components/data-display/DataViews/SaveViewModal.tsx +56 -90
- package/src/components/data-display/DataViews/base-card.tsx +3 -1
- package/src/components/data-display/DataViews/base-list-card-gutters.tsx +3 -1
- package/src/components/data-display/DataViews/data-views-bar-controls.tsx +8 -5
- package/src/components/data-display/DataViews/data-views-category-pill.tsx +6 -3
- package/src/components/data-display/DataViews/data-views-columns-tab.tsx +5 -3
- package/src/components/data-display/DataViews/data-views-copy-context.tsx +43 -0
- package/src/components/data-display/DataViews/data-views-copy.ts +214 -0
- package/src/components/data-display/DataViews/data-views-display-panel.tsx +15 -9
- package/src/components/data-display/DataViews/data-views-display-tabs.tsx +19 -29
- package/src/components/data-display/DataViews/data-views-export.tsx +9 -10
- package/src/components/data-display/DataViews/data-views-filter-panel.tsx +9 -5
- package/src/components/data-display/DataViews/data-views-grid-helpers.tsx +5 -2
- package/src/components/data-display/DataViews/data-views-more-fields.tsx +5 -3
- package/src/components/data-display/DataViews/data-views-more-filters.tsx +6 -3
- package/src/components/data-display/DataViews/data-views-range-pill.tsx +9 -5
- package/src/components/data-display/DataViews/data-views-range-presets.ts +7 -8
- package/src/components/data-display/DataViews/data-views-scopes.tsx +3 -1
- package/src/components/data-display/DataViews/data-views-search.tsx +7 -4
- package/src/components/data-display/DataViews/data-views-select-all-strip.tsx +5 -3
- package/src/components/data-display/DataViews/data-views-table-parts.tsx +7 -2
- package/src/components/data-display/DataViews/data-views-view-nav.tsx +22 -16
- package/src/components/data-display/DataViews/index.ts +20 -0
- package/src/components/data-display/DataViews/save-view-preview.tsx +78 -0
- package/src/components/data-display/DataViews/use-saved-views-controller.ts +3 -1
- package/src/components/data-display/SectionOnboarding/SectionOnboarding.tsx +3 -3
- package/src/components/data-display/SectionOnboarding/SectionOnboarding.types.ts +8 -7
- package/src/components/feedback/ConfirmAction/ConfirmAction.hooks.ts +2 -2
- package/src/components/feedback/ConfirmAction/ConfirmAction.parts.tsx +12 -5
- package/src/components/feedback/ConfirmAction/ConfirmAction.types.ts +9 -1
- package/src/components/feedback/ConfirmAction/ConfirmButton.tsx +12 -4
- package/src/components/feedback/ConfirmAction/index.ts +2 -2
- package/src/components/feedback/ConfirmAction/with-confirmation.tsx +4 -3
- package/src/components/form/CategorySelect/CategoryPanel.tsx +18 -6
- package/src/components/form/CategorySelect/CategoryPanelFoot.tsx +10 -5
- package/src/components/form/CategorySelect/CategoryPanelHead.tsx +8 -3
- package/src/components/form/CategorySelect/CategoryPanelList.tsx +17 -10
- package/src/components/form/CategorySelect/CategorySelect.tsx +3 -3
- package/src/components/form/CategorySelect/CategorySelect.types.ts +5 -0
- package/src/components/form/CategorySelect/CategoryTrigger.tsx +5 -1
- package/src/components/form/CepField/CepField.tsx +6 -9
- package/src/components/form/CepField/CepField.types.ts +3 -0
- package/src/components/form/total-form/Fields/CategoryField.tsx +5 -0
- package/src/components/form/total-form/Fields/CepField.tsx +5 -0
- package/src/components/layout/ContentToolbar/ContentToolbar.types.ts +6 -1
- package/src/components/layout/ContentToolbar/SavedViewsMenu.tsx +1 -21
- package/src/components/layout/TableFilter/TableFilter.tsx +1 -1
- package/src/copy.ts +103 -0
- package/src/pt-BR.ts +247 -0
- package/src/utils/export-rows.ts +95 -0
- package/src/utils/index.ts +1 -0
- package/dist/chunk-62XQWGXU.js.map +0 -1
- package/dist/chunk-7XLEWBKL.js.map +0 -1
- package/dist/chunk-R4TYXKDD.js.map +0 -1
|
@@ -69,8 +69,8 @@ var ConfiguredView = ({
|
|
|
69
69
|
title,
|
|
70
70
|
configuredTitle,
|
|
71
71
|
configuredSummary,
|
|
72
|
-
editLabel
|
|
73
|
-
collapseLabel
|
|
72
|
+
editLabel,
|
|
73
|
+
collapseLabel,
|
|
74
74
|
defaultExpanded = false,
|
|
75
75
|
children,
|
|
76
76
|
className,
|
|
@@ -132,7 +132,7 @@ var HeroView = ({
|
|
|
132
132
|
activeStepId,
|
|
133
133
|
completedStepIds,
|
|
134
134
|
primaryAction,
|
|
135
|
-
startLabel
|
|
135
|
+
startLabel,
|
|
136
136
|
secondaryAction,
|
|
137
137
|
helpLink,
|
|
138
138
|
children,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/data-display/SectionOnboarding/SectionOnboarding.tsx"],"sourcesContent":["'use client';\n\nimport CheckCircle from '@mui/icons-material/CheckCircle';\nimport { Box, Button, Collapse, Stack, Typography, useTheme } from '@mui/material';\nimport React from 'react';\n\nimport { EmptyState } from '../EmptyState/EmptyState';\nimport { Stepper } from '../Stepper/Stepper';\nimport type { SectionOnboardingProps } from './SectionOnboarding.types';\n\n/** The setup steps rendered above the hero / form. Returns null when omitted. */\nconst OnboardingSteps: React.FC<\n Pick<SectionOnboardingProps, 'steps' | 'activeStepId' | 'completedStepIds'> & {\n dataTestId: string;\n }\n> = ({ steps, activeStepId, completedStepIds, dataTestId }) => {\n if (!steps || steps.length === 0) return null;\n // Preview mode (no active step): highlight the first so the flow reads L→R.\n const activeId = activeStepId ?? steps[0]?.id ?? '';\n return (\n <Box sx={{ width: '100%', overflowX: 'auto', pb: 1 }}>\n <Stepper\n steps={steps}\n activeId={activeId}\n completed={new Set(completedStepIds ?? [])}\n size=\"sm\"\n data-testid={`${dataTestId}-steps`}\n />\n </Box>\n );\n};\n\n/** The compact \"already connected\" header shown in the configured state. */\nconst ConfiguredSummary: React.FC<\n Pick<SectionOnboardingProps, 'configuredTitle' | 'title' | 'configuredSummary'> & {\n dataTestId: string;\n expanded: boolean;\n onToggle: () => void;\n editLabel: string;\n collapseLabel: string;\n hasChildren: boolean;\n }\n> = ({\n configuredTitle,\n title,\n configuredSummary,\n dataTestId,\n expanded,\n onToggle,\n editLabel,\n collapseLabel,\n hasChildren,\n}) => {\n const theme = useTheme();\n return (\n <Stack\n direction={{ xs: 'column', sm: 'row' }}\n spacing={2}\n alignItems={{ xs: 'flex-start', sm: 'center' }}\n data-testid={`${dataTestId}-summary`}\n >\n <CheckCircle sx={{ color: theme.palette.success.main }} aria-hidden />\n <Box sx={{ minWidth: 0 }}>\n <Typography variant=\"subtitle1\" component=\"h3\" fontWeight=\"medium\">\n {configuredTitle ?? title}\n </Typography>\n {configuredSummary && (\n <Typography variant=\"body2\" color=\"text.secondary\" component=\"div\">\n {configuredSummary}\n </Typography>\n )}\n </Box>\n {hasChildren && (\n <Button\n variant=\"outlined\"\n size=\"small\"\n onClick={onToggle}\n aria-expanded={expanded}\n data-testid={`${dataTestId}-edit-toggle`}\n >\n {expanded ? collapseLabel : editLabel}\n </Button>\n )}\n </Stack>\n );\n};\n\n/**\n * Per-section onboarding wrapper: the same config surface renders three ways\n * depending on `status`, so a first-time user meets a friendly hero + CTA\n * instead of a wall of empty fields, while a returning user sees a compact\n * \"it's connected\" summary with the form tucked behind an \"Editar\" toggle.\n *\n * Composes the existing {@link EmptyState} (the hero) and {@link Stepper} (the\n * progress preview) — drop it onto any settings/integration page and drive it\n * from whatever \"is this configured?\" signal the feature already has.\n */\n/** Configured state: compact success summary + the form behind an \"Editar\" toggle. */\nconst ConfiguredView: React.FC<SectionOnboardingProps> = ({\n title,\n configuredTitle,\n configuredSummary,\n editLabel = 'Editar',\n collapseLabel = 'Ocultar',\n defaultExpanded = false,\n children,\n className,\n dataTestId = 'section-onboarding',\n}) => {\n const [expanded, setExpanded] = React.useState(defaultExpanded);\n return (\n <Box\n className={className}\n data-testid={dataTestId}\n data-status=\"configured\"\n sx={{ p: 2, borderRadius: 1, border: 1, borderColor: 'divider' }}\n >\n <ConfiguredSummary\n configuredTitle={configuredTitle}\n title={title}\n configuredSummary={configuredSummary}\n dataTestId={dataTestId}\n expanded={expanded}\n onToggle={() => setExpanded((prev) => !prev)}\n editLabel={editLabel}\n collapseLabel={collapseLabel}\n hasChildren={Boolean(children)}\n />\n {children && (\n <Collapse in={expanded} unmountOnExit>\n <Box sx={{ mt: 3 }} data-testid={`${dataTestId}-content`}>\n {children}\n </Box>\n </Collapse>\n )}\n </Box>\n );\n};\n\n/** In-progress state (or a started hero): the live stepper + the form. */\nconst InProgressView: React.FC<SectionOnboardingProps & { statusAttr: string }> = ({\n steps,\n activeStepId,\n completedStepIds,\n children,\n className,\n statusAttr,\n dataTestId = 'section-onboarding',\n}) => (\n <Stack className={className} data-testid={dataTestId} data-status={statusAttr} spacing={3}>\n <OnboardingSteps\n steps={steps}\n activeStepId={activeStepId}\n completedStepIds={completedStepIds}\n dataTestId={dataTestId}\n />\n {children && <Box data-testid={`${dataTestId}-content`}>{children}</Box>}\n </Stack>\n);\n\n/** Unconfigured hero: optional step preview + the EmptyState hero + CTA. */\nconst HeroView: React.FC<SectionOnboardingProps & { onStart: () => void }> = ({\n title,\n description,\n illustration,\n steps,\n activeStepId,\n completedStepIds,\n primaryAction,\n startLabel = 'Começar',\n secondaryAction,\n helpLink,\n children,\n className,\n onStart,\n dataTestId = 'section-onboarding',\n}) => {\n // With no custom primaryAction, offer a built-in CTA that reveals the form.\n const heroPrimary =\n primaryAction ?? (children ? { label: startLabel, onClick: onStart } : undefined);\n return (\n <Stack className={className} data-testid={dataTestId} data-status=\"unconfigured\" spacing={1}>\n <OnboardingSteps\n steps={steps}\n activeStepId={activeStepId}\n completedStepIds={completedStepIds}\n dataTestId={dataTestId}\n />\n <EmptyState\n variant={illustration ? 'illustrated' : 'action'}\n title={title}\n description={description}\n illustration={illustration}\n primaryAction={heroPrimary}\n secondaryAction={secondaryAction}\n helpLink={helpLink}\n dataTestId={`${dataTestId}-hero`}\n />\n </Stack>\n );\n};\n\nexport const SectionOnboarding: React.FC<SectionOnboardingProps> = (props) => {\n // Lets the hero reveal the form in place, so a server page can adopt\n // onboarding by passing `status` + children alone — no client wrapper.\n const [started, setStarted] = React.useState(false);\n\n if (props.status === 'configured') {\n return <ConfiguredView {...props} />;\n }\n if (props.status === 'in-progress' || started) {\n return (\n <InProgressView\n {...props}\n statusAttr={props.status === 'in-progress' ? 'in-progress' : 'started'}\n />\n );\n }\n return <HeroView {...props} onStart={() => setStarted(true)} />;\n};\n\nSectionOnboarding.displayName = 'SectionOnboarding';\n\nexport default SectionOnboarding;\n"],"mappings":";;;;;;;;;AAEA,OAAO,iBAAiB;AACxB,SAAS,KAAK,QAAQ,UAAU,OAAO,YAAY,gBAAgB;AACnE,OAAO,WAAW;AAiBZ,cAyCA,YAzCA;AAVN,IAAM,kBAIF,CAAC,EAAE,OAAO,cAAc,kBAAkB,WAAW,MAAM;AAC7D,MA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,aAAa;AACf,MAAM;AAEJ,QAAM,cACJ,kBAAkB,WAAW,EAAE,OAAO,YAAY,SAAS,QAAQ,IAAI;AACzE,SACE,qBAAC,SAAM,WAAsB,eAAa,YAAY,eAAY,gBAAe,SAAS,GACxF;AAAA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,SAAS,eAAe,gBAAgB;AAAA,QACxC;AAAA,QACA;AAAA,QACA;AAAA,QACA,eAAe;AAAA,QACf;AAAA,QACA;AAAA,QACA,YAAY,GAAG,UAAU;AAAA;AAAA,IAC3B;AAAA,KACF;AAEJ;AAEO,IAAM,oBAAsD,CAAC,UAAU;AAG5E,QAAM,CAAC,SAAS,UAAU,IAAI,MAAM,SAAS,KAAK;AAElD,MAAI,MAAM,WAAW,cAAc;AACjC,WAAO,oBAAC,kBAAgB,GAAG,OAAO;AAAA,EACpC;AACA,MAAI,MAAM,WAAW,iBAAiB,SAAS;AAC7C,WACE;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ,YAAY,MAAM,WAAW,gBAAgB,gBAAgB;AAAA;AAAA,IAC/D;AAAA,EAEJ;AACA,SAAO,oBAAC,YAAU,GAAG,OAAO,SAAS,MAAM,WAAW,IAAI,GAAG;AAC/D;AAEA,kBAAkB,cAAc;AAEhC,IAAO,4BAAQ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/data-display/SectionOnboarding/SectionOnboarding.tsx"],"sourcesContent":["'use client';\n\nimport CheckCircle from '@mui/icons-material/CheckCircle';\nimport { Box, Button, Collapse, Stack, Typography, useTheme } from '@mui/material';\nimport React from 'react';\n\nimport { EmptyState } from '../EmptyState/EmptyState';\nimport { Stepper } from '../Stepper/Stepper';\nimport type { SectionOnboardingProps } from './SectionOnboarding.types';\n\n/** The setup steps rendered above the hero / form. Returns null when omitted. */\nconst OnboardingSteps: React.FC<\n Pick<SectionOnboardingProps, 'steps' | 'activeStepId' | 'completedStepIds'> & {\n dataTestId: string;\n }\n> = ({ steps, activeStepId, completedStepIds, dataTestId }) => {\n if (!steps || steps.length === 0) return null;\n // Preview mode (no active step): highlight the first so the flow reads L→R.\n const activeId = activeStepId ?? steps[0]?.id ?? '';\n return (\n <Box sx={{ width: '100%', overflowX: 'auto', pb: 1 }}>\n <Stepper\n steps={steps}\n activeId={activeId}\n completed={new Set(completedStepIds ?? [])}\n size=\"sm\"\n data-testid={`${dataTestId}-steps`}\n />\n </Box>\n );\n};\n\n/** The compact \"already connected\" header shown in the configured state. */\nconst ConfiguredSummary: React.FC<\n Pick<SectionOnboardingProps, 'configuredTitle' | 'title' | 'configuredSummary'> & {\n dataTestId: string;\n expanded: boolean;\n onToggle: () => void;\n editLabel: string;\n collapseLabel: string;\n hasChildren: boolean;\n }\n> = ({\n configuredTitle,\n title,\n configuredSummary,\n dataTestId,\n expanded,\n onToggle,\n editLabel,\n collapseLabel,\n hasChildren,\n}) => {\n const theme = useTheme();\n return (\n <Stack\n direction={{ xs: 'column', sm: 'row' }}\n spacing={2}\n alignItems={{ xs: 'flex-start', sm: 'center' }}\n data-testid={`${dataTestId}-summary`}\n >\n <CheckCircle sx={{ color: theme.palette.success.main }} aria-hidden />\n <Box sx={{ minWidth: 0 }}>\n <Typography variant=\"subtitle1\" component=\"h3\" fontWeight=\"medium\">\n {configuredTitle ?? title}\n </Typography>\n {configuredSummary && (\n <Typography variant=\"body2\" color=\"text.secondary\" component=\"div\">\n {configuredSummary}\n </Typography>\n )}\n </Box>\n {hasChildren && (\n <Button\n variant=\"outlined\"\n size=\"small\"\n onClick={onToggle}\n aria-expanded={expanded}\n data-testid={`${dataTestId}-edit-toggle`}\n >\n {expanded ? collapseLabel : editLabel}\n </Button>\n )}\n </Stack>\n );\n};\n\n/**\n * Per-section onboarding wrapper: the same config surface renders three ways\n * depending on `status`, so a first-time user meets a friendly hero + CTA\n * instead of a wall of empty fields, while a returning user sees a compact\n * \"it's connected\" summary with the form tucked behind an \"Editar\" toggle.\n *\n * Composes the existing {@link EmptyState} (the hero) and {@link Stepper} (the\n * progress preview) — drop it onto any settings/integration page and drive it\n * from whatever \"is this configured?\" signal the feature already has.\n */\n/** Configured state: compact success summary + the form behind an \"Editar\" toggle. */\nconst ConfiguredView: React.FC<SectionOnboardingProps> = ({\n title,\n configuredTitle,\n configuredSummary,\n editLabel,\n collapseLabel,\n defaultExpanded = false,\n children,\n className,\n dataTestId = 'section-onboarding',\n}) => {\n const [expanded, setExpanded] = React.useState(defaultExpanded);\n return (\n <Box\n className={className}\n data-testid={dataTestId}\n data-status=\"configured\"\n sx={{ p: 2, borderRadius: 1, border: 1, borderColor: 'divider' }}\n >\n <ConfiguredSummary\n configuredTitle={configuredTitle}\n title={title}\n configuredSummary={configuredSummary}\n dataTestId={dataTestId}\n expanded={expanded}\n onToggle={() => setExpanded((prev) => !prev)}\n editLabel={editLabel}\n collapseLabel={collapseLabel}\n hasChildren={Boolean(children)}\n />\n {children && (\n <Collapse in={expanded} unmountOnExit>\n <Box sx={{ mt: 3 }} data-testid={`${dataTestId}-content`}>\n {children}\n </Box>\n </Collapse>\n )}\n </Box>\n );\n};\n\n/** In-progress state (or a started hero): the live stepper + the form. */\nconst InProgressView: React.FC<SectionOnboardingProps & { statusAttr: string }> = ({\n steps,\n activeStepId,\n completedStepIds,\n children,\n className,\n statusAttr,\n dataTestId = 'section-onboarding',\n}) => (\n <Stack className={className} data-testid={dataTestId} data-status={statusAttr} spacing={3}>\n <OnboardingSteps\n steps={steps}\n activeStepId={activeStepId}\n completedStepIds={completedStepIds}\n dataTestId={dataTestId}\n />\n {children && <Box data-testid={`${dataTestId}-content`}>{children}</Box>}\n </Stack>\n);\n\n/** Unconfigured hero: optional step preview + the EmptyState hero + CTA. */\nconst HeroView: React.FC<SectionOnboardingProps & { onStart: () => void }> = ({\n title,\n description,\n illustration,\n steps,\n activeStepId,\n completedStepIds,\n primaryAction,\n startLabel,\n secondaryAction,\n helpLink,\n children,\n className,\n onStart,\n dataTestId = 'section-onboarding',\n}) => {\n // With no custom primaryAction, offer a built-in CTA that reveals the form.\n const heroPrimary =\n primaryAction ?? (children ? { label: startLabel, onClick: onStart } : undefined);\n return (\n <Stack className={className} data-testid={dataTestId} data-status=\"unconfigured\" spacing={1}>\n <OnboardingSteps\n steps={steps}\n activeStepId={activeStepId}\n completedStepIds={completedStepIds}\n dataTestId={dataTestId}\n />\n <EmptyState\n variant={illustration ? 'illustrated' : 'action'}\n title={title}\n description={description}\n illustration={illustration}\n primaryAction={heroPrimary}\n secondaryAction={secondaryAction}\n helpLink={helpLink}\n dataTestId={`${dataTestId}-hero`}\n />\n </Stack>\n );\n};\n\nexport const SectionOnboarding: React.FC<SectionOnboardingProps> = (props) => {\n // Lets the hero reveal the form in place, so a server page can adopt\n // onboarding by passing `status` + children alone — no client wrapper.\n const [started, setStarted] = React.useState(false);\n\n if (props.status === 'configured') {\n return <ConfiguredView {...props} />;\n }\n if (props.status === 'in-progress' || started) {\n return (\n <InProgressView\n {...props}\n statusAttr={props.status === 'in-progress' ? 'in-progress' : 'started'}\n />\n );\n }\n return <HeroView {...props} onStart={() => setStarted(true)} />;\n};\n\nSectionOnboarding.displayName = 'SectionOnboarding';\n\nexport default SectionOnboarding;\n"],"mappings":";;;;;;;;;AAEA,OAAO,iBAAiB;AACxB,SAAS,KAAK,QAAQ,UAAU,OAAO,YAAY,gBAAgB;AACnE,OAAO,WAAW;AAiBZ,cAyCA,YAzCA;AAVN,IAAM,kBAIF,CAAC,EAAE,OAAO,cAAc,kBAAkB,WAAW,MAAM;AAC7D,MAAI,CAAC,SAAS,MAAM,WAAW,EAAG,QAAO;AAEzC,QAAM,WAAW,gBAAgB,MAAM,CAAC,GAAG,MAAM;AACjD,SACE,oBAAC,OAAI,IAAI,EAAE,OAAO,QAAQ,WAAW,QAAQ,IAAI,EAAE,GACjD;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,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A,IACA;AAAA,MAAC;AAAA;AAAA,QACC,SAAS,eAAe,gBAAgB;AAAA,QACxC;AAAA,QACA;AAAA,QACA;AAAA,QACA,eAAe;AAAA,QACf;AAAA,QACA;AAAA,QACA,YAAY,GAAG,UAAU;AAAA;AAAA,IAC3B;AAAA,KACF;AAEJ;AAEO,IAAM,oBAAsD,CAAC,UAAU;AAG5E,QAAM,CAAC,SAAS,UAAU,IAAI,MAAM,SAAS,KAAK;AAElD,MAAI,MAAM,WAAW,cAAc;AACjC,WAAO,oBAAC,kBAAgB,GAAG,OAAO;AAAA,EACpC;AACA,MAAI,MAAM,WAAW,iBAAiB,SAAS;AAC7C,WACE;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ,YAAY,MAAM,WAAW,gBAAgB,gBAAgB;AAAA;AAAA,IAC/D;AAAA,EAEJ;AACA,SAAO,oBAAC,YAAU,GAAG,OAAO,SAAS,MAAM,WAAW,IAAI,GAAG;AAC/D;AAEA,kBAAkB,cAAc;AAEhC,IAAO,4BAAQ;","names":[]}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ConfirmAction,
|
|
3
3
|
ConfirmActionDialog,
|
|
4
|
-
|
|
5
|
-
DEFAULT_ERROR_TEXT,
|
|
4
|
+
createConfirmButton,
|
|
6
5
|
useConfirmAction,
|
|
7
6
|
withConfirmation
|
|
8
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-MXPXKORR.js";
|
|
9
8
|
import "../chunk-ARNQIGA4.js";
|
|
10
9
|
import "../chunk-BA4RHQ3B.js";
|
|
11
10
|
import "../chunk-ANNZ3PLI.js";
|
|
@@ -13,8 +12,7 @@ import "../chunk-PZ5AY32C.js";
|
|
|
13
12
|
export {
|
|
14
13
|
ConfirmAction,
|
|
15
14
|
ConfirmActionDialog,
|
|
16
|
-
|
|
17
|
-
DEFAULT_ERROR_TEXT,
|
|
15
|
+
createConfirmButton,
|
|
18
16
|
useConfirmAction,
|
|
19
17
|
withConfirmation
|
|
20
18
|
};
|
package/dist/form/CepField.js
CHANGED
package/dist/form/total-form.js
CHANGED
|
@@ -6,13 +6,13 @@ import {
|
|
|
6
6
|
} from "../chunk-ENUVGXLE.js";
|
|
7
7
|
import {
|
|
8
8
|
CepField
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-N554AFDB.js";
|
|
10
10
|
import {
|
|
11
11
|
Toast
|
|
12
12
|
} from "../chunk-5ETQ3NX5.js";
|
|
13
13
|
import {
|
|
14
14
|
CategorySelect
|
|
15
|
-
} from "../chunk-
|
|
15
|
+
} from "../chunk-TPQRIPCN.js";
|
|
16
16
|
import {
|
|
17
17
|
Input
|
|
18
18
|
} from "../chunk-OOKQ2LMM.js";
|
|
@@ -148,13 +148,15 @@ function CategoryField({
|
|
|
148
148
|
options,
|
|
149
149
|
label,
|
|
150
150
|
placeholder,
|
|
151
|
-
allowParentSelection = true
|
|
151
|
+
allowParentSelection = true,
|
|
152
|
+
copy
|
|
152
153
|
}) {
|
|
153
154
|
const { values, errors, setFieldValue } = useFormContext();
|
|
154
155
|
const error = errors[name];
|
|
155
156
|
return /* @__PURE__ */ jsx4(
|
|
156
157
|
CategorySelect,
|
|
157
158
|
{
|
|
159
|
+
copy,
|
|
158
160
|
mode: "single",
|
|
159
161
|
fullWidth: true,
|
|
160
162
|
label,
|
|
@@ -204,7 +206,8 @@ function CepField2({
|
|
|
204
206
|
label,
|
|
205
207
|
lookup,
|
|
206
208
|
fills,
|
|
207
|
-
debounceMs
|
|
209
|
+
debounceMs,
|
|
210
|
+
copy
|
|
208
211
|
}) {
|
|
209
212
|
const { values, errors, setFieldValue } = useFormContext();
|
|
210
213
|
const { write, clearOwned } = useOwnedAutofill();
|
|
@@ -225,6 +228,7 @@ function CepField2({
|
|
|
225
228
|
return /* @__PURE__ */ jsx5(
|
|
226
229
|
CepField,
|
|
227
230
|
{
|
|
231
|
+
copy,
|
|
228
232
|
name,
|
|
229
233
|
label,
|
|
230
234
|
value: values[name] ?? "",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/form/total-form/FormContainer.tsx","../../src/components/form/total-form/FormContext.tsx","../../src/components/form/total-form/FormErrorSnackbar.tsx","../../src/components/form/total-form/SubmitButton.tsx","../../src/components/form/total-form/Fields/index.ts","../../src/components/form/total-form/Fields/CategoryField.tsx","../../src/components/form/total-form/Fields/CepField.tsx","../../src/components/form/total-form/Fields/TextField.tsx","../../src/components/form/total-form/Fields/SelectField.tsx","../../src/components/form/total-form/Fields/ToggleField.tsx"],"sourcesContent":["'use client';\n\nimport { validateFields } from '@12-apps/forms-core';\nimport type { ValidatorSchema } from '@12-apps/forms-core';\nimport React, { useCallback, useMemo, useState } from 'react';\n\nimport { Form } from '../Form';\n\nimport { FormContext } from './FormContext';\nimport type { TotalFormContextValue } from './FormContext';\n\n/** Imperative helpers handed to {@link FormContainerProps.onSubmit}. */\nexport interface FormSubmitHelpers {\n /**\n * Set (highlight) per-field error messages after a submit — e.g. mapping a\n * server failure back to the exact offending field. Pass `{}` to clear. Each\n * error auto-clears when the user edits that field.\n */\n setFieldErrors: (errors: Record<string, string | undefined>) => void;\n}\n\n/** Props for {@link FormContainer}. */\nexport interface FormContainerProps<T extends Record<string, string>> {\n /** Initial value for every field, keyed by field name. */\n initialValues: T;\n /** Per-field validators run on submit. Omit to skip validation. */\n schema?: ValidatorSchema<T>;\n /**\n * Called with the validated values once the form passes validation. Receives\n * {@link FormSubmitHelpers} so it can highlight fields on a server failure.\n */\n onSubmit: (values: T, helpers: FormSubmitHelpers) => void | Promise<void>;\n /** Field components, the submit button, and the error snackbar. */\n children: React.ReactNode;\n /** Test id applied to the underlying `<form>`. Defaults to `total-form`. */\n dataTestId?: string;\n}\n\n/**\n * Stateful, domain-agnostic form container ported from the gym-app\n * `total-form`. Holds values/errors/submitting in {@link FormContext}, runs the\n * field validators from `@12-apps/forms-core` on submit, and only calls\n * `onSubmit` with the validated values when no field errors remain. Uses no\n * zod and no react-hook-form.\n *\n * @typeParam T - The form's value shape (a record of string fields).\n */\nexport function FormContainer<T extends Record<string, string>>({\n initialValues,\n schema,\n onSubmit,\n children,\n dataTestId = 'total-form',\n}: FormContainerProps<T>): React.ReactElement {\n const [values, setValues] = useState<T>(initialValues);\n const [errors, setErrors] = useState<Record<string, string | undefined>>({});\n const [submitting, setSubmitting] = useState(false);\n\n const setFieldValue = useCallback<TotalFormContextValue['setFieldValue']>((name, value) => {\n setValues((prev) => ({ ...prev, [name]: value }));\n setErrors((prev) => {\n if (!prev[name]) return prev;\n const next = { ...prev };\n delete next[name];\n return next;\n });\n }, []);\n\n const handleSubmit = useCallback(\n async (event: React.FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n const nextErrors = schema ? validateFields(values, schema) : {};\n setErrors(nextErrors);\n if (Object.values(nextErrors).some(Boolean)) return;\n\n setSubmitting(true);\n try {\n // Replace the error map so the helper's contract holds: passing `{}`\n // clears, and a later field-less failure can't leave a stale highlight.\n // `onSubmit` only runs once client validation passes, so there are no\n // client errors here to preserve.\n await onSubmit(values, {\n setFieldErrors: (fieldErrors) => setErrors(fieldErrors),\n });\n } finally {\n setSubmitting(false);\n }\n },\n [onSubmit, schema, values],\n );\n\n const contextValue = useMemo<TotalFormContextValue>(\n () => ({ values, errors, submitting, setFieldValue }),\n [errors, setFieldValue, submitting, values],\n );\n\n return (\n <FormContext.Provider value={contextValue}>\n <Form dataTestId={dataTestId} onSubmit={handleSubmit} noValidate>\n {children}\n </Form>\n </FormContext.Provider>\n );\n}\n","'use client';\n\nimport { createContext, useContext } from 'react';\n\n/**\n * Shape of the value exposed by the `total-form` {@link FormContext}.\n *\n * Field values and errors are keyed by field name. The container owns the\n * state; fields and controls read from and write to it through\n * {@link useFormContext}.\n */\nexport interface TotalFormContextValue {\n /** Current value of every field, keyed by field name. */\n values: Record<string, string>;\n /** First validation error per field (absent when the field is valid). */\n errors: Record<string, string | undefined>;\n /** Whether the form's `onSubmit` handler is currently running. */\n submitting: boolean;\n /** Updates a single field's value and clears any resolved error for it. */\n setFieldValue: (name: string, value: string) => void;\n}\n\n/** React context backing the `total-form` layer. `null` outside a container. */\nexport const FormContext = createContext<TotalFormContextValue | null>(null);\n\n/**\n * Reads the nearest {@link FormContext}.\n *\n * @throws If called outside a `FormContainer`.\n * @returns The current form context value.\n */\nexport function useFormContext(): TotalFormContextValue {\n const context = useContext(FormContext);\n if (!context) {\n throw new Error('useFormContext must be used within a <FormContainer>');\n }\n return context;\n}\n","'use client';\n\nimport React from 'react';\n\nimport { Toast } from '../../feedback/Toast';\nimport { useFormContext } from './FormContext';\n\n/** Props for {@link FormErrorSnackbar}. */\nexport interface FormErrorSnackbarProps {\n /** Message shown when the form has field errors. */\n message?: string;\n}\n\n/**\n * Surfaces form-level validation failures. Thin wrapper over the existing\n * `@12-apps/ui` `Toast`: renders nothing while the form is valid and shows an\n * error toast (testid `total-form-error-snackbar`) once any field has an error.\n */\nexport function FormErrorSnackbar({\n message = 'Please fix the highlighted fields and try again.',\n}: FormErrorSnackbarProps): React.ReactElement | null {\n const { errors } = useFormContext();\n const hasErrors = Object.values(errors).some(Boolean);\n\n if (!hasErrors) return null;\n\n return (\n <Toast\n dataTestId=\"total-form-error-snackbar\"\n variant=\"error\"\n message={message}\n closable={false}\n />\n );\n}\n","'use client';\n\nimport React from 'react';\n\nimport { Button } from '../Button';\nimport { useFormContext } from './FormContext';\n\n/** Props for {@link SubmitButton}. */\nexport interface SubmitButtonProps {\n /** Button label. */\n children: React.ReactNode;\n /** Test id; defaults to `total-form-submit`. Override when a page renders more than one form. */\n dataTestId?: string;\n}\n\n/**\n * The height of a form input control (see `Input` — `.MuiInputBase-root`), so a\n * submit button placed inline with fields lines up with them instead of sitting\n * shorter. Kept in sync with that value by hand.\n */\nconst FIELD_HEIGHT = 56;\n\n/**\n * Submit control wired to {@link useFormContext}. Wraps the existing `@12-apps/ui`\n * `Button` as a `type=\"submit\"` button (testid `total-form-submit`) and\n * reflects the form's `submitting` state via `loading`/`disabled`.\n *\n * It matches the form field height and never wraps its label, so it aligns with\n * an adjacent input on the same row (and stays full-width when the row stacks).\n */\nexport function SubmitButton({\n children,\n dataTestId = 'total-form-submit',\n}: SubmitButtonProps): React.ReactElement {\n const { submitting } = useFormContext();\n\n return (\n <Button\n type=\"submit\"\n dataTestId={dataTestId}\n loading={submitting}\n disabled={submitting}\n // `Button` replaces (not merges) its size styles with this `sx`, so restate\n // the md padding/font here alongside the field-height + no-wrap alignment.\n sx={{ height: FIELD_HEIGHT, px: 2, fontSize: '1rem', flexShrink: 0, whiteSpace: 'nowrap' }}\n >\n {children}\n </Button>\n );\n}\n","export { CategoryField } from './CategoryField';\nexport type { CategoryFieldProps } from './CategoryField';\nexport { CepField } from './CepField';\nexport type { CepFieldProps, CepFills } from './CepField';\nexport { TextField } from './TextField';\nexport type { TextFieldProps } from './TextField';\nexport { SelectField } from './SelectField';\nexport type { SelectFieldProps } from './SelectField';\nexport { ToggleField } from './ToggleField';\nexport type { ToggleFieldProps } from './ToggleField';\n","'use client';\n\nimport React from 'react';\n\nimport { CategorySelect } from '../../CategorySelect';\nimport type { CategorySelectOption } from '../../CategorySelect';\nimport { useFormContext } from '../FormContext';\n\n/** Props for the `total-form` {@link CategoryField}. */\nexport interface CategoryFieldProps {\n /** Field name; also the key into the form's values/errors. */\n name: string;\n /** The categories to choose from, flat, each carrying its `parentId`. */\n options: CategorySelectOption[];\n /** Optional visible label rendered above the control. */\n label?: string;\n /** Placeholder shown while nothing is chosen. */\n placeholder?: string;\n /** Lets a top-level category be chosen in its own right (default: `true`). */\n allowParentSelection?: boolean;\n}\n\n/**\n * Category picker bound to {@link useFormContext}.\n *\n * The sibling {@link SelectField} flattens a category tree into one list, which\n * is the thing the hierarchical picker exists to stop. Use this wherever the\n * field's options nest.\n *\n * Form values are strings, so \"nothing chosen\" travels as `\"\"` — mapped to and\n * from the control's `null` here rather than making every caller do it.\n */\nexport function CategoryField({\n name,\n options,\n label,\n placeholder,\n allowParentSelection = true,\n}: CategoryFieldProps): React.ReactElement {\n const { values, errors, setFieldValue } = useFormContext();\n const error = errors[name];\n\n return (\n <CategorySelect\n mode=\"single\"\n fullWidth\n label={label}\n placeholder={placeholder}\n options={options}\n allowParentSelection={allowParentSelection}\n value={values[name] ? values[name] : null}\n error={error}\n onChange={(next) => setFieldValue(name, next ?? '')}\n dataTestId={`total-form-field-${name}`}\n />\n );\n}\n","'use client';\n\nimport React, { useCallback, useMemo, useRef } from 'react';\n\nimport { CepField as BaseCepField, type CepAddress } from '../../CepField';\nimport { useFormContext } from '../FormContext';\n\n/** The resolved address parts a form can receive. */\ntype CepPart = 'street' | 'neighborhood' | 'city' | 'state';\n\n/**\n * Which form field receives each resolved part. Omit a part to leave it alone —\n * a form with no bairro column simply doesn't map `neighborhood`.\n */\nexport type CepFills = Partial<Record<CepPart, string>>;\n\n/** Props for the `total-form` {@link CepField}. */\nexport interface CepFieldProps {\n /** Field name; also the key into the form's values/errors. */\n name: string;\n /** Optional visible label. Defaults to `CEP`. */\n label?: string;\n /** Resolve a complete CEP. Omit for a masked input with no lookup. */\n lookup?: (cep: string) => Promise<CepAddress | null>;\n /** Maps each resolved address part onto a field in THIS form. */\n fills?: CepFills;\n /** Milliseconds to wait after the last keystroke before looking up. */\n debounceMs?: number;\n}\n\nconst PARTS: readonly CepPart[] = ['street', 'neighborhood', 'city', 'state'];\n\n/** Ownership-aware writes into sibling form fields. */\ninterface OwnedAutofill {\n /** Write one field, where `''` means \"no value for this part\". */\n write: (field: string, value: string) => void;\n /** Blank every field this hook still owns. */\n clearOwned: () => void;\n}\n\n/**\n * The honesty rule, in one place: this hook remembers exactly what it wrote,\n * writes only into fields that are empty or still hold its own value, and drops\n * the ownership record when it blanks one. That single invariant is what lets\n * autofill replace itself freely while never touching the user's typing.\n */\nfunction useOwnedAutofill(): OwnedAutofill {\n const { values, setFieldValue } = useFormContext();\n // What we last auto-filled per target field, so a later lookup may replace\n // its own value while a manual edit is preserved.\n const autoFilledRef = useRef<Record<string, string>>({});\n // Read values at call time without making them a dependency of the callback.\n const valuesRef = useRef(values);\n valuesRef.current = values;\n\n const write = useCallback(\n (field: string, value: string) => {\n const current = (valuesRef.current[field] ?? '').trim();\n const ours = autoFilledRef.current[field] === current;\n if (current !== '' && !ours) return;\n setFieldValue(field, value);\n if (value) {\n autoFilledRef.current[field] = value;\n } else {\n delete autoFilledRef.current[field];\n }\n },\n [setFieldValue],\n );\n\n const clearOwned = useCallback(() => {\n // Object.keys snapshots, so `write` may delete entries as we iterate.\n for (const field of Object.keys(autoFilledRef.current)) {\n write(field, '');\n }\n }, [write]);\n\n return useMemo(() => ({ write, clearOwned }), [write, clearOwned]);\n}\n\n/**\n * CEP field bound to {@link useFormContext}: masks and validates the CEP, then\n * writes the resolved logradouro/bairro/cidade/UF straight into the sibling\n * fields named by `fills`.\n *\n * It will not overwrite work the user has done. A target field is only written\n * when it is empty, or when it still holds the exact value THIS component put\n * there — so correcting the CEP re-fills the address, but a hand-edited street\n * survives the next lookup.\n *\n * @example\n * ```tsx\n * <Fields.CepField\n * name=\"postalCode\"\n * lookup={lookupCep}\n * fills={{ street: 'addressLine1', neighborhood: 'neighborhood', city: 'city', state: 'state' }}\n * />\n * ```\n */\nexport function CepField({\n name,\n label,\n lookup,\n fills,\n debounceMs,\n}: CepFieldProps): React.ReactElement {\n const { values, errors, setFieldValue } = useFormContext();\n const { write, clearOwned } = useOwnedAutofill();\n\n const handleResolved = useCallback(\n (address: CepAddress) => {\n if (!fills) return;\n // Every mapped part is written on EVERY resolve, absent ones as ''. A\n // \"CEP geral\" (a small município's catch-all) carries no logradouro, so\n // skipping absent parts would leave the previous CEP's street here.\n for (const part of PARTS) {\n const field = fills[part];\n if (field) write(field, address[part] ?? '');\n }\n },\n [fills, write],\n );\n\n const handleChange = useCallback(\n (masked: string) => setFieldValue(name, masked),\n [name, setFieldValue],\n );\n\n return (\n <BaseCepField\n name={name}\n label={label}\n value={values[name] ?? ''}\n error={errors[name]}\n onChange={handleChange}\n onLookup={lookup}\n onResolved={handleResolved}\n onNotFound={clearOwned}\n debounceMs={debounceMs}\n dataTestId={`total-form-field-${name}`}\n />\n );\n}\n","'use client';\n\nimport React from 'react';\n\nimport { FormControl, FormLabel, FormMessage } from '../../Form';\nimport { Input } from '../../Input';\nimport { useFormContext } from '../FormContext';\n\n/** Props for the `total-form` {@link TextField}. */\nexport interface TextFieldProps {\n /** Field name; also the key into the form's values/errors. */\n name: string;\n /** Optional visible label rendered above the input. */\n label?: string;\n /** Native input type (e.g. `email`, `password`). Defaults to `text`. */\n type?: string;\n /** Placeholder shown when the field is empty. */\n placeholder?: string;\n}\n\n/**\n * Text input field bound to {@link useFormContext}. Composes the existing\n * `@12-apps/ui` `Form*` presentational primitives and the `Input` control,\n * reading its value/error from context and writing changes back through it.\n *\n * Renders its error via `total-form-field-<name>-message` and the input via\n * `total-form-field-<name>`.\n */\nexport function TextField({ name, label, type = 'text', placeholder }: TextFieldProps): React.ReactElement {\n const { values, errors, setFieldValue } = useFormContext();\n const error = errors[name];\n const testId = `total-form-field-${name}`;\n\n return (\n <FormControl fullWidth>\n {label && (\n <FormLabel htmlFor={name} error={Boolean(error)}>\n {label}\n </FormLabel>\n )}\n <Input\n id={name}\n name={name}\n type={type}\n placeholder={placeholder}\n value={values[name] ?? ''}\n error={Boolean(error)}\n data-testid={testId}\n onChange={(event) => setFieldValue(name, event.target.value)}\n />\n {error && (\n <FormMessage error dataTestId={`${testId}-message`}>\n {error}\n </FormMessage>\n )}\n </FormControl>\n );\n}\n","'use client';\n\nimport React from 'react';\n\nimport { FormControl, FormLabel, FormMessage } from '../../Form';\nimport { Select } from '../../Select';\nimport type { SelectOption } from '../../Select';\nimport { useFormContext } from '../FormContext';\n\n/** Props for the `total-form` {@link SelectField}. */\nexport interface SelectFieldProps {\n /** Field name; also the key into the form's values/errors. */\n name: string;\n /** Selectable options. */\n options: SelectOption[];\n /** Optional visible label rendered above the select. */\n label?: string;\n /** Placeholder shown when no option is selected. */\n placeholder?: string;\n}\n\n/**\n * Select field bound to {@link useFormContext}. Composes the existing\n * `@12-apps/ui` `Form*` primitives and the `Select` control, reading its\n * value/error from context and writing the chosen value back through it.\n *\n * Renders its error via `total-form-field-<name>-message` and the select via\n * `total-form-field-<name>`.\n */\nexport function SelectField({ name, options, label, placeholder }: SelectFieldProps): React.ReactElement {\n const { values, errors, setFieldValue } = useFormContext();\n const error = errors[name];\n const testId = `total-form-field-${name}`;\n\n return (\n <FormControl fullWidth>\n {label && (\n <FormLabel htmlFor={name} error={Boolean(error)}>\n {label}\n </FormLabel>\n )}\n <Select\n options={options}\n placeholder={placeholder}\n value={values[name] ?? ''}\n error={Boolean(error)}\n data-testid={testId}\n onChange={(event) => setFieldValue(name, String(event.target.value))}\n />\n {error && (\n <FormMessage error dataTestId={`${testId}-message`}>\n {error}\n </FormMessage>\n )}\n </FormControl>\n );\n}\n","'use client';\n\nimport React from 'react';\n\nimport { FormControl, FormLabel, FormMessage } from '../../Form';\nimport { ToggleGroup } from '../../ToggleGroup';\nimport type { ToggleOption } from '../../ToggleGroup';\nimport { useFormContext } from '../FormContext';\n\n/** Props for the `total-form` {@link ToggleField}. */\nexport interface ToggleFieldProps {\n /** Field name; also the key into the form's values/errors. */\n name: string;\n /** The mutually-exclusive options (one is always selected). */\n options: ToggleOption[];\n /** Optional visible label rendered above the toggle. */\n label?: string;\n}\n\n/**\n * Exclusive toggle (segmented control) bound to {@link useFormContext} — a\n * label-height-matched alternative to {@link SelectField} for a short, always-set\n * enum. Composes the `Form*` primitives and the `ToggleGroup` control, reading\n * its value from context and writing the chosen value back through it. Ignores a\n * deselect (clicking the active segment) so a value is always kept.\n *\n * Renders its error via `total-form-field-<name>-message` and the toggle via\n * `total-form-field-<name>` (each segment at `total-form-field-<name>-item-<value>`).\n */\nexport function ToggleField({ name, options, label }: ToggleFieldProps): React.ReactElement {\n const { values, errors, setFieldValue } = useFormContext();\n const error = errors[name];\n const testId = `total-form-field-${name}`;\n\n return (\n <FormControl fullWidth>\n {label && (\n <FormLabel htmlFor={name} error={Boolean(error)}>\n {label}\n </FormLabel>\n )}\n <ToggleGroup\n variant=\"exclusive\"\n options={options}\n value={values[name] ?? ''}\n fullWidth\n dataTestId={testId}\n // Match the input field height so the toggle lines up in a form row.\n sx={{ '& .MuiToggleButtonGroup-grouped': { height: 56 } }}\n onChange={(_event, next) => {\n if (typeof next === 'string') setFieldValue(name, next);\n }}\n />\n {error && (\n <FormMessage error dataTestId={`${testId}-message`}>\n {error}\n </FormMessage>\n )}\n </FormControl>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAS,sBAAsB;AAE/B,SAAgB,aAAa,SAAS,gBAAgB;;;ACFtD,SAAS,eAAe,kBAAkB;AAqBnC,IAAM,cAAc,cAA4C,IAAI;AAQpE,SAAS,iBAAwC;AACtD,QAAM,UAAU,WAAW,WAAW;AACtC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,sDAAsD;AAAA,EACxE;AACA,SAAO;AACT;;;AD6DM;AAnDC,SAAS,cAAgD;AAAA,EAC9D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AACf,GAA8C;AAC5C,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAY,aAAa;AACrD,QAAM,CAAC,QAAQ,SAAS,IAAI,SAA6C,CAAC,CAAC;AAC3E,QAAM,CAAC,YAAY,aAAa,IAAI,SAAS,KAAK;AAElD,QAAM,gBAAgB,YAAoD,CAAC,MAAM,UAAU;AACzF,cAAU,CAAC,UAAU,EAAE,GAAG,MAAM,CAAC,IAAI,GAAG,MAAM,EAAE;AAChD,cAAU,CAAC,SAAS;AAClB,UAAI,CAAC,KAAK,IAAI,EAAG,QAAO;AACxB,YAAM,OAAO,EAAE,GAAG,KAAK;AACvB,aAAO,KAAK,IAAI;AAChB,aAAO;AAAA,IACT,CAAC;AAAA,EACH,GAAG,CAAC,CAAC;AAEL,QAAM,eAAe;AAAA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AFJ,QAAAC,aAAA;AANG,SAAS,YAAY,EAAE,MAAM,SAAS,MAAM,GAAyC;AAC1F,QAAM,EAAE,QAAQ,QAAQ,cAAc,IAAI,eAAe;AACzD,QAAM,QAAQ,OAAO,IAAI;AACzB,QAAM,SAAS,oBAAoB,IAAI;AAEvC,SACE,gBAAAA,MAAC,eAAY,WAAS,MACnB;AAAA,aACC,gBAAAD,KAAC,aAAU,SAAS,MAAM,OAAO,QAAQ,KAAK,GAC3C,iBACH;AAAA,IAEF,gBAAAA;AAAA,MAAC;AAAA;AAAA,QACC,SAAQ;AAAA,QACR;AAAA,QACA,OAAO,OAAO,IAAI,KAAK;AAAA,QACvB,WAAS;AAAA,QACT,YAAY;AAAA,QAEZ,IAAI,EAAE,mCAAmC,EAAE,QAAQ,GAAG,EAAE;AAAA,QACxD,UAAU,CAAC,QAAQ,SAAS;AAC1B,cAAI,OAAO,SAAS,SAAU,eAAc,MAAM,IAAI;AAAA,QACxD;AAAA;AAAA,IACF;AAAA,IACC,SACC,gBAAAA,KAAC,eAAY,OAAK,MAAC,YAAY,GAAG,MAAM,YACrC,iBACH;AAAA,KAEJ;AAEJ;","names":["jsx","jsx","CepField","jsx","useCallback","useMemo","jsx","useCallback","useMemo","CepField","jsx","jsx","jsxs","jsx","jsxs"]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/form/total-form/FormContainer.tsx","../../src/components/form/total-form/FormContext.tsx","../../src/components/form/total-form/FormErrorSnackbar.tsx","../../src/components/form/total-form/SubmitButton.tsx","../../src/components/form/total-form/Fields/index.ts","../../src/components/form/total-form/Fields/CategoryField.tsx","../../src/components/form/total-form/Fields/CepField.tsx","../../src/components/form/total-form/Fields/TextField.tsx","../../src/components/form/total-form/Fields/SelectField.tsx","../../src/components/form/total-form/Fields/ToggleField.tsx"],"sourcesContent":["'use client';\n\nimport { validateFields } from '@12-apps/forms-core';\nimport type { ValidatorSchema } from '@12-apps/forms-core';\nimport React, { useCallback, useMemo, useState } from 'react';\n\nimport { Form } from '../Form';\n\nimport { FormContext } from './FormContext';\nimport type { TotalFormContextValue } from './FormContext';\n\n/** Imperative helpers handed to {@link FormContainerProps.onSubmit}. */\nexport interface FormSubmitHelpers {\n /**\n * Set (highlight) per-field error messages after a submit — e.g. mapping a\n * server failure back to the exact offending field. Pass `{}` to clear. Each\n * error auto-clears when the user edits that field.\n */\n setFieldErrors: (errors: Record<string, string | undefined>) => void;\n}\n\n/** Props for {@link FormContainer}. */\nexport interface FormContainerProps<T extends Record<string, string>> {\n /** Initial value for every field, keyed by field name. */\n initialValues: T;\n /** Per-field validators run on submit. Omit to skip validation. */\n schema?: ValidatorSchema<T>;\n /**\n * Called with the validated values once the form passes validation. Receives\n * {@link FormSubmitHelpers} so it can highlight fields on a server failure.\n */\n onSubmit: (values: T, helpers: FormSubmitHelpers) => void | Promise<void>;\n /** Field components, the submit button, and the error snackbar. */\n children: React.ReactNode;\n /** Test id applied to the underlying `<form>`. Defaults to `total-form`. */\n dataTestId?: string;\n}\n\n/**\n * Stateful, domain-agnostic form container ported from the gym-app\n * `total-form`. Holds values/errors/submitting in {@link FormContext}, runs the\n * field validators from `@12-apps/forms-core` on submit, and only calls\n * `onSubmit` with the validated values when no field errors remain. Uses no\n * zod and no react-hook-form.\n *\n * @typeParam T - The form's value shape (a record of string fields).\n */\nexport function FormContainer<T extends Record<string, string>>({\n initialValues,\n schema,\n onSubmit,\n children,\n dataTestId = 'total-form',\n}: FormContainerProps<T>): React.ReactElement {\n const [values, setValues] = useState<T>(initialValues);\n const [errors, setErrors] = useState<Record<string, string | undefined>>({});\n const [submitting, setSubmitting] = useState(false);\n\n const setFieldValue = useCallback<TotalFormContextValue['setFieldValue']>((name, value) => {\n setValues((prev) => ({ ...prev, [name]: value }));\n setErrors((prev) => {\n if (!prev[name]) return prev;\n const next = { ...prev };\n delete next[name];\n return next;\n });\n }, []);\n\n const handleSubmit = useCallback(\n async (event: React.FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n const nextErrors = schema ? validateFields(values, schema) : {};\n setErrors(nextErrors);\n if (Object.values(nextErrors).some(Boolean)) return;\n\n setSubmitting(true);\n try {\n // Replace the error map so the helper's contract holds: passing `{}`\n // clears, and a later field-less failure can't leave a stale highlight.\n // `onSubmit` only runs once client validation passes, so there are no\n // client errors here to preserve.\n await onSubmit(values, {\n setFieldErrors: (fieldErrors) => setErrors(fieldErrors),\n });\n } finally {\n setSubmitting(false);\n }\n },\n [onSubmit, schema, values],\n );\n\n const contextValue = useMemo<TotalFormContextValue>(\n () => ({ values, errors, submitting, setFieldValue }),\n [errors, setFieldValue, submitting, values],\n );\n\n return (\n <FormContext.Provider value={contextValue}>\n <Form dataTestId={dataTestId} onSubmit={handleSubmit} noValidate>\n {children}\n </Form>\n </FormContext.Provider>\n );\n}\n","'use client';\n\nimport { createContext, useContext } from 'react';\n\n/**\n * Shape of the value exposed by the `total-form` {@link FormContext}.\n *\n * Field values and errors are keyed by field name. The container owns the\n * state; fields and controls read from and write to it through\n * {@link useFormContext}.\n */\nexport interface TotalFormContextValue {\n /** Current value of every field, keyed by field name. */\n values: Record<string, string>;\n /** First validation error per field (absent when the field is valid). */\n errors: Record<string, string | undefined>;\n /** Whether the form's `onSubmit` handler is currently running. */\n submitting: boolean;\n /** Updates a single field's value and clears any resolved error for it. */\n setFieldValue: (name: string, value: string) => void;\n}\n\n/** React context backing the `total-form` layer. `null` outside a container. */\nexport const FormContext = createContext<TotalFormContextValue | null>(null);\n\n/**\n * Reads the nearest {@link FormContext}.\n *\n * @throws If called outside a `FormContainer`.\n * @returns The current form context value.\n */\nexport function useFormContext(): TotalFormContextValue {\n const context = useContext(FormContext);\n if (!context) {\n throw new Error('useFormContext must be used within a <FormContainer>');\n }\n return context;\n}\n","'use client';\n\nimport React from 'react';\n\nimport { Toast } from '../../feedback/Toast';\nimport { useFormContext } from './FormContext';\n\n/** Props for {@link FormErrorSnackbar}. */\nexport interface FormErrorSnackbarProps {\n /** Message shown when the form has field errors. */\n message?: string;\n}\n\n/**\n * Surfaces form-level validation failures. Thin wrapper over the existing\n * `@12-apps/ui` `Toast`: renders nothing while the form is valid and shows an\n * error toast (testid `total-form-error-snackbar`) once any field has an error.\n */\nexport function FormErrorSnackbar({\n message = 'Please fix the highlighted fields and try again.',\n}: FormErrorSnackbarProps): React.ReactElement | null {\n const { errors } = useFormContext();\n const hasErrors = Object.values(errors).some(Boolean);\n\n if (!hasErrors) return null;\n\n return (\n <Toast\n dataTestId=\"total-form-error-snackbar\"\n variant=\"error\"\n message={message}\n closable={false}\n />\n );\n}\n","'use client';\n\nimport React from 'react';\n\nimport { Button } from '../Button';\nimport { useFormContext } from './FormContext';\n\n/** Props for {@link SubmitButton}. */\nexport interface SubmitButtonProps {\n /** Button label. */\n children: React.ReactNode;\n /** Test id; defaults to `total-form-submit`. Override when a page renders more than one form. */\n dataTestId?: string;\n}\n\n/**\n * The height of a form input control (see `Input` — `.MuiInputBase-root`), so a\n * submit button placed inline with fields lines up with them instead of sitting\n * shorter. Kept in sync with that value by hand.\n */\nconst FIELD_HEIGHT = 56;\n\n/**\n * Submit control wired to {@link useFormContext}. Wraps the existing `@12-apps/ui`\n * `Button` as a `type=\"submit\"` button (testid `total-form-submit`) and\n * reflects the form's `submitting` state via `loading`/`disabled`.\n *\n * It matches the form field height and never wraps its label, so it aligns with\n * an adjacent input on the same row (and stays full-width when the row stacks).\n */\nexport function SubmitButton({\n children,\n dataTestId = 'total-form-submit',\n}: SubmitButtonProps): React.ReactElement {\n const { submitting } = useFormContext();\n\n return (\n <Button\n type=\"submit\"\n dataTestId={dataTestId}\n loading={submitting}\n disabled={submitting}\n // `Button` replaces (not merges) its size styles with this `sx`, so restate\n // the md padding/font here alongside the field-height + no-wrap alignment.\n sx={{ height: FIELD_HEIGHT, px: 2, fontSize: '1rem', flexShrink: 0, whiteSpace: 'nowrap' }}\n >\n {children}\n </Button>\n );\n}\n","export { CategoryField } from './CategoryField';\nexport type { CategoryFieldProps } from './CategoryField';\nexport { CepField } from './CepField';\nexport type { CepFieldProps, CepFills } from './CepField';\nexport { TextField } from './TextField';\nexport type { TextFieldProps } from './TextField';\nexport { SelectField } from './SelectField';\nexport type { SelectFieldProps } from './SelectField';\nexport { ToggleField } from './ToggleField';\nexport type { ToggleFieldProps } from './ToggleField';\n","'use client';\n\nimport type { CategorySelectCopy } from \"../../../../copy\";\nimport React from 'react';\n\nimport { CategorySelect } from '../../CategorySelect';\nimport type { CategorySelectOption } from '../../CategorySelect';\nimport { useFormContext } from '../FormContext';\n\n/** Props for the `total-form` {@link CategoryField}. */\nexport interface CategoryFieldProps {\n /** The picker\\'s words. REQUIRED — this package ships no default copy. */\n copy: CategorySelectCopy;\n /** Field name; also the key into the form's values/errors. */\n name: string;\n /** The categories to choose from, flat, each carrying its `parentId`. */\n options: CategorySelectOption[];\n /** Optional visible label rendered above the control. */\n label?: string;\n /** Placeholder shown while nothing is chosen. */\n placeholder?: string;\n /** Lets a top-level category be chosen in its own right (default: `true`). */\n allowParentSelection?: boolean;\n}\n\n/**\n * Category picker bound to {@link useFormContext}.\n *\n * The sibling {@link SelectField} flattens a category tree into one list, which\n * is the thing the hierarchical picker exists to stop. Use this wherever the\n * field's options nest.\n *\n * Form values are strings, so \"nothing chosen\" travels as `\"\"` — mapped to and\n * from the control's `null` here rather than making every caller do it.\n */\nexport function CategoryField({\n name,\n options,\n label,\n placeholder,\n allowParentSelection = true,\n copy,\n}: CategoryFieldProps): React.ReactElement {\n const { values, errors, setFieldValue } = useFormContext();\n const error = errors[name];\n\n return (\n <CategorySelect\n copy={copy}\n mode=\"single\"\n fullWidth\n label={label}\n placeholder={placeholder}\n options={options}\n allowParentSelection={allowParentSelection}\n value={values[name] ? values[name] : null}\n error={error}\n onChange={(next) => setFieldValue(name, next ?? '')}\n dataTestId={`total-form-field-${name}`}\n />\n );\n}\n","'use client';\n\nimport type { CepFieldCopy } from \"../../../../copy\";\nimport React, { useCallback, useMemo, useRef } from 'react';\n\nimport { CepField as BaseCepField, type CepAddress } from '../../CepField';\nimport { useFormContext } from '../FormContext';\n\n/** The resolved address parts a form can receive. */\ntype CepPart = 'street' | 'neighborhood' | 'city' | 'state';\n\n/**\n * Which form field receives each resolved part. Omit a part to leave it alone —\n * a form with no bairro column simply doesn't map `neighborhood`.\n */\nexport type CepFills = Partial<Record<CepPart, string>>;\n\n/** Props for the `total-form` {@link CepField}. */\nexport interface CepFieldProps {\n /** The lookup status wording. REQUIRED — no default copy. */\n copy: CepFieldCopy;\n /** Field name; also the key into the form's values/errors. */\n name: string;\n /** Optional visible label. Defaults to `CEP`. */\n label?: string;\n /** Resolve a complete CEP. Omit for a masked input with no lookup. */\n lookup?: (cep: string) => Promise<CepAddress | null>;\n /** Maps each resolved address part onto a field in THIS form. */\n fills?: CepFills;\n /** Milliseconds to wait after the last keystroke before looking up. */\n debounceMs?: number;\n}\n\nconst PARTS: readonly CepPart[] = ['street', 'neighborhood', 'city', 'state'];\n\n/** Ownership-aware writes into sibling form fields. */\ninterface OwnedAutofill {\n /** Write one field, where `''` means \"no value for this part\". */\n write: (field: string, value: string) => void;\n /** Blank every field this hook still owns. */\n clearOwned: () => void;\n}\n\n/**\n * The honesty rule, in one place: this hook remembers exactly what it wrote,\n * writes only into fields that are empty or still hold its own value, and drops\n * the ownership record when it blanks one. That single invariant is what lets\n * autofill replace itself freely while never touching the user's typing.\n */\nfunction useOwnedAutofill(): OwnedAutofill {\n const { values, setFieldValue } = useFormContext();\n // What we last auto-filled per target field, so a later lookup may replace\n // its own value while a manual edit is preserved.\n const autoFilledRef = useRef<Record<string, string>>({});\n // Read values at call time without making them a dependency of the callback.\n const valuesRef = useRef(values);\n valuesRef.current = values;\n\n const write = useCallback(\n (field: string, value: string) => {\n const current = (valuesRef.current[field] ?? '').trim();\n const ours = autoFilledRef.current[field] === current;\n if (current !== '' && !ours) return;\n setFieldValue(field, value);\n if (value) {\n autoFilledRef.current[field] = value;\n } else {\n delete autoFilledRef.current[field];\n }\n },\n [setFieldValue],\n );\n\n const clearOwned = useCallback(() => {\n // Object.keys snapshots, so `write` may delete entries as we iterate.\n for (const field of Object.keys(autoFilledRef.current)) {\n write(field, '');\n }\n }, [write]);\n\n return useMemo(() => ({ write, clearOwned }), [write, clearOwned]);\n}\n\n/**\n * CEP field bound to {@link useFormContext}: masks and validates the CEP, then\n * writes the resolved logradouro/bairro/cidade/UF straight into the sibling\n * fields named by `fills`.\n *\n * It will not overwrite work the user has done. A target field is only written\n * when it is empty, or when it still holds the exact value THIS component put\n * there — so correcting the CEP re-fills the address, but a hand-edited street\n * survives the next lookup.\n *\n * @example\n * ```tsx\n * <Fields.CepField\n * name=\"postalCode\"\n * lookup={lookupCep}\n * fills={{ street: 'addressLine1', neighborhood: 'neighborhood', city: 'city', state: 'state' }}\n * />\n * ```\n */\nexport function CepField({\n name,\n label,\n lookup,\n fills,\n debounceMs,\n copy,\n}: CepFieldProps): React.ReactElement {\n const { values, errors, setFieldValue } = useFormContext();\n const { write, clearOwned } = useOwnedAutofill();\n\n const handleResolved = useCallback(\n (address: CepAddress) => {\n if (!fills) return;\n // Every mapped part is written on EVERY resolve, absent ones as ''. A\n // \"CEP geral\" (a small município's catch-all) carries no logradouro, so\n // skipping absent parts would leave the previous CEP's street here.\n for (const part of PARTS) {\n const field = fills[part];\n if (field) write(field, address[part] ?? '');\n }\n },\n [fills, write],\n );\n\n const handleChange = useCallback(\n (masked: string) => setFieldValue(name, masked),\n [name, setFieldValue],\n );\n\n return (\n <BaseCepField\n copy={copy}\n name={name}\n label={label}\n value={values[name] ?? ''}\n error={errors[name]}\n onChange={handleChange}\n onLookup={lookup}\n onResolved={handleResolved}\n onNotFound={clearOwned}\n debounceMs={debounceMs}\n dataTestId={`total-form-field-${name}`}\n />\n );\n}\n","'use client';\n\nimport React from 'react';\n\nimport { FormControl, FormLabel, FormMessage } from '../../Form';\nimport { Input } from '../../Input';\nimport { useFormContext } from '../FormContext';\n\n/** Props for the `total-form` {@link TextField}. */\nexport interface TextFieldProps {\n /** Field name; also the key into the form's values/errors. */\n name: string;\n /** Optional visible label rendered above the input. */\n label?: string;\n /** Native input type (e.g. `email`, `password`). Defaults to `text`. */\n type?: string;\n /** Placeholder shown when the field is empty. */\n placeholder?: string;\n}\n\n/**\n * Text input field bound to {@link useFormContext}. Composes the existing\n * `@12-apps/ui` `Form*` presentational primitives and the `Input` control,\n * reading its value/error from context and writing changes back through it.\n *\n * Renders its error via `total-form-field-<name>-message` and the input via\n * `total-form-field-<name>`.\n */\nexport function TextField({ name, label, type = 'text', placeholder }: TextFieldProps): React.ReactElement {\n const { values, errors, setFieldValue } = useFormContext();\n const error = errors[name];\n const testId = `total-form-field-${name}`;\n\n return (\n <FormControl fullWidth>\n {label && (\n <FormLabel htmlFor={name} error={Boolean(error)}>\n {label}\n </FormLabel>\n )}\n <Input\n id={name}\n name={name}\n type={type}\n placeholder={placeholder}\n value={values[name] ?? ''}\n error={Boolean(error)}\n data-testid={testId}\n onChange={(event) => setFieldValue(name, event.target.value)}\n />\n {error && (\n <FormMessage error dataTestId={`${testId}-message`}>\n {error}\n </FormMessage>\n )}\n </FormControl>\n );\n}\n","'use client';\n\nimport React from 'react';\n\nimport { FormControl, FormLabel, FormMessage } from '../../Form';\nimport { Select } from '../../Select';\nimport type { SelectOption } from '../../Select';\nimport { useFormContext } from '../FormContext';\n\n/** Props for the `total-form` {@link SelectField}. */\nexport interface SelectFieldProps {\n /** Field name; also the key into the form's values/errors. */\n name: string;\n /** Selectable options. */\n options: SelectOption[];\n /** Optional visible label rendered above the select. */\n label?: string;\n /** Placeholder shown when no option is selected. */\n placeholder?: string;\n}\n\n/**\n * Select field bound to {@link useFormContext}. Composes the existing\n * `@12-apps/ui` `Form*` primitives and the `Select` control, reading its\n * value/error from context and writing the chosen value back through it.\n *\n * Renders its error via `total-form-field-<name>-message` and the select via\n * `total-form-field-<name>`.\n */\nexport function SelectField({ name, options, label, placeholder }: SelectFieldProps): React.ReactElement {\n const { values, errors, setFieldValue } = useFormContext();\n const error = errors[name];\n const testId = `total-form-field-${name}`;\n\n return (\n <FormControl fullWidth>\n {label && (\n <FormLabel htmlFor={name} error={Boolean(error)}>\n {label}\n </FormLabel>\n )}\n <Select\n options={options}\n placeholder={placeholder}\n value={values[name] ?? ''}\n error={Boolean(error)}\n data-testid={testId}\n onChange={(event) => setFieldValue(name, String(event.target.value))}\n />\n {error && (\n <FormMessage error dataTestId={`${testId}-message`}>\n {error}\n </FormMessage>\n )}\n </FormControl>\n );\n}\n","'use client';\n\nimport React from 'react';\n\nimport { FormControl, FormLabel, FormMessage } from '../../Form';\nimport { ToggleGroup } from '../../ToggleGroup';\nimport type { ToggleOption } from '../../ToggleGroup';\nimport { useFormContext } from '../FormContext';\n\n/** Props for the `total-form` {@link ToggleField}. */\nexport interface ToggleFieldProps {\n /** Field name; also the key into the form's values/errors. */\n name: string;\n /** The mutually-exclusive options (one is always selected). */\n options: ToggleOption[];\n /** Optional visible label rendered above the toggle. */\n label?: string;\n}\n\n/**\n * Exclusive toggle (segmented control) bound to {@link useFormContext} — a\n * label-height-matched alternative to {@link SelectField} for a short, always-set\n * enum. Composes the `Form*` primitives and the `ToggleGroup` control, reading\n * its value from context and writing the chosen value back through it. Ignores a\n * deselect (clicking the active segment) so a value is always kept.\n *\n * Renders its error via `total-form-field-<name>-message` and the toggle via\n * `total-form-field-<name>` (each segment at `total-form-field-<name>-item-<value>`).\n */\nexport function ToggleField({ name, options, label }: ToggleFieldProps): React.ReactElement {\n const { values, errors, setFieldValue } = useFormContext();\n const error = errors[name];\n const testId = `total-form-field-${name}`;\n\n return (\n <FormControl fullWidth>\n {label && (\n <FormLabel htmlFor={name} error={Boolean(error)}>\n {label}\n </FormLabel>\n )}\n <ToggleGroup\n variant=\"exclusive\"\n options={options}\n value={values[name] ?? ''}\n fullWidth\n dataTestId={testId}\n // Match the input field height so the toggle lines up in a form row.\n sx={{ '& .MuiToggleButtonGroup-grouped': { height: 56 } }}\n onChange={(_event, next) => {\n if (typeof next === 'string') setFieldValue(name, next);\n }}\n />\n {error && (\n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A,aACC,gBAAAD,KAAC,aAAU,SAAS,MAAM,OAAO,QAAQ,KAAK,GAC3C,iBACH;AAAA,IAEF,gBAAAA;AAAA,MAAC;AAAA;AAAA,QACC,SAAQ;AAAA,QACR;AAAA,QACA,OAAO,OAAO,IAAI,KAAK;AAAA,QACvB,WAAS;AAAA,QACT,YAAY;AAAA,QAEZ,IAAI,EAAE,mCAAmC,EAAE,QAAQ,GAAG,EAAE;AAAA,QACxD,UAAU,CAAC,QAAQ,SAAS;AAC1B,cAAI,OAAO,SAAS,SAAU,eAAc,MAAM,IAAI;AAAA,QACxD;AAAA;AAAA,IACF;AAAA,IACC,SACC,gBAAAA,KAAC,eAAY,OAAK,MAAC,YAAY,GAAG,MAAM,YACrC,iBACH;AAAA,KAEJ;AAEJ;","names":["jsx","jsx","CepField","jsx","useCallback","useMemo","jsx","useCallback","useMemo","CepField","jsx","jsx","jsxs","jsx","jsxs"]}
|
package/dist/pt-BR.js
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import "./chunk-PZ5AY32C.js";
|
|
2
|
+
|
|
3
|
+
// src/pt-BR.ts
|
|
4
|
+
var PT_BR_SECTION_ONBOARDING_COPY = {
|
|
5
|
+
edit: "Editar",
|
|
6
|
+
collapse: "Ocultar",
|
|
7
|
+
start: "Come\xE7ar"
|
|
8
|
+
};
|
|
9
|
+
var PT_BR_CONFIRM_ACTION_COPY = {
|
|
10
|
+
cancel: "Cancelar",
|
|
11
|
+
defaultError: "N\xE3o foi poss\xEDvel concluir a a\xE7\xE3o. Tente novamente.",
|
|
12
|
+
irreversible: "Esta a\xE7\xE3o n\xE3o pode ser desfeita."
|
|
13
|
+
};
|
|
14
|
+
var PT_BR_CATEGORY_SELECT_COPY = {
|
|
15
|
+
purpose: "Categorias organizam o card\xE1pio e os filtros da loja.",
|
|
16
|
+
clearSelection: "Limpar sele\xE7\xE3o",
|
|
17
|
+
emptyTitle: "Nenhuma categoria ainda",
|
|
18
|
+
createCategory: "Criar categoria",
|
|
19
|
+
noResults: {
|
|
20
|
+
title: (query) => `Nada encontrado para \u201C${query}\u201D`,
|
|
21
|
+
hint: "Tente outro termo ou verifique a grafia.",
|
|
22
|
+
clearSearch: "Limpar busca",
|
|
23
|
+
create: (query) => `Criar \u201C${query}\u201D`
|
|
24
|
+
},
|
|
25
|
+
search: {
|
|
26
|
+
placeholderSingle: "Buscar categoria\u2026",
|
|
27
|
+
placeholderMulti: "Buscar categoria ou subcategoria",
|
|
28
|
+
clear: "Limpar busca",
|
|
29
|
+
removeChip: (label) => `Remover ${label}`,
|
|
30
|
+
pinnedLabel: (count) => `Selecionadas \xB7 ${count}`
|
|
31
|
+
},
|
|
32
|
+
footer: {
|
|
33
|
+
selectedCount: (count) => `${count} selecionada${count === 1 ? "" : "s"}`,
|
|
34
|
+
clear: "Limpar",
|
|
35
|
+
apply: "Aplicar",
|
|
36
|
+
close: "Fechar",
|
|
37
|
+
singleHint: "Escolha uma categoria",
|
|
38
|
+
cancel: "Cancelar"
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
var PT_BR_CEP_FIELD_COPY = {
|
|
42
|
+
loading: "Buscando endere\xE7o\u2026",
|
|
43
|
+
found: "Endere\xE7o preenchido pelo CEP.",
|
|
44
|
+
notfound: "CEP n\xE3o encontrado \u2014 preencha o endere\xE7o manualmente."
|
|
45
|
+
};
|
|
46
|
+
var PT_BR_SAVED_VIEWS_LABELS = {
|
|
47
|
+
trigger: "Vis\xF5es",
|
|
48
|
+
mainView: "Vis\xE3o principal",
|
|
49
|
+
pinned: "Fixadas",
|
|
50
|
+
recent: "Recentes",
|
|
51
|
+
empty: "Nenhuma vis\xE3o salva ainda.",
|
|
52
|
+
saveCurrent: "+ Salvar vis\xE3o atual",
|
|
53
|
+
manageAll: "Gerenciar vis\xF5es",
|
|
54
|
+
apply: "Aplicar",
|
|
55
|
+
setDefault: "Definir como padr\xE3o",
|
|
56
|
+
pin: "Fixar na barra lateral",
|
|
57
|
+
unpin: "Desafixar",
|
|
58
|
+
share: "Compartilhar com a equipe",
|
|
59
|
+
unshare: "Tornar privada",
|
|
60
|
+
edit: "Editar",
|
|
61
|
+
remove: "Excluir",
|
|
62
|
+
defaultTag: "Padr\xE3o"
|
|
63
|
+
};
|
|
64
|
+
var PT_BR_TABLE_FILTER_COPY = {
|
|
65
|
+
invalidRange: "O m\xE1ximo deve ser maior ou igual ao m\xEDnimo."
|
|
66
|
+
};
|
|
67
|
+
var PT_BR_DATA_VIEWS_COPY = {
|
|
68
|
+
savedViewsMenu: PT_BR_SAVED_VIEWS_LABELS,
|
|
69
|
+
confirmAction: PT_BR_CONFIRM_ACTION_COPY,
|
|
70
|
+
categorySelect: PT_BR_CATEGORY_SELECT_COPY,
|
|
71
|
+
board: {
|
|
72
|
+
countOnPage: (label, count) => `${label}: ${count} nesta p\xE1gina`,
|
|
73
|
+
onThisPage: (count) => `${count} nesta p\xE1gina`,
|
|
74
|
+
pageSum: (sum) => `Soma desta p\xE1gina: ${sum}`,
|
|
75
|
+
pageScopeNote: "As contagens e somas abaixo referem-se apenas aos itens desta p\xE1gina."
|
|
76
|
+
},
|
|
77
|
+
deleteView: {
|
|
78
|
+
title: "Excluir vis\xE3o",
|
|
79
|
+
sharedWarning: "Esta vis\xE3o est\xE1 compartilhada \u2014 a equipe perder\xE1 o acesso a ela.",
|
|
80
|
+
rowsUnaffected: (entityLabel) => `${entityLabel} n\xE3o s\xE3o afetados; apenas o recorte salvo \xE9 removido.`,
|
|
81
|
+
confirm: "Excluir vis\xE3o"
|
|
82
|
+
},
|
|
83
|
+
manageViews: {
|
|
84
|
+
title: "Gerenciar vis\xF5es",
|
|
85
|
+
empty: "Nenhuma vis\xE3o salva.",
|
|
86
|
+
defaultTag: "Padr\xE3o",
|
|
87
|
+
otherUserTag: "De outro usu\xE1rio",
|
|
88
|
+
deleteTitle: "Excluir a vis\xE3o salva?",
|
|
89
|
+
deleteBody: "Os filtros e colunas guardados nela s\xE3o perdidos. N\xE3o \xE9 poss\xEDvel restaurar.",
|
|
90
|
+
deleteConfirm: "Excluir"
|
|
91
|
+
},
|
|
92
|
+
saveView: {
|
|
93
|
+
sharedDescription: "Qualquer pessoa da loja poder\xE1 abrir e usar esta vis\xE3o.",
|
|
94
|
+
setDefaultTitle: "Definir como padr\xE3o",
|
|
95
|
+
setDefaultDescription: "Esta tela abre nesta vis\xE3o em vez da Vis\xE3o principal.",
|
|
96
|
+
previewHeading: "O que esta vis\xE3o guarda",
|
|
97
|
+
previewUnchanged: "Nada foi alterado \u2014 esta vis\xE3o ficar\xE1 igual \xE0 Vis\xE3o principal.",
|
|
98
|
+
sortRowLabel: "Ordena\xE7\xE3o",
|
|
99
|
+
saveFailed: "N\xE3o foi poss\xEDvel salvar a vis\xE3o.",
|
|
100
|
+
titleEditing: "Editar vis\xE3o",
|
|
101
|
+
titleCreating: "Salvar vis\xE3o",
|
|
102
|
+
descriptionLabel: "Descri\xE7\xE3o \u2014 opcional",
|
|
103
|
+
descriptionPlaceholder: "Para que serve esta vis\xE3o",
|
|
104
|
+
submitEditing: "Salvar altera\xE7\xF5es",
|
|
105
|
+
submitCreating: "Salvar vis\xE3o",
|
|
106
|
+
nameLabel: "Nome",
|
|
107
|
+
cancel: "Cancelar",
|
|
108
|
+
pinnedTitle: "Fixar na barra lateral",
|
|
109
|
+
pinnedDescription: "Aparece como atalho no menu, abaixo desta tela.",
|
|
110
|
+
sharedTitle: "Compartilhar com a equipe",
|
|
111
|
+
namePlaceholder: "Ex.: Recusados no PIX desta semana",
|
|
112
|
+
previewFilters: "Filtros",
|
|
113
|
+
previewHiddenColumns: "Colunas ocultas"
|
|
114
|
+
},
|
|
115
|
+
columns: {
|
|
116
|
+
visibleCount: (visible, total) => `${visible} de ${total} vis\xEDveis`,
|
|
117
|
+
reset: "Padr\xE3o",
|
|
118
|
+
showAll: "Mostrar todas"
|
|
119
|
+
},
|
|
120
|
+
display: {
|
|
121
|
+
sortTab: "Ordenar",
|
|
122
|
+
columnsTab: "Colunas",
|
|
123
|
+
panelTab: "Exibi\xE7\xE3o",
|
|
124
|
+
direction: "Dire\xE7\xE3o",
|
|
125
|
+
layoutHints: {
|
|
126
|
+
table: "Colunas compar\xE1veis, boa para varrer n\xFAmeros.",
|
|
127
|
+
list: "Uma linha por item, com os dados principais.",
|
|
128
|
+
cards: "Blocos maiores, bom para poucos itens.",
|
|
129
|
+
board: "Colunas por etapa, para acompanhar o que est\xE1 onde."
|
|
130
|
+
},
|
|
131
|
+
densityHeadings: {
|
|
132
|
+
table: "Altura das linhas",
|
|
133
|
+
list: "Altura das linhas",
|
|
134
|
+
cards: "Cards por linha",
|
|
135
|
+
board: "Largura das colunas"
|
|
136
|
+
},
|
|
137
|
+
densityLabels: {
|
|
138
|
+
table: { compact: "Baixa", cozy: "M\xE9dia", comfortable: "Alta" },
|
|
139
|
+
list: { compact: "Baixa", cozy: "M\xE9dia", comfortable: "Alta" },
|
|
140
|
+
cards: { compact: "Muitos", cozy: "M\xE9dio", comfortable: "Poucos" },
|
|
141
|
+
board: { compact: "Estreita", cozy: "M\xE9dia", comfortable: "Larga" }
|
|
142
|
+
},
|
|
143
|
+
boardUnavailable: "Esta tela n\xE3o declara etapas, ent\xE3o n\xE3o oferece quadro.",
|
|
144
|
+
densityUnavailableNarrow: "Um card por linha nesta largura \u2014 a densidade volta em telas maiores.",
|
|
145
|
+
trigger: "Exibir"
|
|
146
|
+
},
|
|
147
|
+
export: {
|
|
148
|
+
formats: {
|
|
149
|
+
json: { label: "JSON (.json)", hint: "Para integra\xE7\xF5es" }
|
|
150
|
+
},
|
|
151
|
+
visibleColumns: (columnCount) => `${columnCount} colunas vis\xEDveis, na ordem atual`,
|
|
152
|
+
trigger: "Exportar"
|
|
153
|
+
},
|
|
154
|
+
grid: {
|
|
155
|
+
rowActions: "A\xE7\xF5es",
|
|
156
|
+
bulkActions: (selectedCount) => `A\xE7\xF5es (${selectedCount}) \u25BE`
|
|
157
|
+
},
|
|
158
|
+
filters: {
|
|
159
|
+
moreFilters: (count) => `Mais filtros: ${count} sem espa\xE7o na barra`,
|
|
160
|
+
moreFiltersApplied: (count, appliedCount) => `Mais filtros: ${count} sem espa\xE7o na barra, ${appliedCount} aplicado(s)`,
|
|
161
|
+
overflowNote: "sem espa\xE7o na barra",
|
|
162
|
+
rangeEnd: "At\xE9",
|
|
163
|
+
rangeInvalid: "O in\xEDcio precisa ser menor que o fim.",
|
|
164
|
+
rangePresets: {
|
|
165
|
+
hoje: "Hoje",
|
|
166
|
+
ontem: "Ontem",
|
|
167
|
+
semana: "Esta semana",
|
|
168
|
+
mes: "Este m\xEAs",
|
|
169
|
+
ano: "Este ano"
|
|
170
|
+
},
|
|
171
|
+
scopesLabel: "Situa\xE7\xE3o",
|
|
172
|
+
panelTitle: "Filtros",
|
|
173
|
+
clear: "Limpar",
|
|
174
|
+
clearAll: "Limpar filtros",
|
|
175
|
+
clearRange: (label) => `Limpar ${label}`,
|
|
176
|
+
allOption: "Todas",
|
|
177
|
+
optionSearchPlaceholder: "Buscar\u2026",
|
|
178
|
+
optionsEmpty: "Nenhum resultado"
|
|
179
|
+
},
|
|
180
|
+
selection: {
|
|
181
|
+
selectAllOnPage: "Selecionar todos nesta p\xE1gina",
|
|
182
|
+
clearSelection: "Limpar sele\xE7\xE3o",
|
|
183
|
+
selectAll: "Selecionar tudo",
|
|
184
|
+
onThisPage: (count) => `${count} nesta p\xE1gina`,
|
|
185
|
+
selectRow: "Selecionar"
|
|
186
|
+
},
|
|
187
|
+
nav: {
|
|
188
|
+
mainView: "Vis\xE3o principal",
|
|
189
|
+
defaultTag: "Padr\xE3o",
|
|
190
|
+
viewOptions: (viewName) => `Op\xE7\xF5es de ${viewName}`,
|
|
191
|
+
emptyHint: "Nenhuma vis\xE3o salva. Ajuste filtros, colunas ou ordena\xE7\xE3o e salve abaixo.",
|
|
192
|
+
setDefault: "Definir como padr\xE3o",
|
|
193
|
+
deleteView: "Excluir vis\xE3o",
|
|
194
|
+
unsavedChanges: "Altera\xE7\xF5es n\xE3o salvas",
|
|
195
|
+
label: "Vis\xE3o",
|
|
196
|
+
update: "Atualizar vis\xE3o",
|
|
197
|
+
save: "Salvar vis\xE3o",
|
|
198
|
+
updateFailed: "N\xE3o foi poss\xEDvel atualizar a vis\xE3o",
|
|
199
|
+
saveFailed: "N\xE3o foi poss\xEDvel salvar a altera\xE7\xE3o da vis\xE3o.",
|
|
200
|
+
editView: "Renomear e editar",
|
|
201
|
+
pinToSidebar: "Fixar na barra lateral",
|
|
202
|
+
shareWithTeam: "Compartilhar com a equipe"
|
|
203
|
+
},
|
|
204
|
+
search: {
|
|
205
|
+
placeholder: "Buscar\u2026",
|
|
206
|
+
allColumnsLabel: "Buscar em todas as colunas",
|
|
207
|
+
keywordPlaceholder: "Pressione Enter para filtrar",
|
|
208
|
+
open: "Buscar",
|
|
209
|
+
close: "Fechar busca",
|
|
210
|
+
clear: "Limpar busca"
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
export {
|
|
214
|
+
PT_BR_CATEGORY_SELECT_COPY,
|
|
215
|
+
PT_BR_CEP_FIELD_COPY,
|
|
216
|
+
PT_BR_CONFIRM_ACTION_COPY,
|
|
217
|
+
PT_BR_DATA_VIEWS_COPY,
|
|
218
|
+
PT_BR_SAVED_VIEWS_LABELS,
|
|
219
|
+
PT_BR_SECTION_ONBOARDING_COPY,
|
|
220
|
+
PT_BR_TABLE_FILTER_COPY
|
|
221
|
+
};
|
|
222
|
+
//# sourceMappingURL=pt-BR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/pt-BR.ts"],"sourcesContent":["import type { DataViewsCopy } from \"./components/data-display/DataViews/data-views-copy\";\nimport type { SavedViewsLabels } from \"./components/layout/ContentToolbar/ContentToolbar.types\";\nimport type {\n CategorySelectCopy,\n CepFieldCopy,\n ConfirmActionCopy,\n SectionOnboardingCopy,\n TableFilterCopy,\n} from \"./copy\";\n\n/**\n * The pt-BR packs — NAMED constants a host passes by hand, never defaults.\n *\n * The filename is what exempts this file from the copy-portability gate:\n * Portuguese may ship, it may not be silent. Every sentence is VERBATIM what\n * the components used to render, so a host adopting these sees no change on\n * screen — what changes is that the words are chosen in a diff.\n */\nexport const PT_BR_SECTION_ONBOARDING_COPY: SectionOnboardingCopy = {\n edit: \"Editar\",\n collapse: \"Ocultar\",\n start: \"Começar\",\n};\n\nexport const PT_BR_CONFIRM_ACTION_COPY: ConfirmActionCopy = {\n cancel: \"Cancelar\",\n defaultError: \"Não foi possível concluir a ação. Tente novamente.\",\n irreversible: \"Esta ação não pode ser desfeita.\",\n};\n\nexport const PT_BR_CATEGORY_SELECT_COPY: CategorySelectCopy = {\n purpose: \"Categorias organizam o cardápio e os filtros da loja.\",\n clearSelection: \"Limpar seleção\",\n emptyTitle: \"Nenhuma categoria ainda\",\n createCategory: \"Criar categoria\",\n noResults: {\n title: (query) => `Nada encontrado para “${query}”`,\n hint: \"Tente outro termo ou verifique a grafia.\",\n clearSearch: \"Limpar busca\",\n create: (query) => `Criar “${query}”`,\n },\n search: {\n placeholderSingle: \"Buscar categoria…\",\n placeholderMulti: \"Buscar categoria ou subcategoria\",\n clear: \"Limpar busca\",\n removeChip: (label) => `Remover ${label}`,\n pinnedLabel: (count) => `Selecionadas · ${count}`,\n },\n footer: {\n selectedCount: (count) => `${count} selecionada${count === 1 ? \"\" : \"s\"}`,\n clear: \"Limpar\",\n apply: \"Aplicar\",\n close: \"Fechar\",\n singleHint: \"Escolha uma categoria\",\n cancel: \"Cancelar\",\n },\n};\n\nexport const PT_BR_CEP_FIELD_COPY: CepFieldCopy = {\n loading: \"Buscando endereço…\",\n found: \"Endereço preenchido pelo CEP.\",\n notfound: \"CEP não encontrado — preencha o endereço manualmente.\",\n};\n\n/**\n * The saved-views dropdown's labels.\n *\n * Typed as the package's OWN `SavedViewsLabels` rather than a parallel shape:\n * that interface already named every string, including the seven with no\n * diacritics the copy gate could not see (`Aplicar`, `Fixar na barra lateral`,\n * `Editar`…). The prop was `Partial<SavedViewsLabels>` with a pt-BR default —\n * configurable in the type, inherited in practice.\n */\nexport const PT_BR_SAVED_VIEWS_LABELS: SavedViewsLabels = {\n trigger: \"Visões\",\n mainView: \"Visão principal\",\n pinned: \"Fixadas\",\n recent: \"Recentes\",\n empty: \"Nenhuma visão salva ainda.\",\n saveCurrent: \"+ Salvar visão atual\",\n manageAll: \"Gerenciar visões\",\n apply: \"Aplicar\",\n setDefault: \"Definir como padrão\",\n pin: \"Fixar na barra lateral\",\n unpin: \"Desafixar\",\n share: \"Compartilhar com a equipe\",\n unshare: \"Tornar privada\",\n edit: \"Editar\",\n remove: \"Excluir\",\n defaultTag: \"Padrão\",\n};\n\nexport const PT_BR_TABLE_FILTER_COPY: TableFilterCopy = {\n invalidRange: \"O máximo deve ser maior ou igual ao mínimo.\",\n};\n\nexport const PT_BR_DATA_VIEWS_COPY: DataViewsCopy = {\n savedViewsMenu: PT_BR_SAVED_VIEWS_LABELS,\n confirmAction: PT_BR_CONFIRM_ACTION_COPY,\n categorySelect: PT_BR_CATEGORY_SELECT_COPY,\n board: {\n countOnPage: (label, count) => `${label}: ${count} nesta página`,\n onThisPage: (count) => `${count} nesta página`,\n pageSum: (sum) => `Soma desta página: ${sum}`,\n pageScopeNote:\n \"As contagens e somas abaixo referem-se apenas aos itens desta página.\",\n },\n deleteView: {\n title: \"Excluir visão\",\n sharedWarning: \"Esta visão está compartilhada — a equipe perderá o acesso a ela.\",\n rowsUnaffected: (entityLabel) =>\n `${entityLabel} não são afetados; apenas o recorte salvo é removido.`,\n confirm: \"Excluir visão\",\n },\n manageViews: {\n title: \"Gerenciar visões\",\n empty: \"Nenhuma visão salva.\",\n defaultTag: \"Padrão\",\n otherUserTag: \"De outro usuário\",\n deleteTitle: \"Excluir a visão salva?\",\n deleteBody: \"Os filtros e colunas guardados nela são perdidos. Não é possível restaurar.\",\n deleteConfirm: \"Excluir\",\n },\n saveView: {\n sharedDescription: \"Qualquer pessoa da loja poderá abrir e usar esta visão.\",\n setDefaultTitle: \"Definir como padrão\",\n setDefaultDescription: \"Esta tela abre nesta visão em vez da Visão principal.\",\n previewHeading: \"O que esta visão guarda\",\n previewUnchanged: \"Nada foi alterado — esta visão ficará igual à Visão principal.\",\n sortRowLabel: \"Ordenação\",\n saveFailed: \"Não foi possível salvar a visão.\",\n titleEditing: \"Editar visão\",\n titleCreating: \"Salvar visão\",\n descriptionLabel: \"Descrição — opcional\",\n descriptionPlaceholder: \"Para que serve esta visão\",\n submitEditing: \"Salvar alterações\",\n submitCreating: \"Salvar visão\",\n nameLabel: \"Nome\",\n cancel: \"Cancelar\",\n pinnedTitle: \"Fixar na barra lateral\",\n pinnedDescription: \"Aparece como atalho no menu, abaixo desta tela.\",\n sharedTitle: \"Compartilhar com a equipe\",\n namePlaceholder: \"Ex.: Recusados no PIX desta semana\",\n previewFilters: \"Filtros\",\n previewHiddenColumns: \"Colunas ocultas\",\n },\n columns: {\n visibleCount: (visible, total) => `${visible} de ${total} visíveis`,\n reset: \"Padrão\",\n showAll: \"Mostrar todas\",\n },\n display: {\n sortTab: \"Ordenar\",\n columnsTab: \"Colunas\",\n panelTab: \"Exibição\",\n direction: \"Direção\",\n layoutHints: {\n table: \"Colunas comparáveis, boa para varrer números.\",\n list: \"Uma linha por item, com os dados principais.\",\n cards: \"Blocos maiores, bom para poucos itens.\",\n board: \"Colunas por etapa, para acompanhar o que está onde.\",\n },\n densityHeadings: {\n table: \"Altura das linhas\",\n list: \"Altura das linhas\",\n cards: \"Cards por linha\",\n board: \"Largura das colunas\",\n },\n densityLabels: {\n table: { compact: \"Baixa\", cozy: \"Média\", comfortable: \"Alta\" },\n list: { compact: \"Baixa\", cozy: \"Média\", comfortable: \"Alta\" },\n cards: { compact: \"Muitos\", cozy: \"Médio\", comfortable: \"Poucos\" },\n board: { compact: \"Estreita\", cozy: \"Média\", comfortable: \"Larga\" },\n },\n boardUnavailable: \"Esta tela não declara etapas, então não oferece quadro.\",\n densityUnavailableNarrow:\n \"Um card por linha nesta largura — a densidade volta em telas maiores.\",\n trigger: \"Exibir\",\n },\n export: {\n formats: {\n json: { label: \"JSON (.json)\", hint: \"Para integrações\" },\n },\n visibleColumns: (columnCount) => `${columnCount} colunas visíveis, na ordem atual`,\n trigger: \"Exportar\",\n },\n grid: {\n rowActions: \"Ações\",\n bulkActions: (selectedCount) => `Ações (${selectedCount}) ▾`,\n },\n filters: {\n moreFilters: (count) => `Mais filtros: ${count} sem espaço na barra`,\n moreFiltersApplied: (count, appliedCount) =>\n `Mais filtros: ${count} sem espaço na barra, ${appliedCount} aplicado(s)`,\n overflowNote: \"sem espaço na barra\",\n rangeEnd: \"Até\",\n rangeInvalid: \"O início precisa ser menor que o fim.\",\n rangePresets: {\n hoje: \"Hoje\",\n ontem: \"Ontem\",\n semana: \"Esta semana\",\n mes: \"Este mês\",\n ano: \"Este ano\",\n },\n scopesLabel: \"Situação\",\n panelTitle: \"Filtros\",\n clear: \"Limpar\",\n clearAll: \"Limpar filtros\",\n clearRange: (label) => `Limpar ${label}`,\n allOption: \"Todas\",\n optionSearchPlaceholder: \"Buscar…\",\n optionsEmpty: \"Nenhum resultado\",\n },\n selection: {\n selectAllOnPage: \"Selecionar todos nesta página\",\n clearSelection: \"Limpar seleção\",\n selectAll: \"Selecionar tudo\",\n onThisPage: (count) => `${count} nesta página`,\n selectRow: \"Selecionar\",\n },\n nav: {\n mainView: \"Visão principal\",\n defaultTag: \"Padrão\",\n viewOptions: (viewName) => `Opções de ${viewName}`,\n emptyHint: \"Nenhuma visão salva. Ajuste filtros, colunas ou ordenação e salve abaixo.\",\n setDefault: \"Definir como padrão\",\n deleteView: \"Excluir visão\",\n unsavedChanges: \"Alterações não salvas\",\n label: \"Visão\",\n update: \"Atualizar visão\",\n save: \"Salvar visão\",\n updateFailed: \"Não foi possível atualizar a visão\",\n saveFailed: \"Não foi possível salvar a alteração da visão.\",\n editView: \"Renomear e editar\",\n pinToSidebar: \"Fixar na barra lateral\",\n shareWithTeam: \"Compartilhar com a equipe\",\n },\n search: {\n placeholder: \"Buscar…\",\n allColumnsLabel: \"Buscar em todas as colunas\",\n keywordPlaceholder: \"Pressione Enter para filtrar\",\n open: \"Buscar\",\n close: \"Fechar busca\",\n clear: \"Limpar busca\",\n },\n};\n\n"],"mappings":";;;AAkBO,IAAM,gCAAuD;AAAA,EAClE,MAAM;AAAA,EACN,UAAU;AAAA,EACV,OAAO;AACT;AAEO,IAAM,4BAA+C;AAAA,EAC1D,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,cAAc;AAChB;AAEO,IAAM,6BAAiD;AAAA,EAC5D,SAAS;AAAA,EACT,gBAAgB;AAAA,EAChB,YAAY;AAAA,EACZ,gBAAgB;AAAA,EAChB,WAAW;AAAA,IACT,OAAO,CAAC,UAAU,8BAAyB,KAAK;AAAA,IAChD,MAAM;AAAA,IACN,aAAa;AAAA,IACb,QAAQ,CAAC,UAAU,eAAU,KAAK;AAAA,EACpC;AAAA,EACA,QAAQ;AAAA,IACN,mBAAmB;AAAA,IACnB,kBAAkB;AAAA,IAClB,OAAO;AAAA,IACP,YAAY,CAAC,UAAU,WAAW,KAAK;AAAA,IACvC,aAAa,CAAC,UAAU,qBAAkB,KAAK;AAAA,EACjD;AAAA,EACA,QAAQ;AAAA,IACN,eAAe,CAAC,UAAU,GAAG,KAAK,eAAe,UAAU,IAAI,KAAK,GAAG;AAAA,IACvE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,OAAO;AAAA,IACP,YAAY;AAAA,IACZ,QAAQ;AAAA,EACV;AACF;AAEO,IAAM,uBAAqC;AAAA,EAChD,SAAS;AAAA,EACT,OAAO;AAAA,EACP,UAAU;AACZ;AAWO,IAAM,2BAA6C;AAAA,EACxD,SAAS;AAAA,EACT,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,aAAa;AAAA,EACb,WAAW;AAAA,EACX,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,KAAK;AAAA,EACL,OAAO;AAAA,EACP,OAAO;AAA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,IACV,YAAY,CAAC,UAAU,UAAU,KAAK;AAAA,IACtC,WAAW;AAAA,IACX,yBAAyB;AAAA,IACzB,cAAc;AAAA,EAChB;AAAA,EACA,WAAW;AAAA,IACT,iBAAiB;AAAA,IACjB,gBAAgB;AAAA,IAChB,WAAW;AAAA,IACX,YAAY,CAAC,UAAU,GAAG,KAAK;AAAA,IAC/B,WAAW;AAAA,EACb;AAAA,EACA,KAAK;AAAA,IACH,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,aAAa,CAAC,aAAa,mBAAa,QAAQ;AAAA,IAChD,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,cAAc;AAAA,IACd,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,cAAc;AAAA,IACd,eAAe;AAAA,EACjB;AAAA,EACA,QAAQ;AAAA,IACN,aAAa;AAAA,IACb,iBAAiB;AAAA,IACjB,oBAAoB;AAAA,IACpB,MAAM;AAAA,IACN,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AACF;","names":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
import { type DropdownMenuItem } from '../../navigation/DropdownMenu';
|
|
3
|
+
/**
|
|
4
|
+
* The "⋮" trigger every row and card menu opens from.
|
|
5
|
+
*
|
|
6
|
+
* One component rather than a `DropdownMenu` per entity, so the kebab looks and
|
|
7
|
+
* behaves identically in the card, in the list row and in the table row. The
|
|
8
|
+
* entity's menu owns its own popups; this is the trigger and the item list.
|
|
9
|
+
*/
|
|
10
|
+
export declare function CardKebab({ items, menuLabel, dataTestId, }: {
|
|
11
|
+
items: DropdownMenuItem[];
|
|
12
|
+
/**
|
|
13
|
+
* The trigger's accessible name — required, and with no default.
|
|
14
|
+
*
|
|
15
|
+
* It is the only text this component renders, and a screen reader announces
|
|
16
|
+
* it verbatim. A default here would be a word in the origin's language that
|
|
17
|
+
* reads as finished to the next adopter right up until somebody using a
|
|
18
|
+
* screen reader meets it.
|
|
19
|
+
*/
|
|
20
|
+
menuLabel: string;
|
|
21
|
+
dataTestId?: string;
|
|
22
|
+
}): JSX.Element;
|
|
23
|
+
//# sourceMappingURL=CardKebab.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardKebab.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/CardKit/CardKebab.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjC,OAAO,EAAgB,KAAK,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEpF;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,SAAS,EACT,UAAU,GACX,EAAE;IACD,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B;;;;;;;OAOG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,GAAG,CAAC,OAAO,CAYd"}
|