kiso 0.3.0.pre → 0.4.1.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 (98) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +30 -1
  3. data/README.md +16 -3
  4. data/app/assets/tailwind/kiso/engine.css +40 -28
  5. data/app/assets/tailwind/kiso/palettes/blue.css +65 -0
  6. data/app/assets/tailwind/kiso/palettes/green.css +65 -0
  7. data/app/assets/tailwind/kiso/palettes/orange.css +65 -0
  8. data/app/assets/tailwind/kiso/palettes/violet.css +65 -0
  9. data/app/assets/tailwind/kiso/palettes/zinc.css +65 -0
  10. data/app/helpers/kiso/app_component_helper.rb +63 -0
  11. data/app/helpers/kiso/component_helper.rb +140 -24
  12. data/app/helpers/kiso/ui_context_helper.rb +59 -0
  13. data/app/javascript/controllers/kiso/alert_controller.js +33 -0
  14. data/app/javascript/controllers/kiso/index.js +3 -0
  15. data/app/views/kiso/components/_alert.html.erb +19 -3
  16. data/app/views/kiso/components/_alert_dialog.html.erb +2 -2
  17. data/app/views/kiso/components/_app.html.erb +7 -0
  18. data/app/views/kiso/components/_avatar.html.erb +3 -3
  19. data/app/views/kiso/components/_breadcrumb.html.erb +1 -1
  20. data/app/views/kiso/components/_color_mode_button.html.erb +1 -1
  21. data/app/views/kiso/components/_color_mode_select.html.erb +4 -4
  22. data/app/views/kiso/components/_container.html.erb +7 -0
  23. data/app/views/kiso/components/_dashboard_sidebar.html.erb +1 -1
  24. data/app/views/kiso/components/_dialog.html.erb +2 -2
  25. data/app/views/kiso/components/_footer.html.erb +7 -0
  26. data/app/views/kiso/components/_header.html.erb +7 -0
  27. data/app/views/kiso/components/_main.html.erb +7 -0
  28. data/app/views/kiso/components/_page.html.erb +7 -0
  29. data/app/views/kiso/components/_page_body.html.erb +7 -0
  30. data/app/views/kiso/components/_page_card.html.erb +40 -0
  31. data/app/views/kiso/components/_page_grid.html.erb +7 -0
  32. data/app/views/kiso/components/_page_header.html.erb +38 -0
  33. data/app/views/kiso/components/_page_section.html.erb +11 -0
  34. data/app/views/kiso/components/_pagination.html.erb +1 -1
  35. data/app/views/kiso/components/_select_native.html.erb +3 -3
  36. data/app/views/kiso/components/_skeleton.html.erb +5 -0
  37. data/app/views/kiso/components/_slider.html.erb +4 -4
  38. data/app/views/kiso/components/_switch.html.erb +2 -2
  39. data/app/views/kiso/components/alert/_actions.html.erb +7 -0
  40. data/app/views/kiso/components/breadcrumb/_ellipsis.html.erb +1 -1
  41. data/app/views/kiso/components/combobox/_input.html.erb +1 -1
  42. data/app/views/kiso/components/combobox/_item.html.erb +2 -2
  43. data/app/views/kiso/components/combobox/_list.html.erb +2 -1
  44. data/app/views/kiso/components/command/_group.html.erb +2 -2
  45. data/app/views/kiso/components/command/_input.html.erb +3 -2
  46. data/app/views/kiso/components/command/_list.html.erb +2 -1
  47. data/app/views/kiso/components/dashboard_navbar/_toggle.html.erb +1 -1
  48. data/app/views/kiso/components/dashboard_sidebar/_collapse.html.erb +1 -1
  49. data/app/views/kiso/components/dashboard_sidebar/_toggle.html.erb +1 -1
  50. data/app/views/kiso/components/dialog/_close.html.erb +1 -1
  51. data/app/views/kiso/components/nav/_item.html.erb +2 -2
  52. data/app/views/kiso/components/nav/_section.html.erb +5 -5
  53. data/app/views/kiso/components/page/_center.html.erb +7 -0
  54. data/app/views/kiso/components/page/_left.html.erb +7 -0
  55. data/app/views/kiso/components/page/_right.html.erb +7 -0
  56. data/app/views/kiso/components/page_card/_body.html.erb +7 -0
  57. data/app/views/kiso/components/page_card/_description.html.erb +7 -0
  58. data/app/views/kiso/components/page_card/_footer.html.erb +7 -0
  59. data/app/views/kiso/components/page_card/_header.html.erb +7 -0
  60. data/app/views/kiso/components/page_card/_icon.html.erb +7 -0
  61. data/app/views/kiso/components/page_card/_title.html.erb +7 -0
  62. data/app/views/kiso/components/page_header/_description.html.erb +7 -0
  63. data/app/views/kiso/components/page_header/_headline.html.erb +7 -0
  64. data/app/views/kiso/components/page_header/_links.html.erb +7 -0
  65. data/app/views/kiso/components/page_header/_title.html.erb +7 -0
  66. data/app/views/kiso/components/page_section/_body.html.erb +7 -0
  67. data/app/views/kiso/components/page_section/_description.html.erb +7 -0
  68. data/app/views/kiso/components/page_section/_header.html.erb +7 -0
  69. data/app/views/kiso/components/page_section/_headline.html.erb +7 -0
  70. data/app/views/kiso/components/page_section/_links.html.erb +7 -0
  71. data/app/views/kiso/components/page_section/_title.html.erb +7 -0
  72. data/app/views/kiso/components/page_section/_wrapper.html.erb +7 -0
  73. data/app/views/kiso/components/pagination/_ellipsis.html.erb +1 -1
  74. data/app/views/kiso/components/pagination/_next.html.erb +2 -2
  75. data/app/views/kiso/components/pagination/_previous.html.erb +2 -2
  76. data/app/views/kiso/components/select/_item.html.erb +2 -2
  77. data/config/locales/en.yml +33 -0
  78. data/lib/generators/kiso/component/USAGE +35 -0
  79. data/lib/generators/kiso/component/component_generator.rb +104 -0
  80. data/lib/generators/kiso/component/templates/partial.html.erb.tt +5 -0
  81. data/lib/generators/kiso/component/templates/sub_part_partial.html.erb.tt +5 -0
  82. data/lib/generators/kiso/component/templates/sub_part_theme.rb.tt +21 -0
  83. data/lib/generators/kiso/component/templates/theme.rb.tt +21 -0
  84. data/lib/kiso/configuration.rb +40 -0
  85. data/lib/kiso/engine.rb +109 -1
  86. data/lib/kiso/presets/rounded.rb +136 -0
  87. data/lib/kiso/presets/sharp.rb +178 -0
  88. data/lib/kiso/presets.rb +49 -0
  89. data/lib/kiso/theme_overrides.rb +5 -1
  90. data/lib/kiso/themes/alert.rb +24 -11
  91. data/lib/kiso/themes/dashboard.rb +1 -1
  92. data/lib/kiso/themes/layout.rb +78 -0
  93. data/lib/kiso/themes/page.rb +295 -0
  94. data/lib/kiso/themes/skeleton.rb +16 -0
  95. data/lib/kiso/version.rb +1 -1
  96. data/lib/kiso.rb +7 -0
  97. data/lib/tasks/kiso.rake +36 -0
  98. metadata +64 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 17ae0456b44e65c4a1f0c0fc7a0fb854daca4af8bf933d13d0fa2a3e78dc0b5d
