lightning_ui_kit 0.3.1 → 0.3.2
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.
- checksums.yaml +4 -4
- data/README.md +30 -0
- data/app/assets/stylesheets/lightning_ui_kit/application.css +58 -0
- data/app/assets/stylesheets/lightning_ui_kit/themes.css +133 -0
- data/app/components/lightning_ui_kit/alert_component.rb +1 -1
- data/app/components/lightning_ui_kit/avatar_component.html.erb +1 -1
- data/app/components/lightning_ui_kit/badge_component.rb +14 -14
- data/app/components/lightning_ui_kit/banner_component.html.erb +1 -1
- data/app/components/lightning_ui_kit/banner_component.rb +3 -3
- data/app/components/lightning_ui_kit/button_component.rb +16 -16
- data/app/components/lightning_ui_kit/checkbox_component.html.erb +10 -10
- data/app/components/lightning_ui_kit/combobox_component.html.erb +14 -14
- data/app/components/lightning_ui_kit/combobox_component.rb +4 -4
- data/app/components/lightning_ui_kit/description_list/item_component.html.erb +2 -2
- data/app/components/lightning_ui_kit/dropdown_component.html.erb +2 -2
- data/app/components/lightning_ui_kit/dropdown_component.rb +1 -1
- data/app/components/lightning_ui_kit/dropzone_component.html.erb +13 -13
- data/app/components/lightning_ui_kit/dropzone_component.rb +1 -1
- data/app/components/lightning_ui_kit/file_input_component.html.erb +2 -2
- data/app/components/lightning_ui_kit/file_input_component.rb +3 -3
- data/app/components/lightning_ui_kit/input_component.html.erb +2 -2
- data/app/components/lightning_ui_kit/input_component.rb +9 -9
- data/app/components/lightning_ui_kit/layout_component.html.erb +10 -10
- data/app/components/lightning_ui_kit/modal_component.html.erb +4 -4
- data/app/components/lightning_ui_kit/pagination_component.html.erb +3 -3
- data/app/components/lightning_ui_kit/pagination_component.rb +14 -5
- data/app/components/lightning_ui_kit/select_component.html.erb +3 -3
- data/app/components/lightning_ui_kit/select_component.rb +3 -3
- data/app/components/lightning_ui_kit/sidebar_link_component.html.erb +1 -1
- data/app/components/lightning_ui_kit/sidebar_link_component.rb +11 -7
- data/app/components/lightning_ui_kit/sidebar_section_component.rb +1 -1
- data/app/components/lightning_ui_kit/skeleton_component.html.erb +2 -2
- data/app/components/lightning_ui_kit/spinner_component.html.erb +5 -4
- data/app/components/lightning_ui_kit/switch_component.html.erb +2 -2
- data/app/components/lightning_ui_kit/switch_component.rb +7 -7
- data/app/components/lightning_ui_kit/table_component.html.erb +7 -7
- data/app/components/lightning_ui_kit/text_component.rb +1 -1
- data/app/components/lightning_ui_kit/textarea_component.html.erb +2 -2
- data/app/components/lightning_ui_kit/textarea_component.rb +3 -3
- data/app/components/lightning_ui_kit/toast_component.html.erb +3 -3
- data/app/components/lightning_ui_kit/tooltip_component.html.erb +2 -2
- data/app/javascript/lightning_ui_kit/controllers/combobox_controller.js +2 -2
- data/app/javascript/lightning_ui_kit/controllers/dropzone_controller.js +1 -1
- data/lib/lightning_ui_kit/builder.rb +56 -56
- data/lib/lightning_ui_kit/version.rb +1 -1
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/bigdecimal-3.2.2/bigdecimal.so +0 -0
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/bigdecimal-3.2.2/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/bigdecimal-3.2.2/mkmf.log +3 -3
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/date-3.4.1/date_core.so +0 -0
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/date-3.4.1/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/erb-5.0.2/erb/escape.so +0 -0
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/erb-5.0.2/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/io-console-0.8.1/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/io-console-0.8.1/io/console.so +0 -0
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/json-2.18.0/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/json-2.18.0/json/ext/generator.so +0 -0
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/json-2.18.0/json/ext/parser.so +0 -0
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/nio4r-2.7.4/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/nio4r-2.7.4/nio4r_ext.so +0 -0
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/prism-1.8.0/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/prism-1.8.0/prism/prism.so +0 -0
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/psych-5.2.6/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/psych-5.2.6/psych.so +0 -0
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/racc-1.8.1/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/racc-1.8.1/racc/cparse.so +0 -0
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/stringio-3.1.7/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/stringio-3.1.7/stringio.so +0 -0
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/websocket-driver-0.8.0/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/websocket-driver-0.8.0/websocket_mask.so +0 -0
- data/vendor/bundle/ruby/3.4.0/gems/bigdecimal-3.2.2/lib/bigdecimal.so +0 -0
- data/vendor/bundle/ruby/3.4.0/gems/date-3.4.1/lib/date_core.so +0 -0
- data/vendor/bundle/ruby/3.4.0/gems/erb-5.0.2/lib/erb/escape.so +0 -0
- data/vendor/bundle/ruby/3.4.0/gems/io-console-0.8.1/lib/io/console.so +0 -0
- data/vendor/bundle/ruby/3.4.0/gems/json-2.18.0/lib/json/ext/generator.so +0 -0
- data/vendor/bundle/ruby/3.4.0/gems/json-2.18.0/lib/json/ext/parser.so +0 -0
- data/vendor/bundle/ruby/3.4.0/gems/nio4r-2.7.4/lib/nio4r_ext.so +0 -0
- data/vendor/bundle/ruby/3.4.0/gems/prism-1.8.0/lib/prism/prism.so +0 -0
- data/vendor/bundle/ruby/3.4.0/gems/psych-5.2.6/lib/psych.so +0 -0
- data/vendor/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/cparse.so +0 -0
- data/vendor/bundle/ruby/3.4.0/gems/stringio-3.1.7/lib/stringio.so +0 -0
- data/vendor/bundle/ruby/3.4.0/gems/websocket-driver-0.8.0/lib/websocket_mask.so +0 -0
- metadata +2 -3
- data/app/assets/vendor/lightning_ui_kit.css +0 -3191
- data/app/assets/vendor/lightning_ui_kit.js +0 -12
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7146887cfb0e95944c7e2e8b737b35b9a469ff63aff79e9dedf71aada5490509
|
|
4
|
+
data.tar.gz: 047a1bd54e1f9caf6b79f1fbc94408173f5ed9560bd2501546cee8497501025d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a8cad9be59e10d452f31d9fb747f6c9b1dc2df818dace1a3c6937bd0751c1ac6023d673578cc5f64989371473dc6d2233366990d1f0209edc707b5d52a4e32b3
|
|
7
|
+
data.tar.gz: c5416b27c5805d22ed015ed4b11d855701de1a99bf248bd1a3441a376c762b887b4711d2365fa47eaaaa99c0b36a46788fe0dcaa25fa1a979f76f493cd5931e4
|
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
|
+
}
|
|
@@ -5,7 +5,7 @@ class LightningUiKit::AlertComponent < LightningUiKit::BaseComponent
|
|
|
5
5
|
end
|
|
6
6
|
|
|
7
7
|
def default_classes
|
|
8
|
-
"lui:flex lui:items-center lui:p-4 lui:text-sm lui:text-
|
|
8
|
+
"lui:flex lui:items-center lui:p-4 lui:text-sm lui:text-neutral-text lui:rounded-lg lui:bg-neutral-bg"
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
def classes
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
class: class_names(
|
|
3
3
|
"lui:inline-grid lui:shrink-0 lui:align-middle lui:[--avatar-radius:20%] lui:[--ring-opacity:20%] *:lui:col-start-1 *:lui:row-start-1 lui:outline lui:-outline-offset-1 lui:outline-black/(--ring-opacity)",
|
|
4
4
|
SIZE_CLASSES.fetch(@size, SIZE_CLASSES[:md]),
|
|
5
|
-
@initials ? "lui:text-
|
|
5
|
+
@initials ? "lui:text-foreground-invert lui:bg-surface-invert" : "lui:text-foreground-muted lui:bg-surface-tertiary",
|
|
6
6
|
@square ? "lui:rounded-(--avatar-radius) lui:*:rounded-(--avatar-radius)" : "lui:rounded-full lui:*:rounded-full",
|
|
7
7
|
@options[:class]
|
|
8
8
|
),
|
|
@@ -7,13 +7,13 @@ class LightningUiKit::BadgeComponent < LightningUiKit::BaseComponent
|
|
|
7
7
|
def classes
|
|
8
8
|
status_classes = case @status
|
|
9
9
|
when :success
|
|
10
|
-
"lui:bg-
|
|
10
|
+
"lui:bg-success-bg lui:text-success-text"
|
|
11
11
|
when :warning
|
|
12
|
-
"lui:bg-
|
|
12
|
+
"lui:bg-warning-bg lui:text-warning-text"
|
|
13
13
|
when :error
|
|
14
|
-
"lui:bg-
|
|
14
|
+
"lui:bg-destructive/15 lui:text-destructive-text"
|
|
15
15
|
else
|
|
16
|
-
"lui:bg-
|
|
16
|
+
"lui:bg-foreground-faint/20 lui:text-foreground-muted"
|
|
17
17
|
end
|
|
18
18
|
[defalt_classes, status_classes].join(" ")
|
|
19
19
|
end
|
|
@@ -23,20 +23,20 @@ class LightningUiKit::BadgeComponent < LightningUiKit::BaseComponent
|
|
|
23
23
|
when :complete
|
|
24
24
|
case @status
|
|
25
25
|
when :success
|
|
26
|
-
"lui:bg-
|
|
26
|
+
"lui:bg-success-indicator lui:border-success-indicator"
|
|
27
27
|
when :warning
|
|
28
|
-
"lui:bg-
|
|
28
|
+
"lui:bg-warning-indicator lui:border-warning-indicator"
|
|
29
29
|
when :error
|
|
30
|
-
"lui:bg-
|
|
30
|
+
"lui:bg-destructive lui:border-destructive"
|
|
31
31
|
else
|
|
32
|
-
"lui:bg-
|
|
32
|
+
"lui:bg-foreground-faint lui:border-foreground-faint"
|
|
33
33
|
end
|
|
34
34
|
when :incomplete
|
|
35
35
|
case @status
|
|
36
36
|
when :error
|
|
37
|
-
"lui:bg-transparent lui:border-
|
|
37
|
+
"lui:bg-transparent lui:border-foreground-invert"
|
|
38
38
|
else
|
|
39
|
-
"lui:bg-transparent lui:border-
|
|
39
|
+
"lui:bg-transparent lui:border-foreground-faint"
|
|
40
40
|
end
|
|
41
41
|
when :partialy_complete
|
|
42
42
|
partialy_complete_classes = "lui:relative lui:after:w-[3.75px] lui:after:h-[8.2px]\
|
|
@@ -44,13 +44,13 @@ class LightningUiKit::BadgeComponent < LightningUiKit::BaseComponent
|
|
|
44
44
|
lui:after:left-[1px] lui:after:margin-0 lui:after-margin-y-[1px]"
|
|
45
45
|
case @status
|
|
46
46
|
when :success
|
|
47
|
-
"#{partialy_complete_classes} lui:border-
|
|
47
|
+
"#{partialy_complete_classes} lui:border-success-indicator lui:after:border-l-success-indicator lui:after:border-r-success-indicator"
|
|
48
48
|
when :warning
|
|
49
|
-
"#{partialy_complete_classes} lui:border-
|
|
49
|
+
"#{partialy_complete_classes} lui:border-warning-indicator lui:after:border-l-warning-indicator lui:after:border-r-warning-indicator"
|
|
50
50
|
when :error
|
|
51
|
-
"#{partialy_complete_classes} lui:border-
|
|
51
|
+
"#{partialy_complete_classes} lui:border-foreground-invert lui:after:border-l-foreground-invert lui:after:border-r-foreground-invert"
|
|
52
52
|
else
|
|
53
|
-
"#{partialy_complete_classes} lui:border-
|
|
53
|
+
"#{partialy_complete_classes} lui:border-foreground-faint lui:after:border-l-foreground-faint lui:after:border-r-foreground-faint"
|
|
54
54
|
end
|
|
55
55
|
end
|
|
56
56
|
[default_progress_classes, progress_classes].join(" ")
|
|
@@ -10,9 +10,9 @@ class LightningUiKit::BannerComponent < LightningUiKit::BaseComponent
|
|
|
10
10
|
def classes
|
|
11
11
|
type_classes = case @type
|
|
12
12
|
when :error
|
|
13
|
-
"lui:*:data-[slot=header]:bg-
|
|
13
|
+
"lui:*:data-[slot=header]:bg-destructive/80 lui:*:data-[slot=header]:text-foreground-invert"
|
|
14
14
|
else
|
|
15
|
-
"lui:*:data-[slot=header]:bg-
|
|
15
|
+
"lui:*:data-[slot=header]:bg-neutral-bg"
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
merge_classes([default_classes, type_classes, @options[:class]].compact.join(" "))
|
|
@@ -28,6 +28,6 @@ class LightningUiKit::BannerComponent < LightningUiKit::BaseComponent
|
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
def default_classes
|
|
31
|
-
"lui:border lui:border-
|
|
31
|
+
"lui:border lui:border-border lui:rounded-lg lui:overflow-hidden lui:transition-opacity lui:duration-300 lui:ease-out lui:opacity-100"
|
|
32
32
|
end
|
|
33
33
|
end
|
|
@@ -58,12 +58,12 @@ class LightningUiKit::ButtonComponent < LightningUiKit::BaseComponent
|
|
|
58
58
|
end
|
|
59
59
|
|
|
60
60
|
def destructive_classes
|
|
61
|
-
"lui:text-
|
|
62
|
-
lui:[--btn-bg:var(--lui-
|
|
63
|
-
lui:[--btn-border:var(--lui-
|
|
64
|
-
lui:[--btn-hover-overlay:var(--lui-
|
|
65
|
-
lui:[--btn-icon:var(--lui-
|
|
66
|
-
lui:active:[--btn-icon:var(--lui-
|
|
61
|
+
"lui:text-foreground-invert lui:border-destructive-border lui:hover:bg-destructive lui:active:bg-destructive\
|
|
62
|
+
lui:[--btn-bg:var(--lui-theme-destructive)]\
|
|
63
|
+
lui:[--btn-border:var(--lui-theme-destructive-border)]
|
|
64
|
+
lui:[--btn-hover-overlay:var(--lui-theme-foreground-invert)]/10\
|
|
65
|
+
lui:[--btn-icon:var(--lui-theme-foreground-invert)]\
|
|
66
|
+
lui:active:[--btn-icon:var(--lui-theme-foreground-invert)] lui:hover:[--btn-icon:var(--lui-theme-foreground-invert)] lui:cursor-pointer"
|
|
67
67
|
end
|
|
68
68
|
|
|
69
69
|
def default_classes
|
|
@@ -75,21 +75,21 @@ class LightningUiKit::ButtonComponent < LightningUiKit::BaseComponent
|
|
|
75
75
|
lui:after:-z-10 lui:after:rounded-[calc(var(--lui-radius-lg)-1px)] lui:after:shadow-[shadow:inset_0_1px_--theme(--color-white/15%)]\
|
|
76
76
|
lui:active:after:bg-(--btn-hover-overlay) lui:hover:after:bg-(--btn-hover-overlay)\
|
|
77
77
|
lui:disabled:opacity-50 lui:disabled:before:shadow-none lui:disabled:after:shadow-none lui:disabled:hover:after:bg-transparent\
|
|
78
|
-
lui:text-
|
|
79
|
-
lui:[--btn-bg:var(--lui-
|
|
80
|
-
lui:[--btn-border:var(--lui-
|
|
81
|
-
lui:[--btn-hover-overlay:var(--lui-
|
|
82
|
-
lui:[--btn-icon:var(--lui-
|
|
83
|
-
lui:active:[--btn-icon:var(--lui-
|
|
84
|
-
lui:hover:[--btn-icon:var(--lui-
|
|
78
|
+
lui:text-foreground-invert lui:cursor-pointer\
|
|
79
|
+
lui:[--btn-bg:var(--lui-theme-surface-invert)]\
|
|
80
|
+
lui:[--btn-border:var(--lui-theme-border-invert)]
|
|
81
|
+
lui:[--btn-hover-overlay:var(--lui-theme-foreground-invert)]/10\
|
|
82
|
+
lui:[--btn-icon:var(--lui-theme-foreground-faint)]\
|
|
83
|
+
lui:active:[--btn-icon:var(--lui-theme-foreground-muted)]\
|
|
84
|
+
lui:hover:[--btn-icon:var(--lui-theme-foreground-muted)]"
|
|
85
85
|
end
|
|
86
86
|
|
|
87
87
|
def outline_classes
|
|
88
88
|
"lui:relative lui:isolate lui:inline-flex lui:items-baseline lui:justify-center lui:gap-x-2 lui:rounded-lg lui:border lui:px-[calc(--spacing(3.5)-1px)] lui:py-[calc(--spacing(2.5)-1px)] sm:lui:px-[calc(--spacing(3)-1px)]\
|
|
89
89
|
lui:sm:py-[calc(--spacing(1.5)-1px)] lui:focus:outline-hidden lui:focus:outline lui:focus:outline-2 lui:focus:outline-offset-2\
|
|
90
|
-
lui:focus:outline-
|
|
90
|
+
lui:focus:outline-focus lui:disabled:opacity-50 lui:*:data-[slot=icon]:-mx-0.5 lui:*:data-[slot=icon]:my-0.5 lui:*:data-[slot=icon]:size-5\
|
|
91
91
|
lui:*:data-[slot=icon]:shrink-0 lui:*:data-[slot=icon]:self-center lui:*:data-[slot=icon]:text-(--btn-icon) lui:sm:*:data-[slot=icon]:my-1\
|
|
92
|
-
lui:sm:*:data-[slot=icon]:size-4 lui:border-
|
|
93
|
-
lui:[--btn-icon:var(--lui-
|
|
92
|
+
lui:sm:*:data-[slot=icon]:size-4 lui:border-border lui:text-foreground lui:active:bg-surface-hover lui:hover:bg-surface-hover\
|
|
93
|
+
lui:[--btn-icon:var(--lui-theme-foreground-muted)] lui:active:[--btn-icon:var(--lui-theme-foreground-secondary)] lui:hover:[--btn-icon:var(--lui-theme-foreground-secondary)] lui:cursor-pointer"
|
|
94
94
|
end
|
|
95
95
|
end
|
|
@@ -6,19 +6,19 @@
|
|
|
6
6
|
<%= tag.span(data: control_data, class: "lui:group lui:inline-flex lui:focus:outline-hidden", role: "checkbox", aria_checked: "false", tabindex: 0) do %>
|
|
7
7
|
<span class="lui:relative lui:isolate lui:flex lui:size-[1.125rem] lui:items-center lui:justify-center
|
|
8
8
|
lui:rounded-[0.3125rem] lui:sm:size-4 lui:before:absolute lui:before:inset-0 lui:before:-z-10
|
|
9
|
-
lui:before:rounded-[calc(0.3125rem-1px)] lui:before:bg-
|
|
10
|
-
lui:group-data-checked:before:bg-(--checkbox-checked-bg) lui:border lui:border-
|
|
9
|
+
lui:before:rounded-[calc(0.3125rem-1px)] lui:before:bg-surface-input lui:before:shadow-sm
|
|
10
|
+
lui:group-data-checked:before:bg-(--checkbox-checked-bg) lui:border lui:border-border-strong
|
|
11
11
|
lui:group-data-checked:border-transparent lui:group-hover:group-data-checked:border-transparent
|
|
12
|
-
lui:group-hover:border-
|
|
12
|
+
lui:group-hover:border-border-hover lui:group-data-checked:bg-(--checkbox-checked-border)
|
|
13
13
|
lui:after:absolute lui:after:inset-0 lui:after:rounded-[calc(0.3125rem-1px)] lui:after:shadow-[inset_0_1px_--theme(--color-white/15%)]
|
|
14
14
|
lui:group-data-focus:outline lui:group-data-focus:outline-2 lui:group-data-focus:outline-offset-2
|
|
15
|
-
lui:group-data-focus:outline-
|
|
16
|
-
lui:group-data-disabled:bg-
|
|
15
|
+
lui:group-data-focus:outline-focus lui:group-data-disabled:opacity-50 lui:group-data-disabled:border-border-strong
|
|
16
|
+
lui:group-data-disabled:bg-surface-hover lui:group-data-disabled:[--checkbox-check:var(--lui-theme-foreground)]/50
|
|
17
17
|
lui:group-data-disabled:before:bg-transparent lui:forced-colors:[--checkbox-check:HighlightText] lui:forced-colors:[--checkbox-checked-bg:Highlight]
|
|
18
18
|
lui:forced-colors:group-data-disabled:[--checkbox-check:Highlight]
|
|
19
|
-
lui:[--checkbox-check:var(--lui-
|
|
20
|
-
lui:[--checkbox-checked-bg:var(--lui-
|
|
21
|
-
lui:[--checkbox-checked-border:var(--
|
|
19
|
+
lui:[--checkbox-check:var(--lui-theme-foreground-invert)]
|
|
20
|
+
lui:[--checkbox-checked-bg:var(--lui-theme-surface-invert)]
|
|
21
|
+
lui:[--checkbox-checked-border:var(--lui-theme-border-invert)]"
|
|
22
22
|
>
|
|
23
23
|
<svg class="lui:size-4 lui:stroke-(--checkbox-check) lui:opacity-0 lui:group-data-checked:opacity-100 lui:sm:h-3.5 lui:sm:w-3.5" viewBox="0 0 14 14" fill="none">
|
|
24
24
|
<path class="lui:opacity-100 lui:group-data-indeterminate:opacity-0" d="M3 8L6 11L11 3.5" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
@@ -29,14 +29,14 @@
|
|
|
29
29
|
<% if render_label? %>
|
|
30
30
|
<label
|
|
31
31
|
data-slot="label"
|
|
32
|
-
class="lui:text-base/6 lui:text-
|
|
32
|
+
class="lui:text-base/6 lui:text-foreground lui:select-none lui:data-disabled:opacity-50 lui:sm:text-sm/6"
|
|
33
33
|
data-action="click->lui-checkbox#toggle"
|
|
34
34
|
>
|
|
35
35
|
<%= effective_label %>
|
|
36
36
|
</label>
|
|
37
37
|
<% end %>
|
|
38
38
|
<% if @description %>
|
|
39
|
-
<p data-slot="description" class="lui:text-base/6 lui:text-
|
|
39
|
+
<p data-slot="description" class="lui:text-base/6 lui:text-foreground-muted lui:data-disabled:opacity-50 lui:sm:text-sm/6">
|
|
40
40
|
<%= @description %>
|
|
41
41
|
</p>
|
|
42
42
|
<% end %>
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
<% if render_label? %>
|
|
3
3
|
<%= tag.label(
|
|
4
4
|
effective_label,
|
|
5
|
-
class: "lui:text-base/6 lui:text-
|
|
5
|
+
class: "lui:text-base/6 lui:text-foreground lui:select-none lui:data-disabled:opacity-50 lui:sm:text-sm/6",
|
|
6
6
|
data: label_data
|
|
7
7
|
) %>
|
|
8
8
|
<% end %>
|
|
9
9
|
<% if @description %>
|
|
10
10
|
<%= tag.p(
|
|
11
11
|
@description,
|
|
12
|
-
class: "lui:text-base/6 lui:text-
|
|
12
|
+
class: "lui:text-base/6 lui:text-foreground-muted lui:data-disabled:opacity-50 lui:sm:text-sm/6",
|
|
13
13
|
data: description_data
|
|
14
14
|
) %>
|
|
15
15
|
<% end %>
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<% if @multiple %>
|
|
18
18
|
<%# Multiple selection: tags + input in a styled container %>
|
|
19
19
|
<div
|
|
20
|
-
class="lui:relative lui:flex lui:flex-wrap lui:items-center lui:gap-1.5 lui:w-full lui:min-h-[42px] lui:sm:min-h-[38px] lui:rounded-lg lui:border lui:border-
|
|
20
|
+
class="lui:relative lui:flex lui:flex-wrap lui:items-center lui:gap-1.5 lui:w-full lui:min-h-[42px] lui:sm:min-h-[38px] lui:rounded-lg lui:border lui:border-border lui:data-[hover]:border-border-hover lui:bg-surface-input lui:shadow-sm lui:px-2 lui:py-1.5 lui:focus-within:ring-2 lui:focus-within:ring-focus lui:focus-within:ring-offset-0 <%= 'lui:opacity-50' if @disabled %> <%= 'lui:border-destructive-border' if has_errors? %>"
|
|
21
21
|
data-lui-combobox-target="inputWrapper selectedTags"
|
|
22
22
|
>
|
|
23
23
|
<input
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
aria-expanded="false"
|
|
28
28
|
aria-haspopup="listbox"
|
|
29
29
|
autocomplete="off"
|
|
30
|
-
class="lui:flex-1 lui:min-w-[120px] lui:border-0 lui:bg-transparent lui:p-0 lui:text-base/6 lui:text-
|
|
30
|
+
class="lui:flex-1 lui:min-w-[120px] lui:border-0 lui:bg-transparent lui:p-0 lui:text-base/6 lui:text-foreground lui:placeholder:text-foreground-muted lui:sm:text-sm/6 lui:focus:outline-none lui:focus:ring-0"
|
|
31
31
|
placeholder="<%= @placeholder %>"
|
|
32
32
|
data-lui-combobox-target="input"
|
|
33
33
|
data-action="input->lui-combobox#onInput focus->lui-combobox#onFocus keydown->lui-combobox#onKeydown"
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
<%= "data-invalid=true" if has_errors? %>
|
|
37
37
|
/>
|
|
38
38
|
<span class="lui:pointer-events-none lui:flex lui:items-center">
|
|
39
|
-
<svg class="lui:size-5 lui:stroke-
|
|
39
|
+
<svg class="lui:size-5 lui:stroke-foreground-muted lui:sm:size-4" viewBox="0 0 16 16" aria-hidden="true" fill="none">
|
|
40
40
|
<path d="M5.75 10.75L8 13L10.25 10.75" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
41
41
|
<path d="M10.25 5.25L8 3L5.75 5.25" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
42
42
|
</svg>
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
</div>
|
|
45
45
|
<% else %>
|
|
46
46
|
<%# Single selection: standard input styling %>
|
|
47
|
-
<span class="lui:relative lui:block lui:w-full lui:before:absolute lui:before:inset-px lui:before:rounded-[7px] lui:before:bg-
|
|
47
|
+
<span class="lui:relative lui:block lui:w-full lui:before:absolute lui:before:inset-px lui:before:rounded-[7px] lui:before:bg-surface-input lui:before:shadow-sm lui:after:pointer-events-none lui:after:absolute lui:after:inset-0 lui:after:rounded-lg lui:after:ring-transparent lui:after:ring-inset lui:sm:focus-within:after:ring-2 lui:sm:focus-within:after:ring-focus lui:has-data-disabled:opacity-50 lui:has-data-disabled:before:bg-surface-hover lui:has-data-disabled:before:shadow-none lui:has-data-invalid:before:shadow-destructive-border/10">
|
|
48
48
|
<input
|
|
49
49
|
type="text"
|
|
50
50
|
role="combobox"
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
<%= "data-invalid=true" if has_errors? %>
|
|
62
62
|
/>
|
|
63
63
|
<span class="lui:pointer-events-none lui:absolute lui:inset-y-0 lui:right-0 lui:flex lui:items-center lui:pr-2">
|
|
64
|
-
<svg class="lui:size-5 lui:stroke-
|
|
64
|
+
<svg class="lui:size-5 lui:stroke-foreground-muted lui:sm:size-4" viewBox="0 0 16 16" aria-hidden="true" fill="none">
|
|
65
65
|
<path d="M5.75 10.75L8 13L10.25 10.75" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
66
66
|
<path d="M10.25 5.25L8 3L5.75 5.25" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
67
67
|
</svg>
|
|
@@ -73,17 +73,17 @@
|
|
|
73
73
|
data-lui-combobox-target="listbox"
|
|
74
74
|
role="listbox"
|
|
75
75
|
aria-label="<%= effective_label || 'Options' %>"
|
|
76
|
-
class="lui:hidden lui:absolute lui:z-50 lui:mt-1 lui:w-full lui:max-h-60 lui:overflow-auto lui:rounded-lg lui:bg-
|
|
76
|
+
class="lui:hidden lui:absolute lui:z-50 lui:mt-1 lui:w-full lui:max-h-60 lui:overflow-auto lui:rounded-lg lui:bg-surface-secondary lui:shadow-lg lui:ring-1 lui:ring-border"
|
|
77
77
|
>
|
|
78
78
|
<template data-lui-combobox-target="optionTemplate">
|
|
79
79
|
<div
|
|
80
80
|
role="option"
|
|
81
81
|
data-lui-combobox-target="option"
|
|
82
|
-
class="lui:relative lui:cursor-pointer lui:select-none lui:py-2 lui:px-3 lui:text-
|
|
82
|
+
class="lui:relative lui:cursor-pointer lui:select-none lui:py-2 lui:px-3 lui:text-foreground lui:hover:bg-surface-tertiary lui:data-[selected]:bg-interactive-subtle lui:data-[highlighted]:bg-surface-tertiary lui:data-[disabled]:opacity-50 lui:data-[disabled]:cursor-not-allowed"
|
|
83
83
|
data-action="click->lui-combobox#selectOption mouseenter->lui-combobox#highlightOption"
|
|
84
84
|
>
|
|
85
85
|
<span data-label class="lui:block lui:truncate"></span>
|
|
86
|
-
<span data-checkmark class="lui:hidden lui:absolute lui:inset-y-0 lui:right-0 lui:flex lui:items-center lui:pr-3 lui:text-
|
|
86
|
+
<span data-checkmark class="lui:hidden lui:absolute lui:inset-y-0 lui:right-0 lui:flex lui:items-center lui:pr-3 lui:text-interactive">
|
|
87
87
|
<svg class="lui:size-5" viewBox="0 0 20 20" fill="currentColor">
|
|
88
88
|
<path fill-rule="evenodd" d="M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z" clip-rule="evenodd" />
|
|
89
89
|
</svg>
|
|
@@ -91,16 +91,16 @@
|
|
|
91
91
|
</div>
|
|
92
92
|
</template>
|
|
93
93
|
<div data-lui-combobox-target="optionsContainer"></div>
|
|
94
|
-
<div data-lui-combobox-target="loading" class="lui:hidden lui:py-2 lui:px-3 lui:text-
|
|
94
|
+
<div data-lui-combobox-target="loading" class="lui:hidden lui:py-2 lui:px-3 lui:text-foreground-muted lui:text-sm">
|
|
95
95
|
Loading...
|
|
96
96
|
</div>
|
|
97
|
-
<div data-lui-combobox-target="noResults" class="lui:hidden lui:py-2 lui:px-3 lui:text-
|
|
97
|
+
<div data-lui-combobox-target="noResults" class="lui:hidden lui:py-2 lui:px-3 lui:text-foreground-muted lui:text-sm">
|
|
98
98
|
No results found
|
|
99
99
|
</div>
|
|
100
100
|
<% if @allow_custom %>
|
|
101
101
|
<div
|
|
102
102
|
data-lui-combobox-target="createOption"
|
|
103
|
-
class="lui:hidden lui:cursor-pointer lui:py-2 lui:px-3 lui:text-
|
|
103
|
+
class="lui:hidden lui:cursor-pointer lui:py-2 lui:px-3 lui:text-interactive lui:hover:bg-interactive-subtle lui:border-t lui:border-border-subtle lui:flex lui:items-center lui:gap-1.5"
|
|
104
104
|
data-action="click->lui-combobox#createCustomOption"
|
|
105
105
|
>
|
|
106
106
|
<%= heroicon "plus", variant: :solid, options: { class: "lui:size-4" } %>
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
<% if has_errors? %>
|
|
122
122
|
<%= tag.p(
|
|
123
123
|
error_messages,
|
|
124
|
-
class: "lui:text-base/6 lui:text-
|
|
124
|
+
class: "lui:text-base/6 lui:text-destructive-text lui:data-disabled:opacity-50 lui:sm:text-sm/6",
|
|
125
125
|
data: error_data
|
|
126
126
|
) %>
|
|
127
127
|
<% end %>
|
|
@@ -114,11 +114,11 @@ class LightningUiKit::ComboboxComponent < LightningUiKit::BaseComponent
|
|
|
114
114
|
"lui:relative lui:block lui:w-full lui:appearance-none lui:rounded-lg",
|
|
115
115
|
"lui:px-[calc(--spacing(3.5)-1px)] lui:py-[calc(--spacing(2.5)-1px)]",
|
|
116
116
|
"lui:sm:px-[calc(--spacing(3)-1px)] lui:sm:py-[calc(--spacing(1.5)-1px)]",
|
|
117
|
-
"lui:text-base/6 lui:text-
|
|
118
|
-
"lui:border lui:border-
|
|
117
|
+
"lui:text-base/6 lui:text-foreground lui:placeholder:text-foreground-muted lui:sm:text-sm/6",
|
|
118
|
+
"lui:border lui:border-border lui:data-[hover]:border-border-hover",
|
|
119
119
|
"lui:bg-transparent lui:focus:outline-hidden",
|
|
120
|
-
"lui:data-invalid:border-
|
|
121
|
-
"lui:data-disabled:border-
|
|
120
|
+
"lui:data-invalid:border-destructive-border lui:data-invalid:data-[hover]:border-destructive-border/60",
|
|
121
|
+
"lui:data-disabled:border-border-hover",
|
|
122
122
|
"lui:pr-10"
|
|
123
123
|
].join(" "))
|
|
124
124
|
end
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<dt class="lui:col-start-1 lui:border-t lui:border-
|
|
1
|
+
<dt class="lui:col-start-1 lui:border-t lui:border-border-subtle lui:pt-3 lui:text-foreground-muted lui:first:border-none lui:sm:border-t lui:sm:border-border-subtle lui:sm:py-3 lui:flex lui:items-center">
|
|
2
2
|
<%= @label %>
|
|
3
3
|
</dt>
|
|
4
4
|
|
|
5
|
-
<dd class="lui:pt-1 lui:pb-3 lui:text-
|
|
5
|
+
<dd class="lui:pt-1 lui:pb-3 lui:text-foreground lui:sm:border-t lui:sm:border-border-subtle lui:sm:py-3 lui:sm:nth-2:border-none lui:flex lui:items-center">
|
|
6
6
|
<div class="lui:w-full">
|
|
7
7
|
<% if @value %>
|
|
8
8
|
<%= @value %>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div data-controller="lui-dropdown" class="lui:relative">
|
|
2
|
-
<button type="button" data-action="lui-dropdown#toggle click@window->lui-dropdown#hide" class="lui:flex lui:items-center lui:justify-between lui:cursor-pointer lui:w-full lui:text-sm/6 lui:font-medium lui:text-
|
|
2
|
+
<button type="button" data-action="lui-dropdown#toggle click@window->lui-dropdown#hide" class="lui:flex lui:items-center lui:justify-between lui:cursor-pointer lui:w-full lui:text-sm/6 lui:font-medium lui:text-foreground-secondary lui:hover:text-foreground">
|
|
3
3
|
<% if trigger? %>
|
|
4
4
|
<%= trigger %>
|
|
5
5
|
<% else %>
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
data-transition-leave-to="opacity-0 scale-95"
|
|
28
28
|
>
|
|
29
29
|
<% items.each do |item| %>
|
|
30
|
-
<div class="lui:px-4 lui:py-2 lui:text-sm/5 lui:font-medium lui:text-
|
|
30
|
+
<div class="lui:px-4 lui:py-2 lui:text-sm/5 lui:font-medium lui:text-foreground lui:hover:bg-surface-hover lui:rounded-md">
|
|
31
31
|
<%= item %>
|
|
32
32
|
</div>
|
|
33
33
|
<% end %>
|
|
@@ -9,7 +9,7 @@ class LightningUiKit::DropdownComponent < LightningUiKit::BaseComponent
|
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
def menu_classes
|
|
12
|
-
classes = %w[lui:hidden lui:transition lui:transform lui:p-1 lui:origin-top-left lui:absolute lui:left-0 lui:rounded-md lui:shadow-lg lui:bg-
|
|
12
|
+
classes = %w[lui:hidden lui:transition lui:transform lui:p-1 lui:origin-top-left lui:absolute lui:left-0 lui:rounded-md lui:shadow-lg lui:bg-surface-secondary lui:ring-1 lui:ring-border lui:focus:outline-none lui:z-50]
|
|
13
13
|
case @position.to_s
|
|
14
14
|
when "top"
|
|
15
15
|
classes << "lui:mb-2 lui:top-auto lui:bottom-full"
|