@bikdotai/bik-component-library 0.0.863-beta.4 → 0.0.863-beta.6
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/dist/cjs/components/agent-builder/AgentBuilder.js +1 -1
- package/dist/cjs/components/agent-builder/AgentBuilder.js.map +1 -1
- package/dist/cjs/components/agent-builder/AgentBuilder.styled.js +174 -42
- package/dist/cjs/components/agent-builder/AgentBuilder.styled.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/AgentStateModal.js +2 -0
- package/dist/cjs/components/agent-builder/components/AgentStateModal.js.map +1 -0
- package/dist/cjs/components/agent-builder/components/ChannelSelectModal.js +2 -0
- package/dist/cjs/components/agent-builder/components/ChannelSelectModal.js.map +1 -0
- package/dist/cjs/components/agent-builder/components/ChannelsSection.js +2 -0
- package/dist/cjs/components/agent-builder/components/ChannelsSection.js.map +1 -0
- package/dist/cjs/components/agent-builder/components/MentionPicker.js +1 -1
- package/dist/cjs/components/agent-builder/components/MentionPicker.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/SelectableListSection.js +1 -1
- package/dist/cjs/components/agent-builder/components/SelectableListSection.js.map +1 -1
- package/dist/cjs/components/agent-builder/constants/channels.js +2 -0
- package/dist/cjs/components/agent-builder/constants/channels.js.map +1 -0
- package/dist/cjs/components/agent-builder/constants/steps.js +1 -1
- package/dist/cjs/components/agent-builder/constants/steps.js.map +1 -1
- package/dist/cjs/components/agent-builder/context/AgentBuilderContext.js +1 -1
- package/dist/cjs/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
- package/dist/cjs/components/agent-builder/steps/Step1About.js +1 -1
- package/dist/cjs/components/agent-builder/steps/Step1About.js.map +1 -1
- package/dist/cjs/components/agent-builder/steps/Step2WhenItStepsIn.js +2 -2
- package/dist/cjs/components/agent-builder/steps/Step2WhenItStepsIn.js.map +1 -1
- package/dist/cjs/components/agent-builder/steps/Step4HandoverRules.js +1 -1
- package/dist/cjs/components/agent-builder/steps/Step4HandoverRules.js.map +1 -1
- package/dist/cjs/components/agent-listing/AgentTableRow.js +1 -1
- package/dist/cjs/components/agent-listing/AgentTableRow.js.map +1 -1
- package/dist/cjs/components/toaster/Toaster.styled.js +35 -20
- package/dist/cjs/components/toaster/Toaster.styled.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/esm/components/agent-builder/AgentBuilder.js +105 -99
- package/dist/esm/components/agent-builder/AgentBuilder.js.map +1 -1
- package/dist/esm/components/agent-builder/AgentBuilder.model.d.ts +76 -0
- package/dist/esm/components/agent-builder/AgentBuilder.styled.d.ts +91 -0
- package/dist/esm/components/agent-builder/AgentBuilder.styled.js +271 -93
- package/dist/esm/components/agent-builder/AgentBuilder.styled.js.map +1 -1
- package/dist/esm/components/agent-builder/components/AgentStateModal.d.ts +47 -0
- package/dist/esm/components/agent-builder/components/AgentStateModal.js +82 -0
- package/dist/esm/components/agent-builder/components/AgentStateModal.js.map +1 -0
- package/dist/esm/components/agent-builder/components/ChannelSelectModal.d.ts +26 -0
- package/dist/esm/components/agent-builder/components/ChannelSelectModal.js +121 -0
- package/dist/esm/components/agent-builder/components/ChannelSelectModal.js.map +1 -0
- package/dist/esm/components/agent-builder/components/ChannelsSection.d.ts +10 -0
- package/dist/esm/components/agent-builder/components/ChannelsSection.js +183 -0
- package/dist/esm/components/agent-builder/components/ChannelsSection.js.map +1 -0
- package/dist/esm/components/agent-builder/components/MentionPicker.js +27 -27
- package/dist/esm/components/agent-builder/components/MentionPicker.js.map +1 -1
- package/dist/esm/components/agent-builder/components/SelectableListSection.js +16 -23
- package/dist/esm/components/agent-builder/components/SelectableListSection.js.map +1 -1
- package/dist/esm/components/agent-builder/constants/channels.d.ts +56 -0
- package/dist/esm/components/agent-builder/constants/channels.js +41 -0
- package/dist/esm/components/agent-builder/constants/channels.js.map +1 -0
- package/dist/esm/components/agent-builder/constants/steps.d.ts +31 -1
- package/dist/esm/components/agent-builder/constants/steps.js +15 -6
- package/dist/esm/components/agent-builder/constants/steps.js.map +1 -1
- package/dist/esm/components/agent-builder/context/AgentBuilderContext.d.ts +13 -1
- package/dist/esm/components/agent-builder/context/AgentBuilderContext.js +192 -175
- package/dist/esm/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
- package/dist/esm/components/agent-builder/index.d.ts +7 -2
- package/dist/esm/components/agent-builder/steps/Step1About.js +15 -13
- package/dist/esm/components/agent-builder/steps/Step1About.js.map +1 -1
- package/dist/esm/components/agent-builder/steps/Step2WhenItStepsIn.js +54 -49
- package/dist/esm/components/agent-builder/steps/Step2WhenItStepsIn.js.map +1 -1
- package/dist/esm/components/agent-builder/steps/Step4HandoverRules.d.ts +11 -0
- package/dist/esm/components/agent-builder/steps/Step4HandoverRules.js +127 -23
- package/dist/esm/components/agent-builder/steps/Step4HandoverRules.js.map +1 -1
- package/dist/esm/components/agent-listing/AgentTableRow.js +71 -38
- package/dist/esm/components/agent-listing/AgentTableRow.js.map +1 -1
- package/dist/esm/components/toaster/Toaster.styled.js +37 -22
- package/dist/esm/components/toaster/Toaster.styled.js.map +1 -1
- package/dist/esm/index.js +644 -634
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentBuilder.styled.js","sources":["../../../../src/components/agent-builder/AgentBuilder.styled.tsx"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { BASE_COLORS, COLORS } from '@src/constants/Theme';\n\n// Shared look for the 24×24 transparent icon buttons (add / row-menu / close).\nconst iconActionButton = css`\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 24px;\n\theight: 24px;\n\tborder: none;\n\tbackground: transparent;\n\tpadding: 0;\n\tcursor: pointer;\n\tborder-radius: 4px;\n\n\t&:hover {\n\t\tbackground: ${COLORS.surface.subdued};\n\t}\n\n\t&:disabled {\n\t\tcursor: not-allowed;\n\t\topacity: 0.5;\n\t\tbackground: transparent;\n\t}\n`;\n\nexport const BuilderRoot = styled.div.attrs({ className: 'bik-builder-root' })`\n\tdisplay: flex;\n\tflex-direction: column;\n\theight: 100%;\n\twidth: 100%;\n\tmin-height: 0;\n\tbackground: ${COLORS.surface.standard};\n`;\n\nexport const TopBar = styled.div.attrs({ className: 'bik-top-bar' })`\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\theight: 56px;\n\tpadding: 12px 16px;\n\tborder-bottom: 1px solid ${COLORS.stroke.primary};\n\tflex-shrink: 0;\n`;\n\nexport const TopBarSide = styled.div.attrs({ className: 'bik-top-bar-side' })`\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n`;\n\nexport const BackButton = styled.button.attrs({ className: 'bik-back-button' })`\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 28px;\n\theight: 28px;\n\tborder: none;\n\tbackground: transparent;\n\tpadding: 0;\n\tcursor: pointer;\n\tborder-radius: 4px;\n\n\t&:hover {\n\t\tbackground: ${COLORS.surface.subdued};\n\t}\n`;\n\nexport const Main = styled.div.attrs({ className: 'bik-main' })`\n\tdisplay: flex;\n\tflex: 1;\n\tmin-height: 0;\n`;\n\nexport const Rail = styled.div.attrs({ className: 'bik-rail' })`\n\twidth: 234px;\n\tflex-shrink: 0;\n\tborder-right: 1px solid ${COLORS.stroke.primary};\n\tpadding: 16px;\n\toverflow-y: auto;\n\tbackground: ${COLORS.surface.standard};\n`;\n\nexport const Content = styled.div.attrs({ className: 'bik-content' })`\n\tflex: 1;\n\tmin-width: 0;\n\tmin-height: 0;\n\toverflow: hidden;\n\tdisplay: flex;\n\tflex-direction: column;\n\tpadding: 16px;\n\tbackground: ${COLORS.surface.standard};\n`;\n\nexport const ContentCard = styled.div.attrs({ className: 'bik-content-card' })`\n\tflex: 1;\n\tmin-height: 0;\n\tdisplay: flex;\n\tflex-direction: column;\n\toverflow: hidden;\n\tborder: 1px solid ${COLORS.stroke.primary};\n\tborder-radius: 8px;\n\tbox-sizing: border-box;\n`;\n\n// Scrollable step body inside the card; the footer stays pinned below it.\nexport const StepScroll = styled.div.attrs({ className: 'bik-step-scroll' })`\n\tflex: 1;\n\tmin-height: 0;\n\toverflow-y: auto;\n`;\n\nexport const Footer = styled.div.attrs({ className: 'bik-footer' })`\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tmin-height: 56px;\n\tpadding: 12px 16px;\n\tborder-top: 1px solid ${COLORS.stroke.primary};\n\tflex-shrink: 0;\n\tbox-shadow: 0px -2px 12px 0px #0000000a;\n`;\n\nexport const FooterHint = styled.div.attrs({ className: 'bik-footer-hint' })`\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 6px;\n`;\n\nexport const FooterActions = styled.div.attrs({\n\tclassName: 'bik-footer-actions',\n})`\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n`;\n\n// ── Step rail items ─────────────────────────────────────────────────────────\n\nexport const RailList = styled.div.attrs({ className: 'bik-rail-list' })`\n\tdisplay: flex;\n\tflex-direction: column;\n`;\n\nexport const RailItem = styled.button.attrs({ className: 'bik-rail-item' })`\n\tposition: relative;\n\tdisplay: flex;\n\talign-items: flex-start;\n\tgap: 8px;\n\t/* Bottom padding leaves room for the connector down to the next badge. */\n\tpadding: 0 0 24px;\n\tborder: none;\n\tbackground: transparent;\n\tcursor: pointer;\n\ttext-align: left;\n\twidth: 100%;\n\n\t&:last-child {\n\t\tpadding-bottom: 0;\n\t}\n\n\t&:disabled {\n\t\tcursor: default;\n\t}\n\n\t/* Dashed connector line between consecutive step badges (centered on the badge). */\n\t&:not(:last-child)::after {\n\t\tcontent: '';\n\t\tposition: absolute;\n\t\tleft: 9px;\n\t\ttop: 20px;\n\t\twidth: 0;\n\t\theight: 24px;\n\t\tborder-left: 1px dashed #e0e0e0;\n\t\tpointer-events: none;\n\t}\n`;\n\nexport const StepBadge = styled.div.attrs({ className: 'bik-step-badge' })<{\n\tstate: 'active' | 'complete' | 'inactive';\n}>`\n\twidth: 20px;\n\theight: 20px;\n\tflex-shrink: 0;\n\tborder-radius: 50%;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tfont-family: Inter;\n\tfont-size: 10px;\n\tfont-weight: 400;\n\tline-height: 12px;\n\tbackground: ${(p) =>\n\t\tp.state === 'complete'\n\t\t\t? COLORS.background.inverseLight\n\t\t\t: p.state === 'active'\n\t\t\t? COLORS.background.brandLight\n\t\t\t: COLORS.background.base};\n\tcolor: ${(p) =>\n\t\tp.state === 'complete'\n\t\t\t? COLORS.surface.standard\n\t\t\t: p.state === 'active'\n\t\t\t? COLORS.background.inverseLight\n\t\t\t: COLORS.content.secondary};\n`;\n\n// ── Shared step pieces ──────────────────────────────────────────────────────\n\nexport const SectionHeaderWrap = styled.div.attrs({\n\tclassName: 'bik-section-header-wrap',\n})`\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n\tpadding: 16px;\n\tborder-bottom: 1px solid ${COLORS.stroke.primary};\n`;\n\nexport const SectionBodyWrap = styled.div.attrs({\n\tclassName: 'bik-section-header-wrap',\n})`\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 16px;\n\tpadding: 16px;\n`;\n\nexport const FieldBlock = styled.div.attrs({ className: 'bik-field-block' })`\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n`;\n\nexport const FieldLabelRow = styled.div.attrs({\n\tclassName: 'bik-field-label-row',\n})`\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n`;\n\n// ── Labelled text area ──────────────────────────────────────────────────────\n\nexport const AiTextAreaShell = styled.div.attrs({\n\tclassName: 'bik-ai-text-area-shell',\n})<{\n\tfocused?: boolean;\n\tminHeight?: string;\n}>`\n\tdisplay: flex;\n\tflex-direction: column;\n\tborder: 1px solid\n\t\t${(p) => (p.focused ? COLORS.stroke.brand : COLORS.stroke.primary)};\n\tborder-radius: 4px;\n\tpadding: 8px 12px;\n\tgap: 8px;\n\tmin-height: ${(p) => p.minHeight ?? '120px'};\n\tbackground: ${COLORS.surface.standard};\n`;\n\nexport const AiTextAreaInput = styled.textarea.attrs({\n\tclassName: 'bik-ai-text-area-input',\n})`\n\tflex: 1;\n\tborder: none;\n\toutline: none;\n\tresize: none;\n\tfont-family: Inter;\n\tfont-size: 14px;\n\tline-height: 20px;\n\tcolor: ${COLORS.content.primary};\n\tbackground: transparent;\n\tmin-height: 60px;\n\n\t&::placeholder {\n\t\tcolor: ${COLORS.content.placeholder};\n\t}\n`;\n\n// ── Radio card (Step 2 / Step 4 option cards) ───────────────────────────────\n\nexport const CardRow = styled.div.attrs({ className: 'bik-card-row' })`\n\tdisplay: flex;\n\tgap: 12px;\n`;\n\nexport const RadioCard = styled.button.attrs({ className: 'bik-radio-card' })<{\n\tselected?: boolean;\n}>`\n\tflex: 1;\n\tdisplay: flex;\n\talign-items: flex-start;\n\tgap: 12px;\n\tpadding: 16px;\n\tborder: 1px solid\n\t\t${(p) => (p.selected ? BASE_COLORS.brand['800'] : COLORS.stroke.primary)};\n\tbackground: ${(p) =>\n\t\tp.selected ? COLORS.background.brandLight : COLORS.surface.standard};\n\tborder-radius: 8px;\n\tcursor: pointer;\n\ttext-align: left;\n\twidth: 100%;\n`;\n\nexport const RadioCardText = styled.div.attrs({\n\tclassName: 'bik-radio-card-text',\n})`\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n`;\n\n// ── Intent chips (Step 2) ───────────────────────────────────────────────────\n\nexport const ChipWrap = styled.div.attrs({ className: 'bik-chip-wrap' })`\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: center;\n\tgap: 8px;\n`;\n\nexport const AddChipButton = styled.button.attrs({\n\tclassName: 'bik-add-chip-button',\n})`\n\tdisplay: inline-flex;\n\talign-items: center;\n\tgap: 6px;\n\tpadding: 4px 8px;\n\tborder: 1px dashed ${COLORS.stroke.primary};\n\tborder-radius: 4px;\n\tbackground: transparent;\n\tcursor: pointer;\n`;\n\n// ── Step 3 two-column layout + tool / sub-agent rows ────────────────────────\n\n// Fills the scroll area so the step header + grow-body chain reaches the footer.\nexport const Step3Root = styled.div.attrs({\n\tclassName: 'bik-agent-step bik-agent-step--response',\n})`\n\tdisplay: flex;\n\tflex-direction: column;\n\tmin-height: 100%;\n`;\n\nexport const Step3Grid = styled.div.attrs({ className: 'bik-step3-grid' })<{\n\t$grow?: boolean;\n}>`\n\tdisplay: grid;\n\tgrid-template-columns: minmax(0, 1fr) 1px 360px;\n\t/* Single row that fills the grid's height, so the divider spans the full\n\t height (down to the footer) rather than stopping at the taller column. */\n\tgrid-template-rows: 1fr;\n\tflex: 1;\n\tmin-height: 0;\n\n\t@media (max-width: 1100px) {\n\t\tgrid-template-columns: 1fr;\n\t\tgrid-template-rows: auto;\n\t}\n\n\t/* Fill the remaining card height so a full-height child (e.g. the Step 3\n\t column divider) can stretch all the way down to the footer. */\n\t${(p) =>\n\t\tp.$grow &&\n\t\tcss`\n\t\t\tflex: 1;\n\t\t\tmin-height: 0;\n\t\t`}\n`;\n\n// Vertical rule between the main column and the side (tools / sub-agents) column;\n// hidden once the grid collapses to a single column.\nexport const Step3Divider = styled.div.attrs({\n\tclassName: 'bik-step3-divider',\n})`\n\twidth: 1px;\n\talign-self: stretch;\n\tbackground: ${COLORS.stroke.primary};\n\n\t@media (max-width: 1100px) {\n\t\tdisplay: none;\n\t}\n`;\n\nexport const SideSection = styled.div.attrs({ className: 'bik-side-section' })`\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n`;\n\nexport const SideSectionHeader = styled.div.attrs({\n\tclassName: 'bik-side-section-header',\n})`\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n`;\n\nexport const AddIconButton = styled.button.attrs({\n\tclassName: 'bik-add-icon-button',\n})`\n\t${iconActionButton}\n\tbackground: ${COLORS.surface.standard};\n\tborder: 1px solid ${COLORS.stroke.primary};\n`;\n\n// Empty-state tool-source picker (e.g. Manifest / Shopify buttons).\nexport const SourceButtonRow = styled.div.attrs({\n\tclassName: 'bik-source-button-row',\n})`\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 8px;\n`;\n\nexport const SourceButton = styled.button.attrs({\n\tclassName: 'bik-source-button',\n})`\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\tpadding: 6px;\n\tborder: 1px solid ${COLORS.stroke.primary};\n\tborder-radius: 4px;\n\tbackground: ${COLORS.surface.standard};\n\tcursor: pointer;\n\theight: 28px;\n\n\t&:hover {\n\t\tbackground: ${COLORS.surface.subdued};\n\t}\n`;\n\nexport const SelectableRow = styled.div.attrs({\n\tclassName: 'bik-selectable-row',\n})`\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\tpadding: 8px 12px;\n\t/* Fixed 48px rows regardless of the (variably-sized) leading source icon.\n\t box-sizing pins the height across hosts with differing resets; flex-shrink:0\n\t + min-height stop a height-constrained flex column (the merchant side panel)\n\t from squashing the rows — Storybook has room, so it looked fine there. */\n\tmin-height: 48px;\n\tbox-sizing: border-box;\n\tflex-shrink: 0;\n\tborder: 1px solid ${COLORS.stroke.primary};\n\tborder-radius: 4px;\n\tmin-width: 0;\n\toverflow: hidden;\n\n\t/* Leading icon (e.g. tool source) keeps its size; the label takes the rest. */\n\t& > svg {\n\t\tflex-shrink: 0;\n\t}\n`;\n\nexport const RowText = styled.div.attrs({ className: 'bik-row-text' })`\n\tflex: 1;\n\tmin-width: 0;\n\toverflow: hidden;\n\n\t/* Truncate the label to one line with an ellipsis. */\n\t& > * {\n\t\tdisplay: block;\n\t\toverflow: hidden;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t}\n`;\n\n/* Label + trailing verification shield on one row. */\nexport const RowLabel = styled.div.attrs({ className: 'bik-row-label' })`\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 6px;\n\tmin-width: 0;\n\tflex: 1;\n\n\t/* Shrink the label to its text so the shield sits just after it, rather than\n\t RowText's default flex: 1 filling the row and pushing the shield to the end. */\n\t& .bik-row-text {\n\t\tflex: 0 1 auto;\n\t}\n`;\n\nexport const RowRemoveButton = styled.button.attrs({\n\tclassName: 'bik-row-remove-button',\n})`\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tborder: none;\n\tbackground: transparent;\n\tpadding: 0;\n\tcursor: pointer;\n`;\n\n// ── Per-row actions (always-visible edit / delete icon buttons) ───────────────\n\nexport const RowActions = styled.div.attrs({ className: 'bik-row-actions' })`\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 4px;\n\tflex-shrink: 0;\n`;\n\n// Vertical separator between the edit and delete icon buttons.\nexport const RowActionDivider = styled.span.attrs({\n\tclassName: 'bik-row-action-divider',\n})`\n\twidth: 1px;\n\talign-self: stretch;\n\tmargin: 4px 0;\n\tbackground: ${COLORS.stroke.primary};\n`;\n\nexport const RowMenuButton = styled.button.attrs({\n\tclassName: 'bik-row-menu-button',\n})`\n\t${iconActionButton}\n`;\n\nexport const DraftButtonScope = styled.div.attrs({\n\tclassName: 'bik-draft-button-scope',\n})`\n\tdisplay: flex;\n\tflex: 1;\n\n\tbutton {\n\t\tborder-color: ${BASE_COLORS.brand['800']};\n\t}\n\tbutton .text {\n\t\tcolor: ${BASE_COLORS.brand['800']};\n\t}\n`;\n\n// ── Go-live modal ───────────────────────────────────────────────────────────\n\nexport const ModalBody = styled.div.attrs({ className: 'bik-modal-body' })`\n\tpadding: 24px;\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tgap: 16px;\n\ttext-align: center;\n`;\n\nexport const ModalIcon = styled.div.attrs({ className: 'bik-modal-icon' })`\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n`;\n\nexport const ModalActions = styled.div.attrs({\n\tclassName: 'bik-modal-actions',\n})`\n\tdisplay: flex;\n\tgap: 12px;\n\twidth: 100%;\n\t/* Every action shares the row equally. Each action MUST be its own flex\n\t wrapper (a plain <div style=\"display:flex\">, or DraftButtonScope) rather\n\t than a bare Button: on hover the Button relocates its padding into an\n\t inner container, and as the flex item itself that changes its resolved\n\t width — the button visibly grows/shrinks. Wrapped, the div is the sized\n\t track (flex:1) and the Button grows to fill it, absorbing the padding\n\t move so the width stays put. */\n\t> * {\n\t\tflex: 1;\n\t}\n`;\n\n/** Inline action row inside a rich field (e.g. \"Improve with AI\"). */\nexport const FieldActionRow = styled.div.attrs({\n\tclassName: 'bik-field-action-row',\n})`\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n`;\n"],"names":["iconActionButton","css","COLORS","BuilderRoot","styled","TopBar","TopBarSide","BackButton","Main","Rail","Content","ContentCard","StepScroll","Footer","FooterHint","FooterActions","RailList","RailItem","StepBadge","p","SectionHeaderWrap","SectionBodyWrap","FieldBlock","FieldLabelRow","AiTextAreaShell","AiTextAreaInput","CardRow","RadioCard","BASE_COLORS","RadioCardText","ChipWrap","Step3Root","Step3Grid","Step3Divider","SideSection","SideSectionHeader","AddIconButton","SourceButtonRow","SourceButton","SelectableRow","RowText","RowLabel","RowActions","RowActionDivider","RowMenuButton","DraftButtonScope","ModalBody","ModalIcon","ModalActions"],"mappings":";;AAIA,MAAMA,IAAmBC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAaTC,EAAO,QAAQ,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAUzBC,IAAcC,EAAO,IAAI,MAAM,EAAE,WAAW,oBAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAM9DF,EAAO,QAAQ,QAAQ;AAAA,GAGzBG,IAASD,EAAO,IAAI,MAAM,EAAE,WAAW,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAMvCF,EAAO,OAAO,OAAO;AAAA;AAAA,GAIpCI,IAAaF,EAAO,IAAI,MAAM,EAAE,WAAW,oBAAoB;AAAA;AAAA;AAAA;AAAA,GAM/DG,IAAaH,EAAO,OAAO,MAAM,EAAE,WAAW,mBAAmB;AAAA;AAAA;AAAA;AAA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MsC,IAAatC,EAAO,IAAI,MAAM,EAAE,WAAW,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA,GAQ9DuC,IAAmBvC,EAAO,KAAK,MAAM;AAAA,EACjD,WAAW;AACZ,CAAC;AAAA;AAAA;AAAA;AAAA,eAIcF,EAAO,OAAO,OAAO;AAAA,GAGvB0C,IAAgBxC,EAAO,OAAO,MAAM;AAAA,EAChD,WAAW;AACZ,CAAC;AAAA,GACEJ,CAAgB;AAAA,GAGN6C,IAAmBzC,EAAO,IAAI,MAAM;AAAA,EAChD,WAAW;AACZ,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,kBAKiBwB,EAAY,MAAM,GAAK,CAAC;AAAA;AAAA;AAAA,WAG/BA,EAAY,MAAM,GAAK,CAAC;AAAA;AAAA,GAMtBkB,IAAY1C,EAAO,IAAI,MAAM,EAAE,WAAW,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAS5D2C,IAAY3C,EAAO,IAAI,MAAM,EAAE,WAAW,kBAAkB;AAAA;AAAA;AAAA;AAAA,GAM5D4C,IAAe5C,EAAO,IAAI,MAAM;AAAA,EAC5C,WAAW;AACZ,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiB6BA,EAAO,IAAI,MAAM;AAAA,EAC9C,WAAW;AACZ,CAAC;AAAA;AAAA;AAAA;AAAA;"}
|
|
1
|
+
{"version":3,"file":"AgentBuilder.styled.js","sources":["../../../../src/components/agent-builder/AgentBuilder.styled.tsx"],"sourcesContent":["import type React from 'react';\nimport styled, { css } from 'styled-components';\nimport { BASE_COLORS, COLORS } from '@src/constants/Theme';\n\n// Shared look for the 24×24 transparent icon buttons (add / row-menu / close).\nconst iconActionButton = css`\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 24px;\n\theight: 24px;\n\tborder: none;\n\tbackground: transparent;\n\tpadding: 0;\n\tcursor: pointer;\n\tborder-radius: 4px;\n\n\t&:hover {\n\t\tbackground: ${COLORS.surface.subdued};\n\t}\n\n\t&:disabled {\n\t\tcursor: not-allowed;\n\t\topacity: 0.5;\n\t\tbackground: transparent;\n\t}\n`;\n\nexport const BuilderRoot = styled.div.attrs({ className: 'bik-builder-root' })`\n\tdisplay: flex;\n\tflex-direction: column;\n\theight: 100%;\n\twidth: 100%;\n\tmin-height: 0;\n\tbackground: ${COLORS.surface.standard};\n`;\n\nexport const TopBar = styled.div.attrs({ className: 'bik-top-bar' })`\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\theight: 56px;\n\tpadding: 12px 16px;\n\tborder-bottom: 1px solid ${COLORS.stroke.primary};\n\tflex-shrink: 0;\n`;\n\nexport const TopBarSide = styled.div.attrs({ className: 'bik-top-bar-side' })`\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n`;\n\nexport const BackButton = styled.button.attrs({ className: 'bik-back-button' })`\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 28px;\n\theight: 28px;\n\tborder: none;\n\tbackground: transparent;\n\tpadding: 0;\n\tcursor: pointer;\n\tborder-radius: 4px;\n\n\t&:hover {\n\t\tbackground: ${COLORS.surface.subdued};\n\t}\n`;\n\nexport const Main = styled.div.attrs({ className: 'bik-main' })`\n\tdisplay: flex;\n\tflex: 1;\n\tmin-height: 0;\n`;\n\nexport const Rail = styled.div.attrs({ className: 'bik-rail' })`\n\twidth: 234px;\n\tflex-shrink: 0;\n\tborder-right: 1px solid ${COLORS.stroke.primary};\n\tpadding: 16px;\n\toverflow-y: auto;\n\tbackground: ${COLORS.surface.standard};\n`;\n\nexport const Content = styled.div.attrs({ className: 'bik-content' })`\n\tflex: 1;\n\tmin-width: 0;\n\tmin-height: 0;\n\toverflow: hidden;\n\tdisplay: flex;\n\tflex-direction: column;\n\tpadding: 16px;\n\tbackground: ${COLORS.surface.standard};\n`;\n\nexport const ContentCard = styled.div.attrs({ className: 'bik-content-card' })`\n\tflex: 1;\n\tmin-height: 0;\n\tdisplay: flex;\n\tflex-direction: column;\n\toverflow: hidden;\n\tborder: 1px solid ${COLORS.stroke.primary};\n\tborder-radius: 8px;\n\tbox-sizing: border-box;\n`;\n\n// Scrollable step body inside the card; the footer stays pinned below it.\nexport const StepScroll = styled.div.attrs({ className: 'bik-step-scroll' })`\n\tflex: 1;\n\tmin-height: 0;\n\toverflow-y: auto;\n`;\n\nexport const Footer = styled.div.attrs({ className: 'bik-footer' })`\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tmin-height: 56px;\n\tpadding: 12px 16px;\n\tborder-top: 1px solid ${COLORS.stroke.primary};\n\tflex-shrink: 0;\n\tbox-shadow: 0px -2px 12px 0px #0000000a;\n`;\n\nexport const FooterHint = styled.div.attrs({ className: 'bik-footer-hint' })`\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 6px;\n`;\n\nexport const FooterActions = styled.div.attrs({\n\tclassName: 'bik-footer-actions',\n})`\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n`;\n\n// ── Step rail items ─────────────────────────────────────────────────────────\n\nexport const RailList = styled.div.attrs({ className: 'bik-rail-list' })`\n\tdisplay: flex;\n\tflex-direction: column;\n`;\n\nexport const RailItem = styled.button.attrs({ className: 'bik-rail-item' })`\n\tposition: relative;\n\tdisplay: flex;\n\talign-items: flex-start;\n\tgap: 8px;\n\t/* Bottom padding leaves room for the connector down to the next badge. */\n\tpadding: 0 0 24px;\n\tborder: none;\n\tbackground: transparent;\n\tcursor: pointer;\n\ttext-align: left;\n\twidth: 100%;\n\n\t&:last-child {\n\t\tpadding-bottom: 0;\n\t}\n\n\t&:disabled {\n\t\tcursor: default;\n\t}\n\n\t/* Dashed connector line between consecutive step badges (centered on the badge). */\n\t&:not(:last-child)::after {\n\t\tcontent: '';\n\t\tposition: absolute;\n\t\tleft: 9px;\n\t\ttop: 20px;\n\t\twidth: 0;\n\t\theight: 24px;\n\t\tborder-left: 1px dashed #e0e0e0;\n\t\tpointer-events: none;\n\t}\n`;\n\nexport const StepBadge = styled.div.attrs({ className: 'bik-step-badge' })<{\n\tstate: 'active' | 'complete' | 'inactive';\n}>`\n\twidth: 20px;\n\theight: 20px;\n\tflex-shrink: 0;\n\tborder-radius: 50%;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tfont-family: Inter;\n\tfont-size: 10px;\n\tfont-weight: 400;\n\tline-height: 12px;\n\tbackground: ${(p) =>\n\t\tp.state === 'complete'\n\t\t\t? COLORS.background.inverseLight\n\t\t\t: p.state === 'active'\n\t\t\t? COLORS.background.brandLight\n\t\t\t: COLORS.background.base};\n\tcolor: ${(p) =>\n\t\tp.state === 'complete'\n\t\t\t? COLORS.surface.standard\n\t\t\t: p.state === 'active'\n\t\t\t? COLORS.background.inverseLight\n\t\t\t: COLORS.content.secondary};\n`;\n\n// ── Shared step pieces ──────────────────────────────────────────────────────\n\nexport const SectionHeaderWrap = styled.div.attrs({\n\tclassName: 'bik-section-header-wrap',\n})`\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n\tpadding: 16px;\n\tborder-bottom: 1px solid ${COLORS.stroke.primary};\n`;\n\nexport const SectionBodyWrap = styled.div.attrs({\n\tclassName: 'bik-section-header-wrap',\n})`\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 16px;\n\tpadding: 16px;\n`;\n\nexport const FieldBlock = styled.div.attrs({ className: 'bik-field-block' })`\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n`;\n\nexport const FieldLabelRow = styled.div.attrs({\n\tclassName: 'bik-field-label-row',\n})`\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n`;\n\n// ── Labelled text area ──────────────────────────────────────────────────────\n\nexport const AiTextAreaShell = styled.div.attrs({\n\tclassName: 'bik-ai-text-area-shell',\n})<{\n\tfocused?: boolean;\n\tminHeight?: string;\n}>`\n\tdisplay: flex;\n\tflex-direction: column;\n\tborder: 1px solid\n\t\t${(p) => (p.focused ? COLORS.stroke.brand : COLORS.stroke.primary)};\n\tborder-radius: 4px;\n\tpadding: 8px 12px;\n\tgap: 8px;\n\tmin-height: ${(p) => p.minHeight ?? '120px'};\n\tbackground: ${COLORS.surface.standard};\n`;\n\nexport const AiTextAreaInput = styled.textarea.attrs({\n\tclassName: 'bik-ai-text-area-input',\n})`\n\tflex: 1;\n\tborder: none;\n\toutline: none;\n\tresize: none;\n\tfont-family: Inter;\n\tfont-size: 14px;\n\tline-height: 20px;\n\tcolor: ${COLORS.content.primary};\n\tbackground: transparent;\n\tmin-height: 60px;\n\n\t&::placeholder {\n\t\tcolor: ${COLORS.content.placeholder};\n\t}\n`;\n\n// ── Radio card (Step 2 / Step 4 option cards) ───────────────────────────────\n\nexport const CardRow = styled.div.attrs({ className: 'bik-card-row' })`\n\tdisplay: flex;\n\tgap: 12px;\n`;\n\nexport const RadioCard = styled.button.attrs({ className: 'bik-radio-card' })<{\n\tselected?: boolean;\n}>`\n\tflex: 1;\n\tdisplay: flex;\n\talign-items: flex-start;\n\tgap: 12px;\n\tpadding: 16px;\n\tborder: 1px solid\n\t\t${(p) => (p.selected ? BASE_COLORS.brand['800'] : COLORS.stroke.primary)};\n\tbackground: ${(p) =>\n\t\tp.selected ? COLORS.background.brandLight : COLORS.surface.standard};\n\tborder-radius: 8px;\n\tcursor: pointer;\n\ttext-align: left;\n\twidth: 100%;\n\n\t&:disabled {\n\t\tcursor: not-allowed;\n\t\tbackground: ${COLORS.surface.subdued};\n\t\tborder-color: ${COLORS.stroke.primary};\n\t}\n`;\n\nexport const RadioCardText = styled.div.attrs({\n\tclassName: 'bik-radio-card-text',\n})`\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n`;\n\n// ── Intent chips (Step 2) ───────────────────────────────────────────────────\n\nexport const ChipWrap = styled.div.attrs({ className: 'bik-chip-wrap' })`\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: center;\n\tgap: 8px;\n`;\n\nexport const AddChipButton = styled.button.attrs({\n\tclassName: 'bik-add-chip-button',\n})`\n\tdisplay: inline-flex;\n\talign-items: center;\n\tgap: 6px;\n\tpadding: 4px 8px;\n\tborder: 1px dashed ${COLORS.stroke.primary};\n\tborder-radius: 4px;\n\tbackground: transparent;\n\tcursor: pointer;\n`;\n\n// ── Step 3 two-column layout + tool / sub-agent rows ────────────────────────\n\n// Fills the scroll area so the step header + grow-body chain reaches the footer.\nexport const Step3Root = styled.div.attrs({\n\tclassName: 'bik-agent-step bik-agent-step--response',\n})`\n\tdisplay: flex;\n\tflex-direction: column;\n\tmin-height: 100%;\n`;\n\nexport const Step3Grid = styled.div.attrs({ className: 'bik-step3-grid' })<{\n\t$grow?: boolean;\n}>`\n\tdisplay: grid;\n\tgrid-template-columns: minmax(0, 1fr) 1px 360px;\n\t/* Single row that fills the grid's height, so the divider spans the full\n\t height (down to the footer) rather than stopping at the taller column. */\n\tgrid-template-rows: 1fr;\n\tflex: 1;\n\tmin-height: 0;\n\n\t@media (max-width: 1100px) {\n\t\tgrid-template-columns: 1fr;\n\t\tgrid-template-rows: auto;\n\t}\n\n\t/* Fill the remaining card height so a full-height child (e.g. the Step 3\n\t column divider) can stretch all the way down to the footer. */\n\t${(p) =>\n\t\tp.$grow &&\n\t\tcss`\n\t\t\tflex: 1;\n\t\t\tmin-height: 0;\n\t\t`}\n`;\n\n// Vertical rule between the main column and the side (tools / sub-agents) column;\n// hidden once the grid collapses to a single column.\nexport const Step3Divider = styled.div.attrs({\n\tclassName: 'bik-step3-divider',\n})`\n\twidth: 1px;\n\talign-self: stretch;\n\tbackground: ${COLORS.stroke.primary};\n\n\t@media (max-width: 1100px) {\n\t\tdisplay: none;\n\t}\n`;\n\nexport const SideSection = styled.div.attrs({ className: 'bik-side-section' })`\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n`;\n\nexport const SideSectionHeader = styled.div.attrs({\n\tclassName: 'bik-side-section-header',\n})`\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n`;\n\nexport const AddIconButton = styled.button.attrs({\n\tclassName: 'bik-add-icon-button',\n})`\n\t${iconActionButton}\n\tbackground: ${COLORS.surface.standard};\n\tborder: 1px solid ${COLORS.stroke.primary};\n`;\n\n// Empty-state tool-source picker (e.g. Manifest / Shopify buttons).\nexport const SourceButtonRow = styled.div.attrs({\n\tclassName: 'bik-source-button-row',\n})`\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 8px;\n`;\n\nexport const SourceButton = styled.button.attrs({\n\tclassName: 'bik-source-button',\n})`\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\tpadding: 6px;\n\tborder: 1px solid ${COLORS.stroke.primary};\n\tborder-radius: 4px;\n\tbackground: ${COLORS.surface.standard};\n\tcursor: pointer;\n\theight: 28px;\n\n\t&:hover {\n\t\tbackground: ${COLORS.surface.subdued};\n\t}\n`;\n\nexport const SelectableRow = styled.div.attrs({\n\tclassName: 'bik-selectable-row',\n})`\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\tpadding: 8px 12px;\n\t/* Fixed 48px rows regardless of the (variably-sized) leading source icon.\n\t box-sizing pins the height across hosts with differing resets; flex-shrink:0\n\t + min-height stop a height-constrained flex column (the merchant side panel)\n\t from squashing the rows — Storybook has room, so it looked fine there. */\n\tmin-height: 48px;\n\tbox-sizing: border-box;\n\tflex-shrink: 0;\n\tborder: 1px solid ${COLORS.stroke.primary};\n\tborder-radius: 4px;\n\tmin-width: 0;\n\toverflow: hidden;\n\n\t/* Leading icon (e.g. tool source) keeps its size; the label takes the rest. */\n\t& > svg {\n\t\tflex-shrink: 0;\n\t}\n`;\n\nexport const RowText = styled.div.attrs({ className: 'bik-row-text' })`\n\tflex: 1;\n\tmin-width: 0;\n\toverflow: hidden;\n\n\t/* Truncate the label to one line with an ellipsis. */\n\t& > * {\n\t\tdisplay: block;\n\t\toverflow: hidden;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t}\n`;\n\n/* Label + trailing verification shield on one row. */\nexport const RowLabel = styled.div.attrs({ className: 'bik-row-label' })`\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 6px;\n\tmin-width: 0;\n\tflex: 1;\n\n\t/* Shrink the label to its text so the shield sits just after it, rather than\n\t RowText's default flex: 1 filling the row and pushing the shield to the end. */\n\t& .bik-row-text {\n\t\tflex: 0 1 auto;\n\t}\n`;\n\nexport const RowRemoveButton = styled.button.attrs({\n\tclassName: 'bik-row-remove-button',\n})`\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tborder: none;\n\tbackground: transparent;\n\tpadding: 0;\n\tcursor: pointer;\n`;\n\n// ── Per-row actions (always-visible edit / delete icon buttons) ───────────────\n\nexport const RowActions = styled.div.attrs({ className: 'bik-row-actions' })`\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 4px;\n\tflex-shrink: 0;\n`;\n\n// Vertical separator between the edit and delete icon buttons.\nexport const RowActionDivider = styled.span.attrs({\n\tclassName: 'bik-row-action-divider',\n})`\n\twidth: 1px;\n\talign-self: stretch;\n\tmargin: 4px 0;\n\tbackground: ${COLORS.stroke.primary};\n`;\n\nexport const RowMenuButton = styled.button.attrs({\n\tclassName: 'bik-row-menu-button',\n})`\n\t${iconActionButton}\n`;\n\nexport const DraftButtonScope = styled.div.attrs({\n\tclassName: 'bik-draft-button-scope',\n})`\n\tdisplay: flex;\n\tflex: 1;\n\n\tbutton {\n\t\tborder-color: ${BASE_COLORS.brand['800']};\n\t}\n\tbutton .text {\n\t\tcolor: ${BASE_COLORS.brand['800']};\n\t}\n`;\n\n// ── Go-live modal ───────────────────────────────────────────────────────────\n\nexport const ModalBody = styled.div.attrs({ className: 'bik-modal-body' })`\n\tpadding: 24px;\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tgap: 16px;\n\ttext-align: center;\n`;\n\nexport const ModalIcon = styled.div.attrs({ className: 'bik-modal-icon' })`\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n`;\n\n/**\n * The go-live SUCCESS dialog's natural height, which every state of\n * `AgentStateModal` is pinned to so the card doesn't resize as a publish moves\n * loading → error, or loading → success (a different dialog at the same size).\n *\n * 24 + 24 padding + 64 icon + 8 gap + 28 title (TitleMedium 20/28) + 8 gap\n * + 48 body (BodyPrimary 16/24, two lines at this width) + 24 gap\n * + 40 action row (medium Button: 10px padding + 20px line-height) = 268.\n *\n * Deliberately NOT on `ModalBody`: DiscardModal and RequireVerificationModal share\n * it and are not part of this sequence.\n */\nexport const AGENT_STATE_MODAL_MIN_HEIGHT = 268;\n\n/** `ModalBody` pinned to the height above. The body itself is NOT centred — that\n * floats the action row in the middle of the card. The hero takes the slack instead\n * (see `AgentStateModalHero`), so the actions stay at the bottom, above the body's\n * own 24px padding. */\nexport const AgentStateModalBody = styled(ModalBody)`\n\tmin-height: ${AGENT_STATE_MODAL_MIN_HEIGHT}px;\n`;\n\n/** Badge + title + message. Grows into whatever height the pinned card has spare and\n * centres itself there, which is what keeps the actions pinned to the bottom. */\nexport const AgentStateModalHero = styled.div`\n\tflex: 1;\n\twidth: 100%;\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tgap: 8px;\n`;\n\nexport const ModalActions = styled.div.attrs({\n\tclassName: 'bik-modal-actions',\n})`\n\tdisplay: flex;\n\tgap: 12px;\n\twidth: 100%;\n\t/* Every action shares the row equally. Each action MUST be its own flex\n\t wrapper (a plain <div style=\"display:flex\">, or DraftButtonScope) rather\n\t than a bare Button: on hover the Button relocates its padding into an\n\t inner container, and as the flex item itself that changes its resolved\n\t width — the button visibly grows/shrinks. Wrapped, the div is the sized\n\t track (flex:1) and the Button grows to fill it, absorbing the padding\n\t move so the width stays put. */\n\t> * {\n\t\tflex: 1;\n\t}\n`;\n\n/** Inline action row inside a rich field (e.g. \"Improve with AI\"). */\nexport const FieldActionRow = styled.div.attrs({\n\tclassName: 'bik-field-action-row',\n})`\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n`;\n\n// ── Step 1 \"Channels to activate it on\" ────────────────────────────────\n\nexport const ChannelsSectionRoot = styled.div.attrs({\n\tclassName: 'bik-channels-section',\n})`\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n`;\n\n/** \"Channel management\" / \"Smart agent handover\" — a text link, not a Button. */\nexport const ChannelsLink = styled.button.attrs({\n\tclassName: 'bik-channels-link',\n})`\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 4px;\n\tborder: none;\n\tbackground: transparent;\n\tpadding: 0;\n\tcursor: pointer;\n\tcolor: ${COLORS.background.inverseLight};\n\tfont-size: 12px;\n\tline-height: 16px;\n\tfont-weight: 400;\n\twhite-space: nowrap;\n\n\t&:hover {\n\t\ttext-decoration: underline;\n\t}\n`;\n\n/** One channel's card. */\nexport const ChannelCard = styled.div.attrs({\n\tclassName: 'bik-channel-card',\n})`\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: flex-start;\n\twidth: 100%;\n\tbackground: ${COLORS.surface.standard};\n\tborder: 1px solid ${COLORS.stroke.primary};\n\tborder-radius: 4px;\n\toverflow: hidden;\n`;\n\nexport const ChannelRow = styled.div.attrs({ className: 'bik-channel-row' })`\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\tpadding: 12px;\n\twidth: 100%;\n\t/* 12 + 24 + 12 — every child is pinned to the 24px band so the row can't\n\t drift taller than the design's 48px. */\n\tmin-height: 48px;\n\tbox-sizing: border-box;\n`;\n\nexport const ChannelRowMain = styled.div.attrs({\n\tclassName: 'bik-channel-row-main',\n})`\n\tdisplay: flex;\n\tflex: 1 0 0;\n\tmin-width: 0;\n\talign-items: center;\n\tgap: 8px;\n\theight: 24px;\n`;\n\n/** Label + glyph. Fixed-width so every card's chips start on the same column. */\nexport const ChannelIdentity = styled.div.attrs({\n\tclassName: 'bik-channel-identity',\n})`\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 4px;\n\tflex: 1 0 0;\n\tmin-width: 0;\n`;\n\n/** Tinted 24×24 square holding the 16px brand glyph. */\nexport const ChannelGlyph = styled.div.attrs({\n\tclassName: 'bik-channel-glyph',\n})<{ tint: string }>`\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tflex-shrink: 0;\n\twidth: 24px;\n\theight: 24px;\n\tborder-radius: 4.8px;\n\tbackground: ${(props) => props.tint};\n\toverflow: hidden;\n`;\n\n/** The account chips. Wraps rather than overflowing when a store has many. */\nexport const ChannelChips = styled.div.attrs({\n\tclassName: 'bik-channel-chips',\n})`\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 4px;\n\tflex-shrink: 0;\n\n\t/* Figma's tag-regular is 24px tall, but Tag's \"regular\" variant floors at\n\t 26px — which pushes the 48px row to 50px. Pin the wrapper back to 24\n\t (Tag's own \\`height\\` prop only reaches its inner container). The second\n\t selector catches a Tag sitting inside a ChipTooltipTarget. */\n\t> *,\n\t> span > * {\n\t\tmin-height: 24px;\n\t}\n`;\n\n/**\n * Hover target for a chip's tooltip.\n *\n * Tippy attaches a ref to its child to use as the trigger, but `Tag` is a plain\n * function component with no `forwardRef` — so wrapping a Tag directly gives\n * Tippy no DOM node and the tooltip silently never opens. This span is the node\n * it can hold on to. (`IconButton` wraps its disabled tooltip the same way.)\n */\nexport const ChipTooltipTarget = styled.span.attrs({\n\tclassName: 'bik-chip-tooltip-target',\n})`\n\tdisplay: inline-flex;\n\talign-items: center;\n`;\n\n/** Scrollable account list inside the picker modal. */\nexport const ChannelPickerList = styled.div.attrs({\n\tclassName: 'bik-channel-picker-list',\n})`\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n\twidth: 100%;\n\tmax-height: 280px;\n\toverflow-y: auto;\n`;\n\nexport const ChannelPickerRow = styled.div.attrs({\n\tclassName: 'bik-channel-picker-row',\n})`\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\twidth: 100%;\n\tpadding: 4px;\n\tborder-radius: 4px;\n\tbox-sizing: border-box;\n\n\t&:hover {\n\t\tbackground: ${COLORS.surface.subdued};\n\t}\n`;\n\n/**\n * Glyph + account name inside a picker row. Figma wraps these in their own\n * `px-4` group, so the checkbox sits 12px from the glyph but the glyph sits 8px\n * from the label.\n */\nexport const ChannelPickerAccount = styled.div.attrs({\n\tclassName: 'bik-channel-picker-account',\n})`\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\tmin-width: 0;\n\theight: 32px;\n\tpadding: 0 4px;\n`;\n\nexport const ChannelPickerBody = styled.div.attrs({\n\tclassName: 'bik-channel-picker-body',\n})`\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n\twidth: 100%;\n\t/* Figma indents the body 8px inside the modal's own 24px gutter, so the list\n\t sits at 32px while the title stays at 24px. StyledModal's body has no\n\t gutter of its own, so both live here. */\n\tpadding: 0 32px;\n\tbox-sizing: border-box;\n`;\n\n/**\n * Figma reserves a 24×24 slot for a checkbox (an 18px box inset by 3px), but the\n * library's CheckBox renders the bare 18px box. Without this the checkbox column\n * — and everything after it — sits 3px tight against the design. Passed as\n * CheckBox's `style`, which lands on its container.\n */\nexport const CHECKBOX_SLOT: React.CSSProperties = {\n\twidth: 24,\n\theight: 24,\n\tjustifyContent: 'center',\n};\n"],"names":["iconActionButton","css","COLORS","BuilderRoot","styled","TopBar","TopBarSide","BackButton","Main","Rail","Content","ContentCard","StepScroll","Footer","FooterHint","FooterActions","RailList","RailItem","StepBadge","p","SectionHeaderWrap","SectionBodyWrap","FieldBlock","FieldLabelRow","AiTextAreaShell","AiTextAreaInput","CardRow","RadioCard","BASE_COLORS","RadioCardText","ChipWrap","Step3Root","Step3Grid","Step3Divider","SideSection","SideSectionHeader","AddIconButton","SourceButtonRow","SourceButton","SelectableRow","RowText","RowLabel","RowActions","RowActionDivider","RowMenuButton","DraftButtonScope","ModalBody","ModalIcon","AGENT_STATE_MODAL_MIN_HEIGHT","AgentStateModalBody","AgentStateModalHero","ModalActions","ChannelsSectionRoot","ChannelsLink","ChannelCard","ChannelRow","ChannelRowMain","ChannelIdentity","ChannelGlyph","props","ChannelChips","ChipTooltipTarget","ChannelPickerList","ChannelPickerRow","ChannelPickerAccount","ChannelPickerBody","CHECKBOX_SLOT"],"mappings":";;AAKA,MAAMA,IAAmBC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAaTC,EAAO,QAAQ,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAUzBC,IAAcC,EAAO,IAAI,MAAM,EAAE,WAAW,oBAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAM9DF,EAAO,QAAQ,QAAQ;AAAA,GAGzBG,IAASD,EAAO,IAAI,MAAM,EAAE,WAAW,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAMvCF,EAAO,OAAO,OAAO;AAAA;AAAA,GAIpCI,IAAaF,EAAO,IAAI,MAAM,EAAE,WAAW,oBAAoB;AAAA;AAAA;AAAA;AAAA,GAM/DG,IAAaH,EAAO,OAAO,MAAM,EAAE,WAAW,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAa9DF,EAAO,QAAQ,OAAO;AAAA;AAAA,GAIzBM,IAAOJ,EAAO,IAAI,MAAM,EAAE,WAAW,YAAY;AAAA;AAAA;AAAA;AAAA,GAMjDK,IAAOL,EAAO,IAAI,MAAM,EAAE,WAAW,YAAY;AAAA;AAAA;AAAA,2BAGnCF,EAAO,OAAO,OAAO;AAAA;AAAA;AAAA,eAGjCA,EAAO,QAAQ,QAAQ;AAAA,GAGzBQ,IAAUN,EAAO,IAAI,MAAM,EAAE,WAAW,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAQrDF,EAAO,QAAQ,QAAQ;AAAA,GAGzBS,I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1,47 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type AgentModalState = 'loading' | 'error';
|
|
3
|
+
interface AgentStateAction {
|
|
4
|
+
text: string;
|
|
5
|
+
onClick: () => void;
|
|
6
|
+
isLoading?: boolean;
|
|
7
|
+
}
|
|
8
|
+
interface AgentStateModalProps {
|
|
9
|
+
open: boolean;
|
|
10
|
+
/** `loading` while the write is in flight, `error` once it came back badly. */
|
|
11
|
+
state: AgentModalState;
|
|
12
|
+
/** Heading, e.g. "Agent couldn't go live". Comes from the caller — on `error` the
|
|
13
|
+
* server owns this copy, so the builder never composes it. */
|
|
14
|
+
title: string;
|
|
15
|
+
/** Body copy. Line breaks are preserved, so a caller can pass one line per reason
|
|
16
|
+
* (e.g. per conflicting intent) without markup. */
|
|
17
|
+
message: string;
|
|
18
|
+
/** Right-hand action, e.g. "Try again", or the step to fix when the caller knows
|
|
19
|
+
* one ("Go to When it steps in"). */
|
|
20
|
+
primaryButton?: AgentStateAction;
|
|
21
|
+
/** Left-hand action, e.g. "Go back to editing". */
|
|
22
|
+
secondaryButton?: AgentStateAction;
|
|
23
|
+
/** 64px image for the `loading` badge — pass the host's loader asset to match its
|
|
24
|
+
* other dialogs. Falls back to `Spinner`, so the library needs no remote asset. */
|
|
25
|
+
loadingImageUrl?: string;
|
|
26
|
+
/** Cross button / outside click. Always available, so a message-only dialog is
|
|
27
|
+
* still dismissible with no actions at all. Not offered while `loading`. */
|
|
28
|
+
onClose: () => void;
|
|
29
|
+
zIndex?: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* What's happening to a save or publish: in flight, or failed. Sibling of
|
|
33
|
+
* `GoLiveModal` — same hero layout (badge, title, body, actions), and the actions sit
|
|
34
|
+
* inside the body for the same reason (see GoLiveModal). Every state is pinned to
|
|
35
|
+
* `AGENT_STATE_MODAL_MIN_HEIGHT`, the go-live success height, so the card doesn't
|
|
36
|
+
* resize as one state replaces another.
|
|
37
|
+
*
|
|
38
|
+
* Deliberately copy-free: title, message and button labels all come from the caller,
|
|
39
|
+
* because the server owns the wording of the failure it just reported.
|
|
40
|
+
*
|
|
41
|
+
* Both buttons are optional, so one component covers every shape — two actions, one,
|
|
42
|
+
* or message-only. That last one is for a failure with nothing to offer: no step to
|
|
43
|
+
* send the merchant to and nothing a retry would change. `loading` never renders
|
|
44
|
+
* actions or a cross, since there is nothing to decide yet.
|
|
45
|
+
*/
|
|
46
|
+
export declare const AgentStateModal: React.FC<AgentStateModalProps>;
|
|
47
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { jsx as t, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
import x from "../../../assets/icons/errorIcon.svg.js";
|
|
3
|
+
import { Spinner as f } from "../../spinner/Spinner.js";
|
|
4
|
+
import { TitleMedium as y, BodyPrimary as u } from "../../TypographyStyle.js";
|
|
5
|
+
import { COLORS as l } from "../../../constants/Theme.js";
|
|
6
|
+
import { AgentStateModalBody as S, AgentStateModalHero as C, ModalIcon as M, ModalActions as k } from "../AgentBuilder.styled.js";
|
|
7
|
+
import { StyledModal as L } from "../../modals/styledModal.js";
|
|
8
|
+
import { Button as d } from "../../button/Button.js";
|
|
9
|
+
const j = ({
|
|
10
|
+
open: a,
|
|
11
|
+
state: s,
|
|
12
|
+
title: c,
|
|
13
|
+
message: m,
|
|
14
|
+
primaryButton: e,
|
|
15
|
+
secondaryButton: i,
|
|
16
|
+
loadingImageUrl: n,
|
|
17
|
+
onClose: h,
|
|
18
|
+
zIndex: p
|
|
19
|
+
}) => {
|
|
20
|
+
if (!a)
|
|
21
|
+
return null;
|
|
22
|
+
const o = s === "loading", g = o ? null : i ?? e;
|
|
23
|
+
return /* @__PURE__ */ t(
|
|
24
|
+
L,
|
|
25
|
+
{
|
|
26
|
+
"data-test": "agent-state-modal",
|
|
27
|
+
open: !0,
|
|
28
|
+
onClose: h,
|
|
29
|
+
width: "520px",
|
|
30
|
+
zIndex: p,
|
|
31
|
+
hideCrossButton: o,
|
|
32
|
+
closeOnOutsideClick: !o,
|
|
33
|
+
closeOnEscapeKey: !o,
|
|
34
|
+
children: /* @__PURE__ */ r(S, { style: { gap: "24px" }, children: [
|
|
35
|
+
/* @__PURE__ */ r(C, { children: [
|
|
36
|
+
/* @__PURE__ */ t(M, { children: o ? n ? /* @__PURE__ */ t("img", { src: n, alt: "", width: 64, height: 64 }) : /* @__PURE__ */ t(f, { size: "large", color: l.stroke.brand }) : /* @__PURE__ */ t(x, { width: 64, height: 64 }) }),
|
|
37
|
+
/* @__PURE__ */ r("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
|
|
38
|
+
/* @__PURE__ */ t(y, { color: l.content.primary, children: c }),
|
|
39
|
+
/* @__PURE__ */ t(
|
|
40
|
+
u,
|
|
41
|
+
{
|
|
42
|
+
color: l.content.secondary,
|
|
43
|
+
style: { whiteSpace: "pre-line" },
|
|
44
|
+
children: m
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
] })
|
|
48
|
+
] }),
|
|
49
|
+
g && /* @__PURE__ */ r(k, { children: [
|
|
50
|
+
i && /* @__PURE__ */ t("div", { style: { display: "flex" }, children: /* @__PURE__ */ t(
|
|
51
|
+
d,
|
|
52
|
+
{
|
|
53
|
+
"data-test": "agent-state-secondary",
|
|
54
|
+
buttonType: "secondary",
|
|
55
|
+
size: "medium",
|
|
56
|
+
matchParentWidth: !0,
|
|
57
|
+
buttonText: i.text,
|
|
58
|
+
isLoading: i.isLoading,
|
|
59
|
+
onClick: i.onClick
|
|
60
|
+
}
|
|
61
|
+
) }),
|
|
62
|
+
e && /* @__PURE__ */ t("div", { style: { display: "flex" }, children: /* @__PURE__ */ t(
|
|
63
|
+
d,
|
|
64
|
+
{
|
|
65
|
+
"data-test": "agent-state-primary",
|
|
66
|
+
buttonType: "primary",
|
|
67
|
+
size: "medium",
|
|
68
|
+
matchParentWidth: !0,
|
|
69
|
+
buttonText: e.text,
|
|
70
|
+
isLoading: e.isLoading,
|
|
71
|
+
onClick: e.onClick
|
|
72
|
+
}
|
|
73
|
+
) })
|
|
74
|
+
] })
|
|
75
|
+
] })
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
};
|
|
79
|
+
export {
|
|
80
|
+
j as AgentStateModal
|
|
81
|
+
};
|
|
82
|
+
//# sourceMappingURL=AgentStateModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentStateModal.js","sources":["../../../../../src/components/agent-builder/components/AgentStateModal.tsx"],"sourcesContent":["import ErrorIcon from '@src/assets/icons/errorIcon.svg';\nimport React from 'react';\nimport { Button } from '@src/components/button';\nimport { StyledModal } from '@src/components/modals';\nimport { Spinner } from '@src/components/spinner/Spinner';\nimport { BodyPrimary, TitleMedium } from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport {\n\tAgentStateModalBody,\n\tAgentStateModalHero,\n\tModalActions,\n\tModalIcon,\n} from '../AgentBuilder.styled';\n\nexport type AgentModalState = 'loading' | 'error';\n\ninterface AgentStateAction {\n\ttext: string;\n\tonClick: () => void;\n\tisLoading?: boolean;\n}\n\ninterface AgentStateModalProps {\n\topen: boolean;\n\t/** `loading` while the write is in flight, `error` once it came back badly. */\n\tstate: AgentModalState;\n\t/** Heading, e.g. \"Agent couldn't go live\". Comes from the caller — on `error` the\n\t * server owns this copy, so the builder never composes it. */\n\ttitle: string;\n\t/** Body copy. Line breaks are preserved, so a caller can pass one line per reason\n\t * (e.g. per conflicting intent) without markup. */\n\tmessage: string;\n\t/** Right-hand action, e.g. \"Try again\", or the step to fix when the caller knows\n\t * one (\"Go to When it steps in\"). */\n\tprimaryButton?: AgentStateAction;\n\t/** Left-hand action, e.g. \"Go back to editing\". */\n\tsecondaryButton?: AgentStateAction;\n\t/** 64px image for the `loading` badge — pass the host's loader asset to match its\n\t * other dialogs. Falls back to `Spinner`, so the library needs no remote asset. */\n\tloadingImageUrl?: string;\n\t/** Cross button / outside click. Always available, so a message-only dialog is\n\t * still dismissible with no actions at all. Not offered while `loading`. */\n\tonClose: () => void;\n\tzIndex?: number;\n}\n\n/**\n * What's happening to a save or publish: in flight, or failed. Sibling of\n * `GoLiveModal` — same hero layout (badge, title, body, actions), and the actions sit\n * inside the body for the same reason (see GoLiveModal). Every state is pinned to\n * `AGENT_STATE_MODAL_MIN_HEIGHT`, the go-live success height, so the card doesn't\n * resize as one state replaces another.\n *\n * Deliberately copy-free: title, message and button labels all come from the caller,\n * because the server owns the wording of the failure it just reported.\n *\n * Both buttons are optional, so one component covers every shape — two actions, one,\n * or message-only. That last one is for a failure with nothing to offer: no step to\n * send the merchant to and nothing a retry would change. `loading` never renders\n * actions or a cross, since there is nothing to decide yet.\n */\nexport const AgentStateModal: React.FC<AgentStateModalProps> = ({\n\topen,\n\tstate,\n\ttitle,\n\tmessage,\n\tprimaryButton,\n\tsecondaryButton,\n\tloadingImageUrl,\n\tonClose,\n\tzIndex,\n}) => {\n\tif (!open) {\n\t\treturn null;\n\t}\n\n\tconst isLoading = state === 'loading';\n\tconst actions = isLoading ? null : secondaryButton ?? primaryButton;\n\n\treturn (\n\t\t<StyledModal\n\t\t\tdata-test=\"agent-state-modal\"\n\t\t\topen\n\t\t\tonClose={onClose}\n\t\t\twidth=\"520px\"\n\t\t\tzIndex={zIndex}\n\t\t\thideCrossButton={isLoading}\n\t\t\tcloseOnOutsideClick={!isLoading}\n\t\t\tcloseOnEscapeKey={!isLoading}\n\t\t>\n\t\t\t<AgentStateModalBody style={{ gap: '24px' }}>\n\t\t\t\t<AgentStateModalHero>\n\t\t\t\t\t<ModalIcon>\n\t\t\t\t\t\t{isLoading ? (\n\t\t\t\t\t\t\tloadingImageUrl ? (\n\t\t\t\t\t\t\t\t<img src={loadingImageUrl} alt=\"\" width={64} height={64} />\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<Spinner size=\"large\" color={COLORS.stroke.brand} />\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<ErrorIcon width={64} height={64} />\n\t\t\t\t\t\t)}\n\t\t\t\t\t</ModalIcon>\n\n\t\t\t\t\t<div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>\n\t\t\t\t\t\t<TitleMedium color={COLORS.content.primary}>{title}</TitleMedium>\n\t\t\t\t\t\t<BodyPrimary\n\t\t\t\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t\t\t\t\tstyle={{ whiteSpace: 'pre-line' }}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{message}\n\t\t\t\t\t\t</BodyPrimary>\n\t\t\t\t\t</div>\n\t\t\t\t</AgentStateModalHero>\n\n\t\t\t\t{actions && (\n\t\t\t\t\t<ModalActions>\n\t\t\t\t\t\t{secondaryButton && (\n\t\t\t\t\t\t\t<div style={{ display: 'flex' }}>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tdata-test=\"agent-state-secondary\"\n\t\t\t\t\t\t\t\t\tbuttonType=\"secondary\"\n\t\t\t\t\t\t\t\t\tsize=\"medium\"\n\t\t\t\t\t\t\t\t\tmatchParentWidth\n\t\t\t\t\t\t\t\t\tbuttonText={secondaryButton.text}\n\t\t\t\t\t\t\t\t\tisLoading={secondaryButton.isLoading}\n\t\t\t\t\t\t\t\t\tonClick={secondaryButton.onClick}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{primaryButton && (\n\t\t\t\t\t\t\t<div style={{ display: 'flex' }}>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tdata-test=\"agent-state-primary\"\n\t\t\t\t\t\t\t\t\tbuttonType=\"primary\"\n\t\t\t\t\t\t\t\t\tsize=\"medium\"\n\t\t\t\t\t\t\t\t\tmatchParentWidth\n\t\t\t\t\t\t\t\t\tbuttonText={primaryButton.text}\n\t\t\t\t\t\t\t\t\tisLoading={primaryButton.isLoading}\n\t\t\t\t\t\t\t\t\tonClick={primaryButton.onClick}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</ModalActions>\n\t\t\t\t)}\n\t\t\t</AgentStateModalBody>\n\t\t</StyledModal>\n\t);\n};\n"],"names":["AgentStateModal","open","state","title","message","primaryButton","secondaryButton","loadingImageUrl","onClose","zIndex","isLoading","actions","jsx","StyledModal","AgentStateModalBody","jsxs","AgentStateModalHero","ModalIcon","Spinner","COLORS","ErrorIcon","TitleMedium","BodyPrimary","ModalActions","Button"],"mappings":";;;;;;;;AA6DO,MAAMA,IAAkD,CAAC;AAAA,EAC/D,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,eAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,SAAAC;AAAA,EACA,QAAAC;AACD,MAAM;AACL,MAAI,CAACR;AACJ,WAAO;AAGR,QAAMS,IAAYR,MAAU,WACtBS,IAAUD,IAAY,OAAOJ,KAAmBD;AAEtD,SACC,gBAAAO;AAAA,IAACC;AAAA,IAAA;AAAA,MACA,aAAU;AAAA,MACV,MAAI;AAAA,MACJ,SAAAL;AAAA,MACA,OAAM;AAAA,MACN,QAAAC;AAAA,MACA,iBAAiBC;AAAA,MACjB,qBAAqB,CAACA;AAAA,MACtB,kBAAkB,CAACA;AAAA,MAEnB,4BAACI,GAAA,EAAoB,OAAO,EAAE,KAAK,UAClC,UAAA;AAAA,QAAA,gBAAAC,EAACC,GAAA,EACA,UAAA;AAAA,UAAA,gBAAAJ,EAACK,GAAA,EACC,UAAAP,IACAH,IACC,gBAAAK,EAAC,OAAA,EAAI,KAAKL,GAAiB,KAAI,IAAG,OAAO,IAAI,QAAQ,IAAI,IAEzD,gBAAAK,EAACM,GAAA,EAAQ,MAAK,SAAQ,OAAOC,EAAO,OAAO,MAAA,CAAO,IAGnD,gBAAAP,EAACQ,GAAA,EAAU,OAAO,IAAI,QAAQ,IAAI,GAEpC;AAAA,UAEA,gBAAAL,EAAC,OAAA,EAAI,OAAO,EAAE,SAAS,QAAQ,eAAe,UAAU,KAAK,MAAA,GAC5D,UAAA;AAAA,YAAA,gBAAAH,EAACS,GAAA,EAAY,OAAOF,EAAO,QAAQ,SAAU,UAAAhB,GAAM;AAAA,YACnD,gBAAAS;AAAA,cAACU;AAAA,cAAA;AAAA,gBACA,OAAOH,EAAO,QAAQ;AAAA,gBACtB,OAAO,EAAE,YAAY,WAAA;AAAA,gBAEpB,UAAAf;AAAA,cAAA;AAAA,YAAA;AAAA,UACF,EAAA,CACD;AAAA,QAAA,GACD;AAAA,QAECO,uBACCY,GAAA,EACC,UAAA;AAAA,UAAAjB,uBACC,OAAA,EAAI,OAAO,EAAE,SAAS,UACtB,UAAA,gBAAAM;AAAA,YAACY;AAAA,YAAA;AAAA,cACA,aAAU;AAAA,cACV,YAAW;AAAA,cACX,MAAK;AAAA,cACL,kBAAgB;AAAA,cAChB,YAAYlB,EAAgB;AAAA,cAC5B,WAAWA,EAAgB;AAAA,cAC3B,SAASA,EAAgB;AAAA,YAAA;AAAA,UAAA,GAE3B;AAAA,UAEAD,KACA,gBAAAO,EAAC,OAAA,EAAI,OAAO,EAAE,SAAS,UACtB,UAAA,gBAAAA;AAAA,YAACY;AAAA,YAAA;AAAA,cACA,aAAU;AAAA,cACV,YAAW;AAAA,cACX,MAAK;AAAA,cACL,kBAAgB;AAAA,cAChB,YAAYnB,EAAc;AAAA,cAC1B,WAAWA,EAAc;AAAA,cACzB,SAASA,EAAc;AAAA,YAAA;AAAA,UAAA,EACxB,CACD;AAAA,QAAA,EAAA,CAEF;AAAA,MAAA,EAAA,CAEF;AAAA,IAAA;AAAA,EAAA;AAGH;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { AgentChannel } from '../AgentBuilder.model';
|
|
3
|
+
interface ChannelSelectModalProps {
|
|
4
|
+
/** The channel being edited. `null` closes the modal. */
|
|
5
|
+
channel: AgentChannel | null;
|
|
6
|
+
/** Currently activated backend channel ids for this channel. */
|
|
7
|
+
selectedIds: string[];
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
/** Apply — commits the draft selection as backend channel ids. */
|
|
10
|
+
onApply: (channelIds: string[]) => void;
|
|
11
|
+
/** Footer "Channel management" link. Omit to hide it. */
|
|
12
|
+
onManageChannels?: () => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Per-channel account picker, opened from a channel row's edit button.
|
|
16
|
+
*
|
|
17
|
+
* The selection is a LOCAL draft until Apply — the design gives the merchant a
|
|
18
|
+
* Cancel, so toggling here must not reach the agent value until they commit.
|
|
19
|
+
*
|
|
20
|
+
* A disconnected account stays selectable and stays selected: the merchant may
|
|
21
|
+
* be mid-reconnect, and quietly removing it from their agent would hide the
|
|
22
|
+
* problem rather than surface it. It's labelled instead, and the row it came
|
|
23
|
+
* from carries the alert.
|
|
24
|
+
*/
|
|
25
|
+
export declare const ChannelSelectModal: React.FC<ChannelSelectModalProps>;
|
|
26
|
+
export type { ChannelSelectModalProps };
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { jsx as t, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import x from "../../../assets/icons/RedirectToNew.svg.js";
|
|
3
|
+
import { useState as S, useEffect as b } from "react";
|
|
4
|
+
import { BodySecondary as p, TitleSmall as C } from "../../TypographyStyle.js";
|
|
5
|
+
import { COLORS as l } from "../../../constants/Theme.js";
|
|
6
|
+
import { ChannelPickerBody as k, ChannelPickerList as T, ChannelPickerRow as z, CHECKBOX_SLOT as B, ChannelPickerAccount as L, ChannelGlyph as N, ChannelsLink as v } from "../AgentBuilder.styled.js";
|
|
7
|
+
import { channelPresentation as w, isAccountDisconnected as P } from "../constants/channels.js";
|
|
8
|
+
import { StyledModal as O } from "../../modals/styledModal.js";
|
|
9
|
+
import { CheckBox as $ } from "../../checkBox/CheckBox.js";
|
|
10
|
+
import { Tag as A } from "../../tag/Tag.js";
|
|
11
|
+
const D = ({
|
|
12
|
+
channel: n,
|
|
13
|
+
selectedIds: r,
|
|
14
|
+
onClose: c,
|
|
15
|
+
onApply: g,
|
|
16
|
+
onManageChannels: d
|
|
17
|
+
}) => {
|
|
18
|
+
const [h, s] = S(r);
|
|
19
|
+
if (b(() => {
|
|
20
|
+
n && s(r);
|
|
21
|
+
}, [n]), !n)
|
|
22
|
+
return null;
|
|
23
|
+
const { Icon: m, tint: y, accountsNoun: i } = w(
|
|
24
|
+
n.type,
|
|
25
|
+
n.label
|
|
26
|
+
), f = (e) => s(
|
|
27
|
+
(o) => o.includes(e) ? o.filter((u) => u !== e) : [...o, e]
|
|
28
|
+
);
|
|
29
|
+
return /* @__PURE__ */ t(
|
|
30
|
+
O,
|
|
31
|
+
{
|
|
32
|
+
"data-test": "agent-channel-select-modal",
|
|
33
|
+
open: !0,
|
|
34
|
+
onClose: c,
|
|
35
|
+
width: "640px",
|
|
36
|
+
headingTitle: "Select channels to activate",
|
|
37
|
+
headingSubtitle: `Select the ${i} on which you need this agent enabled on.`,
|
|
38
|
+
modalHeaderStyles: { padding: "24px", boxSizing: "border-box" },
|
|
39
|
+
modalBodyStyles: { boxSizing: "border-box" },
|
|
40
|
+
footerContainerStyle: { padding: "20px 24px", boxSizing: "border-box" },
|
|
41
|
+
footerLeftCustomElement: d ? /* @__PURE__ */ a(
|
|
42
|
+
v,
|
|
43
|
+
{
|
|
44
|
+
"data-test": "agent-channel-management-link",
|
|
45
|
+
type: "button",
|
|
46
|
+
onClick: d,
|
|
47
|
+
style: { fontSize: 14, lineHeight: "20px", fontWeight: 600 },
|
|
48
|
+
children: [
|
|
49
|
+
"Channel management",
|
|
50
|
+
/* @__PURE__ */ t(x, { width: 16, height: 16 })
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
) : void 0,
|
|
54
|
+
secondaryButton: {
|
|
55
|
+
"data-test": "agent-channel-cancel",
|
|
56
|
+
buttonType: "tertiaryGray",
|
|
57
|
+
size: "small",
|
|
58
|
+
buttonText: "Cancel",
|
|
59
|
+
onClick: c
|
|
60
|
+
},
|
|
61
|
+
primaryButton: {
|
|
62
|
+
"data-test": "agent-channel-apply",
|
|
63
|
+
buttonType: "primary",
|
|
64
|
+
size: "small",
|
|
65
|
+
buttonText: "Apply",
|
|
66
|
+
onClick: () => g(h)
|
|
67
|
+
},
|
|
68
|
+
children: /* @__PURE__ */ a(k, { children: [
|
|
69
|
+
/* @__PURE__ */ t(p, { color: l.content.secondary, children: `Select from available ${i}` }),
|
|
70
|
+
/* @__PURE__ */ a(T, { children: [
|
|
71
|
+
n.accounts.map((e) => {
|
|
72
|
+
const o = P(e);
|
|
73
|
+
return /* @__PURE__ */ a(
|
|
74
|
+
z,
|
|
75
|
+
{
|
|
76
|
+
"data-test": `agent-channel-account-${e.channelId}`,
|
|
77
|
+
children: [
|
|
78
|
+
/* @__PURE__ */ t(
|
|
79
|
+
$,
|
|
80
|
+
{
|
|
81
|
+
isChecked: h.includes(e.channelId),
|
|
82
|
+
ariaLabel: e.channelName,
|
|
83
|
+
value: e.channelId,
|
|
84
|
+
onValueChange: () => f(e.channelId),
|
|
85
|
+
style: B
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
/* @__PURE__ */ a(L, { children: [
|
|
89
|
+
/* @__PURE__ */ t(N, { tint: y, children: m && /* @__PURE__ */ t(m, { size: 16 }) }),
|
|
90
|
+
/* @__PURE__ */ t(C, { color: l.content.primary, children: e.channelName }),
|
|
91
|
+
o && // NOT `size="small"`: that renders through BodyTiny, which
|
|
92
|
+
// is 10px AND has no font-family, so it falls back to the
|
|
93
|
+
// browser serif. The default reads as 12px Inter — Figma's
|
|
94
|
+
// body-caption, same as every other chip.
|
|
95
|
+
/* @__PURE__ */ t(
|
|
96
|
+
A,
|
|
97
|
+
{
|
|
98
|
+
tagText: "Disconnected",
|
|
99
|
+
type: "negative",
|
|
100
|
+
variant: "regular",
|
|
101
|
+
height: 20,
|
|
102
|
+
padding: "2px 8px"
|
|
103
|
+
}
|
|
104
|
+
)
|
|
105
|
+
] })
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
e.channelId
|
|
109
|
+
);
|
|
110
|
+
}),
|
|
111
|
+
n.accounts.length === 0 && /* @__PURE__ */ t(p, { color: l.content.placeholder, children: `No ${i} are connected to this store yet.` })
|
|
112
|
+
] })
|
|
113
|
+
] })
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
};
|
|
117
|
+
D.displayName = "ChannelSelectModal";
|
|
118
|
+
export {
|
|
119
|
+
D as ChannelSelectModal
|
|
120
|
+
};
|
|
121
|
+
//# sourceMappingURL=ChannelSelectModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChannelSelectModal.js","sources":["../../../../../src/components/agent-builder/components/ChannelSelectModal.tsx"],"sourcesContent":["import RedirectIcon from '@src/assets/icons/RedirectToNew.svg';\nimport React, { useEffect, useState } from 'react';\nimport { CheckBox } from '@src/components/checkBox';\nimport { StyledModal } from '@src/components/modals';\nimport { Tag } from '@src/components/tag';\nimport { BodySecondary, TitleSmall } from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport type { AgentChannel } from '../AgentBuilder.model';\nimport {\n\tChannelGlyph,\n\tChannelPickerAccount,\n\tChannelPickerBody,\n\tChannelPickerList,\n\tChannelPickerRow,\n\tChannelsLink,\n\tCHECKBOX_SLOT,\n} from '../AgentBuilder.styled';\nimport {\n\tchannelPresentation,\n\tisAccountDisconnected,\n} from '../constants/channels';\n\ninterface ChannelSelectModalProps {\n\t/** The channel being edited. `null` closes the modal. */\n\tchannel: AgentChannel | null;\n\t/** Currently activated backend channel ids for this channel. */\n\tselectedIds: string[];\n\tonClose: () => void;\n\t/** Apply — commits the draft selection as backend channel ids. */\n\tonApply: (channelIds: string[]) => void;\n\t/** Footer \"Channel management\" link. Omit to hide it. */\n\tonManageChannels?: () => void;\n}\n\n/**\n * Per-channel account picker, opened from a channel row's edit button.\n *\n * The selection is a LOCAL draft until Apply — the design gives the merchant a\n * Cancel, so toggling here must not reach the agent value until they commit.\n *\n * A disconnected account stays selectable and stays selected: the merchant may\n * be mid-reconnect, and quietly removing it from their agent would hide the\n * problem rather than surface it. It's labelled instead, and the row it came\n * from carries the alert.\n */\nexport const ChannelSelectModal: React.FC<ChannelSelectModalProps> = ({\n\tchannel,\n\tselectedIds,\n\tonClose,\n\tonApply,\n\tonManageChannels,\n}) => {\n\tconst [draft, setDraft] = useState<string[]>(selectedIds);\n\n\t// Re-seed whenever the modal opens (or reopens for a different channel), so a\n\t// cancelled edit doesn't leak into the next one.\n\tuseEffect(() => {\n\t\tif (channel) {\n\t\t\tsetDraft(selectedIds);\n\t\t}\n\t\t// `selectedIds` is intentionally read only at open time — the draft owns it\n\t\t// from then until Apply.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [channel]);\n\n\tif (!channel) {\n\t\treturn null;\n\t}\n\n\tconst { Icon, tint, accountsNoun } = channelPresentation(\n\t\tchannel.type,\n\t\tchannel.label,\n\t);\n\n\tconst toggle = (channelId: string) =>\n\t\tsetDraft((prev) =>\n\t\t\tprev.includes(channelId)\n\t\t\t\t? prev.filter((id) => id !== channelId)\n\t\t\t\t: [...prev, channelId],\n\t\t);\n\n\treturn (\n\t\t<StyledModal\n\t\t\tdata-test=\"agent-channel-select-modal\"\n\t\t\topen\n\t\t\tonClose={onClose}\n\t\t\twidth=\"640px\"\n\t\t\theadingTitle=\"Select channels to activate\"\n\t\t\theadingSubtitle={`Select the ${accountsNoun} on which you need this agent enabled on.`}\n\t\t\t// This repo has no global `box-sizing: border-box`, so StyledModal's\n\t\t\t// `width: 100%` + 24px side padding resolves to 688px inside its 640px\n\t\t\t// `overflow: hidden` wrapper — clipping the right 48px, and with it the\n\t\t\t// primary button. Border-box on each section is the fix that doesn't\n\t\t\t// touch the shared modal.\n\t\t\tmodalHeaderStyles={{ padding: '24px', boxSizing: 'border-box' }}\n\t\t\tmodalBodyStyles={{ boxSizing: 'border-box' }}\n\t\t\tfooterContainerStyle={{ padding: '20px 24px', boxSizing: 'border-box' }}\n\t\t\tfooterLeftCustomElement={\n\t\t\t\tonManageChannels ? (\n\t\t\t\t\t<ChannelsLink\n\t\t\t\t\t\tdata-test=\"agent-channel-management-link\"\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tonClick={onManageChannels}\n\t\t\t\t\t\tstyle={{ fontSize: 14, lineHeight: '20px', fontWeight: 600 }}\n\t\t\t\t\t>\n\t\t\t\t\t\tChannel management\n\t\t\t\t\t\t<RedirectIcon width={16} height={16} />\n\t\t\t\t\t</ChannelsLink>\n\t\t\t\t) : undefined\n\t\t\t}\n\t\t\tsecondaryButton={{\n\t\t\t\t'data-test': 'agent-channel-cancel',\n\t\t\t\tbuttonType: 'tertiaryGray',\n\t\t\t\tsize: 'small',\n\t\t\t\tbuttonText: 'Cancel',\n\t\t\t\tonClick: onClose,\n\t\t\t}}\n\t\t\tprimaryButton={{\n\t\t\t\t'data-test': 'agent-channel-apply',\n\t\t\t\tbuttonType: 'primary',\n\t\t\t\tsize: 'small',\n\t\t\t\tbuttonText: 'Apply',\n\t\t\t\tonClick: () => onApply(draft),\n\t\t\t}}\n\t\t>\n\t\t\t<ChannelPickerBody>\n\t\t\t\t<BodySecondary color={COLORS.content.secondary}>\n\t\t\t\t\t{`Select from available ${accountsNoun}`}\n\t\t\t\t</BodySecondary>\n\n\t\t\t\t<ChannelPickerList>\n\t\t\t\t\t{channel.accounts.map((account) => {\n\t\t\t\t\t\tconst disconnected = isAccountDisconnected(account);\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<ChannelPickerRow\n\t\t\t\t\t\t\t\tkey={account.channelId}\n\t\t\t\t\t\t\t\tdata-test={`agent-channel-account-${account.channelId}`}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<CheckBox\n\t\t\t\t\t\t\t\t\tisChecked={draft.includes(account.channelId)}\n\t\t\t\t\t\t\t\t\tariaLabel={account.channelName}\n\t\t\t\t\t\t\t\t\tvalue={account.channelId}\n\t\t\t\t\t\t\t\t\tonValueChange={() => toggle(account.channelId)}\n\t\t\t\t\t\t\t\t\tstyle={CHECKBOX_SLOT}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<ChannelPickerAccount>\n\t\t\t\t\t\t\t\t\t<ChannelGlyph tint={tint}>\n\t\t\t\t\t\t\t\t\t\t{Icon && <Icon size={16} />}\n\t\t\t\t\t\t\t\t\t</ChannelGlyph>\n\t\t\t\t\t\t\t\t\t<TitleSmall color={COLORS.content.primary}>\n\t\t\t\t\t\t\t\t\t\t{account.channelName}\n\t\t\t\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t\t\t\t{disconnected && (\n\t\t\t\t\t\t\t\t\t\t// NOT `size=\"small\"`: that renders through BodyTiny, which\n\t\t\t\t\t\t\t\t\t\t// is 10px AND has no font-family, so it falls back to the\n\t\t\t\t\t\t\t\t\t\t// browser serif. The default reads as 12px Inter — Figma's\n\t\t\t\t\t\t\t\t\t\t// body-caption, same as every other chip.\n\t\t\t\t\t\t\t\t\t\t<Tag\n\t\t\t\t\t\t\t\t\t\t\ttagText=\"Disconnected\"\n\t\t\t\t\t\t\t\t\t\t\ttype=\"negative\"\n\t\t\t\t\t\t\t\t\t\t\tvariant=\"regular\"\n\t\t\t\t\t\t\t\t\t\t\theight={20}\n\t\t\t\t\t\t\t\t\t\t\tpadding=\"2px 8px\"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</ChannelPickerAccount>\n\t\t\t\t\t\t\t</ChannelPickerRow>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\n\t\t\t\t\t{channel.accounts.length === 0 && (\n\t\t\t\t\t\t<BodySecondary color={COLORS.content.placeholder}>\n\t\t\t\t\t\t\t{`No ${accountsNoun} are connected to this store yet.`}\n\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t)}\n\t\t\t\t</ChannelPickerList>\n\t\t\t</ChannelPickerBody>\n\t\t</StyledModal>\n\t);\n};\n\nChannelSelectModal.displayName = 'ChannelSelectModal';\n\nexport type { ChannelSelectModalProps };\n"],"names":["ChannelSelectModal","channel","selectedIds","onClose","onApply","onManageChannels","draft","setDraft","useState","useEffect","Icon","tint","accountsNoun","channelPresentation","toggle","channelId","prev","id","jsx","StyledModal","jsxs","ChannelsLink","RedirectIcon","ChannelPickerBody","BodySecondary","COLORS","ChannelPickerList","account","disconnected","isAccountDisconnected","ChannelPickerRow","CheckBox","CHECKBOX_SLOT","ChannelPickerAccount","ChannelGlyph","TitleSmall","Tag"],"mappings":";;;;;;;;;;AA6CO,MAAMA,IAAwD,CAAC;AAAA,EACrE,SAAAC;AAAA,EACA,aAAAC;AAAA,EACA,SAAAC;AAAA,EACA,SAAAC;AAAA,EACA,kBAAAC;AACD,MAAM;AACL,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAmBN,CAAW;AAaxD,MATAO,EAAU,MAAM;AACf,IAAIR,KACHM,EAASL,CAAW;AAAA,EAKtB,GAAG,CAACD,CAAO,CAAC,GAER,CAACA;AACJ,WAAO;AAGR,QAAM,EAAE,MAAAS,GAAM,MAAAC,GAAM,cAAAC,EAAA,IAAiBC;AAAA,IACpCZ,EAAQ;AAAA,IACRA,EAAQ;AAAA,EAAA,GAGHa,IAAS,CAACC,MACfR;AAAA,IAAS,CAACS,MACTA,EAAK,SAASD,CAAS,IACpBC,EAAK,OAAO,CAACC,MAAOA,MAAOF,CAAS,IACpC,CAAC,GAAGC,GAAMD,CAAS;AAAA,EAAA;AAGxB,SACC,gBAAAG;AAAA,IAACC;AAAA,IAAA;AAAA,MACA,aAAU;AAAA,MACV,MAAI;AAAA,MACJ,SAAAhB;AAAA,MACA,OAAM;AAAA,MACN,cAAa;AAAA,MACb,iBAAiB,cAAcS,CAAY;AAAA,MAM3C,mBAAm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AQ,SAAS;AAAA,sBAC7C,OAAOK;AAAA,oBAAA;AAAA,kBAAA;AAAA,oCAEPC,GAAA,EACA,UAAA;AAAA,oBAAA,gBAAAf,EAACgB,KAAa,MAAAvB,GACZ,UAAAD,uBAASA,GAAA,EAAK,MAAM,IAAI,EAAA,CAC1B;AAAA,sCACCyB,GAAA,EAAW,OAAOV,EAAO,QAAQ,SAChC,YAAQ,aACV;AAAA,oBACCG;AAAA;AAAA;AAAA;AAAA,oBAKA,gBAAAV;AAAA,sBAACkB;AAAA,sBAAA;AAAA,wBACA,SAAQ;AAAA,wBACR,MAAK;AAAA,wBACL,SAAQ;AAAA,wBACR,QAAQ;AAAA,wBACR,SAAQ;AAAA,sBAAA;AAAA,oBAAA;AAAA,kBACT,EAAA,CAEF;AAAA,gBAAA;AAAA,cAAA;AAAA,cA9BKT,EAAQ;AAAA,YAAA;AAAA,UAiChB,CAAC;AAAA,UAEA1B,EAAQ,SAAS,WAAW,KAC5B,gBAAAiB,EAACM,GAAA,EAAc,OAAOC,EAAO,QAAQ,aACnC,UAAA,MAAMb,CAAY,oCAAA,CACpB;AAAA,QAAA,EAAA,CAEF;AAAA,MAAA,EAAA,CACD;AAAA,IAAA;AAAA,EAAA;AAGH;AAEAZ,EAAmB,cAAc;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Step 1's "Channels to activate it on" — one card per connected channel, each
|
|
4
|
+
* with a select-all checkbox, the accounts it covers as chips, and an edit
|
|
5
|
+
* button that opens the per-account picker.
|
|
6
|
+
*
|
|
7
|
+
* Renders nothing when the consumer passes no `availableChannels`, so a host
|
|
8
|
+
* that hasn't wired channels up yet sees the step exactly as it was.
|
|
9
|
+
*/
|
|
10
|
+
export declare const ChannelsSection: React.FC;
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { jsxs as d, jsx as n, Fragment as E } from "react/jsx-runtime";
|
|
2
|
+
import w from "../../../assets/icons/edit.svg.js";
|
|
3
|
+
import A from "../../../assets/icons/errorInfo.svg.js";
|
|
4
|
+
import { useState as M, useMemo as N } from "react";
|
|
5
|
+
import { TitleSmall as v } from "../../TypographyStyle.js";
|
|
6
|
+
import { COLORS as T } from "../../../constants/Theme.js";
|
|
7
|
+
import { ChannelsSectionRoot as B, ChannelCard as L, ChannelRow as O, ChannelRowMain as R, CHECKBOX_SLOT as k, ChannelIdentity as P, ChannelGlyph as j, ChannelChips as D, ChipTooltipTarget as f } from "../AgentBuilder.styled.js";
|
|
8
|
+
import { channelPresentation as _, selectedAccounts as z, isAccountDisconnected as S } from "../constants/channels.js";
|
|
9
|
+
import { useAgentBuilderContext as F } from "../context/AgentBuilderContext.js";
|
|
10
|
+
import { ChannelSelectModal as H } from "./ChannelSelectModal.js";
|
|
11
|
+
import { CheckBox as V } from "../../checkBox/CheckBox.js";
|
|
12
|
+
import { Tooltip as I } from "../../tooltips/Tooltip.js";
|
|
13
|
+
import { Tag as C } from "../../tag/Tag.js";
|
|
14
|
+
import { IconButton as X } from "../../icon-button/IconButton.js";
|
|
15
|
+
const b = 3, G = (e) => [
|
|
16
|
+
...e.filter(S),
|
|
17
|
+
...e.filter((i) => !S(i))
|
|
18
|
+
], K = () => {
|
|
19
|
+
const { value: e, updateField: i, availableChannels: r, onManageChannels: p } = F(), [a, c] = M(null), m = N(() => {
|
|
20
|
+
const t = /* @__PURE__ */ new Map();
|
|
21
|
+
return (e.channels ?? []).forEach((l) => t.set(l.type, l.channelIds)), t;
|
|
22
|
+
}, [e.channels]);
|
|
23
|
+
if (!r || r.length === 0)
|
|
24
|
+
return null;
|
|
25
|
+
const g = (t, l) => {
|
|
26
|
+
const h = (e.channels ?? []).filter((u) => u.type !== t);
|
|
27
|
+
i(
|
|
28
|
+
"channels",
|
|
29
|
+
l.length > 0 ? [...h, { type: t, channelIds: l }] : h
|
|
30
|
+
);
|
|
31
|
+
}, o = r.find((t) => t.type === a) ?? null;
|
|
32
|
+
return /* @__PURE__ */ d(B, { children: [
|
|
33
|
+
/* @__PURE__ */ n(v, { color: T.content.primary, children: "Channels to activate it on" }),
|
|
34
|
+
r.map((t) => /* @__PURE__ */ n(
|
|
35
|
+
U,
|
|
36
|
+
{
|
|
37
|
+
channel: t,
|
|
38
|
+
selectedIds: m.get(t.type) ?? [],
|
|
39
|
+
onSelectionChange: (l) => g(t.type, l),
|
|
40
|
+
onEdit: () => c(t.type)
|
|
41
|
+
},
|
|
42
|
+
String(t.type)
|
|
43
|
+
)),
|
|
44
|
+
/* @__PURE__ */ n(
|
|
45
|
+
H,
|
|
46
|
+
{
|
|
47
|
+
channel: o,
|
|
48
|
+
selectedIds: o ? m.get(o.type) ?? [] : [],
|
|
49
|
+
onClose: () => c(null),
|
|
50
|
+
onApply: (t) => {
|
|
51
|
+
o && g(o.type, t), c(null);
|
|
52
|
+
},
|
|
53
|
+
onManageChannels: p && o ? () => p(o.type) : void 0
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
] });
|
|
57
|
+
};
|
|
58
|
+
K.displayName = "ChannelsSection";
|
|
59
|
+
const U = ({
|
|
60
|
+
channel: e,
|
|
61
|
+
selectedIds: i,
|
|
62
|
+
onSelectionChange: r,
|
|
63
|
+
onEdit: p
|
|
64
|
+
}) => {
|
|
65
|
+
const { label: a, Icon: c, tint: m, accountsNoun: g } = _(
|
|
66
|
+
e.type,
|
|
67
|
+
e.label
|
|
68
|
+
), o = e.accounts.length === 0, t = z(e, i), l = !o && t.length === e.accounts.length, h = t.length > 0 && !l, u = G(t.length > 0 ? t : e.accounts), x = u.slice(0, b), y = u.slice(b), $ = () => r(
|
|
69
|
+
l ? [] : e.accounts.map((s) => s.channelId)
|
|
70
|
+
);
|
|
71
|
+
return /* @__PURE__ */ n(
|
|
72
|
+
L,
|
|
73
|
+
{
|
|
74
|
+
"data-test": `agent-channel-${e.type}`,
|
|
75
|
+
role: "group",
|
|
76
|
+
"aria-label": a,
|
|
77
|
+
children: /* @__PURE__ */ d(O, { children: [
|
|
78
|
+
/* @__PURE__ */ d(R, { children: [
|
|
79
|
+
/* @__PURE__ */ n(
|
|
80
|
+
V,
|
|
81
|
+
{
|
|
82
|
+
isChecked: l || h,
|
|
83
|
+
isPartiallyChecked: h,
|
|
84
|
+
isDisabled: o,
|
|
85
|
+
ariaLabel: a,
|
|
86
|
+
onValueChange: $,
|
|
87
|
+
style: k
|
|
88
|
+
}
|
|
89
|
+
),
|
|
90
|
+
/* @__PURE__ */ d(P, { children: [
|
|
91
|
+
/* @__PURE__ */ n(j, { tint: m, children: c && /* @__PURE__ */ n(c, { size: 16 }) }),
|
|
92
|
+
/* @__PURE__ */ n(v, { color: T.content.primary, children: a })
|
|
93
|
+
] }),
|
|
94
|
+
/* @__PURE__ */ n(D, { children: o ? /* @__PURE__ */ n(
|
|
95
|
+
I,
|
|
96
|
+
{
|
|
97
|
+
body: `No ${g} are connected to this store yet. Connect one from channel management to activate this agent on ${a}.`,
|
|
98
|
+
placement: "top",
|
|
99
|
+
children: /* @__PURE__ */ n(f, { children: /* @__PURE__ */ n(
|
|
100
|
+
C,
|
|
101
|
+
{
|
|
102
|
+
tagText: "Disabled",
|
|
103
|
+
type: "neutral",
|
|
104
|
+
variant: "regular",
|
|
105
|
+
height: 24,
|
|
106
|
+
cursor: "default"
|
|
107
|
+
}
|
|
108
|
+
) })
|
|
109
|
+
}
|
|
110
|
+
) : /* @__PURE__ */ d(E, { children: [
|
|
111
|
+
x.map((s) => /* @__PURE__ */ n(
|
|
112
|
+
q,
|
|
113
|
+
{
|
|
114
|
+
account: s,
|
|
115
|
+
channelLabel: a
|
|
116
|
+
},
|
|
117
|
+
s.channelId
|
|
118
|
+
)),
|
|
119
|
+
y.length > 0 && /* @__PURE__ */ n(
|
|
120
|
+
I,
|
|
121
|
+
{
|
|
122
|
+
body: y.map((s) => s.channelName).join(", "),
|
|
123
|
+
placement: "top",
|
|
124
|
+
children: /* @__PURE__ */ n(f, { children: /* @__PURE__ */ n(
|
|
125
|
+
C,
|
|
126
|
+
{
|
|
127
|
+
tagText: `+${y.length}`,
|
|
128
|
+
type: "purple",
|
|
129
|
+
variant: "regular",
|
|
130
|
+
height: 24,
|
|
131
|
+
cursor: "default"
|
|
132
|
+
}
|
|
133
|
+
) })
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
] }) })
|
|
137
|
+
] }),
|
|
138
|
+
/* @__PURE__ */ n(
|
|
139
|
+
X,
|
|
140
|
+
{
|
|
141
|
+
"data-test": `agent-channel-${e.type}-edit`,
|
|
142
|
+
"aria-label": `Edit ${a} channels`,
|
|
143
|
+
Icon: w,
|
|
144
|
+
size: "xs",
|
|
145
|
+
iconPadding: 4,
|
|
146
|
+
disabled: o,
|
|
147
|
+
onClick: p
|
|
148
|
+
}
|
|
149
|
+
)
|
|
150
|
+
] })
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
}, q = ({ account: e, channelLabel: i }) => S(e) ? /* @__PURE__ */ n(
|
|
154
|
+
I,
|
|
155
|
+
{
|
|
156
|
+
body: `${e.channelName} is disconnected. This agent won't run on it until you reconnect it from ${i} channel management.`,
|
|
157
|
+
placement: "top",
|
|
158
|
+
children: /* @__PURE__ */ n(f, { children: /* @__PURE__ */ n(
|
|
159
|
+
C,
|
|
160
|
+
{
|
|
161
|
+
tagText: e.channelName,
|
|
162
|
+
type: "negative",
|
|
163
|
+
variant: "regular",
|
|
164
|
+
height: 24,
|
|
165
|
+
LeadingIcon: A,
|
|
166
|
+
leadingIconId: `channel-error-${e.channelId}`,
|
|
167
|
+
cursor: "default"
|
|
168
|
+
}
|
|
169
|
+
) })
|
|
170
|
+
}
|
|
171
|
+
) : /* @__PURE__ */ n(
|
|
172
|
+
C,
|
|
173
|
+
{
|
|
174
|
+
tagText: e.channelName,
|
|
175
|
+
type: "purple",
|
|
176
|
+
variant: "regular",
|
|
177
|
+
height: 24
|
|
178
|
+
}
|
|
179
|
+
);
|
|
180
|
+
export {
|
|
181
|
+
K as ChannelsSection
|
|
182
|
+
};
|
|
183
|
+
//# sourceMappingURL=ChannelsSection.js.map
|