Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion semcore/wizard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
},
"dependencies": {
"@semcore/button": "^17.1.0",
"@semcore/modal": "^17.1.0"
"@semcore/modal": "^17.1.0",
"@semcore/typography": "^17.1.0"
},
"peerDependencies": {
"@semcore/base-components": "^17.0.2",
Expand Down
11 changes: 11 additions & 0 deletions semcore/wizard/src/Wizard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import ArrowLeft from '@semcore/icon/ArrowLeft/m';
import ArrowRight from '@semcore/icon/ArrowRight/m';
import CheckM from '@semcore/icon/Check/m';
import Modal from '@semcore/modal';
import { Text } from '@semcore/typography';
import React from 'react';

import style from './style/wizard.shadow.css';
Expand Down Expand Up @@ -354,6 +355,15 @@ function StepNext(props: Required<WizardStepNextProps> & IRootComponentProps) {
);
}

function StepTitle(props: Intergalactic.InternalTypings.InferChildComponentProps<WizardType, typeof WizardRoot, 'StepTitle'>) {
const SWizardStepTitle = Root;
const { styles } = props;

return sstyled(styles)(
<SWizardStepTitle render={Text} tag='h3' size={500} />,
);
}

/**
* Wizard
*
Expand All @@ -366,6 +376,7 @@ const Wizard = createComponent<
Sidebar,
Content,
Step,
StepTitle,
Stepper,
StepBack,
StepNext,
Expand Down
2 changes: 2 additions & 0 deletions semcore/wizard/src/Wizard.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { ButtonProps } from '@semcore/button';
import type { Intergalactic } from '@semcore/core';
import type { useI18n } from '@semcore/core/lib/utils/enhances/WithI18n';
import type { ModalProps } from '@semcore/modal';
import type { Text } from '@semcore/typography';
import type React from 'react';

/** Ordered step position from 0 */
Expand Down Expand Up @@ -148,6 +149,7 @@ Intergalactic.InternalTypings.ComponentAdditive<'div', 'div', WizardStepperProps
export type WizardType = Intergalactic.Component<'div', WizardProps> & {
Sidebar: Intergalactic.Component<'div', WizardSidebarProps>;
Step: Intergalactic.Component<'div', WizardStepProps>;
StepTitle: typeof Text;
Stepper: IntergalacticWizardStepperComponent;
Content: Intergalactic.Component<'div', WizardContentProps>;
StepBack: Intergalactic.Component<'button', WizardStepBackProps>;
Expand Down
7 changes: 6 additions & 1 deletion semcore/wizard/src/style/wizard.shadow.css
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ SStepDescription {

SContent {
padding: var(--intergalactic-spacing-10x, 40px);
width: 100%;
overflow: hidden;
flex: 1;
border-radius: 0 var(--intergalactic-modal-rounded, 14px) var(--intergalactic-modal-rounded, 14px)
0;
background: var(--intergalactic-bg-primary-neutral, oklch(1 0 0));
Expand All @@ -109,3 +110,7 @@ SContent[noSidebar] {
SSidebarMenu {
display: contents;
}

SWizardStepTitle {
word-break: break-word;
}
16 changes: 8 additions & 8 deletions stories/components/wizard/docs/examples/basic_example.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Flex } from '@semcore/ui/base-components';
import { Box, Flex } from '@semcore/ui/base-components';
import Button from '@semcore/ui/button';
import { Text } from '@semcore/ui/typography';
import Wizard from '@semcore/ui/wizard';
import React from 'react';

const steps = [{ title: 'Location' }, { title: 'Keywords' }, { title: 'Schedule' }];
const steps = [{ title: 'SiteAuditSettingsSiteAuditSettings' }, { title: 'Keywords' }, { title: 'Schedule' }];

const Demo = () => {
const [step, setStep] = React.useState<number>(1);
Expand All @@ -30,19 +30,19 @@ const Demo = () => {
</Wizard.Sidebar>
<Wizard.Content tag={Flex} direction='column' justifyContent='space-between'>
<Wizard.Step step={1}>
<Text size={500} tag='h3'>
<Wizard.StepTitle>
{steps[0].title}
</Text>
</Wizard.StepTitle>
</Wizard.Step>
<Wizard.Step step={2}>
<Text size={500} tag='h3'>
<Wizard.StepTitle>
{steps[1].title}
</Text>
</Wizard.StepTitle>
</Wizard.Step>
<Wizard.Step step={3}>
<Text size={500} tag='h3'>
<Wizard.StepTitle>
{steps[2].title}
</Text>
</Wizard.StepTitle>
</Wizard.Step>
<Flex mt={5}>
{step > 1 && (
Expand Down
4 changes: 2 additions & 2 deletions stories/components/wizard/docs/examples/custom_step.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ const Demo = () => {
}}
</Wizard.Step>
<Wizard.Step step={3}>
<Text size={500} tag='h3'>
<Wizard.StepTitle>
Final step
</Text>
</Wizard.StepTitle>
<Text tag='p' mt={2}>
Congratulations on passing all the steps!
</Text>
Expand Down
4 changes: 2 additions & 2 deletions stories/components/wizard/docs/examples/custom_stepper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ const Demo = () => {
</RadioGroup>
</Wizard.Step>
<Wizard.Step step={4}>
<Text size={500} tag='h3'>
<Wizard.StepTitle>
Final step
</Text>
</Wizard.StepTitle>
<Text tag='p' mt={2}>
Congratulations on passing all the steps!
</Text>
Expand Down
12 changes: 6 additions & 6 deletions stories/components/wizard/tests/examples/focus-next-prev.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,19 @@ const Demo = () => {
</Wizard.Sidebar>
<Wizard.Content tag={Flex} direction='column' justifyContent='space-between'>
<Wizard.Step step={1}>
<Text size={500} tag='h3'>
<Wizard.StepTitle>
{steps[0].title}
</Text>
</Wizard.StepTitle>
</Wizard.Step>
<Wizard.Step step={2}>
<Text size={500} tag='h3'>
<Wizard.StepTitle>
{steps[1].title}
</Text>
</Wizard.StepTitle>
</Wizard.Step>
<Wizard.Step step={3}>
<Text size={500} tag='h3'>
<Wizard.StepTitle>
{steps[2].title}
</Text>
</Wizard.StepTitle>
</Wizard.Step>
<Flex mt={5}>
{step > 1 && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ const Demo = (props: WizardContentProps) => {
<Wizard.Content tag={Flex} direction='column' justifyContent='space-between' noSidebar={props.noSidebar}>
{steps.map((s, i) => (
<Wizard.Step key={s.title} step={i + 1}>
<Text size={500} tag='h3'>
<Wizard.StepTitle>
{s.title}
</Text>
</Wizard.StepTitle>
</Wizard.Step>
))}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ const Demo = () => {
<Wizard.Content tag={Flex} direction='column' justifyContent='space-between'>
{steps.map((stepData, index) => (
<Wizard.Step key={index} step={index + 1}>
<Text size={500} tag='h3'>
<Wizard.StepTitle>
{stepData.title}
</Text>
</Wizard.StepTitle>
</Wizard.Step>
))}

Expand Down
4 changes: 2 additions & 2 deletions stories/components/wizard/tests/examples/wizard-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ const Demo = () => {
<Wizard.Content tag={Flex} direction='column' justifyContent='space-between'>
{steps.map((stepData, index) => (
<Wizard.Step key={index} step={index + 1}>
<Text size={500} tag='h3'>
<Wizard.StepTitle>
{stepData.title}
</Text>
</Wizard.StepTitle>
</Wizard.Step>
))}

Expand Down
Loading