kiso 0.2.2.pre → 0.4.0.pre

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +35 -1
  3. data/README.md +16 -3
  4. data/app/assets/tailwind/kiso/dialog.css +46 -0
  5. data/app/assets/tailwind/kiso/engine.css +6 -3
  6. data/app/assets/tailwind/kiso/input-otp.css +17 -0
  7. data/app/assets/tailwind/kiso/palettes/blue.css +65 -0
  8. data/app/assets/tailwind/kiso/palettes/green.css +65 -0
  9. data/app/assets/tailwind/kiso/palettes/orange.css +65 -0
  10. data/app/assets/tailwind/kiso/palettes/violet.css +65 -0
  11. data/app/assets/tailwind/kiso/palettes/zinc.css +65 -0
  12. data/app/assets/tailwind/kiso/slider.css +27 -0
  13. data/app/helpers/kiso/app_component_helper.rb +53 -0
  14. data/app/helpers/kiso/component_helper.rb +110 -24
  15. data/app/helpers/kiso/ui_context_helper.rb +59 -0
  16. data/app/javascript/controllers/kiso/alert_controller.js +33 -0
  17. data/app/javascript/controllers/kiso/dialog_controller.js +140 -0
  18. data/app/javascript/controllers/kiso/index.js +6 -0
  19. data/app/javascript/controllers/kiso/slider_controller.js +276 -0
  20. data/app/views/kiso/components/_alert.html.erb +19 -3
  21. data/app/views/kiso/components/_alert_dialog.html.erb +28 -0
  22. data/app/views/kiso/components/_app.html.erb +7 -0
  23. data/app/views/kiso/components/_aspect_ratio.html.erb +8 -0
  24. data/app/views/kiso/components/_avatar.html.erb +3 -3
  25. data/app/views/kiso/components/_breadcrumb.html.erb +1 -1
  26. data/app/views/kiso/components/_button.html.erb +31 -17
  27. data/app/views/kiso/components/_color_mode_button.html.erb +1 -1
  28. data/app/views/kiso/components/_color_mode_select.html.erb +4 -4
  29. data/app/views/kiso/components/_container.html.erb +7 -0
  30. data/app/views/kiso/components/_dashboard_sidebar.html.erb +1 -1
  31. data/app/views/kiso/components/_dialog.html.erb +11 -0
  32. data/app/views/kiso/components/_footer.html.erb +7 -0
  33. data/app/views/kiso/components/_header.html.erb +7 -0
  34. data/app/views/kiso/components/_main.html.erb +7 -0
  35. data/app/views/kiso/components/_page.html.erb +7 -0
  36. data/app/views/kiso/components/_page_body.html.erb +7 -0
  37. data/app/views/kiso/components/_page_card.html.erb +40 -0
  38. data/app/views/kiso/components/_page_grid.html.erb +7 -0
  39. data/app/views/kiso/components/_page_header.html.erb +38 -0
  40. data/app/views/kiso/components/_page_section.html.erb +11 -0
  41. data/app/views/kiso/components/_pagination.html.erb +1 -1
  42. data/app/views/kiso/components/_select_native.html.erb +3 -3
  43. data/app/views/kiso/components/_skeleton.html.erb +5 -0
  44. data/app/views/kiso/components/_slider.html.erb +42 -0
  45. data/app/views/kiso/components/_switch.html.erb +2 -2
  46. data/app/views/kiso/components/alert/_actions.html.erb +7 -0
  47. data/app/views/kiso/components/alert_dialog/_action.html.erb +8 -0
  48. data/app/views/kiso/components/alert_dialog/_cancel.html.erb +8 -0
  49. data/app/views/kiso/components/alert_dialog/_description.html.erb +8 -0
  50. data/app/views/kiso/components/alert_dialog/_footer.html.erb +7 -0
  51. data/app/views/kiso/components/alert_dialog/_header.html.erb +7 -0
  52. data/app/views/kiso/components/alert_dialog/_media.html.erb +7 -0
  53. data/app/views/kiso/components/alert_dialog/_title.html.erb +8 -0
  54. data/app/views/kiso/components/breadcrumb/_ellipsis.html.erb +1 -1
  55. data/app/views/kiso/components/combobox/_input.html.erb +1 -1
  56. data/app/views/kiso/components/combobox/_item.html.erb +2 -2
  57. data/app/views/kiso/components/combobox/_list.html.erb +2 -1
  58. data/app/views/kiso/components/command/_group.html.erb +2 -2
  59. data/app/views/kiso/components/command/_input.html.erb +3 -2
  60. data/app/views/kiso/components/command/_list.html.erb +2 -1
  61. data/app/views/kiso/components/dashboard_navbar/_toggle.html.erb +1 -1
  62. data/app/views/kiso/components/dashboard_sidebar/_collapse.html.erb +1 -1
  63. data/app/views/kiso/components/dashboard_sidebar/_toggle.html.erb +1 -1
  64. data/app/views/kiso/components/dialog/_body.html.erb +7 -0
  65. data/app/views/kiso/components/dialog/_close.html.erb +10 -0
  66. data/app/views/kiso/components/dialog/_description.html.erb +7 -0
  67. data/app/views/kiso/components/dialog/_footer.html.erb +7 -0
  68. data/app/views/kiso/components/dialog/_header.html.erb +7 -0
  69. data/app/views/kiso/components/dialog/_title.html.erb +7 -0
  70. data/app/views/kiso/components/empty/_actions.html.erb +7 -0
  71. data/app/views/kiso/components/nav/_item.html.erb +2 -2
  72. data/app/views/kiso/components/nav/_section.html.erb +5 -5
  73. data/app/views/kiso/components/page/_center.html.erb +7 -0
  74. data/app/views/kiso/components/page/_left.html.erb +7 -0
  75. data/app/views/kiso/components/page/_right.html.erb +7 -0
  76. data/app/views/kiso/components/page_card/_body.html.erb +7 -0
  77. data/app/views/kiso/components/page_card/_description.html.erb +7 -0
  78. data/app/views/kiso/components/page_card/_footer.html.erb +7 -0
  79. data/app/views/kiso/components/page_card/_header.html.erb +7 -0
  80. data/app/views/kiso/components/page_card/_icon.html.erb +7 -0
  81. data/app/views/kiso/components/page_card/_title.html.erb +7 -0
  82. data/app/views/kiso/components/page_header/_description.html.erb +7 -0
  83. data/app/views/kiso/components/page_header/_headline.html.erb +7 -0
  84. data/app/views/kiso/components/page_header/_links.html.erb +7 -0
  85. data/app/views/kiso/components/page_header/_title.html.erb +7 -0
  86. data/app/views/kiso/components/page_section/_body.html.erb +7 -0
  87. data/app/views/kiso/components/page_section/_description.html.erb +7 -0
  88. data/app/views/kiso/components/page_section/_header.html.erb +7 -0
  89. data/app/views/kiso/components/page_section/_headline.html.erb +7 -0
  90. data/app/views/kiso/components/page_section/_links.html.erb +7 -0
  91. data/app/views/kiso/components/page_section/_title.html.erb +7 -0
  92. data/app/views/kiso/components/page_section/_wrapper.html.erb +7 -0
  93. data/app/views/kiso/components/pagination/_ellipsis.html.erb +1 -1
  94. data/app/views/kiso/components/pagination/_next.html.erb +2 -2
  95. data/app/views/kiso/components/pagination/_previous.html.erb +2 -2
  96. data/app/views/kiso/components/select/_item.html.erb +2 -2
  97. data/config/locales/en.yml +33 -0
  98. data/lib/generators/kiso/component/USAGE +35 -0
  99. data/lib/generators/kiso/component/component_generator.rb +104 -0
  100. data/lib/generators/kiso/component/templates/partial.html.erb.tt +7 -0
  101. data/lib/generators/kiso/component/templates/sub_part_partial.html.erb.tt +7 -0
  102. data/lib/generators/kiso/component/templates/sub_part_theme.rb.tt +21 -0
  103. data/lib/generators/kiso/component/templates/theme.rb.tt +21 -0
  104. data/lib/kiso/configuration.rb +40 -0
  105. data/lib/kiso/engine.rb +105 -1
  106. data/lib/kiso/presets/rounded.rb +136 -0
  107. data/lib/kiso/presets/sharp.rb +178 -0
  108. data/lib/kiso/presets.rb +49 -0
  109. data/lib/kiso/theme_overrides.rb +5 -1
  110. data/lib/kiso/themes/alert.rb +24 -11
  111. data/lib/kiso/themes/alert_dialog.rb +78 -0
  112. data/lib/kiso/themes/aspect_ratio.rb +16 -0
  113. data/lib/kiso/themes/dashboard.rb +3 -3
  114. data/lib/kiso/themes/dialog.rb +57 -0
  115. data/lib/kiso/themes/empty.rb +6 -1
  116. data/lib/kiso/themes/input_otp.rb +2 -2
  117. data/lib/kiso/themes/layout.rb +69 -0
  118. data/lib/kiso/themes/page.rb +295 -0
  119. data/lib/kiso/themes/skeleton.rb +16 -0
  120. data/lib/kiso/themes/slider.rb +53 -0
  121. data/lib/kiso/version.rb +1 -1
  122. data/lib/kiso.rb +11 -0
  123. metadata +89 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cfca4f2a1e45d61e45de52c22a96428de18c04643860ea07c0913d2c29d3c397