4
- data.tar.gz: 5dad006edca36a6d23822274557de73667eb8bd8aa69aa575037859ed1983742
3
+ metadata.gz: 2746806e86680de2110a413ce1e6f29b0cc31a080bd1a41de7b5ac07902833cd
4
+ data.tar.gz: e4bd2a60cf877c765c15b57de4d2743ca4de925a65bd7646ef7783b39d32fbb9
5
5
  SHA512:
6
- metadata.gz: 490e5777fbc1fd030736c6c7866b3e39855699d7f71be28af41c9fc6bb2cbd7fd6b793d9d302e35886908ce663ddcc98e171ffd1c3419eebf8c6577073276c12
7
- data.tar.gz: caa47f1734d26450d7163108cefa70438d75e8ef1201ffc1b4123eb4e5bb5e22aa5f7b545fddad657235d79d18e62aacb05818b6f0aa87922baa20c2d3d66bbb
6
+ metadata.gz: 28c754958c46ffee194a411b0fe995c99fb8e9fe7bce78a30113063311d690d591f4ac6d2ef3855384fbc71e46562477de4981173eb938cc5318c5339c72253e
7
+ data.tar.gz: fab0ce827f49744c698ff9522aa68dcca1d64c73ae1ba9a453297d2fbb3ca5f65fa9d06a15830cc6e5f4c1e1b301b8ecdb0aead95ed368423f7f728aa3058cf2
data/CHANGELOG.md CHANGED
@@ -7,6 +7,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.4.1.pre] - 2026-03-08
11
+
12
+ ### Added
13
+
14
+ - `center:` variant on App layout component — `kui(:app, center: true)` applies full-viewport centering for login pages and similar single-focus layouts
15
+ - `kui_tag` / `appui_tag` helpers — collapse the common `content_tag` + `kiso_prepare_options` + theme rendering boilerplate into a single call; component generator templates now use `appui_tag` by default
16
+ - Shade scale auto-wiring — host apps defining `--color-primary-50` through `--color-primary-950` in their Tailwind `@theme` block now automatically feed into Kiso's semantic color tokens (shade 500 for light mode, 400 for dark mode, matching Nuxt UI conventions)
17
+
18
+ ### Fixed
19
+
20
+ - Palette CSS files are now importable in host apps — a `kiso:palettes` rake task generates CSS stubs so `@import "../builds/tailwind/kiso/palettes/blue.css"` resolves correctly
21
+
22
+ ## [0.4.0.pre] - 2026-03-08
23
+
24
+ ### Added
25
+
26
+ - Layout component family: App, Container (4 size variants), Header, Footer, Main
27
+ - Page component family: Page (grid with sidebars), PageHeader, PageBody, PageSection, PageGrid, PageCard (4 variants)
28
+ - `appui()` helper for host app components with `app/themes/` and `app/views/components/`
29
+ - `kiso:framework_component` generator for scaffolding engine components
30
+ - `kiso:component` generator for scaffolding host app components
31
+ - Theme presets: `apply_preset(:rounded)` and `apply_preset(:sharp)`
32
+ - 5 OKLCH color palettes (zinc, blue, green, orange, violet)
33
+ - i18n support: all component strings use `t()` with `config/locales/en.yml`
34
+ - [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
35
+ - [Detailed release notes](/releases/batch-merge) with upgrade guide and examples for all new features
36
+
10
37
  ## [0.3.0.pre] - 2026-03-03
11
38
 
12
39
  ### Added
@@ -85,7 +112,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
85
112
  - Lookbook component previews
86
113
  - Bridgetown documentation site
87
114
 
88
- [Unreleased]: https://github.com/steveclarke/kiso/compare/v0.3.0.pre...HEAD
115
+ [Unreleased]: https://github.com/steveclarke/kiso/compare/v0.4.1.pre...HEAD
116
+ [0.4.1.pre]: https://github.com/steveclarke/kiso/releases/tag/v0.4.1.pre
117
+ [0.4.0.pre]: https://github.com/steveclarke/kiso/releases/tag/v0.4.0.pre
89
118
  [0.3.0.pre]: https://github.com/steveclarke/kiso/releases/tag/v0.3.0.pre
90
119
  [0.2.2.pre]: https://github.com/steveclarke/kiso/releases/tag/v0.2.2.pre
91
120
  [0.2.1.pre]: https://github.com/steveclarke/kiso/releases/tag/v0.2.1.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
 
@@ -16,7 +16,8 @@
16
16
  Count carefully — wrong paths fail SILENTLY (classes just won't generate). */
17
17
  @source "../../../views"; /* → app/views */
18
18
  @source "../../../helpers"; /* → app/helpers */
19
- @source "../../../../lib/kiso/themes"; /* → lib/kiso/themes */
19
+ @source "../../../../lib/kiso/themes"; /* → lib/kiso/themes */
20
+ @source "../../../../lib/kiso/presets"; /* → lib/kiso/presets */
20
21
 
21
22
  /* === Geist Font (by Vercel) ===
22
23
  Self-hosted variable fonts — no CDN dependency.
@@ -50,29 +51,40 @@
50
51
  Purpose-named tokens that flip in dark mode. Components use bg-primary,
51
52
  text-foreground, etc. — never raw palette shades or dark: prefixes.
52
53
 
53
- Override any token in your app's CSS to retheme:
54
- @theme { --color-primary: var(--color-violet-600); }
54
+ Two ways to customize brand colors:
55
+
56
+ 1. Define a shade scale (Tailwind-native):
57
+ @theme {
58
+ --color-primary-50: oklch(...);
59
+ --color-primary-500: oklch(...);
60
+ --color-primary-950: oklch(...);
61
+ }
62
+ Kiso auto-wires: shade 500 for light mode, shade 400 for dark mode,
63
+ shade 50 for foreground (light), shade 950 for foreground (dark).
64
+
65
+ 2. Override the semantic token directly:
66
+ @theme { --color-primary: oklch(0.55 0.10 237); }
55
67
  */
56
68
 
57
69
  @theme {
58
- /* Brand / action colors */
59
- --color-primary: var(--color-sky-600);
60
- --color-primary-foreground: white;
70
+ /* Brand / action colors — auto-wire from shade scale, fall back to defaults */
71
+ --color-primary: var(--color-primary-500, var(--color-rose-500));
72
+ --color-primary-foreground: var(--color-primary-50, white);
61
73
 
62
- --color-secondary: var(--color-teal-600);
63
- --color-secondary-foreground: white;
74
+ --color-secondary: var(--color-secondary-500, var(--color-teal-600));
75
+ --color-secondary-foreground: var(--color-secondary-50, white);
64
76
 
65
- --color-success: var(--color-green-600);
66
- --color-success-foreground: white;
77
+ --color-success: var(--color-success-500, var(--color-green-600));
78
+ --color-success-foreground: var(--color-success-50, white);
67
79
 
68
- --color-info: var(--color-sky-600);
69
- --color-info-foreground: white;
80
+ --color-info: var(--color-info-500, var(--color-sky-600));
81
+ --color-info-foreground: var(--color-info-50, white);
70
82
 
71
- --color-warning: var(--color-amber-500);
72
- --color-warning-foreground: var(--color-amber-950);
83
+ --color-warning: var(--color-warning-500, var(--color-amber-500));
84
+ --color-warning-foreground: var(--color-warning-950, var(--color-amber-950));
73
85
 
74
- --color-error: var(--color-red-600);
75
- --color-error-foreground: white;
86
+ --color-error: var(--color-error-500, var(--color-red-600));
87
+ --color-error-foreground: var(--color-error-50, white);
76
88
 
77
89
  /* Surface tokens */
78
90
  --color-background: white;
@@ -99,23 +111,23 @@
99
111
  Redefine tokens under .dark — components never use dark: prefixes. */
100
112
 
101
113
  .dark {
102
- --color-primary: var(--color-blue-400);
103
- --color-primary-foreground: var(--color-zinc-950);
114
+ --color-primary: var(--color-primary-400, var(--color-rose-400));
115
+ --color-primary-foreground: var(--color-primary-950, var(--color-zinc-950));
104
116
 
105
- --color-secondary: var(--color-teal-400);
106
- --color-secondary-foreground: var(--color-zinc-950);
117
+ --color-secondary: var(--color-secondary-400, var(--color-teal-400));
118
+ --color-secondary-foreground: var(--color-secondary-950, var(--color-zinc-950));
107
119
 
108
- --color-success: var(--color-green-400);
109
- --color-success-foreground: var(--color-zinc-950);
120
+ --color-success: var(--color-success-400, var(--color-green-400));
121
+ --color-success-foreground: var(--color-success-950, var(--color-zinc-950));
110
122
 
111
- --color-info: var(--color-sky-400);
112
- --color-info-foreground: var(--color-zinc-950);
123
+ --color-info: var(--color-info-400, var(--color-sky-400));
124
+ --color-info-foreground: var(--color-info-950, var(--color-zinc-950));
113
125
 
114
- --color-warning: var(--color-amber-400);
115
- --color-warning-foreground: var(--color-zinc-950);
126
+ --color-warning: var(--color-warning-400, var(--color-amber-400));
127
+ --color-warning-foreground: var(--color-warning-950, var(--color-zinc-950));
116
128
 
117
- --color-error: var(--color-red-400);
118
- --color-error-foreground: var(--color-zinc-950);
129
+ --color-error: var(--color-error-400, var(--color-red-400));
130
+ --color-error-foreground: var(--color-error-950, var(--color-zinc-950));
119
131
 
120
132
  --color-background: var(--color-zinc-950);
121
133
  --color-foreground: var(--color-zinc-50);
@@ -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 "../builds/tailwind/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 "../builds/tailwind/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 "../builds/tailwind/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 "../builds/tailwind/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 "../builds/tailwind/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,63 @@
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
+
53
+ # Renders a themed HTML element for host app components.
54
+ #
55
+ # Identical to {ComponentHelper#kui_tag} — provided as a naming
56
+ # convenience so host app partials use +appui_tag+ alongside +appui()+.
57
+ #
58
+ # @see ComponentHelper#kui_tag
59
+ def appui_tag(...)
60
+ kui_tag(...)
61
+ end
62
+ end
63
+ end