diff --git a/.changeset/funky-pears-occur.md b/.changeset/funky-pears-occur.md new file mode 100644 index 0000000000..af16f448ee --- /dev/null +++ b/.changeset/funky-pears-occur.md @@ -0,0 +1,5 @@ +--- +"@evo-web/marko": patch +--- + +Confirm & Alert Dialog diff --git a/.claude/skills/evo-migrate-marko/SKILL.md b/.claude/skills/evo-migrate-marko/SKILL.md index cc867c412c..dc49f36308 100644 --- a/.claude/skills/evo-migrate-marko/SKILL.md +++ b/.claude/skills/evo-migrate-marko/SKILL.md @@ -132,6 +132,7 @@ Key changes: - **Remove `Omit<..., 'on${string}'>`** -- Marko 6 handles events natively via spread. - **Remove custom `on-*` event props** from the interface -- consumers bind native DOM events directly or use two-way binding callbacks (e.g., `valueChange`, `openChange`, `indexChange`). - **Use camelCase** for all prop names (not kebab-case). +- **Use `Marko.HTML.*`** for element types -- e.g., `Marko.HTML.H2`, `Marko.HTML.Div`, `Marko.HTML.Button`. Do **not** use `Marko.Input<"h2">` or `Marko.Input<"div">`. - **Omit only props the component hardcodes** (e.g., `Omit`). ### HTML attribute pass-through diff --git a/CLAUDE.md b/CLAUDE.md index 053fdbc1d0..103c38bdb6 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -86,6 +86,10 @@ HTML Semantic Structure → @ebay/skin (CSS/BEM) → Framework Components → In - ✅ Attribute values containing `>` MUST be wrapped in parentheses: ` b ? 1 : 0)>` - ❌ Never: ` b ? 1 : 0>` (the `>` is parsed as the tag close) +**Marko 6 Tag Variable Locality:** + +Declare ``, ``, ``, and other tag variables close to where they are first used, not grouped at the top. Exception is variables needed in multiple distant locations. + **React Package Differences:** - `ebayui-core-react`: Requires `React.forwardRef` wrapper diff --git a/packages/evo-marko/src/tags/evo-alert-dialog/README.md b/packages/evo-marko/src/tags/evo-alert-dialog/README.md new file mode 100644 index 0000000000..43e4c94e85 --- /dev/null +++ b/packages/evo-marko/src/tags/evo-alert-dialog/README.md @@ -0,0 +1,18 @@ +

+ + evo-alert-dialog + + + DS vBETA + +

+ +An alert dialog that forces the user to acknowledge a message before continuing. The dialog can only be dismissed by clicking the confirm button -- Escape and backdrop clicks are blocked. + +Uses a native `` element with `role="alertdialog"` and `closedby="none"`. + +## Examples and Documentation + +- [Storybook](https://ebay.github.io/evo-web/evo-marko/?path=/story/navigation-disclosure-evo-alert-dialog) +- [Storybook Docs](https://ebay.github.io/evo-web/evo-marko/?path=/docs/navigation-disclosure-evo-alert-dialog) +- [Code Examples](https://github.com/eBay/evo-web/tree/main/packages/evo-marko/src/tags/evo-alert-dialog/examples) diff --git a/packages/evo-marko/src/tags/evo-alert-dialog/alert-dialog.stories.ts b/packages/evo-marko/src/tags/evo-alert-dialog/alert-dialog.stories.ts new file mode 100644 index 0000000000..6abcd7280c --- /dev/null +++ b/packages/evo-marko/src/tags/evo-alert-dialog/alert-dialog.stories.ts @@ -0,0 +1,58 @@ +import { buildExtensionTemplate } from "../../common/storybook/utils"; +import { type Meta } from "@storybook/marko"; +import Readme from "./README.md"; +import Component, { type Input } from "./index.marko"; +import DefaultTemplate from "./examples/default.marko"; +import DefaultCode from "./examples/default.marko?raw"; + +export default { + title: "navigation & disclosure/evo-alert-dialog", + component: Component, + parameters: { + docs: { + description: { + component: Readme, + }, + }, + }, + + argTypes: { + open: { + type: "boolean", + controllable: true, + description: "Whether the alert dialog is open", + table: { defaultValue: { summary: "false" } }, + }, + header: { + description: + "The header content rendered inside the dialog title (required)", + "@": { + as: { + type: "string", + description: + "The heading element to use for the title. Defaults to `h2`", + }, + ["

attributes" as any]: { + description: + "All attributes and event handlers from the heading element will be passed through", + }, + }, + }, + confirm: { + description: + "The confirm/acknowledge button (required). Render body is the button label text", + "@": { + ["