4
- data.tar.gz: e46ba40a7fe00c0818958742e745058e6cec5990e2b195df085cc2b3e8242477
3
+ metadata.gz: ce3df9a9c977207d60d0253493414495486682817829e7afb9c3ea4f856756b2
4
+ data.tar.gz: ea280bd1479c2bfe90a8fdd3fe597efe1a88c427031f096b24536a02c3558899
5
5
  SHA512:
6
- metadata.gz: 8ca9dcd4857e5f4eb41086239901a6c347314432ba75189372642dba08d6975fe9caa5466635e94e013f26c858a84ff5af64e2701dd75a3ef946e560b3025011
7
- data.tar.gz: 75689ce3b7a06d3377d74ed37f7d5fe1d44c95d19549b6992e5c66bd3b78a8b07e924bbc2ba26a15f02b861f74986565c124369fb7648de5b5655b060dd2d4f6
6
+ metadata.gz: 34279aa5743e7baf516464c98ab5984de8edace8789646cb2277270ba5320f8b5763849141a4c2ddeee85f42d23c21638bcc4d11dcb0dd0f34792b09c8efa217
7
+ data.tar.gz: 8da0d3477b660de7fc174da7a7a1608e39783bd763b428f570beaf4385b301fa5eb9105384a87ff61791d09bab655ad3882c148f39d93f6c8402149c0fbfbac8
data/CHANGELOG.md CHANGED
@@ -7,6 +7,38 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.4.0.pre] - 2026-03-08
11
+
12
+ ### Added
13
+
14
+ - Layout component family: App, Container (4 size variants), Header, Footer, Main
15
+ - Page component family: Page (grid with sidebars), PageHeader, PageBody, PageSection, PageGrid, PageCard (4 variants)
16
+ - `appui()` helper for host app components with `app/themes/` and `app/views/components/`
17
+ - `kiso:framework_component` generator for scaffolding engine components
18
+ - `kiso:component` generator for scaffolding host app components
19
+ - Theme presets: `apply_preset(:rounded)` and `apply_preset(:sharp)`
20
+ - 5 OKLCH color palettes (zinc, blue, green, orange, violet)
21
+ - i18n support: all component strings use `t()` with `config/locales/en.yml`
22
+ - [Building Your Own Components](/guide/building-components) guide — how to wrap Kiso components with domain logic and build standalone components with `appui()`, themes, and sub-parts
23
+ - [Detailed release notes](/releases/batch-merge) with upgrade guide and examples for all new features
24
+
25
+ ## [0.3.0.pre] - 2026-03-03
26
+
27
+ ### Added
28
+
29
+ - Dialog component — modal dialog wrapping the native `<dialog>` element with `showModal()` for focus trapping and backdrop. Sub-parts: header, title, description, body, footer, close. Entry/exit CSS animations with reduced-motion support. Stimulus controller for programmatic open/close.
30
+ - Alert Dialog component — confirmation dialog that requires an explicit user action (`role="alertdialog"`). Cannot be dismissed by Escape or backdrop click. Sub-parts: header, title, description, media, footer, action, cancel. Size variants (default/sm) with responsive media grid layout. Auto-linked `aria-labelledby` and `aria-describedby`.
31
+ - AspectRatio component — lightweight wrapper that applies an aspect ratio via inline style. Accepts any `ratio:` value (defaults to 16:9).
32
+ - Slider component — range input with track, thumb, and fill styling. Supports min/max/step/value, three sizes (sm/md/lg), and disabled state. Stimulus controller for real-time value display.
33
+ - Empty component `:actions` slot for placing buttons below the description.
34
+ - Button `method:` prop — renders a Rails `button_to` form for DELETE/POST/PUT/PATCH actions while preserving all Button styling.
35
+ - Icons guide added to documentation site.
36
+
37
+ ### Fixed
38
+
39
+ - InputOTP slots missing visible border when a separator is placed inside a group.
40
+ - Sidebar header and footer now use `flex-col` layout matching shadcn structure.
41
+
10
42
  ## [0.2.2.pre] - 2026-03-03
