= {
html`
${renderButtons(args, "light")}${renderButtons(args, "dark")}
`,
+
+ play: () =>
+ createIcons({
+ icons: {
+ Check,
+ ArrowRight,
+ },
+ attrs: {
+ "stroke-width": 1.5,
+ },
+ }),
};
export default meta;
diff --git a/packages/documentation/src/elements/icon/icon-story-helpers.ts b/packages/documentation/src/elements/icon/icon-story-helpers.ts
new file mode 100644
index 0000000..49f8b61
--- /dev/null
+++ b/packages/documentation/src/elements/icon/icon-story-helpers.ts
@@ -0,0 +1,41 @@
+import type { ArgTypes } from "@storybook/web-components";
+import { html } from "lit";
+
+export const iconArgs = (
+ iconNames: string[],
+ size: string,
+ // default values for stroke according to design
+ strokeWidth = 1.5,
+ strokeOpacity = 0.8,
+): IconArgs => ({
+ iconNames,
+ size,
+ strokeWidth,
+ strokeOpacity,
+});
+
+export const iconArgTypes: Partial> = {
+ size: {
+ control: { type: "select" },
+ options: ["default", "small"],
+ },
+};
+
+export interface IconArgs {
+ iconNames: string[];
+ size: string;
+ strokeWidth: number;
+ strokeOpacity: number;
+}
+
+export const renderIcons = (args: IconArgs) => html`
+ ${args.iconNames.map((iconName) => html``)}
+`;
+
+export const mapIconSizeToPx = (size: string): string => {
+ if (size === "small") {
+ return "16px";
+ }
+
+ return "24px";
+};
diff --git a/packages/documentation/src/elements/icon/icon.stories.ts b/packages/documentation/src/elements/icon/icon.stories.ts
new file mode 100644
index 0000000..a343e5c
--- /dev/null
+++ b/packages/documentation/src/elements/icon/icon.stories.ts
@@ -0,0 +1,86 @@
+import type { Meta, StoryObj } from "@storybook/web-components";
+import { html } from "lit";
+import { createIcons, icons } from "lucide";
+import {
+ iconArgs,
+ iconArgTypes,
+ mapIconSizeToPx,
+ renderIcons,
+ type IconArgs,
+} from "./icon-story-helpers.js";
+
+const iconList = [
+ "check",
+ "arrow-right",
+ "arrow-left",
+ "arrow-down",
+ "arrow-up",
+ "arrow-up-right",
+ "arrow-down-right",
+ "arrow-down-left",
+ "arrow-down-up",
+ "circle-x",
+ "chevron-down",
+ "chevron-up",
+ "chevron-left",
+ "chevron-right",
+ "plus",
+ "log-out",
+ "shopping-cart",
+ "user-round",
+ "clock",
+ "menu",
+ "search",
+ "eye",
+ "circle-alert",
+ "code",
+ "copy",
+ "circle-play",
+ "circle-help",
+ "settings",
+ "bell",
+ "building-2",
+ "file",
+ "calendar",
+ "trash-2",
+ "eye-off",
+ "sparkles",
+ "info",
+ "megaphone",
+ "circle-check",
+ "folder-open",
+ "mail",
+ "download",
+ "lock",
+];
+
+const meta: Meta = {
+ argTypes: iconArgTypes,
+
+ render: (args) =>
+ html`
+ ${renderIcons(args)}
+
`,
+ play: (args) => {
+ createIcons({
+ icons,
+ attrs: {
+ "stroke-width": args.initialArgs.strokeWidth,
+ "stroke-opacity": args.initialArgs.strokeOpacity,
+ height: mapIconSizeToPx(args.initialArgs.size),
+ width: mapIconSizeToPx(args.initialArgs.size),
+ // TODO should stroke color be declared in CSS directly?
+ color: "#141419CC",
+ },
+ });
+ },
+};
+
+export default meta;
+
+export type Story = StoryObj;
+
+export const IconsDefault: Story = { args: iconArgs(iconList, "default") };
+export const IconsSmall: Story = { args: iconArgs(iconList, "small") };
diff --git a/packages/foundation/src/elements/button.css b/packages/foundation/src/elements/button.css
index 7501cb1..5ead9e7 100644
--- a/packages/foundation/src/elements/button.css
+++ b/packages/foundation/src/elements/button.css
@@ -13,11 +13,21 @@
gap: var(--hap-spacing-sm);
align-items: center;
+ svg {
+ height: var(--hap-typography-line-height-bodytext-standard-singleline);
+ width: var(--hap-typography-line-height-bodytext-standard-singleline);
+ }
+
&.small {
padding: var(--hap-spacing-xs) var(--hap-spacing-sm);
font-size: var(--hap-typography-font-size-bodytext-s);
line-height: var(--hap-typography-line-height-bodytext-s-singleline);
gap: var(--hap-spacing-xs);
+
+ svg {
+ height: var(--hap-typography-line-height-bodytext-s-singleline);
+ width: var(--hap-typography-line-height-bodytext-s-singleline);
+ }
}
&:disabled {