lightning_ui_kit 0.3.1 → 0.3.3

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 (84) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +30 -0
  3. data/app/assets/stylesheets/lightning_ui_kit/application.css +58 -0
  4. data/app/assets/stylesheets/lightning_ui_kit/themes.css +133 -0
  5. data/app/assets/vendor/lightning_ui_kit.css +415 -374
  6. data/app/assets/vendor/lightning_ui_kit.js +2 -2
  7. data/app/components/lightning_ui_kit/alert_component.rb +1 -1
  8. data/app/components/lightning_ui_kit/avatar_component.html.erb +1 -1
  9. data/app/components/lightning_ui_kit/badge_component.rb +14 -14
  10. data/app/components/lightning_ui_kit/banner_component.html.erb +1 -1
  11. data/app/components/lightning_ui_kit/banner_component.rb +3 -3
  12. data/app/components/lightning_ui_kit/button_component.rb +16 -16
  13. data/app/components/lightning_ui_kit/checkbox_component.html.erb +10 -10
  14. data/app/components/lightning_ui_kit/combobox_component.html.erb +14 -14
  15. data/app/components/lightning_ui_kit/combobox_component.rb +4 -4
  16. data/app/components/lightning_ui_kit/description_list/item_component.html.erb +2 -2
  17. data/app/components/lightning_ui_kit/dropdown_component.html.erb +2 -2
  18. data/app/components/lightning_ui_kit/dropdown_component.rb +1 -1
  19. data/app/components/lightning_ui_kit/dropzone_component.html.erb +13 -13
  20. data/app/components/lightning_ui_kit/dropzone_component.rb +1 -1
  21. data/app/components/lightning_ui_kit/file_input_component.html.erb +2 -2
  22. data/app/components/lightning_ui_kit/file_input_component.rb +3 -3
  23. data/app/components/lightning_ui_kit/input_component.html.erb +2 -2
  24. data/app/components/lightning_ui_kit/input_component.rb +9 -9
  25. data/app/components/lightning_ui_kit/layout_component.html.erb +10 -10
  26. data/app/components/lightning_ui_kit/modal_component.html.erb +4 -4
  27. data/app/components/lightning_ui_kit/pagination_component.html.erb +3 -3
  28. data/app/components/lightning_ui_kit/pagination_component.rb +14 -5
  29. data/app/components/lightning_ui_kit/select_component.html.erb +3 -3
  30. data/app/components/lightning_ui_kit/select_component.rb +3 -3
  31. data/app/components/lightning_ui_kit/sidebar_link_component.html.erb +1 -1
  32. data/app/components/lightning_ui_kit/sidebar_link_component.rb +11 -7
  33. data/app/components/lightning_ui_kit/sidebar_section_component.rb +1 -1
  34. data/app/components/lightning_ui_kit/skeleton_component.html.erb +2 -2
  35. data/app/components/lightning_ui_kit/spinner_component.html.erb +5 -4
  36. data/app/components/lightning_ui_kit/switch_component.html.erb +2 -2
  37. data/app/components/lightning_ui_kit/switch_component.rb +7 -7
  38. data/app/components/lightning_ui_kit/table_component.html.erb +7 -7
  39. data/app/components/lightning_ui_kit/text_component.rb +1 -1
  40. data/app/components/lightning_ui_kit/textarea_component.html.erb +2 -2
  41. data/app/components/lightning_ui_kit/textarea_component.rb +3 -3
  42. data/app/components/lightning_ui_kit/toast_component.html.erb +3 -3
  43. data/app/components/lightning_ui_kit/tooltip_component.html.erb +2 -2
  44. data/app/javascript/lightning_ui_kit/controllers/combobox_controller.js +2 -2
  45. data/app/javascript/lightning_ui_kit/controllers/dropzone_controller.js +1 -1
  46. data/lib/lightning_ui_kit/builder.rb +56 -56
  47. data/lib/lightning_ui_kit/version.rb +1 -1
  48. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/bigdecimal-3.2.2/bigdecimal.so +0 -0
  49. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/bigdecimal-3.2.2/gem_make.out +5 -5
  50. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/bigdecimal-3.2.2/mkmf.log +3 -3
  51. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/date-3.4.1/date_core.so +0 -0
  52. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/date-3.4.1/gem_make.out +5 -5
  53. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/erb-5.0.2/erb/escape.so +0 -0
  54. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/erb-5.0.2/gem_make.out +5 -5
  55. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/io-console-0.8.1/gem_make.out +5 -5
  56. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/io-console-0.8.1/io/console.so +0 -0
  57. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/json-2.18.0/gem_make.out +5 -5
  58. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/json-2.18.0/json/ext/generator.so +0 -0
  59. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/json-2.18.0/json/ext/parser.so +0 -0
  60. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/nio4r-2.7.4/gem_make.out +5 -5
  61. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/nio4r-2.7.4/nio4r_ext.so +0 -0
  62. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/prism-1.8.0/gem_make.out +5 -5
  63. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/prism-1.8.0/prism/prism.so +0 -0
  64. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/psych-5.2.6/gem_make.out +5 -5
  65. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/psych-5.2.6/psych.so +0 -0
  66. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/racc-1.8.1/gem_make.out +5 -5
  67. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/racc-1.8.1/racc/cparse.so +0 -0
  68. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/stringio-3.1.7/gem_make.out +5 -5
  69. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/stringio-3.1.7/stringio.so +0 -0
  70. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/websocket-driver-0.8.0/gem_make.out +5 -5
  71. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/websocket-driver-0.8.0/websocket_mask.so +0 -0
  72. data/vendor/bundle/ruby/3.4.0/gems/bigdecimal-3.2.2/lib/bigdecimal.so +0 -0
  73. data/vendor/bundle/ruby/3.4.0/gems/date-3.4.1/lib/date_core.so +0 -0
  74. data/vendor/bundle/ruby/3.4.0/gems/erb-5.0.2/lib/erb/escape.so +0 -0
  75. data/vendor/bundle/ruby/3.4.0/gems/io-console-0.8.1/lib/io/console.so +0 -0
  76. data/vendor/bundle/ruby/3.4.0/gems/json-2.18.0/lib/json/ext/generator.so +0 -0
  77. data/vendor/bundle/ruby/3.4.0/gems/json-2.18.0/lib/json/ext/parser.so +0 -0
  78. data/vendor/bundle/ruby/3.4.0/gems/nio4r-2.7.4/lib/nio4r_ext.so +0 -0
  79. data/vendor/bundle/ruby/3.4.0/gems/prism-1.8.0/lib/prism/prism.so +0 -0
  80. data/vendor/bundle/ruby/3.4.0/gems/psych-5.2.6/lib/psych.so +0 -0
  81. data/vendor/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/cparse.so +0 -0
  82. data/vendor/bundle/ruby/3.4.0/gems/stringio-3.1.7/lib/stringio.so +0 -0
  83. data/vendor/bundle/ruby/3.4.0/gems/websocket-driver-0.8.0/lib/websocket_mask.so +0 -0
  84. metadata +2 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 03ad660a5df33754b3f468fbba5b82cb67c1a284d43d84b980c8d85a835d6e15