11
43
 
12
44
  ### Fixed
@@ -68,7 +100,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
68
100
  - Lookbook component previews
69
101
  - Bridgetown documentation site
70
102
 
71
- [Unreleased]: https://github.com/steveclarke/kiso/compare/v0.2.2.pre...HEAD
103
+ [Unreleased]: https://github.com/steveclarke/kiso/compare/v0.4.0.pre...HEAD
104
+ [0.4.0.pre]: https://github.com/steveclarke/kiso/releases/tag/v0.4.0.pre
105
+ [0.3.0.pre]: https://github.com/steveclarke/kiso/releases/tag/v0.3.0.pre
72
106
  [0.2.2.pre]: https://github.com/steveclarke/kiso/releases/tag/v0.2.2.pre
73
107
  [0.2.1.pre]: https://github.com/steveclarke/kiso/releases/tag/v0.2.1.pre
74
108
  [0.2.0.pre]: https://github.com/steveclarke/kiso/releases/tag/v0.2.0.pre
data/README.md CHANGED
@@ -1,6 +1,19 @@
1
- # Kiso 基礎
2
-
3
- UI components for Rails. Built on ERB, Tailwind CSS, and Hotwire.
1
+ <p align="center">
2
+ <a href="https://kisoui.com">
3
+ <img src="brand/svg/logo-horizontal-color.svg" width="280" alt="Kiso">
4
+ </a>
5
+ </p>
6
+
7
+ <p align="center">
8
+ UI components for Rails. Built on ERB, Tailwind CSS, and Hotwire.
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="https://kisoui.com">Docs</a> ·
13
+ <a href="https://lookbook.kisoui.com">Lookbook</a> ·
14
+ <a href="https://github.com/steveclarke/kiso/discussions">Discussions</a> ·
15
+ <a href="https://discord.gg/aMshcWAW">Discord</a>
16
+ </p>
4
17
 
