Skip to content

Commit 3043eb8

Browse files
committed
feat(components): integrate ruff formatting into type generation and enhance combobox and select components with improved event handling and styling
1 parent a33f52d commit 3043eb8

File tree

8 files changed

+2064
-1741
lines changed

8 files changed

+2064
-1741
lines changed

scripts/gen_lucide_types.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import argparse
44
import json
5+
import subprocess
56
import urllib.request
67
from pathlib import Path
78

@@ -52,6 +53,15 @@ def write_if_changed(path: Path, content: str) -> bool:
5253
return True
5354

5455

56+
def format_with_ruff(path: Path) -> None:
57+
"""Format the generated file with ruff."""
58+
subprocess.run(
59+
["ruff", "format", str(path)],
60+
check=True,
61+
capture_output=True,
62+
)
63+
64+
5565
def main(argv: list[str] | None = None) -> int:
5666
parser = argparse.ArgumentParser(description="Generate Lucide icon Literal types")
5767
parser.add_argument(
@@ -70,6 +80,8 @@ def main(argv: list[str] | None = None) -> int:
7080
names = fetch_icon_names(args.version)
7181
content = generate_types_py(names, version=args.version)
7282
changed = write_if_changed(args.dest, content)
83+
if changed:
84+
format_with_ruff(args.dest)
7385
out = "updated" if changed else "up-to-date"
7486
print(f"Wrote {args.dest} ({out}) with {len(names)} icons from lucide-static@{args.version}")
7587
return 0

scripts/sync_components.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ def __init__(self, workspace_root: str = "/Users/dakixr/dev"):
4343

4444
# Component directories
4545
self.uikit_components = self.uikit_path / "src" / "htpy_uikit" / "components"
46-
self.ionisium_components = self.ionisium_path / "components"
47-
self.costcompiler_components = self.costcompiler_path / "components"
46+
self.ionisium_components = self.ionisium_path / "components" / "ui"
47+
self.costcompiler_components = self.costcompiler_path / "components" / "ui"
4848

4949
# Projects mapping
5050
self.projects = {

src/htpy_uikit/components/_styles.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@
5959
BTN_SIZE_LG_CLASSES = "gap-2 h-10 px-6 has-[>svg]:px-4"
6060

6161
# Button icon-only sizes
62-
BTN_ICON_MD_CLASSES = "p-0 size-9"
63-
BTN_ICON_SM_CLASSES = "p-0 size-8"
64-
BTN_ICON_LG_CLASSES = "p-0 size-10"
62+
BTN_ICON_MD_CLASSES = "p-0 size-9 min-w-9"
63+
BTN_ICON_SM_CLASSES = "p-0 size-8 min-w-8"
64+
BTN_ICON_LG_CLASSES = "p-0 size-10 min-w-10"
6565

6666
# Button variant classes
6767
BTN_VARIANT_PRIMARY_CLASSES = "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90"

0 commit comments

Comments
 (0)