2023-02-05 17:59:22 +01:00
|
|
|
import { DesignOptions } from './design-options/index.mjs'
|
2023-05-13 14:17:47 +02:00
|
|
|
import { CoreSettings, ns as coreSettingsNs } from './core-settings/index.mjs'
|
2023-02-05 19:09:46 +01:00
|
|
|
import { XrayMenu } from './xray/index.mjs'
|
2023-02-05 17:59:22 +01:00
|
|
|
import { TestDesignOptions } from './test-design-options/index.mjs'
|
2023-05-13 14:17:47 +02:00
|
|
|
import { BulletIcon } from 'shared/components/icons.mjs'
|
2022-01-25 12:39:29 +01:00
|
|
|
|
2023-05-13 14:17:47 +02:00
|
|
|
export const linkClasses = `
|
|
|
|
text-base text-base-content sm:text-base-content
|
|
|
|
hover:text-secondary
|
|
|
|
sm:hover:text-secondary
|
|
|
|
`
|
|
|
|
|
|
|
|
export const ns = coreSettingsNs
|
2023-01-29 18:57:24 +01:00
|
|
|
export const Ul = (props) => <ul className="pl-5 list-inside">{props.children}</ul>
|
|
|
|
export const Li = (props) => (
|
2023-05-11 19:14:48 +02:00
|
|
|
<li className="flex flex-row border-r-2 border-r-transparent hover:border-r-secondary">
|
|
|
|
{props.children}
|
|
|
|
</li>
|
2022-01-30 12:21:08 +01:00
|
|
|
)
|
2023-01-29 18:57:24 +01:00
|
|
|
export const Details = (props) => (
|
2022-01-29 18:24:36 +01:00
|
|
|
<details className="grow" open={props.open || false}>
|
|
|
|
{props.children}
|
|
|
|
</details>
|
|
|
|
)
|
2023-05-13 14:17:47 +02:00
|
|
|
export const Deg = ({ changed }) => (
|
|
|
|
<BulletIcon
|
|
|
|
className={`w-2.5 h-2.5 inline-block p-0 mr-1 ${changed ? 'text-accent' : ''}`}
|
|
|
|
stroke={6}
|
|
|
|
/>
|
2023-01-29 18:57:24 +01:00
|
|
|
)
|
2023-05-13 14:17:47 +02:00
|
|
|
|
2023-01-29 18:57:24 +01:00
|
|
|
export const NoSumDiv = (props) => (
|
|
|
|
<div
|
|
|
|
className={`
|
2022-01-29 21:31:12 +01:00
|
|
|
grow px-2 ml-2 border-l-2
|
|
|
|
${linkClasses}
|
2023-05-11 19:14:48 +02:00
|
|
|
hover:cursor-pointer
|
2022-01-29 21:31:12 +01:00
|
|
|
hover:border-secondary
|
|
|
|
sm:hover:border-secondary-focus
|
2022-05-14 14:53:29 +02:00
|
|
|
text-base-content sm:text-base-content
|
2023-01-29 18:57:24 +01:00
|
|
|
`}
|
|
|
|
>
|
|
|
|
{props.children}
|
|
|
|
</div>
|
2022-01-29 21:31:12 +01:00
|
|
|
)
|
2023-01-29 18:57:24 +01:00
|
|
|
export const SumDiv = (props) => (
|
|
|
|
<div
|
|
|
|
className={`
|
2022-01-29 18:24:36 +01:00
|
|
|
grow pl-2 border-l-2
|
|
|
|
${linkClasses}
|
2023-05-11 19:14:48 +02:00
|
|
|
hover:cursor-pointer
|
2022-01-29 18:24:36 +01:00
|
|
|
hover:border-secondary
|
|
|
|
sm:hover:border-secondary-focus
|
2022-05-14 14:53:29 +02:00
|
|
|
text-base-content sm:text-base-content
|
2023-05-13 14:17:47 +02:00
|
|
|
py-2
|
2023-01-29 18:57:24 +01:00
|
|
|
`}
|
|
|
|
>
|
|
|
|
{props.children}
|
|
|
|
</div>
|
2022-01-29 18:24:36 +01:00
|
|
|
)
|
2023-01-29 18:57:24 +01:00
|
|
|
export const Summary = (props) => (
|
|
|
|
<summary
|
|
|
|
className={`
|
2022-01-29 18:24:36 +01:00
|
|
|
flex flex-row
|
|
|
|
px-2
|
|
|
|
text-base-content
|
2022-05-14 14:53:29 +02:00
|
|
|
sm:text-base-content
|
2023-05-11 19:14:48 +02:00
|
|
|
hover:cursor-pointer
|
2023-05-13 14:17:47 +02:00
|
|
|
items-start
|
2023-01-29 18:57:24 +01:00
|
|
|
`}
|
|
|
|
>
|
|
|
|
{props.children}
|
|
|
|
</summary>
|
2022-01-29 18:24:36 +01:00
|
|
|
)
|
2023-01-29 18:57:24 +01:00
|
|
|
export const TopSummary = (props) => (
|
|
|
|
<summary
|
|
|
|
className={`
|
2022-01-29 18:24:36 +01:00
|
|
|
flex flex-row gap-4 text-lg
|
2023-05-11 19:14:48 +02:00
|
|
|
hover:cursor-pointer
|
2022-01-29 18:24:36 +01:00
|
|
|
p-2
|
|
|
|
text-base-content
|
2022-05-14 14:53:29 +02:00
|
|
|
sm:text-base-content
|
2022-01-29 18:24:36 +01:00
|
|
|
items-center
|
2023-01-29 18:57:24 +01:00
|
|
|
`}
|
|
|
|
>
|
2022-01-29 18:24:36 +01:00
|
|
|
<span className="text-secondary-focus mr-4">{props.icon || null}</span>
|
|
|
|
{props.children}
|
|
|
|
</summary>
|
|
|
|
)
|
2023-01-29 18:57:24 +01:00
|
|
|
export const SumButton = (props) => (
|
|
|
|
<button
|
|
|
|
className={`
|
2022-01-29 18:24:36 +01:00
|
|
|
flex flex-row
|
|
|
|
px-2
|
|
|
|
w-full justify-between
|
|
|
|
text-left
|
|
|
|
text-base-content
|
2022-05-14 14:53:29 +02:00
|
|
|
sm:text-base-content
|
2022-01-29 18:24:36 +01:00
|
|
|
hover:cursor-pointer
|
2023-05-13 14:17:47 +02:00
|
|
|
items-start
|
2022-01-29 18:24:36 +01:00
|
|
|
mr-4
|
2023-01-29 18:57:24 +01:00
|
|
|
`}
|
|
|
|
onClick={props.onClick}
|
|
|
|
>
|
|
|
|
{props.children}
|
|
|
|
</button>
|
2022-01-29 18:24:36 +01:00
|
|
|
)
|
2023-01-29 18:57:24 +01:00
|
|
|
export const TopSumTitle = (props) => (
|
2023-05-11 19:14:48 +02:00
|
|
|
<span className={`grow ${linkClasses} hover:cursor-pointer font-bold uppercase`}>
|
2022-01-29 18:24:36 +01:00
|
|
|
{props.children}
|
|
|
|
</span>
|
|
|
|
)
|
2023-01-29 18:57:24 +01:00
|
|
|
export const SecText = (props) =>
|
|
|
|
props.raw ? (
|
|
|
|
<span className="text-secondary-focus" dangerouslySetInnerHTML={{ __html: props.raw }} />
|
|
|
|
) : (
|
|
|
|
<span className="text-secondary-focus">{props.children}</span>
|
|
|
|
)
|
2022-01-29 18:24:36 +01:00
|
|
|
|
2023-05-13 14:17:47 +02:00
|
|
|
export const AccentText = (props) =>
|
|
|
|
props.raw ? (
|
|
|
|
<span className="text-accent-focus" dangerouslySetInnerHTML={{ __html: props.raw }} />
|
|
|
|
) : (
|
|
|
|
<span className="text-accent-focus">{props.children}</span>
|
|
|
|
)
|
|
|
|
|
|
|
|
export const PrimaryText = (props) =>
|
|
|
|
props.raw ? (
|
|
|
|
<span className="text-primary-focus" dangerouslySetInnerHTML={{ __html: props.raw }} />
|
|
|
|
) : (
|
|
|
|
<span className="text-primary-focus">{props.children}</span>
|
|
|
|
)
|
|
|
|
|
2023-05-11 19:14:48 +02:00
|
|
|
export const DraftMenu = (props) => {
|
|
|
|
const { design, patternConfig, settings, ui, update, Option = false } = props
|
|
|
|
|
|
|
|
return (
|
|
|
|
<nav className="grow mb-12">
|
|
|
|
<DesignOptions {...props} />
|
2023-05-13 14:17:47 +02:00
|
|
|
<CoreSettings {...{ design, update, settings, patternConfig }} />
|
2023-05-11 19:14:48 +02:00
|
|
|
{ui.renderer === 'react' ? <XrayMenu {...props} /> : null}
|
|
|
|
</nav>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export const TestMenu = (props) => {
|
2022-01-25 12:39:29 +01:00
|
|
|
return (
|
2022-05-14 14:53:29 +02:00
|
|
|
<nav className="grow mb-12">
|
2023-05-11 19:14:48 +02:00
|
|
|
<TestDesignOptions {...props} />
|
2022-01-25 12:39:29 +01:00
|
|
|
</nav>
|
|
|
|
)
|
|
|
|
}
|