5
18
  Add one gem and get badges, buttons, cards, alerts, and more. They all work with screen readers and dark mode.
6
19
 
@@ -0,0 +1,46 @@
1
+ /* Dialog and Alert Dialog entry/exit animations and scroll lock. */
2
+
3
+ /* Entry */
4
+ :is(dialog[data-slot="dialog"], dialog[data-slot="alert-dialog"])[open] {
5
+ animation: kiso-dialog-backdrop-in 200ms ease-out;
6
+ }
7
+ :is(dialog[data-slot="dialog"], dialog[data-slot="alert-dialog"])[open] > :is([data-slot="dialog-content"], [data-slot="alert-dialog-content"]) {
8
+ animation: kiso-dialog-content-in 200ms ease-out;
9
+ }
10
+
11
+ /* Exit — data-state="closing" set by Stimulus before calling .close() */
12
+ :is(dialog[data-slot="dialog"], dialog[data-slot="alert-dialog"])[data-state="closing"] {
13
+ animation: kiso-dialog-backdrop-out 200ms ease-in forwards;
14
+ }
15
+ :is(dialog[data-slot="dialog"], dialog[data-slot="alert-dialog"])[data-state="closing"] > :is([data-slot="dialog-content"], [data-slot="alert-dialog-content"]) {
16
+ animation: kiso-dialog-content-out 200ms ease-in forwards;
17
+ }
18
+
19
+ @keyframes kiso-dialog-backdrop-in {
20
+ from { opacity: 0; }
21
+ }
22
+ @keyframes kiso-dialog-backdrop-out {
23
+ to { opacity: 0; }
24
+ }
25
+ @keyframes kiso-dialog-content-in {
26
+ from { opacity: 0; transform: scale(0.95); }
27
+ }
28
+ @keyframes kiso-dialog-content-out {
29
+ to { opacity: 0; transform: scale(0.95); }
30
+ }
31
+
32
+ /* Scroll lock — prevent body scroll when modal dialog is open */
33
+ html:has(:is(dialog[data-slot="dialog"], dialog[data-slot="alert-dialog"])[open]:modal) {
34
+ overflow: hidden;
35
+ scrollbar-gutter: stable;
36
+ }
37
+
38
+ /* Respect reduced motion */
39
+ @media (prefers-reduced-motion: reduce) {
40
+ :is(dialog[data-slot="dialog"], dialog[data-slot="alert-dialog"])[open],
41
+ :is(dialog[data-slot="dialog"], dialog[data-slot="alert-dialog"])[open] > :is([data-slot="dialog-content"], [data-slot="alert-dialog-content"]),
42
+ :is(dialog[data-slot="dialog"], dialog[data-slot="alert-dialog"])[data-state="closing"],
43
+ :is(dialog[data-slot="dialog"], dialog[data-slot="alert-dialog"])[data-state="closing"] > :is([data-slot="dialog-content"], [data-slot="alert-dialog-content"]) {
44
+ animation: none;
45
+ }
46
+ }
@@ -7,14 +7,17 @@
7
7
  @import "./radio-group.css";
8
8
  @import "./color-mode.css";
9
9
  @import "./dashboard.css";
10
+ @import "./dialog.css";
10
11
  @import "./input-otp.css";
12
+ @import "./slider.css";
11
13
 
12
14
  /* Scan Kiso's own files so host apps don't need to know the gem's internals.
13
15
  Paths are relative to THIS file (app/assets/tailwind/kiso/engine.css).
14
16
  Count carefully — wrong paths fail SILENTLY (classes just won't generate). */
15
17
  @source "../../../views"; /* → app/views */
16
18
  @source "../../../helpers"; /* → app/helpers */
17
- @source "../../../../lib/kiso/themes"; /* → lib/kiso/themes */
19
+ @source "../../../../lib/kiso/themes"; /* → lib/kiso/themes */
20
+ @source "../../../../lib/kiso/presets"; /* → lib/kiso/presets */
18
21
 
19
22
  /* === Geist Font (by Vercel) ===
20
23
  Self-hosted variable fonts — no CDN dependency.
@@ -54,7 +57,7 @@
54
57
 
55
58
  @theme {
56
59
  /* Brand / action colors */
57
- --color-primary: var(--color-sky-600);
60
+ --color-primary: var(--color-rose-500);
58
61
  --color-primary-foreground: white;
59
62
 
60
63
  --color-secondary: var(--color-teal-600);
@@ -97,7 +100,7 @@
97
100
  Redefine tokens under .dark — components never use dark: prefixes. */
98
101
 
99
102
  .dark {
100
- --color-primary: var(--color-blue-400);
103
+ --color-primary: var(--color-rose-400);
101
104
  --color-primary-foreground: var(--color-zinc-950);
102
105
 
103
106
  --color-secondary: var(--color-teal-400);
@@ -8,3 +8,20 @@
8
8
  0%, 70%, 100% { opacity: 1; }
9
9
  20%, 50% { opacity: 0; }
10
10
  }