4
- data.tar.gz: 565ad6bb20e7e2060d3b7937386a1001dd89c568f8d19c98669e946d0763a8ac
3
+ metadata.gz: '089bcfcdadfc3260d27dda5d1db22666a32697e1446d5786088ce1520609d75d'
4
+ data.tar.gz: b690d324938ae0a2e906336ba02fda621f3160dcaadcb9aafef0cfa2df37339f
5
5
  SHA512:
6
- metadata.gz: 67dfd0d0a6207aab34dc4a21b5c3c3da2fb34282553ce141a1b8614726a8736a28d20a28790044151b2ea7eb2eec474dc1b1a7fd182abd62c291dbc44cec9551
7
- data.tar.gz: d936c5ed4b0275dbe3b1def5e8268bbdea8f991b2d730823e263f20faed66d81e1adc797b837c728fc76f8a70c608ca899d640b2acd2bd4432ac39c533df524f
6
+ metadata.gz: 662f686176b974c57953419eea45650402f3bce057256d756fd3f9dc77a5ecfdd07ac6882ca1b05ccf1e3dddec3e9c19a4a6786e313e10ad0084e04d791058c3
7
+ data.tar.gz: fdd96831b55658d94dee59302a2c0a1ec9ca00501de41e2caf9e56e78e316e10c103352a4aade79f436b31597442913c332258927aebddc5b7184d3133c55cb1
data/README.md CHANGED
@@ -94,6 +94,36 @@ You can also use the standard ViewComponent render syntax:
94
94
  <%= render LightningUiKit::ButtonComponent.new { "Click me" } %>
