From a8eb9e192b5a876b5f872c4428b61eab8ae3620f Mon Sep 17 00:00:00 2001 From: adilallo <39313955+adilallo@users.noreply.github.com> Date: Mon, 2 Feb 2026 12:53:52 -0700 Subject: [PATCH 1/2] Implement create component --- app/components-preview/page.tsx | 108 ++++++++++ .../ContentLockup/ContentLockup.container.tsx | 12 ++ .../ContentLockup/ContentLockup.types.ts | 4 +- .../ContentLockup/ContentLockup.view.tsx | 15 +- app/components/Create/Create.container.tsx | 141 ++++++++++++ app/components/Create/Create.types.ts | 43 ++++ app/components/Create/Create.view.tsx | 95 ++++++++ app/components/Create/index.tsx | 2 + .../InputWithCounter.types.ts | 10 + .../InputWithCounter.view.tsx | 75 +++++++ app/components/InputWithCounter/index.tsx | 2 + .../ModalFooter/ModalFooter.types.ts | 19 ++ .../ModalFooter/ModalFooter.view.tsx | 68 ++++++ app/components/ModalFooter/index.tsx | 2 + .../ModalHeader/ModalHeader.types.ts | 7 + .../ModalHeader/ModalHeader.view.tsx | 55 +++++ app/components/ModalHeader/index.tsx | 2 + messages/en/common.json | 5 +- public/assets/Icon_Help.svg | 8 + stories/Create.stories.js | 202 ++++++++++++++++++ tests/components/Create.test.tsx | 193 +++++++++++++++++ 21 files changed, 1061 insertions(+), 7 deletions(-) create mode 100644 app/components/Create/Create.container.tsx create mode 100644 app/components/Create/Create.types.ts create mode 100644 app/components/Create/Create.view.tsx create mode 100644 app/components/Create/index.tsx create mode 100644 app/components/InputWithCounter/InputWithCounter.types.ts create mode 100644 app/components/InputWithCounter/InputWithCounter.view.tsx create mode 100644 app/components/InputWithCounter/index.tsx create mode 100644 app/components/ModalFooter/ModalFooter.types.ts create mode 100644 app/components/ModalFooter/ModalFooter.view.tsx create mode 100644 app/components/ModalFooter/index.tsx create mode 100644 app/components/ModalHeader/ModalHeader.types.ts create mode 100644 app/components/ModalHeader/ModalHeader.view.tsx create mode 100644 app/components/ModalHeader/index.tsx create mode 100644 public/assets/Icon_Help.svg create mode 100644 stories/Create.stories.js create mode 100644 tests/components/Create.test.tsx diff --git a/app/components-preview/page.tsx b/app/components-preview/page.tsx index 35c3ba0..cccd8ff 100644 --- a/app/components-preview/page.tsx +++ b/app/components-preview/page.tsx @@ -6,6 +6,10 @@ import Alert from "../components/Alert"; import Button from "../components/Button"; import Stepper from "../components/Stepper"; import Progress from "../components/Progress"; +import Create from "../components/Create"; +import Input from "../components/Input"; +import InputWithCounter from "../components/InputWithCounter"; +import { getAssetPath } from "../../lib/assetUtils"; export default function ComponentsPreview() { const [alertVisible, setAlertVisible] = useState({ @@ -16,6 +20,10 @@ export default function ComponentsPreview() { banner: true, }); + const [createOpen, setCreateOpen] = useState(false); + const [createStep, setCreateStep] = useState(1); + const [policyName, setPolicyName] = useState(""); + return (
+ Step {createStep} of 3 +
+ + ++ Select how conflicts should be resolved in your group. +
++ Review your policy configuration before finalizing. +
++ Policy details will appear here +
+{description}
+ )}+ {value.length}/{maxLength} +
++ 0/48 +
++ 0/48 +
++ Review your policy configuration +
++ Modal content without footer +
++ 0/48 +
+0/48
@@ -90,15 +85,10 @@ export const WithStepper = Template.bind({}); WithStepper.args = { isOpen: true, title: "What do you call your group's new policy?", - description: - "You can also combine or add new approaches to the list", + description: "You can also combine or add new approaches to the list", children: (0/48
@@ -117,15 +107,10 @@ export const Step2 = Template.bind({}); Step2.args = { isOpen: true, title: "How should conflicts be resolved?", - description: - "You can also combine or add new approaches to the list", + description: "You can also combine or add new approaches to the list", children: (0/48
diff --git a/tests/components/Create.test.tsx b/tests/components/Create.test.tsx index ff2dfaf..e1f7f0e 100644 --- a/tests/components/Create.test.tsx +++ b/tests/components/Create.test.tsx @@ -1,7 +1,8 @@ import React from "react"; -import { describe, it, expect, vi, beforeEach, afterEach } from "vitest"; -import { render, screen, fireEvent, waitFor } from "@testing-library/react"; +import { describe, it, expect, vi, beforeEach } from "vitest"; +import { screen, fireEvent, waitFor } from "@testing-library/react"; import "@testing-library/jest-dom/vitest"; +import { renderWithProviders } from "../utils/test-utils"; import Create from "../../app/components/Create"; import Input from "../../app/components/Input"; @@ -20,20 +21,22 @@ describe("Create", () => { }); it("renders when isOpen is true", () => { - render(