Skip to content

Self-improving AI Employees for everyone

4.6 KB
Raw Blame
<!-- @dsCard group="Components" viewport="700x620" name="Panels" subtitle="PanelModal, SettingsSection, DataCard, CollapsibleSection, ApiKeyInput, Slider" -->
<!DOCTYPE html>
<html class="dark">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../../styles.css">
<script src="https://unpkg.com/[email protected]/umd/react.development.js" integrity="sha384-hD6/rw4ppMLGNu3tX5cjIb+uRZ7UkRJ6BPkLpg4hAu/6onKUg4lLsHAs9EBPT82L" crossorigin="anonymous"></script>
<script src="https://unpkg.com/[email protected]/umd/react-dom.development.js" integrity="sha384-u6aeetuaXnQ38mYT8rp6sbXaQe3NL9t+IBXmnYxwkUI2Hw4bsp2Wvmx4yRQF1uAm" crossorigin="anonymous"></script>
<script src="https://unpkg.com/@babel/[email protected]/babel.min.js" integrity="sha384-m08KidiNqLdpJqLq95G/LEi8Qvjl/xUYll3QILypMoQ65QorJ9Lvtp2RXYGBFj1y" crossorigin="anonymous"></script>
<script src="https://unpkg.com/lucide@latest/dist/umd/lucide.min.js"></script>
<script src="../../_ds_bundle.js?v=4"></script>
</head>
<body style="background: var(--bg-panel); margin: 0; padding: 16px;">
<div id="root"></div>
<script type="text/babel">
const { PanelModal, SettingsSection, SettingsRow, DataCard, CollapsibleSection, ApiKeyInput, Slider, Switch, ActionButton, Icon } = window.OpenCompanyDesignSystem_2559cf;

function PanelsCard() {
  const [ratio, setRatio] = React.useState(80);
  return (
    <div style={{ display: 'flex', flexDirection: 'column', gap: 14 }}>
      <PanelModal
        inline
        title="Settings"
        titleIcon={<Icon name="Settings" size={14} />}
        headerActions={
          <div style={{ display: 'flex', gap: 8 }}>
            <ActionButton intent="config"><Icon name="RotateCcw" size={12} /> Reset</ActionButton>
            <ActionButton intent="run"><Icon name="Save" size={12} /> Save</ActionButton>
            <ActionButton intent="stop"><Icon name="X" size={12} /> Close</ActionButton>
          </div>
        }
      >
        <div style={{ padding: 16, maxHeight: 290, overflowY: 'auto' }}>
          <SettingsSection title="Auto-save" icon={<Icon name="Save" size={16} />} tone="model">
            <SettingsRow label="Enable Auto-save" description="Automatically save the workflow at regular intervals">
              <Switch defaultChecked />
            </SettingsRow>
          </SettingsSection>
          <SettingsSection title="Memory & Compaction" icon={<Icon name="Brain" size={16} />} tone="agent" style={{ marginBottom: 0 }}>
            <div style={{ display: 'flex', alignItems: 'baseline', justifyContent: 'space-between' }}>
              <div>
                <div style={{ fontSize: 14, fontWeight: 500 }}>Compaction Ratio</div>
                <div style={{ fontSize: 12, color: 'var(--fg-muted)', marginTop: 2 }}>Fraction of context window that triggers memory compaction</div>
              </div>
              <span style={{ fontSize: 14, fontWeight: 600, color: 'var(--node-model)' }}>{ratio}%</span>
            </div>
            <Slider min={5} max={95} step={5} value={ratio} onChange={setRatio} color="var(--node-model)" style={{ margin: '10px 0 4px' }} />
            <div style={{ display: 'flex', justifyContent: 'space-between', fontSize: 10, color: 'var(--fg-muted)' }}>
              <span>5%</span><span>50%</span><span>95%</span>
            </div>
          </SettingsSection>
        </div>
      </PanelModal>

      <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 12, alignItems: 'start' }}>
        <DataCard
          title="Item 1"
          badge="from WhatsApp Receive"
          data={{ message: "What's on my calendar today?", from: '+1 555 014 2236' }}
        />
        <div style={{ display: 'flex', flexDirection: 'column', gap: 10 }}>
          <CollapsibleSection title={<><Icon name="Wrench" size={13} /> Connected Skills</>}>
            <div style={{ display: 'flex', flexDirection: 'column', gap: 6, fontSize: 13 }}>
              <span style={{ display: 'flex', alignItems: 'center', gap: 8 }}><span style={{ width: 6, height: 6, borderRadius: 99, background: 'var(--node-tool)' }}></span>Web Search</span>
              <span style={{ display: 'flex', alignItems: 'center', gap: 8 }}><span style={{ width: 6, height: 6, borderRadius: 99, background: 'var(--node-tool)' }}></span>Android Toolkit</span>
            </div>
          </CollapsibleSection>
          <ApiKeyInput defaultValue="sk-ant-api03-xxxxxxxxxxxx" isStored onSave={() => {}} onDelete={() => {}} />
          <ApiKeyInput placeholder="gsk_..." onSave={() => {}} />
        </div>
      </div>
    </div>
  );
}
ReactDOM.createRoot(document.getElementById('root')).render(<PanelsCard />);
</script>
</body>
</html>