11
+
12
+ /* Separator-adjacent rounding — when a separator sits inside a group,
13
+ round the slot edges next to it so each visual cluster has proper corners.
14
+ Also reset the negative margin so the slot after a separator starts fresh. */
15
+
16
+ @layer utilities {
17
+ [data-slot="input-otp-slot"]:has(+ [data-slot="input-otp-separator"]) {
18
+ border-top-right-radius: var(--radius-md);
19
+ border-bottom-right-radius: var(--radius-md);
20
+ }
21
+
22
+ [data-slot="input-otp-separator"] + [data-slot="input-otp-slot"] {
23
+ margin-left: 0;
24
+ border-top-left-radius: var(--radius-md);
25
+ border-bottom-left-radius: var(--radius-md);
26
+ }
27
+ }
@@ -0,0 +1,65 @@
1
+ /* Kiso Color Palette: Blue
2
+ A professional blue palette — classic SaaS/enterprise feel.
3
+ Based on shadcn/ui's Blue theme with OKLCH color values.
4
+
5
+ Usage:
6
+ 1. Import in your CSS: @import "kiso/palettes/blue.css";
7
+ 2. Add to your HTML: <html data-palette="blue"> or <body data-palette="blue">
8
+ */
9
+
10
+ [data-palette="blue"] {
11
+ /* Brand / action colors — vibrant blue */
12
+ --color-primary: oklch(0.488 0.243 264.376);
13
+ --color-primary-foreground: oklch(0.97 0.014 254.604);
14
+
15
+ --color-secondary: oklch(0.967 0.001 286.375);
16
+ --color-secondary-foreground: oklch(0.21 0.006 285.885);
17
+
18
+ /* Surface tokens — slate-tinted neutrals */
19
+ --color-background: oklch(1 0 0);
20
+ --color-foreground: oklch(0.13 0.028 261.692);
21
+
22
+ --color-muted: oklch(0.967 0.003 264.542);
23
+ --color-muted-foreground: oklch(0.551 0.027 264.364);
24
+
25
+ --color-accent: oklch(0.967 0.003 264.542);
26
+ --color-accent-foreground: oklch(0.21 0.034 264.665);
27
+
28
+ --color-inverted: oklch(0.21 0.034 264.665);
29
+ --color-inverted-foreground: oklch(0.985 0.002 247.839);
30
+ --color-elevated: oklch(0.967 0.003 264.542);
31
+ --color-accented: oklch(0.707 0.022 261.325);
32
+
33
+ --color-border: oklch(0.928 0.006 264.531);
34
+ --color-border-accented: oklch(0.707 0.022 261.325);
35
+
36
+ --color-ring: oklch(0.488 0.243 264.376);
37
+ }
38
+
39
+ .dark [data-palette="blue"],
40
+ [data-palette="blue"].dark {
41
+ --color-primary: oklch(0.42 0.18 266);
42
+ --color-primary-foreground: oklch(0.97 0.014 254.604);
43
+
44
+ --color-secondary: oklch(0.274 0.006 286.033);
45
+ --color-secondary-foreground: oklch(0.985 0 0);
46
+
47
+ --color-background: oklch(0.13 0.028 261.692);
48
+ --color-foreground: oklch(0.985 0.002 247.839);
49
+
50
+ --color-muted: oklch(0.278 0.033 256.848);
51
+ --color-muted-foreground: oklch(0.707 0.022 261.325);
52
+
53
+ --color-accent: oklch(0.278 0.033 256.848);
54
+ --color-accent-foreground: oklch(0.985 0.002 247.839);
55
+
56
+ --color-inverted: oklch(0.985 0.002 247.839);
57
+ --color-inverted-foreground: oklch(0.21 0.034 264.665);
58
+ --color-elevated: oklch(0.278 0.033 256.848);
59
+ --color-accented: oklch(0.551 0.027 264.364);
60
+
61
+ --color-border: oklch(0.278 0.033 256.848);
62
+ --color-border-accented: oklch(0.551 0.027 264.364);
63
+
64
+ --color-ring: oklch(0.488 0.243 264.376);
65
+ }
@@ -0,0 +1,65 @@
1
+ /* Kiso Color Palette: Green
2
+ A fresh, natural green palette — great for eco, health, or finance apps.
3
+ Based on shadcn/ui's Green theme with OKLCH color values.
4
+
5
+ Usage:
6
+ 1. Import in your CSS: @import "kiso/palettes/green.css";
7
+ 2. Add to your HTML: <html data-palette="green"> or <body data-palette="green">
8
+ */
9
+
10
+ [data-palette="green"] {
11
+ /* Brand / action colors — vivid green */
12
+ --color-primary: oklch(0.648 0.2 131.684);
13
+ --color-primary-foreground: oklch(0.986 0.031 120.757);
14
+
15
+ --color-secondary: oklch(0.967 0.001 286.375);
16
+ --color-secondary-foreground: oklch(0.21 0.006 285.885);
17
+
18
+ /* Surface tokens — zinc neutrals */
19
+ --color-background: oklch(1 0 0);
20
+ --color-foreground: oklch(0.141 0.005 285.823);
21
+
22
+ --color-muted: oklch(0.967 0.001 286.375);
23
+ --color-muted-foreground: oklch(0.552 0.016 285.938);
24
+
25
+ --color-accent: oklch(0.967 0.001 286.375);
26
+ --color-accent-foreground: oklch(0.21 0.006 285.885);
27
+
28
+ --color-inverted: oklch(0.21 0.006 285.885);
29
+ --color-inverted-foreground: oklch(0.985 0 0);
30
+ --color-elevated: oklch(0.967 0.001 286.375);
31
+ --color-accented: oklch(0.705 0.015 286.067);
32
+
33
+ --color-border: oklch(0.92 0.004 286.32);
34
+ --color-border-accented: oklch(0.705 0.015 286.067);
35
+
36
+ --color-ring: oklch(0.648 0.2 131.684);
37
+ }
38
+
39
+ .dark [data-palette="green"],
40
+ [data-palette="green"].dark {
41
+ --color-primary: oklch(0.648 0.2 131.684);
42
+ --color-primary-foreground: oklch(0.986 0.031 120.757);
43
+
44
+ --color-secondary: oklch(0.274 0.006 286.033);
45
+ --color-secondary-foreground: oklch(0.985 0 0);
46
+
47
+ --color-background: oklch(0.141 0.005 285.823);
48
+ --color-foreground: oklch(0.985 0 0);
49
+
50
+ --color-muted: oklch(0.274 0.006 286.033);
51
+ --color-muted-foreground: oklch(0.705 0.015 286.067);
52
+
53
+ --color-accent: oklch(0.274 0.006 286.033);
54
+ --color-accent-foreground: oklch(0.985 0 0);
55
+
56
+ --color-inverted: oklch(0.985 0 0);
57
+ --color-inverted-foreground: oklch(0.21 0.006 285.885);
58
+ --color-elevated: oklch(0.274 0.006 286.033);
59
+ --color-accented: oklch(0.552 0.016 285.938);
60
+
61
+ --color-border: oklch(0.274 0.006 286.033);
62
+ --color-border-accented: oklch(0.552 0.016 285.938);
63
+
64
+ --color-ring: oklch(0.648 0.2 131.684);
65
+ }
@@ -0,0 +1,65 @@
1
+ /* Kiso Color Palette: Orange
2
+ A warm, energetic palette — great for creative, food, or community apps.
3
+ Based on shadcn/ui's Orange theme with OKLCH color values.
4
+
5
+ Usage:
6
+ 1. Import in your CSS: @import "kiso/palettes/orange.css";
7
+ 2. Add to your HTML: <html data-palette="orange"> or <body data-palette="orange">
8
+ */
9
+
10
+ [data-palette="orange"] {
11
+ /* Brand / action colors — warm orange */
12
+ --color-primary: oklch(0.646 0.222 41.116);
13
+ --color-primary-foreground: oklch(0.98 0.016 73.684);
14
+
15
+ --color-secondary: oklch(0.97 0.001 106.424);
16
+ --color-secondary-foreground: oklch(0.216 0.006 56.043);
17
+
18
+ /* Surface tokens — warm stone neutrals */
19
+ --color-background: oklch(1 0 0);
20
+ --color-foreground: oklch(0.147 0.004 49.25);
21
+
22
+ --color-muted: oklch(0.97 0.001 106.424);
23
+ --color-muted-foreground: oklch(0.553 0.013 58.071);
24
+
25
+ --color-accent: oklch(0.97 0.001 106.424);
26
+ --color-accent-foreground: oklch(0.216 0.006 56.043);
27
+
28
+ --color-inverted: oklch(0.216 0.006 56.043);
29
+ --color-inverted-foreground: oklch(0.985 0.001 106.423);
30
+ --color-elevated: oklch(0.97 0.001 106.424);
31
+ --color-accented: oklch(0.709 0.01 56.259);
32
+
33
+ --color-border: oklch(0.923 0.003 48.717);
34
+ --color-border-accented: oklch(0.709 0.01 56.259);
35
+
36
+ --color-ring: oklch(0.646 0.222 41.116);
37
+ }
38
+
39
+ .dark [data-palette="orange"],
40
+ [data-palette="orange"].dark {
41
+ --color-primary: oklch(0.705 0.213 47.604);
42
+ --color-primary-foreground: oklch(0.98 0.016 73.684);
43
+
44
+ --color-secondary: oklch(0.268 0.007 34.298);
45
+ --color-secondary-foreground: oklch(0.985 0.001 106.423);
46
+
47
+ --color-background: oklch(0.147 0.004 49.25);
48
+ --color-foreground: oklch(0.985 0.001 106.423);
49
+
50
+ --color-muted: oklch(0.268 0.007 34.298);
51
+ --color-muted-foreground: oklch(0.709 0.01 56.259);
52
+
53
+ --color-accent: oklch(0.268 0.007 34.298);
54
+ --color-accent-foreground: oklch(0.985 0.001 106.423);
55
+
56
+ --color-inverted: oklch(0.985 0.001 106.423);
57
+ --color-inverted-foreground: oklch(0.216 0.006 56.043);
58
+ --color-elevated: oklch(0.268 0.007 34.298);
59
+ --color-accented: oklch(0.553 0.013 58.071);
60
+
61
+ --color-border: oklch(0.268 0.007 34.298);
62
+ --color-border-accented: oklch(0.553 0.013 58.071);
63
+
64
+ --color-ring: oklch(0.705 0.213 47.604);
65
+ }
@@ -0,0 +1,65 @@
1
+ /* Kiso Color Palette: Violet
2
+ A rich, creative purple palette — great for design tools or premium brands.
3
+ Based on shadcn/ui's Violet theme with OKLCH color values.
4
+
5
+ Usage:
6
+ 1. Import in your CSS: @import "kiso/palettes/violet.css";
7
+ 2. Add to your HTML: <html data-palette="violet"> or <body data-palette="violet">
8
+ */
9
+
10
+ [data-palette="violet"] {
11
+ /* Brand / action colors — vivid violet */
12
+ --color-primary: oklch(0.541 0.281 293.009);
13
+ --color-primary-foreground: oklch(0.969 0.016 293.756);
14
+
15
+ --color-secondary: oklch(0.967 0.001 286.375);
16
+ --color-secondary-foreground: oklch(0.21 0.006 285.885);
17
+
18
+ /* Surface tokens — gray neutrals */
19
+ --color-background: oklch(1 0 0);
20
+ --color-foreground: oklch(0.13 0.028 261.692);
21
+
22
+ --color-muted: oklch(0.967 0.003 264.542);
23
+ --color-muted-foreground: oklch(0.551 0.027 264.364);
24
+
25
+ --color-accent: oklch(0.967 0.003 264.542);
26
+ --color-accent-foreground: oklch(0.21 0.034 264.665);
27
+
28
+ --color-inverted: oklch(0.21 0.034 264.665);
29
+ --color-inverted-foreground: oklch(0.985 0.002 247.839);
30
+ --color-elevated: oklch(0.967 0.003 264.542);
31
+ --color-accented: oklch(0.707 0.022 261.325);
32
+
33
+ --color-border: oklch(0.928 0.006 264.531);
34
+ --color-border-accented: oklch(0.707 0.022 261.325);
35
+
36
+ --color-ring: oklch(0.541 0.281 293.009);
37
+ }
38
+
39
+ .dark [data-palette="violet"],
40
+ [data-palette="violet"].dark {
41
+ --color-primary: oklch(0.606 0.25 292.717);
42
+ --color-primary-foreground: oklch(0.969 0.016 293.756);
43
+
44
+ --color-secondary: oklch(0.274 0.006 286.033);
45
+ --color-secondary-foreground: oklch(0.985 0 0);
46
+
47
+ --color-background: oklch(0.13 0.028 261.692);
48
+ --color-foreground: oklch(0.985 0.002 247.839);
49
+
50
+ --color-muted: oklch(0.278 0.033 256.848);
51
+ --color-muted-foreground: oklch(0.707 0.022 261.325);
52
+
53
+ --color-accent: oklch(0.278 0.033 256.848);
54
+ --color-accent-foreground: oklch(0.985 0.002 247.839);
55
+
56
+ --color-inverted: oklch(0.985 0.002 247.839);
57
+ --color-inverted-foreground: oklch(0.21 0.034 264.665);
58
+ --color-elevated: oklch(0.278 0.033 256.848);
59
+ --color-accented: oklch(0.551 0.027 264.364);
60
+
61
+ --color-border: oklch(0.278 0.033 256.848);
62
+ --color-border-accented: oklch(0.551 0.027 264.364);
63
+
64
+ --color-ring: oklch(0.606 0.25 292.717);
65
+ }
@@ -0,0 +1,65 @@
1
+ /* Kiso Color Palette: Zinc
2
+ A neutral, cool-toned palette using the Zinc scale.
3
+ Based on shadcn/ui's Zinc theme with OKLCH color values.
4
+
5
+ Usage:
6
+ 1. Import in your CSS: @import "kiso/palettes/zinc.css";
7
+ 2. Add to your HTML: <html data-palette="zinc"> or <body data-palette="zinc">
8
+ */
9
+
10
+ [data-palette="zinc"] {
11
+ /* Brand / action colors — zinc primary (near-black in light, near-white in dark) */
12
+ --color-primary: oklch(0.21 0.006 285.885);
13
+ --color-primary-foreground: oklch(0.985 0 0);
14
+
15
+ --color-secondary: oklch(0.967 0.001 286.375);
16
+ --color-secondary-foreground: oklch(0.21 0.006 285.885);
17
+
18
+ /* Surface tokens */
19
+ --color-background: oklch(1 0 0);
20
+ --color-foreground: oklch(0.141 0.005 285.823);
21
+
22
+ --color-muted: oklch(0.967 0.001 286.375);
23
+ --color-muted-foreground: oklch(0.552 0.016 285.938);
24
+
25
+ --color-accent: oklch(0.967 0.001 286.375);
26
+ --color-accent-foreground: oklch(0.21 0.006 285.885);
27
+
28
+ --color-inverted: oklch(0.21 0.006 285.885);
29
+ --color-inverted-foreground: oklch(0.985 0 0);
30
+ --color-elevated: oklch(0.967 0.001 286.375);
31
+ --color-accented: oklch(0.705 0.015 286.067);
32
+
33
+ --color-border: oklch(0.92 0.004 286.32);
34
+ --color-border-accented: oklch(0.705 0.015 286.067);
35
+
36
+ --color-ring: oklch(0.705 0.015 286.067);
37
+ }
38
+
39
+ .dark [data-palette="zinc"],
40
+ [data-palette="zinc"].dark {
41
+ --color-primary: oklch(0.92 0.004 286.32);
42
+ --color-primary-foreground: oklch(0.21 0.006 285.885);
43
+
44
+ --color-secondary: oklch(0.274 0.006 286.033);
45
+ --color-secondary-foreground: oklch(0.985 0 0);
46
+
47
+ --color-background: oklch(0.141 0.005 285.823);
48
+ --color-foreground: oklch(0.985 0 0);
49
+
50
+ --color-muted: oklch(0.274 0.006 286.033);
51
+ --color-muted-foreground: oklch(0.705 0.015 286.067);
52
+
53
+ --color-accent: oklch(0.274 0.006 286.033);
54
+ --color-accent-foreground: oklch(0.985 0 0);
55
+
56
+ --color-inverted: oklch(0.985 0 0);
57
+ --color-inverted-foreground: oklch(0.21 0.006 285.885);
58
+ --color-elevated: oklch(0.274 0.006 286.033);
59
+ --color-accented: oklch(0.552 0.016 285.938);
60
+
61
+ --color-border: oklch(0.274 0.006 286.033);
62
+ --color-border-accented: oklch(0.552 0.016 285.938);
63
+
64
+ --color-ring: oklch(0.552 0.016 285.938);
65
+ }
@@ -0,0 +1,27 @@
1
+ @layer components {
2
+ /* Center the thumb over its left % position */
3
+ [data-slot="slider-thumb"] {
4
+ transform: translateX(-50%);
5
+ top: 50%;
6
+ margin-top: calc(-1 * var(--thumb-offset, 0.5rem));
7
+ }
8
+
9
+ /* Size-specific thumb offsets (half the thumb size) */
10
+ [data-slot="slider"] :where([data-slot="slider-thumb"].size-3) {
11
+ --thumb-offset: 0.375rem;
12
+ }
13
+
14
+ [data-slot="slider"] :where([data-slot="slider-thumb"].size-4) {
15
+ --thumb-offset: 0.5rem;
16
+ }
17
+
18
+ [data-slot="slider"] :where([data-slot="slider-thumb"].size-5) {
19
+ --thumb-offset: 0.625rem;
20
+ }
21
+
22
+ /* Disabled state */
23
+ [data-slot="slider"]:has(input:disabled) {
24
+ opacity: 0.5;
25
+ pointer-events: none;
26
+ }
27
+ }
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Kiso
4
+ # View helpers for rendering host app components.
5
+ #
6
+ # Mirrors {ComponentHelper#kui} but resolves partials from
7
+ # +app/views/components/+ and themes from +AppThemes::+.
8
+ # No global config layer — host apps own the source directly.
9
+ #
10
+ # Included in all views automatically by {Engine}.
11
+ module AppComponentHelper
12
+ # Renders a host app component partial.
13
+ #
14
+ # Components live in +app/views/components/+. Sub-parts are nested
15
+ # in a directory matching the parent component name.
16
+ #
17
+ # @param component [Symbol] the component name (e.g. +:pricing_card+)
18
+ # @param part [Symbol, nil] optional sub-part name (e.g. +:header+, +:footer+)
19
+ # @param collection [Array, nil] renders the partial once per item when present
20
+ # @param ui [Hash{Symbol => String}, nil] per-slot class overrides keyed by sub-part name.
21
+ # For parent components, the hash is pushed onto a context stack so sub-parts
22
+ # inherit overrides automatically. For self-rendering components, the hash is
23
+ # also passed as a local so the partial can apply overrides to internally
24
+ # rendered elements.
25
+ # @param kwargs [Hash] locals passed to the partial (e.g. +css_classes:+)
26
+ # @yield optional block for component content
27
+ # @return [ActiveSupport::SafeBuffer] rendered HTML
28
+ #
29
+ # @example Render a pricing card
30
+ # appui(:pricing_card) { "Content" }
31
+ #
32
+ # @example Render a pricing card with sub-parts
33
+ # appui(:pricing_card) do
34
+ # appui(:pricing_card, :header) { "Header" }
35
+ # end
36
+ #
37
+ # @example Render with per-slot overrides
38
+ # appui(:pricing_card, ui: { header: "p-8" }) do
39
+ # appui(:pricing_card, :header) { "Header" }
40
+ # end
41
+ #
42
+ # @example Render a collection
43
+ # appui(:pricing_card, collection: @plans)
44
+ def appui(component, part = nil, collection: nil, ui: nil, **kwargs, &block)
45
+ kiso_render_component(
46
+ component, part,
47
+ path_prefix: "components",
48
+ collection: collection, ui: ui, merge_global_ui: false,
49
+ **kwargs, &block
50
+ )
51
+ end
52
+ end
53
+ end