95
95
  ```
96
96
 
97
+ ## Theming
98
+
99
+ LightningUiKit supports theming via CSS custom properties. All components use semantic design tokens instead of hardcoded colors.
100
+
101
+ ### Built-in Themes
102
+
103
+ - **Light** (default) — applied automatically
104
+ - **Dark** — add `class="lui-theme-dark"` to a container element
105
+
106
+ ```erb
107
+ <body class="lui-theme-dark">
108
+ <%= lui.button { "Dark themed" } %>
109
+ </body>
110
+ ```
111
+
112
+ ### Custom Themes
113
+
114
+ Override `--lui-theme-*` CSS variables to create your own theme:
115
+
116
+ ```css
117
+ .my-brand-theme {
118
+ --lui-theme-surface: oklch(0.98 0.01 250);
119
+ --lui-theme-foreground: oklch(0.2 0.02 250);
120
+ --lui-theme-interactive: oklch(0.6 0.2 250);
121
+ /* See themes.css for all available tokens */
122
+ }
123
+ ```
124
+
125
+ Full token definitions are in `app/assets/stylesheets/lightning_ui_kit/themes.css`.
126
+
97
127
  ## Contributing
98
128
 
99
129
  Bug reports and pull requests are welcome
@@ -1 +1,59 @@
1
1
  @import "tailwindcss" prefix(lui);
2
+ @import "./themes.css";
3
+
4
+ @theme inline {
5
+ --color-surface: var(--lui-theme-surface);
6
+ --color-surface-secondary: var(--lui-theme-surface-secondary);
7
+ --color-surface-tertiary: var(--lui-theme-surface-tertiary);
8
+ --color-surface-aside: var(--lui-theme-surface-aside);
9
+ --color-surface-input: var(--lui-theme-surface-input);
10
+ --color-surface-invert: var(--lui-theme-surface-invert);
11
+ --color-surface-overlay: var(--lui-theme-surface-overlay);
12
+ --color-surface-hover: var(--lui-theme-surface-hover);
13
+
14
+ --color-foreground: var(--lui-theme-foreground);
15
+ --color-foreground-secondary: var(--lui-theme-foreground-secondary);
16
+ --color-foreground-muted: var(--lui-theme-foreground-muted);
17
+ --color-foreground-faint: var(--lui-theme-foreground-faint);
18
+ --color-foreground-invert: var(--lui-theme-foreground-invert);
19
+
20
+ --color-border: var(--lui-theme-border);
21
+ --color-border-hover: var(--lui-theme-border-hover);
22
+ --color-border-strong: var(--lui-theme-border-strong);
23
+ --color-border-subtle: var(--lui-theme-border-subtle);
24
+ --color-border-invert: var(--lui-theme-border-invert);
25
+
26
+ --color-focus: var(--lui-theme-focus);
27
+ --color-interactive: var(--lui-theme-interactive);
28
+ --color-interactive-subtle: var(--lui-theme-interactive-subtle);
29
+
30
+ --color-destructive: var(--lui-theme-destructive);
31
+ --color-destructive-border: var(--lui-theme-destructive-border);
32
+ --color-destructive-text: var(--lui-theme-destructive-text);
33
+
34
+ --color-success-bg: var(--lui-theme-success-bg);
35
+ --color-success-indicator: var(--lui-theme-success-indicator);
36
+ --color-success-text: var(--lui-theme-success-text);
37
+
38
+ --color-warning-bg: var(--lui-theme-warning-bg);
39
+ --color-warning-indicator: var(--lui-theme-warning-indicator);
40
+ --color-warning-text: var(--lui-theme-warning-text);
41
+
42
+ --color-tooltip-bg: var(--lui-theme-tooltip-bg);
43
+ --color-tooltip-text: var(--lui-theme-tooltip-text);
44
+
45
+ --color-neutral-bg: var(--lui-theme-neutral-bg);
46
+ --color-neutral-text: var(--lui-theme-neutral-text);
47
+
48
+ --color-spinner-primary: var(--lui-theme-spinner-primary);
49
+ --color-spinner-secondary: var(--lui-theme-spinner-secondary);
50
+
51
+ --animate-icon-bounce: icon-bounce 350ms ease-out;
52
+ }
53
+
54
+ @keyframes icon-bounce {
55
+ 0% { scale: 1; }
56
+ 40% { scale: 1.2; }
57
+ 70% { scale: 0.95; }
58
+ 100% { scale: 1; }
59
+ }
@@ -0,0 +1,133 @@
1
+ /*
2
+ * LightningUiKit Theme Tokens
3
+ *
4
+ * Semantic design tokens using CSS custom properties.
5
+ * Override these variables to create custom themes — no rebuild needed.
6
+ *
7
+ * Apply themes via CSS class on any container element:
8
+ * <body class="lui-theme-dark">
9
+ *
10
+ * Create custom themes by overriding variables:
11
+ * .lui-theme-brand {
12
+ * --lui-theme-interactive: oklch(0.6 0.2 150);
13
+ * --lui-theme-surface: oklch(0.98 0.01 150);
14
+ * }
15
+ */
16
+
17
+ /* ===== Default (Light) Theme ===== */
18
+ :root {
19
+ /* Surface */
20
+ --lui-theme-surface: #fff;
21
+ --lui-theme-surface-secondary: oklch(0.985 0 0);
22
+ --lui-theme-surface-tertiary: oklch(0.967 0.001 286.375);
23
+ --lui-theme-surface-aside: oklch(0.967 0.001 286.375);
24
+ --lui-theme-surface-input: #fff;
25
+ --lui-theme-surface-invert: oklch(0.21 0.006 285.885);
26
+ --lui-theme-surface-overlay: oklch(0.141 0.005 285.823 / 25%);
27
+ --lui-theme-surface-hover: oklch(0.141 0.005 285.823 / 5%);
28
+
29
+ /* Foreground */
30
+ --lui-theme-foreground: oklch(0.141 0.005 285.823);
31
+ --lui-theme-foreground-secondary: oklch(0.442 0.017 285.786);
32
+ --lui-theme-foreground-muted: oklch(0.552 0.016 285.938);
33
+ --lui-theme-foreground-faint: oklch(0.705 0.015 286.067);
34
+ --lui-theme-foreground-invert: #fff;
35
+
36
+ /* Border */
37
+ --lui-theme-border: oklch(0.141 0.005 285.823 / 10%);
38
+ --lui-theme-border-hover: oklch(0.141 0.005 285.823 / 20%);
39
+ --lui-theme-border-strong: oklch(0.141 0.005 285.823 / 15%);
40
+ --lui-theme-border-subtle: oklch(0.141 0.005 285.823 / 5%);
41
+ --lui-theme-border-invert: oklch(0.141 0.005 285.823 / 90%);
42
+
43
+ /* Interactive */
44
+ --lui-theme-focus: oklch(0.623 0.214 259.815);
45
+ --lui-theme-interactive: oklch(0.546 0.245 262.881);
46
+ --lui-theme-interactive-subtle: oklch(0.97 0.014 254.604);
47
+
48
+ /* Destructive */
49
+ --lui-theme-destructive: oklch(0.577 0.245 27.325);
50
+ --lui-theme-destructive-border: oklch(0.637 0.237 25.331);
51
+ --lui-theme-destructive-text: oklch(0.577 0.245 27.325);
52
+
53
+ /* Success */
54
+ --lui-theme-success-bg: oklch(0.925 0.084 155.995);
55
+ --lui-theme-success-indicator: oklch(0.627 0.194 149.214);
56
+ --lui-theme-success-text: oklch(0.45 0.13 150);
57
+
58
+ /* Warning */
59
+ --lui-theme-warning-bg: oklch(0.945 0.129 101.54);
60
+ --lui-theme-warning-indicator: oklch(0.852 0.199 91.936);
61
+ --lui-theme-warning-text: oklch(0.53 0.14 70);
62
+
63
+ /* Tooltip */
64
+ --lui-theme-tooltip-bg: oklch(0.274 0.006 286.033);
65
+ --lui-theme-tooltip-text: #fff;
66
+
67
+ /* Neutral */
68
+ --lui-theme-neutral-bg: oklch(0.985 0.002 247.839);
69
+ --lui-theme-neutral-text: oklch(0.278 0.033 256.848);
70
+
71
+ /* Spinner */
72
+ --lui-theme-spinner-primary: oklch(0.552 0.016 285.938);
73
+ --lui-theme-spinner-secondary: oklch(0.872 0.01 258.338);
74
+ }
75
+
76
+ /* ===== Dark Theme ===== */
77
+ .lui-theme-dark {
78
+ /* Surface */
79
+ --lui-theme-surface: oklch(0.141 0.005 285.823);
80
+ --lui-theme-surface-secondary: oklch(0.21 0.006 285.885);
81
+ --lui-theme-surface-tertiary: oklch(0.274 0.006 286.033);
82
+ --lui-theme-surface-aside: oklch(0.13 0.004 285.823);
83
+ --lui-theme-surface-input: color-mix(in oklab, white 5%, transparent);
84
+ --lui-theme-surface-invert: oklch(0.985 0 0);
85
+ --lui-theme-surface-overlay: oklch(0 0 0 / 50%);
86
+ --lui-theme-surface-hover: oklch(1 0 0 / 7%);
87
+
88
+ /* Foreground */
89
+ --lui-theme-foreground: oklch(0.985 0 0);
90
+ --lui-theme-foreground-secondary: oklch(0.705 0.015 286.067);
91
+ --lui-theme-foreground-muted: oklch(0.552 0.016 285.938);
92
+ --lui-theme-foreground-faint: oklch(0.442 0.017 285.786);
93
+ --lui-theme-foreground-invert: oklch(0.141 0.005 285.823);
94
+
95
+ /* Border */
96
+ --lui-theme-border: oklch(1 0 0 / 10%);
97
+ --lui-theme-border-hover: oklch(1 0 0 / 20%);
98
+ --lui-theme-border-strong: oklch(1 0 0 / 15%);
99
+ --lui-theme-border-subtle: oklch(1 0 0 / 5%);
100
+ --lui-theme-border-invert: oklch(1 0 0 / 90%);
101
+
102
+ /* Interactive */
103
+ --lui-theme-focus: oklch(0.623 0.214 259.815);
104
+ --lui-theme-interactive: oklch(0.623 0.214 259.815);
105
+ --lui-theme-interactive-subtle: oklch(0.546 0.245 262.881 / 20%);
106
+
107
+ /* Destructive */
108
+ --lui-theme-destructive: oklch(0.637 0.237 25.331);
109
+ --lui-theme-destructive-border: oklch(0.637 0.237 25.331);
110
+ --lui-theme-destructive-text: oklch(0.637 0.237 25.331);
111
+
112
+ /* Success */
113
+ --lui-theme-success-bg: oklch(0.627 0.194 149.214 / 25%);
114
+ --lui-theme-success-indicator: oklch(0.627 0.194 149.214);
115
+ --lui-theme-success-text: oklch(0.76 0.16 150);
116
+
117
+ /* Warning */
118
+ --lui-theme-warning-bg: oklch(0.852 0.199 91.936 / 25%);
119
+ --lui-theme-warning-indicator: oklch(0.852 0.199 91.936);
120
+ --lui-theme-warning-text: oklch(0.82 0.15 85);
121
+
122
+ /* Tooltip */
123
+ --lui-theme-tooltip-bg: oklch(0.92 0.004 286.32);
124
+ --lui-theme-tooltip-text: oklch(0.141 0.005 285.823);
125
+
126
+ /* Neutral */
127
+ --lui-theme-neutral-bg: oklch(0.274 0.006 286.033);
128
+ --lui-theme-neutral-text: oklch(0.871 0.006 286.286);
129
+
130
+ /* Spinner */
131
+ --lui-theme-spinner-primary: oklch(0.705 0.015 286.067);
132
+ --lui-theme-spinner-secondary: oklch(0.442 0.017 285.786);
133
+ }