velvetkit 0.4.0 → 0.4.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/CHANGELOG.md +47 -2
- data/lib/velvetkit/version.rb +1 -1
- data/registry/app/components/ui/card/action.html.erb +1 -0
- data/registry/app/components/ui/card/action.rb +14 -0
- data/registry/app/components/ui/card/content.html.erb +1 -1
- data/registry/app/components/ui/card/content.rb +4 -2
- data/registry/app/components/ui/card/description.html.erb +1 -1
- data/registry/app/components/ui/card/description.rb +4 -2
- data/registry/app/components/ui/card/footer.html.erb +1 -1
- data/registry/app/components/ui/card/footer.rb +4 -2
- data/registry/app/components/ui/card/header.html.erb +1 -1
- data/registry/app/components/ui/card/header.rb +9 -2
- data/registry/app/components/ui/card/title.html.erb +1 -1
- data/registry/app/components/ui/card/title.rb +4 -2
- data/registry/app/components/ui/card.html.erb +1 -1
- data/registry/app/components/ui/card.rb +49 -3
- data/registry/app/components/ui/money_input.html.erb +8 -0
- data/registry/app/components/ui/money_input.rb +153 -0
- data/registry/app/components/ui/scan_input.html.erb +6 -0
- data/registry/app/components/ui/scan_input.rb +94 -0
- data/registry/app/components/ui/slider.html.erb +23 -0
- data/registry/app/components/ui/slider.rb +254 -0
- data/registry/app/javascript/controllers/ui/money_input_controller.ts +228 -0
- data/registry/app/javascript/controllers/ui/scan_input_controller.ts +143 -0
- data/registry/app/javascript/controllers/ui/slider_controller.ts +216 -0
- data/registry/components.yml +7 -1
- data/registry/config/locales/velvetkit.en.yml +6 -0
- data/registry/icons/lucide/scan-barcode.svg +21 -0
- data/registry/icons/lucide/volume-2.svg +17 -0
- data/registry/icons/lucide/volume-x.svg +17 -0
- data/registry/icons/phosphor/barcode.svg +2 -0
- data/registry/icons/phosphor/speaker-high.svg +2 -0
- data/registry/icons/phosphor/speaker-x.svg +2 -0
- data/registry/icons/tabler/barcode.svg +23 -0
- data/registry/icons/tabler/volume-3.svg +17 -0
- data/registry/icons/tabler/volume.svg +18 -0
- data/registry/icons.yml +3 -0
- data/registry/test/components/previews/ui/card_preview/edge_to_edge.html.erb +19 -0
- data/registry/test/components/previews/ui/card_preview/image.html.erb +12 -0
- data/registry/test/components/previews/ui/card_preview/just_content.html.erb +10 -0
- data/registry/test/components/previews/ui/card_preview/open_bill.html.erb +18 -0
- data/registry/test/components/previews/ui/card_preview/playground.html.erb +17 -0
- data/registry/test/components/previews/ui/card_preview/settings_form.html.erb +15 -24
- data/registry/test/components/previews/ui/card_preview/sign_in.html.erb +23 -0
- data/registry/test/components/previews/ui/card_preview/small.html.erb +17 -0
- data/registry/test/components/previews/ui/card_preview/spacing.html.erb +13 -0
- data/registry/test/components/previews/ui/card_preview/stats.html.erb +11 -0
- data/registry/test/components/previews/ui/card_preview/team.html.erb +21 -0
- data/registry/test/components/previews/ui/card_preview.rb +42 -28
- data/registry/test/components/previews/ui/money_input_preview/cash_tendered.html.erb +24 -0
- data/registry/test/components/previews/ui/money_input_preview/currencies.html.erb +7 -0
- data/registry/test/components/previews/ui/money_input_preview/invoice.html.erb +24 -0
- data/registry/test/components/previews/ui/money_input_preview/sizes_and_states.html.erb +9 -0
- data/registry/test/components/previews/ui/money_input_preview.rb +34 -0
- data/registry/test/components/previews/ui/scan_input_preview/_simulate.html.erb +20 -0
- data/registry/test/components/previews/ui/scan_input_preview/library_checkout.html.erb +30 -0
- data/registry/test/components/previews/ui/scan_input_preview/playground.html.erb +13 -0
- data/registry/test/components/previews/ui/scan_input_preview/stock_count.html.erb +24 -0
- data/registry/test/components/previews/ui/scan_input_preview/ticket_check_in.html.erb +34 -0
- data/registry/test/components/previews/ui/scan_input_preview/till.html.erb +9 -0
- data/registry/test/components/previews/ui/scan_input_preview.rb +33 -0
- data/registry/test/components/previews/ui/slider_preview/named_steps.html.erb +7 -0
- data/registry/test/components/previews/ui/slider_preview/opening_hours.html.erb +5 -0
- data/registry/test/components/previews/ui/slider_preview/price_range.html.erb +6 -0
- data/registry/test/components/previews/ui/slider_preview/sizes_and_states.html.erb +9 -0
- data/registry/test/components/previews/ui/slider_preview/text_size.html.erb +16 -0
- data/registry/test/components/previews/ui/slider_preview/tip.html.erb +22 -0
- data/registry/test/components/previews/ui/slider_preview/volume.html.erb +5 -0
- data/registry/test/components/previews/ui/slider_preview.rb +45 -0
- data/registry/test/components/ui/card/action_test.rb +19 -0
- data/registry/test/components/ui/card/content_test.rb +1 -11
- data/registry/test/components/ui/card/footer_test.rb +3 -2
- data/registry/test/components/ui/card/header_test.rb +3 -4
- data/registry/test/components/ui/card/title_test.rb +3 -4
- data/registry/test/components/ui/card_test.rb +63 -2
- data/registry/test/components/ui/money_input_test.rb +149 -0
- data/registry/test/components/ui/scan_input_test.rb +110 -0
- data/registry/test/components/ui/slider_test.rb +190 -0
- metadata +55 -5
- data/registry/test/components/previews/ui/card_preview/complete.html.erb +0 -31
- data/registry/test/components/previews/ui/card_preview/default.html.erb +0 -7
- data/registry/test/components/previews/ui/card_preview/with_footer.html.erb +0 -13
- data/registry/test/components/previews/ui/card_preview/with_header.html.erb +0 -11
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { Controller } from '@hotwired/stimulus';
|
|
2
|
+
|
|
3
|
+
// Connects to data-controller="ui--slider"
|
|
4
|
+
//
|
|
5
|
+
// The handles are native range inputs, which do the keyboard, the form and
|
|
6
|
+
// the screen reader, and can't be seen. This places the knobs and the filled
|
|
7
|
+
// part of the track, keeps the shown value and aria-valuetext current, and
|
|
8
|
+
// takes the pointer: a press anywhere on the track grabs the nearest handle,
|
|
9
|
+
// so a range's two handles can be dragged even when they sit on top of each
|
|
10
|
+
// other, and they never pass. While dragged, a knob follows the pointer
|
|
11
|
+
// freely and the value keeps to the step; let go, it glides onto the value.
|
|
12
|
+
type PickEvent = MouseEvent & { params: { value: number } };
|
|
13
|
+
|
|
14
|
+
export default class extends Controller<HTMLElement> {
|
|
15
|
+
static targets = ['input', 'track', 'output'];
|
|
16
|
+
static values = { format: String, rangeFormat: String, labels: Object };
|
|
17
|
+
|
|
18
|
+
declare readonly inputTargets: HTMLInputElement[];
|
|
19
|
+
declare readonly trackTarget: HTMLElement;
|
|
20
|
+
declare readonly outputTarget: HTMLOutputElement;
|
|
21
|
+
declare readonly hasOutputTarget: boolean;
|
|
22
|
+
declare readonly formatValue: string;
|
|
23
|
+
declare readonly rangeFormatValue: string;
|
|
24
|
+
declare readonly labelsValue: Record<string, string>;
|
|
25
|
+
|
|
26
|
+
private dragging?: HTMLInputElement;
|
|
27
|
+
private pointerId?: number;
|
|
28
|
+
private startX = 0;
|
|
29
|
+
private before = '';
|
|
30
|
+
// Where the pointer is along the track, 0 to 1, while it holds a handle:
|
|
31
|
+
// the knob follows this rather than the value, which keeps to the step.
|
|
32
|
+
private held?: number;
|
|
33
|
+
|
|
34
|
+
connect() {
|
|
35
|
+
this.element.closest('form')?.addEventListener('reset', this.afterReset);
|
|
36
|
+
this.sync();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
disconnect() {
|
|
40
|
+
this.element.closest('form')?.removeEventListener('reset', this.afterReset);
|
|
41
|
+
this.release();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// On every input: a range's handles can meet but not cross.
|
|
45
|
+
sync(event?: Event) {
|
|
46
|
+
const [low, high] = this.inputTargets;
|
|
47
|
+
if (high) {
|
|
48
|
+
if (event?.target === low && low.valueAsNumber > high.valueAsNumber) low.value = high.value;
|
|
49
|
+
if (event?.target === high && high.valueAsNumber < low.valueAsNumber) high.value = low.value;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
let from = high ? this.fraction(low) : 0;
|
|
53
|
+
let to = this.fraction(high ?? low);
|
|
54
|
+
if (this.dragging && this.held !== undefined) {
|
|
55
|
+
if (high && this.dragging === low) from = Math.min(this.held, to);
|
|
56
|
+
else to = Math.max(this.held, from);
|
|
57
|
+
}
|
|
58
|
+
this.element.style.setProperty('--from', String(from));
|
|
59
|
+
this.element.style.setProperty('--to', String(to));
|
|
60
|
+
for (const input of this.inputTargets) input.setAttribute('aria-valuetext', this.text(input.value));
|
|
61
|
+
if (this.hasOutputTarget) {
|
|
62
|
+
this.outputTarget.textContent = high
|
|
63
|
+
? this.rangeFormatValue.replace('%{from}', this.text(low.value)).replace('%{to}', this.text(high.value))
|
|
64
|
+
: this.text(low.value);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
press(event: PointerEvent) {
|
|
69
|
+
if (event.button !== 0 || this.inputTargets[0].disabled) return;
|
|
70
|
+
|
|
71
|
+
event.preventDefault();
|
|
72
|
+
const at = this.fractionAt(event.clientX);
|
|
73
|
+
const value = this.valueOf(at);
|
|
74
|
+
this.dragging = this.nearest(value);
|
|
75
|
+
this.startX = event.clientX;
|
|
76
|
+
this.pointerId = event.pointerId;
|
|
77
|
+
this.before = this.inputTargets.map((input) => input.value).join();
|
|
78
|
+
this.trackTarget.setPointerCapture(event.pointerId);
|
|
79
|
+
this.trackTarget.addEventListener('pointermove', this.move);
|
|
80
|
+
this.trackTarget.addEventListener('pointerup', this.release);
|
|
81
|
+
this.trackTarget.addEventListener('pointercancel', this.release);
|
|
82
|
+
// Two handles on one spot: which one is decided by the way the pointer moves.
|
|
83
|
+
if (this.dragging) this.moveTo(this.dragging, value, at);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// A mark: the nearest handle goes there, as if the track were pressed.
|
|
87
|
+
pick(event: PickEvent) {
|
|
88
|
+
const value = event.params.value;
|
|
89
|
+
const input = this.nearest(value) ?? this.inputTargets[0];
|
|
90
|
+
const before = input.value;
|
|
91
|
+
this.moveTo(input, value);
|
|
92
|
+
input.focus({ focusVisible: false } as FocusOptions);
|
|
93
|
+
if (input.value !== before) input.dispatchEvent(new Event('change', { bubbles: true }));
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Once it moves, the knob keeps up with the pointer: no gliding.
|
|
97
|
+
private move = (event: PointerEvent) => {
|
|
98
|
+
const at = this.fractionAt(event.clientX);
|
|
99
|
+
if (!this.dragging) {
|
|
100
|
+
if (Math.abs(event.clientX - this.startX) < 2) return;
|
|
101
|
+
|
|
102
|
+
const [low, high] = this.inputTargets;
|
|
103
|
+
this.dragging = (event.clientX < this.startX) !== this.rtl ? low : high;
|
|
104
|
+
}
|
|
105
|
+
this.element.dataset.dragging = '';
|
|
106
|
+
this.moveTo(this.dragging, this.valueOf(at), at);
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
private release = () => {
|
|
110
|
+
const input = this.dragging;
|
|
111
|
+
if (this.pointerId !== undefined && this.trackTarget.hasPointerCapture(this.pointerId)) {
|
|
112
|
+
this.trackTarget.releasePointerCapture(this.pointerId);
|
|
113
|
+
}
|
|
114
|
+
this.trackTarget.removeEventListener('pointermove', this.move);
|
|
115
|
+
this.trackTarget.removeEventListener('pointerup', this.release);
|
|
116
|
+
this.trackTarget.removeEventListener('pointercancel', this.release);
|
|
117
|
+
for (const each of this.inputTargets) delete each.dataset.active;
|
|
118
|
+
delete this.element.dataset.dragging;
|
|
119
|
+
this.dragging = undefined;
|
|
120
|
+
this.held = undefined;
|
|
121
|
+
this.pointerId = undefined;
|
|
122
|
+
// The knob glides from the pointer onto the value.
|
|
123
|
+
this.sync();
|
|
124
|
+
if (input && this.inputTargets.map((each) => each.value).join() !== this.before) {
|
|
125
|
+
input.dispatchEvent(new Event('change', { bubbles: true }));
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
private afterReset = () => requestAnimationFrame(() => this.sync());
|
|
130
|
+
|
|
131
|
+
// Sets the value the way the keyboard would, so step and the other handle
|
|
132
|
+
// are respected, and fires input as the browser does. `at` is the pointer's
|
|
133
|
+
// place, for the knob to follow.
|
|
134
|
+
private moveTo(input: HTMLInputElement, value: number, at?: number) {
|
|
135
|
+
const [low, high] = this.inputTargets;
|
|
136
|
+
let next = value;
|
|
137
|
+
if (high && input === low) next = Math.min(next, high.valueAsNumber);
|
|
138
|
+
if (high && input === high) next = Math.max(next, low.valueAsNumber);
|
|
139
|
+
|
|
140
|
+
input.dataset.active = '';
|
|
141
|
+
// Focused for the keyboard to carry on from, without the keyboard's ring.
|
|
142
|
+
input.focus({ preventScroll: true, focusVisible: false } as FocusOptions);
|
|
143
|
+
this.held = at;
|
|
144
|
+
if (String(next) === input.value) {
|
|
145
|
+
this.sync();
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
input.value = String(next);
|
|
150
|
+
input.dispatchEvent(new Event('input', { bubbles: true }));
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// The handle closest to a value; none when a range's two are equally close
|
|
154
|
+
// and on one spot, until the pointer moves.
|
|
155
|
+
private nearest(value: number): HTMLInputElement | undefined {
|
|
156
|
+
const [low, high] = this.inputTargets;
|
|
157
|
+
if (!high) return low;
|
|
158
|
+
if (low.value === high.value) {
|
|
159
|
+
if (value === low.valueAsNumber) return undefined;
|
|
160
|
+
return value < low.valueAsNumber ? low : high;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return Math.abs(value - low.valueAsNumber) <= Math.abs(value - high.valueAsNumber) ? low : high;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// How far along the track a point is, 0 to 1. The knob's centre can't
|
|
167
|
+
// reach the very ends, so neither does the scale.
|
|
168
|
+
private fractionAt(clientX: number): number {
|
|
169
|
+
const rect = this.trackTarget.getBoundingClientRect();
|
|
170
|
+
const thumb = this.thumbWidth;
|
|
171
|
+
const fraction = Math.min(1, Math.max(0, (clientX - rect.left - thumb / 2) / Math.max(1, rect.width - thumb)));
|
|
172
|
+
return this.rtl ? 1 - fraction : fraction;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// The value at a fraction of the track, snapped to step.
|
|
176
|
+
private valueOf(fraction: number): number {
|
|
177
|
+
const { min, max, step } = this.bounds(this.inputTargets[0]);
|
|
178
|
+
const steps = Math.round((fraction * (max - min)) / step);
|
|
179
|
+
return Number(Math.min(max, min + steps * step).toFixed(this.decimals(step)));
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
private fraction(input: HTMLInputElement): number {
|
|
183
|
+
const { min, max } = this.bounds(input);
|
|
184
|
+
return max === min ? 0 : (input.valueAsNumber - min) / (max - min);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
private bounds(input: HTMLInputElement) {
|
|
188
|
+
const min = parseFloat(input.min) || 0;
|
|
189
|
+
const max = Number.isNaN(parseFloat(input.max)) ? 100 : parseFloat(input.max);
|
|
190
|
+
const step = parseFloat(input.step) || 1;
|
|
191
|
+
return { min, max, step };
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// Matches the server's: the value as the step writes it, "3" not "3.0".
|
|
195
|
+
private text(value: string): string {
|
|
196
|
+
const number = String(Number(Number(value).toFixed(this.decimals(this.bounds(this.inputTargets[0]).step))));
|
|
197
|
+
return this.labelsValue[number] ?? this.formatValue.replace('%{value}', number);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
private decimals(step: number): number {
|
|
201
|
+
return (String(step).split('.')[1] ?? '').length;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// --thumb, in pixels: a custom property comes back as written, "0.5rem".
|
|
205
|
+
private get thumbWidth(): number {
|
|
206
|
+
const written = getComputedStyle(this.element).getPropertyValue('--thumb').trim();
|
|
207
|
+
const size = parseFloat(written) || 0;
|
|
208
|
+
if (!written.endsWith('rem')) return size;
|
|
209
|
+
|
|
210
|
+
return size * parseFloat(getComputedStyle(document.documentElement).fontSize);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
private get rtl(): boolean {
|
|
214
|
+
return getComputedStyle(this.element).direction === 'rtl';
|
|
215
|
+
}
|
|
216
|
+
}
|
data/registry/components.yml
CHANGED
|
@@ -41,7 +41,7 @@ components:
|
|
|
41
41
|
button_to:
|
|
42
42
|
description: A button that submits a one-off form, like Rails' button_to.
|
|
43
43
|
card:
|
|
44
|
-
description: A
|
|
44
|
+
description: A surface for one thing, with a header and action, body, footer and optional image.
|
|
45
45
|
chart:
|
|
46
46
|
description: Line and bar charts, with a legend, tooltips and the numbers as a table, on Chart.js.
|
|
47
47
|
checkbox:
|
|
@@ -84,6 +84,8 @@ components:
|
|
|
84
84
|
description: A link styled as text or as a button.
|
|
85
85
|
menu:
|
|
86
86
|
description: A dropdown menu with keyboard navigation.
|
|
87
|
+
money_input:
|
|
88
|
+
description: An amount of money, grouped as it's typed with its currency sign, posting the plain number.
|
|
87
89
|
navigation_menu:
|
|
88
90
|
description: Site navigation with links and hover or click panels of rich links.
|
|
89
91
|
number_input:
|
|
@@ -101,6 +103,8 @@ components:
|
|
|
101
103
|
description: A set of radio buttons.
|
|
102
104
|
native_select:
|
|
103
105
|
description: The browser's own select, styled closed; best for phones' system pickers.
|
|
106
|
+
scan_input:
|
|
107
|
+
description: A field for a barcode or QR scanner, submitting each code as it's scanned and keeping focus.
|
|
104
108
|
select:
|
|
105
109
|
description: A styled dropdown with keyboard navigation and type-ahead, posting like a native select.
|
|
106
110
|
session_tabs:
|
|
@@ -111,6 +115,8 @@ components:
|
|
|
111
115
|
description: A collapsible application sidebar with groups and menus.
|
|
112
116
|
skeleton:
|
|
113
117
|
description: A pulsing placeholder shown in a piece of content's shape while it loads.
|
|
118
|
+
slider:
|
|
119
|
+
description: A handle to drag along a track for a value, or two for a range, on the browser's own range input.
|
|
114
120
|
spinner:
|
|
115
121
|
description: A loading indicator.
|
|
116
122
|
stepper:
|
|
@@ -76,6 +76,10 @@ en:
|
|
|
76
76
|
progress:
|
|
77
77
|
label: 'Progress'
|
|
78
78
|
value_text: '%{percent}%'
|
|
79
|
+
slider:
|
|
80
|
+
from: 'Minimum'
|
|
81
|
+
to: 'Maximum'
|
|
82
|
+
range_text: '%{from} – %{to}'
|
|
79
83
|
sidebar:
|
|
80
84
|
toggle: 'Toggle sidebar'
|
|
81
85
|
table_of_contents:
|
|
@@ -98,6 +102,8 @@ en:
|
|
|
98
102
|
error: 'Needs attention'
|
|
99
103
|
loading: 'Checking'
|
|
100
104
|
summary: 'Step %{current} of %{total}'
|
|
105
|
+
scan_input:
|
|
106
|
+
placeholder: 'Scan or type a code'
|
|
101
107
|
select:
|
|
102
108
|
placeholder: 'Choose…'
|
|
103
109
|
search: 'Search'
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<!-- @license lucide-static v0.545.0 - ISC -->
|
|
2
|
+
<svg
|
|
3
|
+
class="lucide lucide-scan-barcode"
|
|
4
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
5
|
+
width="24"
|
|
6
|
+
height="24"
|
|
7
|
+
viewBox="0 0 24 24"
|
|
8
|
+
fill="none"
|
|
9
|
+
stroke="currentColor"
|
|
10
|
+
stroke-width="2"
|
|
11
|
+
stroke-linecap="round"
|
|
12
|
+
stroke-linejoin="round"
|
|
13
|
+
>
|
|
14
|
+
<path d="M3 7V5a2 2 0 0 1 2-2h2" />
|
|
15
|
+
<path d="M17 3h2a2 2 0 0 1 2 2v2" />
|
|
16
|
+
<path d="M21 17v2a2 2 0 0 1-2 2h-2" />
|
|
17
|
+
<path d="M7 21H5a2 2 0 0 1-2-2v-2" />
|
|
18
|
+
<path d="M8 7v10" />
|
|
19
|
+
<path d="M12 7v10" />
|
|
20
|
+
<path d="M17 7v10" />
|
|
21
|
+
</svg>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!-- @license lucide-static v0.545.0 - ISC -->
|
|
2
|
+
<svg
|
|
3
|
+
class="lucide lucide-volume-2"
|
|
4
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
5
|
+
width="24"
|
|
6
|
+
height="24"
|
|
7
|
+
viewBox="0 0 24 24"
|
|
8
|
+
fill="none"
|
|
9
|
+
stroke="currentColor"
|
|
10
|
+
stroke-width="2"
|
|
11
|
+
stroke-linecap="round"
|
|
12
|
+
stroke-linejoin="round"
|
|
13
|
+
>
|
|
14
|
+
<path d="M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z" />
|
|
15
|
+
<path d="M16 9a5 5 0 0 1 0 6" />
|
|
16
|
+
<path d="M19.364 18.364a9 9 0 0 0 0-12.728" />
|
|
17
|
+
</svg>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!-- @license lucide-static v0.545.0 - ISC -->
|
|
2
|
+
<svg
|
|
3
|
+
class="lucide lucide-volume-x"
|
|
4
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
5
|
+
width="24"
|
|
6
|
+
height="24"
|
|
7
|
+
viewBox="0 0 24 24"
|
|
8
|
+
fill="none"
|
|
9
|
+
stroke="currentColor"
|
|
10
|
+
stroke-width="2"
|
|
11
|
+
stroke-linecap="round"
|
|
12
|
+
stroke-linejoin="round"
|
|
13
|
+
>
|
|
14
|
+
<path d="M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z" />
|
|
15
|
+
<line x1="22" x2="16" y1="9" y2="15" />
|
|
16
|
+
<line x1="16" x2="22" y1="9" y2="15" />
|
|
17
|
+
</svg>
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
<!-- @license @phosphor-icons/core v2.1.1 - MIT -->
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M232,48V88a8,8,0,0,1-16,0V56H184a8,8,0,0,1,0-16h40A8,8,0,0,1,232,48ZM72,200H40V168a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16Zm152-40a8,8,0,0,0-8,8v32H184a8,8,0,0,0,0,16h40a8,8,0,0,0,8-8V168A8,8,0,0,0,224,160ZM32,96a8,8,0,0,0,8-8V56H72a8,8,0,0,0,0-16H32a8,8,0,0,0-8,8V88A8,8,0,0,0,32,96ZM80,80a8,8,0,0,0-8,8v80a8,8,0,0,0,16,0V88A8,8,0,0,0,80,80Zm104,88V88a8,8,0,0,0-16,0v80a8,8,0,0,0,16,0ZM144,80a8,8,0,0,0-8,8v80a8,8,0,0,0,16,0V88A8,8,0,0,0,144,80Zm-32,0a8,8,0,0,0-8,8v80a8,8,0,0,0,16,0V88A8,8,0,0,0,112,80Z"/></svg>
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
<!-- @license @phosphor-icons/core v2.1.1 - MIT -->
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M155.51,24.81a8,8,0,0,0-8.42.88L77.25,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H77.25l69.84,54.31A8,8,0,0,0,160,224V32A8,8,0,0,0,155.51,24.81ZM32,96H72v64H32ZM144,207.64,88,164.09V91.91l56-43.55Zm54-106.08a40,40,0,0,1,0,52.88,8,8,0,0,1-12-10.58,24,24,0,0,0,0-31.72,8,8,0,0,1,12-10.58ZM248,128a79.9,79.9,0,0,1-20.37,53.34,8,8,0,0,1-11.92-10.67,64,64,0,0,0,0-85.33,8,8,0,1,1,11.92-10.67A79.83,79.83,0,0,1,248,128Z"/></svg>
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
<!-- @license @phosphor-icons/core v2.1.1 - MIT -->
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M155.51,24.81a8,8,0,0,0-8.42.88L77.25,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H77.25l69.84,54.31A8,8,0,0,0,160,224V32A8,8,0,0,0,155.51,24.81ZM32,96H72v64H32ZM144,207.64,88,164.09V91.91l56-43.55Zm101.66-61.3a8,8,0,0,1-11.32,11.32L216,139.31l-18.34,18.35a8,8,0,0,1-11.32-11.32L204.69,128l-18.35-18.34a8,8,0,0,1,11.32-11.32L216,116.69l18.34-18.35a8,8,0,0,1,11.32,11.32L227.31,128Z"/></svg>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<!-- @license @tabler/icons v3.50.0 - MIT -->
|
|
2
|
+
<svg
|
|
3
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
4
|
+
width="24"
|
|
5
|
+
height="24"
|
|
6
|
+
viewBox="0 0 24 24"
|
|
7
|
+
fill="none"
|
|
8
|
+
stroke="currentColor"
|
|
9
|
+
stroke-width="2"
|
|
10
|
+
stroke-linecap="round"
|
|
11
|
+
stroke-linejoin="round"
|
|
12
|
+
class="icon icon-tabler icons-tabler-outline icon-tabler-barcode"
|
|
13
|
+
>
|
|
14
|
+
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
|
15
|
+
<path d="M4 7v-1a2 2 0 0 1 2 -2h2" />
|
|
16
|
+
<path d="M4 17v1a2 2 0 0 0 2 2h2" />
|
|
17
|
+
<path d="M16 4h2a2 2 0 0 1 2 2v1" />
|
|
18
|
+
<path d="M16 20h2a2 2 0 0 0 2 -2v-1" />
|
|
19
|
+
<path d="M5 11h1v2h-1l0 -2" />
|
|
20
|
+
<path d="M10 11l0 2" />
|
|
21
|
+
<path d="M14 11h1v2h-1l0 -2" />
|
|
22
|
+
<path d="M19 11l0 2" />
|
|
23
|
+
</svg>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!-- @license @tabler/icons v3.50.0 - MIT -->
|
|
2
|
+
<svg
|
|
3
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
4
|
+
width="24"
|
|
5
|
+
height="24"
|
|
6
|
+
viewBox="0 0 24 24"
|
|
7
|
+
fill="none"
|
|
8
|
+
stroke="currentColor"
|
|
9
|
+
stroke-width="2"
|
|
10
|
+
stroke-linecap="round"
|
|
11
|
+
stroke-linejoin="round"
|
|
12
|
+
class="icon icon-tabler icons-tabler-outline icon-tabler-volume-3"
|
|
13
|
+
>
|
|
14
|
+
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
|
15
|
+
<path d="M6 15h-2a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1h2l3.5 -4.5a.8 .8 0 0 1 1.5 .5v14a.8 .8 0 0 1 -1.5 .5l-3.5 -4.5" />
|
|
16
|
+
<path d="M16 10l4 4m0 -4l-4 4" />
|
|
17
|
+
</svg>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!-- @license @tabler/icons v3.50.0 - MIT -->
|
|
2
|
+
<svg
|
|
3
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
4
|
+
width="24"
|
|
5
|
+
height="24"
|
|
6
|
+
viewBox="0 0 24 24"
|
|
7
|
+
fill="none"
|
|
8
|
+
stroke="currentColor"
|
|
9
|
+
stroke-width="2"
|
|
10
|
+
stroke-linecap="round"
|
|
11
|
+
stroke-linejoin="round"
|
|
12
|
+
class="icon icon-tabler icons-tabler-outline icon-tabler-volume"
|
|
13
|
+
>
|
|
14
|
+
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
|
15
|
+
<path d="M15 8a5 5 0 0 1 0 8" />
|
|
16
|
+
<path d="M17.7 5a9 9 0 0 1 0 14" />
|
|
17
|
+
<path d="M6 15h-2a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1h2l3.5 -4.5a.8 .8 0 0 1 1.5 .5v14a.8 .8 0 0 1 -1.5 .5l-3.5 -4.5" />
|
|
18
|
+
</svg>
|
data/registry/icons.yml
CHANGED
|
@@ -70,6 +70,7 @@ qr-code: { tabler: qrcode, phosphor: qr-code }
|
|
|
70
70
|
receipt: { tabler: receipt, phosphor: receipt }
|
|
71
71
|
rocket: { tabler: rocket, phosphor: rocket }
|
|
72
72
|
rotate-cw: { tabler: rotate-clockwise, phosphor: arrow-clockwise }
|
|
73
|
+
scan-barcode: { tabler: barcode, phosphor: barcode }
|
|
73
74
|
search: { tabler: search, phosphor: magnifying-glass }
|
|
74
75
|
settings: { tabler: settings, phosphor: gear }
|
|
75
76
|
shield: { tabler: shield, phosphor: shield }
|
|
@@ -84,6 +85,8 @@ upload: { tabler: upload, phosphor: upload-simple }
|
|
|
84
85
|
user: { tabler: user, phosphor: user }
|
|
85
86
|
user-plus: { tabler: user-plus, phosphor: user-plus }
|
|
86
87
|
users: { tabler: users, phosphor: users }
|
|
88
|
+
volume-2: { tabler: volume, phosphor: speaker-high }
|
|
89
|
+
volume-x: { tabler: volume-3, phosphor: speaker-x }
|
|
87
90
|
workflow: { tabler: sitemap, phosphor: flow-arrow }
|
|
88
91
|
x: { tabler: x, phosphor: x }
|
|
89
92
|
zoom-in: { tabler: zoom-in, phosphor: magnifying-glass-plus }
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<%# The negative margins cancel the card's inset and the gap above the footer, so they stay right at any spacing. %>
|
|
2
|
+
<%= render(UI::Card.new(spacing: 6, class: "max-w-md")) do |card| %>
|
|
3
|
+
<% card.with_header do |header| %>
|
|
4
|
+
<% header.with_title { "Terms of service" } %>
|
|
5
|
+
<% header.with_description { "Please read these before carrying on." } %>
|
|
6
|
+
<% end %>
|
|
7
|
+
<% card.with_content do %>
|
|
8
|
+
<div class="-mx-(--card-spacing) -mb-(--card-spacing) max-h-40 space-y-3 overflow-y-auto border-t px-(--card-spacing) py-3 text-muted-foreground" tabindex="0">
|
|
9
|
+
<p>You keep everything you upload. We only use it to run the service for you.</p>
|
|
10
|
+
<p>You can export your data at any time, and when you close your account we delete it within 30 days.</p>
|
|
11
|
+
<p>We'll tell you a month ahead if these terms change, and you can leave before they do.</p>
|
|
12
|
+
<p>Don't use the service to break the law or to get in the way of other people using it.</p>
|
|
13
|
+
</div>
|
|
14
|
+
<% end %>
|
|
15
|
+
<% card.with_footer(class: "justify-end gap-2") do %>
|
|
16
|
+
<%= render(UI::Button.new(variant: :outline, size: :sm)) { "Decline" } %>
|
|
17
|
+
<%= render(UI::Button.new(size: :sm)) { "Accept" } %>
|
|
18
|
+
<% end %>
|
|
19
|
+
<% end %>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<%= render(UI::Card.new(class: "max-w-sm")) do |card| %>
|
|
2
|
+
<% card.with_image(src: UI::CardPreview.photo("#0f766e", "#1d4ed8"), alt: "Hills under a pale sun") %>
|
|
3
|
+
<% card.with_header do |header| %>
|
|
4
|
+
<% header.with_title { "Coastal walk, Saturday" } %>
|
|
5
|
+
<% header.with_description { "Twelve kilometres along the cliffs, with lunch at the harbour." } %>
|
|
6
|
+
<% header.with_action { render(UI::Badge.new(variant: :secondary, size: :sm)) { "Featured" } } %>
|
|
7
|
+
<% end %>
|
|
8
|
+
<% card.with_footer(class: "justify-between") do %>
|
|
9
|
+
<span class="text-muted-foreground">18 going</span>
|
|
10
|
+
<%= render(UI::Button.new(size: :sm)) { "Join" } %>
|
|
11
|
+
<% end %>
|
|
12
|
+
<% end %>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<div class="grid max-w-sm gap-4">
|
|
2
|
+
<%= render(UI::Card.new) do |card| %>
|
|
3
|
+
<% card.with_content do %>
|
|
4
|
+
<p class="text-muted-foreground">One part: the card's padding still applies.</p>
|
|
5
|
+
<% end %>
|
|
6
|
+
<% end %>
|
|
7
|
+
<%= render(UI::Card.new(class: "p-8 text-center")) do %>
|
|
8
|
+
<p class="text-muted-foreground">No parts, just a block: a bare surface, padded however you like.</p>
|
|
9
|
+
<% end %>
|
|
10
|
+
</div>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<%= render(UI::Card.new(size: :sm, class: "max-w-xs")) do |card| %>
|
|
2
|
+
<% card.with_header do |header| %>
|
|
3
|
+
<% header.with_title { "Table 12" } %>
|
|
4
|
+
<% header.with_description { "Opened 19:42 by Priya" } %>
|
|
5
|
+
<% header.with_action { render(UI::Badge.new(variant: :secondary, size: :sm)) { "Open" } } %>
|
|
6
|
+
<% end %>
|
|
7
|
+
<% card.with_content do %>
|
|
8
|
+
<dl class="grid grid-cols-[1fr_auto] gap-y-1 tabular-nums">
|
|
9
|
+
<dt>2 × Masala dosa</dt><dd>₹360.00</dd>
|
|
10
|
+
<dt>1 × Filter coffee</dt><dd>₹70.00</dd>
|
|
11
|
+
<dt class="text-muted-foreground">GST at 5%</dt><dd class="text-muted-foreground">₹21.50</dd>
|
|
12
|
+
</dl>
|
|
13
|
+
<% end %>
|
|
14
|
+
<% card.with_footer(class: "justify-between") do %>
|
|
15
|
+
<span class="font-semibold tabular-nums">₹451.50</span>
|
|
16
|
+
<%= render(UI::Button.new(size: :sm)) { "Charge" } %>
|
|
17
|
+
<% end %>
|
|
18
|
+
<% end %>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<%= render(UI::Card.new(size: size, spacing: spacing, class: "max-w-sm")) do |card| %>
|
|
2
|
+
<% card.with_image(src: UI::CardPreview.photo("#7c3aed", "#db2777"), alt: "An abstract landscape") if show_image %>
|
|
3
|
+
<% card.with_header do |header| %>
|
|
4
|
+
<% header.with_title { title } %>
|
|
5
|
+
<% header.with_description { description } %>
|
|
6
|
+
<% header.with_action { render(UI::Badge.new(variant: :secondary, size: :sm)) { "New" } } if show_action %>
|
|
7
|
+
<% end %>
|
|
8
|
+
<% card.with_content do %>
|
|
9
|
+
<p class="text-muted-foreground">Pick a repository and we'll build it on every push.</p>
|
|
10
|
+
<% end %>
|
|
11
|
+
<% if show_footer %>
|
|
12
|
+
<% card.with_footer(class: "justify-end gap-2") do %>
|
|
13
|
+
<%= render(UI::Button.new(variant: :outline, size: :sm)) { "Cancel" } %>
|
|
14
|
+
<%= render(UI::Button.new(size: :sm)) { "Deploy" } %>
|
|
15
|
+
<% end %>
|
|
16
|
+
<% end %>
|
|
17
|
+
<% end %>
|
|
@@ -1,25 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
<%
|
|
4
|
-
|
|
5
|
-
<% header.with_description { "Update your account preferences." } %>
|
|
6
|
-
<% end %>
|
|
7
|
-
<% card.with_content do %>
|
|
8
|
-
<div class="space-y-4">
|
|
9
|
-
<div class="space-y-2">
|
|
10
|
-
<%= render(UI::Label.new(for: "name")) { "Display Name" } %>
|
|
11
|
-
<%= render(UI::Input.new(id: "name", placeholder: "Enter your name")) %>
|
|
12
|
-
</div>
|
|
13
|
-
<div class="space-y-2">
|
|
14
|
-
<%= render(UI::Label.new(for: "username")) { "Username" } %>
|
|
15
|
-
<%= render(UI::Input.new(id: "username", placeholder: "@username")) %>
|
|
16
|
-
</div>
|
|
17
|
-
</div>
|
|
18
|
-
<% end %>
|
|
19
|
-
<% card.with_footer do %>
|
|
20
|
-
<div class="flex gap-2">
|
|
21
|
-
<%= render(UI::Button.new(variant: :primary, size: :sm)) { "Save Changes" } %>
|
|
22
|
-
</div>
|
|
23
|
-
<% end %>
|
|
1
|
+
<%= render(UI::Card.new(class: "max-w-md")) do |card| %>
|
|
2
|
+
<% card.with_header(class: "border-b") do |header| %>
|
|
3
|
+
<% header.with_title { "Profile" } %>
|
|
4
|
+
<% header.with_description { "This is how others see you." } %>
|
|
24
5
|
<% end %>
|
|
25
|
-
|
|
6
|
+
<% card.with_content do %>
|
|
7
|
+
<div class="grid gap-4">
|
|
8
|
+
<%= render(UI::Input.new(name: "display_name", label: "Display name", value: "Maya Okafor")) %>
|
|
9
|
+
<%= render(UI::Input.new(name: "username", label: "Username", value: "maya", hint: "Letters and numbers only.")) %>
|
|
10
|
+
</div>
|
|
11
|
+
<% end %>
|
|
12
|
+
<% card.with_footer(class: "justify-between") do %>
|
|
13
|
+
<span class="text-muted-foreground">Last saved 2 days ago</span>
|
|
14
|
+
<%= render(UI::Button.new(size: :sm)) { "Save" } %>
|
|
15
|
+
<% end %>
|
|
16
|
+
<% end %>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<%= render(UI::Card.new(class: "max-w-sm")) do |card| %>
|
|
2
|
+
<% card.with_header do |header| %>
|
|
3
|
+
<% header.with_title { "Sign in to your workspace" } %>
|
|
4
|
+
<% header.with_description { "Use your email and password." } %>
|
|
5
|
+
<% header.with_action do %><%= render(UI::Button.new(variant: :link, size: :sm, class: "px-0")) { "Create account" } %><% end %>
|
|
6
|
+
<% end %>
|
|
7
|
+
<% card.with_content do %>
|
|
8
|
+
<div class="grid gap-4">
|
|
9
|
+
<%= render(UI::Input.new(type: :email, name: "email", label: "Email", placeholder: "you@example.com")) %>
|
|
10
|
+
<div class="grid gap-2">
|
|
11
|
+
<div class="flex items-center justify-between">
|
|
12
|
+
<%= render(UI::Label.new(for: "card-password")) { "Password" } %>
|
|
13
|
+
<a href="#" class="text-xs text-muted-foreground underline-offset-4 hover:underline">Forgot it?</a>
|
|
14
|
+
</div>
|
|
15
|
+
<%= render(UI::Input.new(type: :password, name: "password", id: "card-password")) %>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
<% end %>
|
|
19
|
+
<% card.with_footer(class: "flex-col gap-2") do %>
|
|
20
|
+
<%= render(UI::Button.new(class: "w-full")) { "Sign in" } %>
|
|
21
|
+
<%= render(UI::Button.new(variant: :outline, class: "w-full")) { "Continue with single sign-on" } %>
|
|
22
|
+
<% end %>
|
|
23
|
+
<% end %>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<%= render(UI::Card.new(size: :sm, class: "max-w-xs")) do |card| %>
|
|
2
|
+
<% card.with_header do |header| %>
|
|
3
|
+
<% header.with_title { "Weekly digest" } %>
|
|
4
|
+
<% header.with_description { "One email, every Monday morning." } %>
|
|
5
|
+
<% end %>
|
|
6
|
+
<% card.with_content do %>
|
|
7
|
+
<ul class="list-disc space-y-1 ps-4 text-muted-foreground">
|
|
8
|
+
<li>New comments on your projects</li>
|
|
9
|
+
<li>Tasks due this week</li>
|
|
10
|
+
<li>Who joined your team</li>
|
|
11
|
+
</ul>
|
|
12
|
+
<% end %>
|
|
13
|
+
<% card.with_footer(class: "gap-2") do %>
|
|
14
|
+
<%= render(UI::Button.new(size: :sm)) { "Turn on" } %>
|
|
15
|
+
<%= render(UI::Button.new(variant: :ghost, size: :sm)) { "See an example" } %>
|
|
16
|
+
<% end %>
|
|
17
|
+
<% end %>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<div class="grid gap-4 sm:grid-cols-2">
|
|
2
|
+
<% { 4 => "16px, the default", 5 => "20px", 6 => "24px", 8 => "32px" }.each do |spacing, label| %>
|
|
3
|
+
<%= render(UI::Card.new(spacing: spacing)) do |card| %>
|
|
4
|
+
<% card.with_header do |header| %>
|
|
5
|
+
<% header.with_title { "spacing: #{spacing}" } %>
|
|
6
|
+
<% header.with_description { label } %>
|
|
7
|
+
<% end %>
|
|
8
|
+
<% card.with_content do %>
|
|
9
|
+
<p class="text-muted-foreground">The gaps between the parts and their inset change together.</p>
|
|
10
|
+
<% end %>
|
|
11
|
+
<% end %>
|
|
12
|
+
<% end %>
|
|
13
|
+
</div>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<div class="grid gap-4 sm:grid-cols-3">
|
|
2
|
+
<% [ [ "Active users", "8,249", "+12%" ], [ "Open tickets", "37", "-4" ], [ "Storage used", "64%", "+2%" ] ].each do |label, value, change| %>
|
|
3
|
+
<%= render(UI::Card.new) do |card| %>
|
|
4
|
+
<% card.with_header do |header| %>
|
|
5
|
+
<% header.with_description { label } %>
|
|
6
|
+
<% header.with_title(class: "text-2xl font-semibold tabular-nums") { value } %>
|
|
7
|
+
<% header.with_action { render(UI::Badge.new(variant: :outline, size: :sm)) { change } } %>
|
|
8
|
+
<% end %>
|
|
9
|
+
<% end %>
|
|
10
|
+
<% end %>
|
|
11
|
+
</div>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<%= render(UI::Card.new(class: "max-w-md")) do |card| %>
|
|
2
|
+
<% card.with_header do |header| %>
|
|
3
|
+
<% header.with_title { "Team" } %>
|
|
4
|
+
<% header.with_description { "Who can see this project." } %>
|
|
5
|
+
<% header.with_action { render(UI::Button.new(variant: :outline, size: :sm)) { "Invite" } } %>
|
|
6
|
+
<% end %>
|
|
7
|
+
<% card.with_content do %>
|
|
8
|
+
<ul class="grid gap-3">
|
|
9
|
+
<% [ [ "Maya Okafor", "maya@example.com", "Owner" ], [ "Tomás Reyes", "tomas@example.com", "Editor" ], [ "Li Wei", "li@example.com", "Viewer" ] ].each do |name, email, role| %>
|
|
10
|
+
<li class="flex items-center gap-3">
|
|
11
|
+
<%= render(UI::Avatar.new) { name.split.map(&:first).join } %>
|
|
12
|
+
<div class="min-w-0 flex-1">
|
|
13
|
+
<p class="truncate font-medium"><%= name %></p>
|
|
14
|
+
<p class="truncate text-muted-foreground"><%= email %></p>
|
|
15
|
+
</div>
|
|
16
|
+
<%= render(UI::Badge.new(variant: :secondary, size: :sm)) { role } %>
|
|
17
|
+
</li>
|
|
18
|
+
<% end %>
|
|
19
|
+
</ul>
|
|
20
|
+
<% end %>
|
|
21
|
+
<% end %>
|