mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-16 11:23:10 +02:00
SaaS fixes (#6578)
Co-authored-by: Claude Opus 4.8 <[email protected]> Co-authored-by: James Brunton <[email protected]> Co-authored-by: Reece Browne <[email protected]> Co-authored-by: ConnorYoh <[email protected]> Co-authored-by: Reece <[email protected]> Co-authored-by: EthanHealy01 <[email protected]> Co-authored-by: Ludy <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 4.8
James Brunton
Reece Browne
ConnorYoh
Reece
EthanHealy01
Ludy
parent
96accea984
commit
ddf78d11ae
@@ -0,0 +1,82 @@
|
||||
import type { Meta, StoryObj } from "@storybook/react-vite";
|
||||
import { SettingsRow } from "@shared/components/SettingsRow";
|
||||
import { ToggleSwitch } from "@shared/components/ToggleSwitch";
|
||||
import { Select } from "@shared/components/Select";
|
||||
import { Card } from "@shared/components/Card";
|
||||
|
||||
const meta: Meta<typeof SettingsRow> = {
|
||||
title: "Primitives/SettingsRow",
|
||||
component: SettingsRow,
|
||||
tags: ["autodocs"],
|
||||
parameters: { layout: "padded" },
|
||||
decorators: [
|
||||
(S) => (
|
||||
<div style={{ maxWidth: "24rem" }}>
|
||||
<S />
|
||||
</div>
|
||||
),
|
||||
],
|
||||
};
|
||||
export default meta;
|
||||
type Story = StoryObj<typeof SettingsRow>;
|
||||
|
||||
export const Toggle: Story = {
|
||||
args: {
|
||||
label: "Auto-classify",
|
||||
control: <ToggleSwitch checked onChange={() => {}} size="sm" />,
|
||||
},
|
||||
};
|
||||
|
||||
export const WithDescription: Story = {
|
||||
args: {
|
||||
label: "Detect PII",
|
||||
description: "Scan documents for sensitive fields on save",
|
||||
control: <ToggleSwitch checked onChange={() => {}} size="sm" />,
|
||||
},
|
||||
};
|
||||
|
||||
/** A settings list inside a padding-none Card. */
|
||||
export const List: Story = {
|
||||
render: () => (
|
||||
<Card padding="none">
|
||||
{[
|
||||
{ label: "Auto-classify", on: true },
|
||||
{ label: "Extract tables", on: true },
|
||||
{ label: "Strip blank pages", on: false },
|
||||
].map((r, i) => (
|
||||
<div
|
||||
key={r.label}
|
||||
style={{
|
||||
padding: "0.7rem 0.875rem",
|
||||
borderTop: i > 0 ? "1px solid var(--color-border)" : undefined,
|
||||
}}
|
||||
>
|
||||
<SettingsRow
|
||||
label={r.label}
|
||||
control={
|
||||
<ToggleSwitch checked={r.on} onChange={() => {}} size="sm" />
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
</Card>
|
||||
),
|
||||
};
|
||||
|
||||
export const SelectControl: Story = {
|
||||
args: {
|
||||
label: "OCR level",
|
||||
control: (
|
||||
<Select
|
||||
inputSize="sm"
|
||||
value="high"
|
||||
onChange={() => {}}
|
||||
options={[
|
||||
{ value: "standard", label: "Standard" },
|
||||
{ value: "high", label: "High" },
|
||||
{ value: "max", label: "Maximum" },
|
||||
]}
|
||||
/>
|
||||
),
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user