@noix-dev/brix-vue 0.0.0-stage → 0.2.0
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.
- package/LICENSE +21 -0
- package/README.md +74 -2
- package/package.json +117 -3
- package/src/components/address-field/AddressField.vue +337 -0
- package/src/components/address-field/index.ts +1 -0
- package/src/components/appearance-picker/AppearancePicker.vue +502 -0
- package/src/components/appearance-picker/AppearanceSegment.vue +175 -0
- package/src/components/appearance-picker/index.ts +44 -0
- package/src/components/autofill/AutoFillDialog.vue +264 -0
- package/src/components/autofill/index.ts +1 -0
- package/src/components/badge/Badge.vue +23 -0
- package/src/components/badge/index.ts +106 -0
- package/src/components/build-stamp/BuildStamp.vue +62 -0
- package/src/components/build-stamp/index.ts +1 -0
- package/src/components/button/Button.vue +31 -0
- package/src/components/button/index.ts +122 -0
- package/src/components/card/Card.vue +29 -0
- package/src/components/card/CardAction.vue +17 -0
- package/src/components/card/CardContent.vue +14 -0
- package/src/components/card/CardDescription.vue +14 -0
- package/src/components/card/CardFooter.vue +22 -0
- package/src/components/card/CardHeader.vue +22 -0
- package/src/components/card/CardTitle.vue +29 -0
- package/src/components/card/index.ts +47 -0
- package/src/components/chart/BarChart.vue +123 -0
- package/src/components/chart/StackedBarChart.vue +149 -0
- package/src/components/chart/appearanceRevision.ts +22 -0
- package/src/components/chart/chartColor.ts +59 -0
- package/src/components/chart/index.ts +6 -0
- package/src/components/checkbox/Checkbox.vue +61 -0
- package/src/components/checkbox/index.ts +1 -0
- package/src/components/code-editor/CodeEditor.vue +352 -0
- package/src/components/code-editor/index.ts +9 -0
- package/src/components/code-editor/syntaxTheme.ts +110 -0
- package/src/components/colour-picker/ColourPicker.vue +421 -0
- package/src/components/colour-picker/index.ts +1 -0
- package/src/components/combobox/Combobox.vue +337 -0
- package/src/components/combobox/index.ts +1 -0
- package/src/components/comments/CommentComposer.vue +302 -0
- package/src/components/comments/CommentMessage.vue +259 -0
- package/src/components/comments/CommentThread.vue +250 -0
- package/src/components/comments/commentBody.ts +185 -0
- package/src/components/comments/commentLevels.ts +139 -0
- package/src/components/comments/commentNode.ts +35 -0
- package/src/components/comments/composer.ts +20 -0
- package/src/components/comments/index.ts +29 -0
- package/src/components/confirm-dialog/ConfirmDialog.vue +153 -0
- package/src/components/confirm-dialog/index.ts +1 -0
- package/src/components/containers/Box.vue +42 -0
- package/src/components/containers/Section.vue +88 -0
- package/src/components/containers/SectionAction.vue +17 -0
- package/src/components/containers/SectionContent.vue +14 -0
- package/src/components/containers/SectionDescription.vue +14 -0
- package/src/components/containers/SectionHeader.vue +22 -0
- package/src/components/containers/SectionTitle.vue +17 -0
- package/src/components/containers/index.ts +9 -0
- package/src/components/data-table/ColumnMenu.vue +241 -0
- package/src/components/data-table/DataTable.vue +447 -0
- package/src/components/data-table/ExpandCaret.vue +34 -0
- package/src/components/data-table/SortableHead.vue +184 -0
- package/src/components/data-table/TableLoadingRow.vue +13 -0
- package/src/components/data-table/TableProgressRow.vue +26 -0
- package/src/components/data-table/columns.ts +13 -0
- package/src/components/data-table/index.ts +3 -0
- package/src/components/data-table/pinned.ts +19 -0
- package/src/components/data-table/rowActivation.ts +14 -0
- package/src/components/data-table/sort.ts +13 -0
- package/src/components/data-table/types.ts +23 -0
- package/src/components/date-picker/CalendarPanel.vue +432 -0
- package/src/components/date-picker/DateField.vue +293 -0
- package/src/components/date-picker/DatePicker.vue +147 -0
- package/src/components/date-picker/UntilDatePicker.vue +96 -0
- package/src/components/date-picker/dateFieldGuard.ts +87 -0
- package/src/components/date-picker/index.ts +4 -0
- package/src/components/date-picker/useDateField.ts +37 -0
- package/src/components/date-range-picker/DateRangePicker.vue +247 -0
- package/src/components/date-range-picker/index.ts +1 -0
- package/src/components/date-time-picker/DateTimePicker.vue +291 -0
- package/src/components/date-time-picker/index.ts +1 -0
- package/src/components/dialog/Dialog.vue +250 -0
- package/src/components/dialog/DialogSurface.vue +214 -0
- package/src/components/dialog/dialogEdges.ts +65 -0
- package/src/components/dialog/dialogSizes.ts +35 -0
- package/src/components/dialog/index.ts +12 -0
- package/src/components/dialog/toastHost.ts +18 -0
- package/src/components/dropdown/Dropdown.vue +101 -0
- package/src/components/dropdown/DropdownItems.vue +154 -0
- package/src/components/dropdown/dropdown.ts +64 -0
- package/src/components/dropdown/index.ts +2 -0
- package/src/components/file-preview/FilePreview.vue +78 -0
- package/src/components/file-preview/index.ts +1 -0
- package/src/components/file-upload/FileUpload.vue +234 -0
- package/src/components/file-upload/index.ts +1 -0
- package/src/components/filter-check-menu/FilterCheckMenu.vue +562 -0
- package/src/components/filter-check-menu/filterCheckOption.ts +10 -0
- package/src/components/filter-check-menu/index.ts +2 -0
- package/src/components/form-field/FormField.vue +74 -0
- package/src/components/form-field/index.ts +2 -0
- package/src/components/form-field/types.ts +5 -0
- package/src/components/frames/FrameCentred.vue +137 -0
- package/src/components/frames/FrameSidebar.vue +113 -0
- package/src/components/frames/FrameSplit.vue +109 -0
- package/src/components/frames/index.ts +3 -0
- package/src/components/icon/BellIcon.vue +27 -0
- package/src/components/icon/BoldIcon.vue +31 -0
- package/src/components/icon/CalendarDaysIcon.vue +33 -0
- package/src/components/icon/CheckIcon.vue +31 -0
- package/src/components/icon/ChevronDownIcon.vue +30 -0
- package/src/components/icon/ChevronLeftIcon.vue +31 -0
- package/src/components/icon/ChevronRightIcon.vue +31 -0
- package/src/components/icon/ChevronUpIcon.vue +30 -0
- package/src/components/icon/CircleAlertIcon.vue +29 -0
- package/src/components/icon/ClockIcon.vue +31 -0
- package/src/components/icon/Columns3Icon.vue +32 -0
- package/src/components/icon/FlipHorizontalIcon.vue +29 -0
- package/src/components/icon/ItalicIcon.vue +28 -0
- package/src/components/icon/LinkIcon.vue +27 -0
- package/src/components/icon/ListIcon.vue +29 -0
- package/src/components/icon/ListOrderedIcon.vue +28 -0
- package/src/components/icon/PenLineIcon.vue +31 -0
- package/src/components/icon/PlusIcon.vue +28 -0
- package/src/components/icon/RotateCcwIcon.vue +28 -0
- package/src/components/icon/RotateCwIcon.vue +28 -0
- package/src/components/icon/SearchIcon.vue +31 -0
- package/src/components/icon/StarIcon.vue +29 -0
- package/src/components/icon/TriangleAlertIcon.vue +29 -0
- package/src/components/icon/UnderlineIcon.vue +27 -0
- package/src/components/icon/Undo2Icon.vue +28 -0
- package/src/components/icon/XIcon.vue +31 -0
- package/src/components/icon/ZoomInIcon.vue +30 -0
- package/src/components/icon/ZoomOutIcon.vue +29 -0
- package/src/components/icon/index.ts +37 -0
- package/src/components/icon-picker/IconPicker.vue +560 -0
- package/src/components/icon-picker/index.ts +1 -0
- package/src/components/image-crop-dialog/CropRatioRow.vue +132 -0
- package/src/components/image-crop-dialog/CropVariantStrip.vue +277 -0
- package/src/components/image-crop-dialog/ImageCropDialog.vue +1541 -0
- package/src/components/image-crop-dialog/index.ts +16 -0
- package/src/components/image-upload/ImageUpload.vue +345 -0
- package/src/components/image-upload/index.ts +2 -0
- package/src/components/input/Input.vue +48 -0
- package/src/components/input/index.ts +1 -0
- package/src/components/keycap/Keycap.vue +49 -0
- package/src/components/keycap/index.ts +1 -0
- package/src/components/label/Label.vue +26 -0
- package/src/components/label/index.ts +1 -0
- package/src/components/menu/MenuCheckboxItem.vue +63 -0
- package/src/components/menu/MenuContent.vue +45 -0
- package/src/components/menu/MenuGroup.vue +22 -0
- package/src/components/menu/MenuItem.vue +34 -0
- package/src/components/menu/MenuLabel.vue +22 -0
- package/src/components/menu/MenuRadioGroup.vue +22 -0
- package/src/components/menu/MenuRadioItem.vue +50 -0
- package/src/components/menu/MenuRoot.vue +25 -0
- package/src/components/menu/MenuSeparator.vue +27 -0
- package/src/components/menu/MenuSub.vue +29 -0
- package/src/components/menu/MenuSubContent.vue +48 -0
- package/src/components/menu/MenuSubTrigger.vue +49 -0
- package/src/components/menu/MenuTrigger.vue +22 -0
- package/src/components/menu/index.ts +20 -0
- package/src/components/menu/menuClasses.ts +74 -0
- package/src/components/morph-select/MorphSelect.vue +150 -0
- package/src/components/morph-select/index.ts +1 -0
- package/src/components/nav/NavFlyout.vue +343 -0
- package/src/components/nav/NavGroup.vue +306 -0
- package/src/components/nav/NavItem.vue +243 -0
- package/src/components/nav/NavNodes.ts +66 -0
- package/src/components/nav/NavSection.vue +105 -0
- package/src/components/nav/NavSidebar.vue +137 -0
- package/src/components/nav/index.ts +5 -0
- package/src/components/nav/navChain.ts +112 -0
- package/src/components/nav/navClasses.ts +229 -0
- package/src/components/nav/navNode.ts +10 -0
- package/src/components/nav/navRegistry.ts +24 -0
- package/src/components/notification-list/NotificationList.vue +314 -0
- package/src/components/notification-list/index.ts +2 -0
- package/src/components/notification-list/notifications.ts +21 -0
- package/src/components/pagination/Pagination.vue +296 -0
- package/src/components/pagination/index.ts +1 -0
- package/src/components/pin-field/PinField.vue +332 -0
- package/src/components/pin-field/index.ts +1 -0
- package/src/components/popover-panel/PopoverPanel.vue +115 -0
- package/src/components/popover-panel/index.ts +5 -0
- package/src/components/rating/Rating.vue +201 -0
- package/src/components/rating/index.ts +1 -0
- package/src/components/record-avatar/RecordAvatar.vue +76 -0
- package/src/components/record-avatar/index.ts +1 -0
- package/src/components/result-window/ResultWindow.vue +399 -0
- package/src/components/result-window/index.ts +2 -0
- package/src/components/result-window/results.ts +75 -0
- package/src/components/rich-editor/RichEditor.vue +370 -0
- package/src/components/rich-editor/RichEditorLinkDialog.vue +133 -0
- package/src/components/rich-editor/index.ts +8 -0
- package/src/components/row-actions/RowActions.vue +262 -0
- package/src/components/row-actions/index.ts +2 -0
- package/src/components/row-actions/rowActions.ts +44 -0
- package/src/components/search-select/SearchSelect.vue +599 -0
- package/src/components/search-select/index.ts +2 -0
- package/src/components/search-select/types.ts +14 -0
- package/src/components/segmented-choice/SegmentedChoice.vue +136 -0
- package/src/components/segmented-choice/index.ts +2 -0
- package/src/components/segmented-choice/segmentedOption.ts +6 -0
- package/src/components/select/Select.vue +18 -0
- package/src/components/select/SelectContent.vue +73 -0
- package/src/components/select/SelectGroup.vue +21 -0
- package/src/components/select/SelectItem.vue +47 -0
- package/src/components/select/SelectItemText.vue +12 -0
- package/src/components/select/SelectLabel.vue +17 -0
- package/src/components/select/SelectScrollDownButton.vue +36 -0
- package/src/components/select/SelectScrollUpButton.vue +36 -0
- package/src/components/select/SelectSeparator.vue +19 -0
- package/src/components/select/SelectTrigger.vue +52 -0
- package/src/components/select/SelectValue.vue +12 -0
- package/src/components/select/index.ts +11 -0
- package/src/components/session/IdleTimer.vue +71 -0
- package/src/components/session/SessionDialogs.vue +177 -0
- package/src/components/session/index.ts +2 -0
- package/src/components/split-button/SplitButton.vue +122 -0
- package/src/components/split-button/index.ts +2 -0
- package/src/components/split-button/splitButtonItem.ts +7 -0
- package/src/components/switch/Switch.vue +60 -0
- package/src/components/switch/index.ts +1 -0
- package/src/components/table/Table.vue +51 -0
- package/src/components/table/TableBody.vue +14 -0
- package/src/components/table/TableCaption.vue +17 -0
- package/src/components/table/TableCell.vue +22 -0
- package/src/components/table/TableEmpty.vue +72 -0
- package/src/components/table/TableFooter.vue +17 -0
- package/src/components/table/TableHead.vue +22 -0
- package/src/components/table/TableHeader.vue +14 -0
- package/src/components/table/TableRow.vue +22 -0
- package/src/components/table/index.ts +9 -0
- package/src/components/tabs/Tabs.vue +173 -0
- package/src/components/tabs/index.ts +2 -0
- package/src/components/tabs/tabItem.ts +12 -0
- package/src/components/textarea/LimitedTextarea.vue +81 -0
- package/src/components/textarea/TextLimitCounter.vue +107 -0
- package/src/components/textarea/Textarea.vue +42 -0
- package/src/components/textarea/index.ts +4 -0
- package/src/components/textarea/textLimit.ts +43 -0
- package/src/components/time-picker/TimePicker.vue +522 -0
- package/src/components/time-picker/index.ts +1 -0
- package/src/components/toast/ToastHost.vue +276 -0
- package/src/components/toast/index.ts +1 -0
- package/src/components/update-notice/UpdateNotice.vue +103 -0
- package/src/components/update-notice/index.ts +1 -0
- package/src/components/user-menu/UserMenu.vue +154 -0
- package/src/components/user-menu/index.ts +1 -0
- package/src/index.ts +182 -0
- package/src/lib/cn.ts +21 -0
- package/src/lib/panelFocus.ts +65 -0
- package/src/lib/sessionMonitor.ts +390 -0
- package/src/lib/slotContent.ts +17 -0
- package/src/lib/updateCheck.ts +133 -0
- package/src/styles.css +82 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, nextTick, ref } from 'vue';
|
|
3
|
+
import { cn } from '../../lib/cn';
|
|
4
|
+
import type { SegmentedOption } from './segmentedOption';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* One of a few options, all of them visible.
|
|
8
|
+
*
|
|
9
|
+
* For choices where seeing the alternatives is part of making the choice —
|
|
10
|
+
* who will be able to read what you are writing, most of all. A closed select
|
|
11
|
+
* hides the answer behind a click at the moment it matters most, and hides the
|
|
12
|
+
* other options entirely.
|
|
13
|
+
*
|
|
14
|
+
* A radiogroup, not a tab set: it picks a value rather than swapping panels.
|
|
15
|
+
* Use it for three or four options; past that the row stops being readable and
|
|
16
|
+
* a select is the better tool.
|
|
17
|
+
*
|
|
18
|
+
* Keyboard, as a native radio group: the group is one tab stop (the chosen option, or the
|
|
19
|
+
* first enabled one while nothing is chosen), and the arrow keys move to the next or previous
|
|
20
|
+
* enabled option and choose it, wrapping at the ends. Home and End jump to the first and last.
|
|
21
|
+
*/
|
|
22
|
+
const props = defineProps<{
|
|
23
|
+
modelValue: string;
|
|
24
|
+
options: SegmentedOption[];
|
|
25
|
+
/** Names the group for a screen reader — it has no visible label of its own. */
|
|
26
|
+
groupLabel: string;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
/** Starts each option's test id (`<prefix>-<value>`) — for two choices on one page that share a value. */
|
|
29
|
+
testidPrefix?: string;
|
|
30
|
+
class?: string;
|
|
31
|
+
}>();
|
|
32
|
+
|
|
33
|
+
const emit = defineEmits<{ (e: 'update:modelValue', value: string): void }>();
|
|
34
|
+
|
|
35
|
+
const buttons = ref<HTMLButtonElement[]>([]);
|
|
36
|
+
|
|
37
|
+
function isOff(option: SegmentedOption): boolean {
|
|
38
|
+
return props.disabled === true || option.disabled === true;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function choose(option: SegmentedOption): void {
|
|
42
|
+
if (isOff(option)) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
emit('update:modelValue', option.value);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// The one option the Tab key lands on.
|
|
49
|
+
const tabStop = computed(() => {
|
|
50
|
+
const chosen = props.options.find((o) => o.value === props.modelValue && !isOff(o));
|
|
51
|
+
return (chosen ?? props.options.find((o) => !isOff(o)))?.value;
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
function enabledFrom(start: number, step: 1 | -1): number {
|
|
55
|
+
const count = props.options.length;
|
|
56
|
+
for (let i = 1; i <= count; i += 1) {
|
|
57
|
+
const index = (((start + step * i) % count) + count) % count;
|
|
58
|
+
const option = props.options[index];
|
|
59
|
+
if (option !== undefined && !isOff(option)) {
|
|
60
|
+
return index;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return -1;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function onKeydown(event: KeyboardEvent, index: number): void {
|
|
67
|
+
let target = -1;
|
|
68
|
+
switch (event.key) {
|
|
69
|
+
case 'ArrowRight':
|
|
70
|
+
case 'ArrowDown':
|
|
71
|
+
target = enabledFrom(index, 1);
|
|
72
|
+
break;
|
|
73
|
+
case 'ArrowLeft':
|
|
74
|
+
case 'ArrowUp':
|
|
75
|
+
target = enabledFrom(index, -1);
|
|
76
|
+
break;
|
|
77
|
+
case 'Home':
|
|
78
|
+
target = enabledFrom(-1, 1);
|
|
79
|
+
break;
|
|
80
|
+
case 'End':
|
|
81
|
+
target = enabledFrom(props.options.length, -1);
|
|
82
|
+
break;
|
|
83
|
+
default:
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
event.preventDefault();
|
|
87
|
+
const option = props.options[target];
|
|
88
|
+
if (option === undefined) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
choose(option);
|
|
92
|
+
// The caller owns the value and may not take it, so focus follows the key, not the prop.
|
|
93
|
+
void nextTick(() => buttons.value[target]?.focus());
|
|
94
|
+
}
|
|
95
|
+
</script>
|
|
96
|
+
|
|
97
|
+
<template>
|
|
98
|
+
<div
|
|
99
|
+
role="radiogroup"
|
|
100
|
+
:aria-label="props.groupLabel"
|
|
101
|
+
:class="
|
|
102
|
+
cn(
|
|
103
|
+
'inline-flex flex-wrap gap-0.5 rounded-lg border border-muted-foreground p-0.5',
|
|
104
|
+
// The group is the bordered element, so the invalid edge belongs here and not
|
|
105
|
+
// on the options: a `FormField` hands this control one `aria-invalid`, which
|
|
106
|
+
// falls through to the root, and a group of radios is invalid as a group.
|
|
107
|
+
'aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40',
|
|
108
|
+
props.class,
|
|
109
|
+
)
|
|
110
|
+
"
|
|
111
|
+
>
|
|
112
|
+
<button
|
|
113
|
+
v-for="(option, index) in props.options"
|
|
114
|
+
:key="option.value"
|
|
115
|
+
ref="buttons"
|
|
116
|
+
type="button"
|
|
117
|
+
role="radio"
|
|
118
|
+
:aria-checked="props.modelValue === option.value"
|
|
119
|
+
:tabindex="option.value === tabStop ? 0 : -1"
|
|
120
|
+
:disabled="isOff(option)"
|
|
121
|
+
:data-testid="`${props.testidPrefix ?? 'segmented'}-${option.value}`"
|
|
122
|
+
:class="
|
|
123
|
+
cn(
|
|
124
|
+
'rounded-md border border-transparent px-2.5 py-1 text-[11.5px] font-semibold outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50',
|
|
125
|
+
props.modelValue === option.value
|
|
126
|
+
? 'border-primary bg-accent-tint text-primary-on-wash'
|
|
127
|
+
: 'text-muted-foreground hover:text-foreground',
|
|
128
|
+
)
|
|
129
|
+
"
|
|
130
|
+
@click="choose(option)"
|
|
131
|
+
@keydown="onKeydown($event, index)"
|
|
132
|
+
>
|
|
133
|
+
{{ option.label }}
|
|
134
|
+
</button>
|
|
135
|
+
</div>
|
|
136
|
+
</template>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SelectRootEmits, SelectRootProps } from 'reka-ui';
|
|
3
|
+
import { SelectRoot, useForwardPropsEmits } from 'reka-ui';
|
|
4
|
+
|
|
5
|
+
const props = defineProps<SelectRootProps>();
|
|
6
|
+
const emits = defineEmits<SelectRootEmits>();
|
|
7
|
+
|
|
8
|
+
const forwarded = useForwardPropsEmits(props, emits);
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<!-- No `data-slot` here: reka's `SelectRoot` is a provider and renders no element of
|
|
13
|
+
its own, so an attribute on it is discarded. The hooks the density rules and the
|
|
14
|
+
suites address live on `SelectTrigger`, `SelectContent` and `SelectItem`. -->
|
|
15
|
+
<SelectRoot v-slot="slotProps" v-bind="forwarded">
|
|
16
|
+
<slot v-bind="slotProps" />
|
|
17
|
+
</SelectRoot>
|
|
18
|
+
</template>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SelectContentEmits, SelectContentProps } from 'reka-ui';
|
|
3
|
+
import type { HTMLAttributes } from 'vue';
|
|
4
|
+
import { reactiveOmit } from '@vueuse/core';
|
|
5
|
+
import { SelectContent, SelectPortal, SelectViewport, useForwardPropsEmits } from 'reka-ui';
|
|
6
|
+
import { cn } from '../../lib/cn';
|
|
7
|
+
import SelectScrollDownButton from './SelectScrollDownButton.vue';
|
|
8
|
+
import SelectScrollUpButton from './SelectScrollUpButton.vue';
|
|
9
|
+
|
|
10
|
+
defineOptions({
|
|
11
|
+
inheritAttrs: false,
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const props = withDefaults(
|
|
15
|
+
defineProps<SelectContentProps & { class?: HTMLAttributes['class'] }>(),
|
|
16
|
+
{
|
|
17
|
+
position: 'item-aligned',
|
|
18
|
+
align: 'center',
|
|
19
|
+
},
|
|
20
|
+
);
|
|
21
|
+
const emits = defineEmits<SelectContentEmits>();
|
|
22
|
+
|
|
23
|
+
defineSlots<{
|
|
24
|
+
default?: () => unknown;
|
|
25
|
+
/** Replaces the arrow on the scroll-up button. Defaults to the package's own chevron. */
|
|
26
|
+
'scroll-up-icon'?: () => unknown;
|
|
27
|
+
/** Replaces the arrow on the scroll-down button. Defaults to the package's own chevron. */
|
|
28
|
+
'scroll-down-icon'?: () => unknown;
|
|
29
|
+
}>();
|
|
30
|
+
|
|
31
|
+
const delegatedProps = reactiveOmit(props, 'class');
|
|
32
|
+
|
|
33
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<template>
|
|
37
|
+
<SelectPortal>
|
|
38
|
+
<SelectContent
|
|
39
|
+
data-slot="select-content"
|
|
40
|
+
:data-align-trigger="position === 'item-aligned'"
|
|
41
|
+
v-bind="{ ...$attrs, ...forwarded }"
|
|
42
|
+
:class="
|
|
43
|
+
cn(
|
|
44
|
+
'bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 min-w-36 rounded-lg shadow-md ring-1 duration-100 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 relative z-50 max-h-(--reka-select-content-available-height) origin-(--reka-select-content-transform-origin) overflow-x-hidden overflow-y-auto data-[align-trigger=true]:animate-none',
|
|
45
|
+
position === 'popper' &&
|
|
46
|
+
'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',
|
|
47
|
+
props.class,
|
|
48
|
+
)
|
|
49
|
+
"
|
|
50
|
+
>
|
|
51
|
+
<SelectScrollUpButton>
|
|
52
|
+
<template v-if="$slots['scroll-up-icon']" #icon>
|
|
53
|
+
<slot name="scroll-up-icon" />
|
|
54
|
+
</template>
|
|
55
|
+
</SelectScrollUpButton>
|
|
56
|
+
<SelectViewport
|
|
57
|
+
:data-position="position"
|
|
58
|
+
:class="
|
|
59
|
+
cn(
|
|
60
|
+
'data-[position=popper]:h-(--reka-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--reka-select-trigger-width)',
|
|
61
|
+
)
|
|
62
|
+
"
|
|
63
|
+
>
|
|
64
|
+
<slot />
|
|
65
|
+
</SelectViewport>
|
|
66
|
+
<SelectScrollDownButton>
|
|
67
|
+
<template v-if="$slots['scroll-down-icon']" #icon>
|
|
68
|
+
<slot name="scroll-down-icon" />
|
|
69
|
+
</template>
|
|
70
|
+
</SelectScrollDownButton>
|
|
71
|
+
</SelectContent>
|
|
72
|
+
</SelectPortal>
|
|
73
|
+
</template>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SelectGroupProps } from 'reka-ui';
|
|
3
|
+
import type { HTMLAttributes } from 'vue';
|
|
4
|
+
import { reactiveOmit } from '@vueuse/core';
|
|
5
|
+
import { SelectGroup } from 'reka-ui';
|
|
6
|
+
import { cn } from '../../lib/cn';
|
|
7
|
+
|
|
8
|
+
const props = defineProps<SelectGroupProps & { class?: HTMLAttributes['class'] }>();
|
|
9
|
+
|
|
10
|
+
const delegatedProps = reactiveOmit(props, 'class');
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<SelectGroup
|
|
15
|
+
data-slot="select-group"
|
|
16
|
+
v-bind="delegatedProps"
|
|
17
|
+
:class="cn('scroll-my-1 p-1', props.class)"
|
|
18
|
+
>
|
|
19
|
+
<slot />
|
|
20
|
+
</SelectGroup>
|
|
21
|
+
</template>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SelectItemProps } from 'reka-ui';
|
|
3
|
+
import type { HTMLAttributes } from 'vue';
|
|
4
|
+
import { reactiveOmit } from '@vueuse/core';
|
|
5
|
+
import { SelectItem, SelectItemIndicator, useForwardProps } from 'reka-ui';
|
|
6
|
+
import { cn } from '../../lib/cn';
|
|
7
|
+
import { CheckIcon } from '../icon';
|
|
8
|
+
import SelectItemText from './SelectItemText.vue';
|
|
9
|
+
|
|
10
|
+
const props = defineProps<SelectItemProps & { class?: HTMLAttributes['class'] }>();
|
|
11
|
+
|
|
12
|
+
defineSlots<{
|
|
13
|
+
/** The option's label. */
|
|
14
|
+
default?: () => unknown;
|
|
15
|
+
/** The tick drawn beside the chosen option. Defaults to the package's own glyph. */
|
|
16
|
+
'indicator-icon'?: () => unknown;
|
|
17
|
+
}>();
|
|
18
|
+
|
|
19
|
+
const delegatedProps = reactiveOmit(props, 'class');
|
|
20
|
+
|
|
21
|
+
const forwardedProps = useForwardProps(delegatedProps);
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<SelectItem
|
|
26
|
+
data-slot="select-item"
|
|
27
|
+
v-bind="forwardedProps"
|
|
28
|
+
:class="
|
|
29
|
+
cn(
|
|
30
|
+
'focus:bg-accent focus:text-accent-foreground focus:ring-2 focus:ring-inset focus:ring-ring gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm [&_svg:not([class*=size-])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0',
|
|
31
|
+
props.class,
|
|
32
|
+
)
|
|
33
|
+
"
|
|
34
|
+
>
|
|
35
|
+
<span class="pointer-events-none absolute right-2 flex size-4 items-center justify-center">
|
|
36
|
+
<SelectItemIndicator>
|
|
37
|
+
<slot name="indicator-icon">
|
|
38
|
+
<CheckIcon class="pointer-events-none" />
|
|
39
|
+
</slot>
|
|
40
|
+
</SelectItemIndicator>
|
|
41
|
+
</span>
|
|
42
|
+
|
|
43
|
+
<SelectItemText>
|
|
44
|
+
<slot />
|
|
45
|
+
</SelectItemText>
|
|
46
|
+
</SelectItem>
|
|
47
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SelectItemTextProps } from 'reka-ui';
|
|
3
|
+
import { SelectItemText } from 'reka-ui';
|
|
4
|
+
|
|
5
|
+
const props = defineProps<SelectItemTextProps>();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<SelectItemText data-slot="select-item-text" v-bind="props">
|
|
10
|
+
<slot />
|
|
11
|
+
</SelectItemText>
|
|
12
|
+
</template>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SelectLabelProps } from 'reka-ui';
|
|
3
|
+
import type { HTMLAttributes } from 'vue';
|
|
4
|
+
import { SelectLabel } from 'reka-ui';
|
|
5
|
+
import { cn } from '../../lib/cn';
|
|
6
|
+
|
|
7
|
+
const props = defineProps<SelectLabelProps & { class?: HTMLAttributes['class'] }>();
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<SelectLabel
|
|
12
|
+
data-slot="select-label"
|
|
13
|
+
:class="cn('text-muted-foreground px-1.5 py-1 text-xs', props.class)"
|
|
14
|
+
>
|
|
15
|
+
<slot />
|
|
16
|
+
</SelectLabel>
|
|
17
|
+
</template>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SelectScrollDownButtonProps } from 'reka-ui';
|
|
3
|
+
import type { HTMLAttributes } from 'vue';
|
|
4
|
+
import { reactiveOmit } from '@vueuse/core';
|
|
5
|
+
import { SelectScrollDownButton, useForwardProps } from 'reka-ui';
|
|
6
|
+
import { cn } from '../../lib/cn';
|
|
7
|
+
import { ChevronDownIcon } from '../icon';
|
|
8
|
+
|
|
9
|
+
const props = defineProps<SelectScrollDownButtonProps & { class?: HTMLAttributes['class'] }>();
|
|
10
|
+
|
|
11
|
+
defineSlots<{
|
|
12
|
+
/** The arrow drawn on the scroll-down button. Defaults to the package's own chevron. */
|
|
13
|
+
icon?: () => unknown;
|
|
14
|
+
}>();
|
|
15
|
+
|
|
16
|
+
const delegatedProps = reactiveOmit(props, 'class');
|
|
17
|
+
|
|
18
|
+
const forwardedProps = useForwardProps(delegatedProps);
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<SelectScrollDownButton
|
|
23
|
+
data-slot="select-scroll-down-button"
|
|
24
|
+
v-bind="forwardedProps"
|
|
25
|
+
:class="
|
|
26
|
+
cn(
|
|
27
|
+
'bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*=size-])]:size-4',
|
|
28
|
+
props.class,
|
|
29
|
+
)
|
|
30
|
+
"
|
|
31
|
+
>
|
|
32
|
+
<slot name="icon">
|
|
33
|
+
<ChevronDownIcon />
|
|
34
|
+
</slot>
|
|
35
|
+
</SelectScrollDownButton>
|
|
36
|
+
</template>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SelectScrollUpButtonProps } from 'reka-ui';
|
|
3
|
+
import type { HTMLAttributes } from 'vue';
|
|
4
|
+
import { reactiveOmit } from '@vueuse/core';
|
|
5
|
+
import { SelectScrollUpButton, useForwardProps } from 'reka-ui';
|
|
6
|
+
import { cn } from '../../lib/cn';
|
|
7
|
+
import { ChevronUpIcon } from '../icon';
|
|
8
|
+
|
|
9
|
+
const props = defineProps<SelectScrollUpButtonProps & { class?: HTMLAttributes['class'] }>();
|
|
10
|
+
|
|
11
|
+
defineSlots<{
|
|
12
|
+
/** The arrow drawn on the scroll-up button. Defaults to the package's own chevron. */
|
|
13
|
+
icon?: () => unknown;
|
|
14
|
+
}>();
|
|
15
|
+
|
|
16
|
+
const delegatedProps = reactiveOmit(props, 'class');
|
|
17
|
+
|
|
18
|
+
const forwardedProps = useForwardProps(delegatedProps);
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<SelectScrollUpButton
|
|
23
|
+
data-slot="select-scroll-up-button"
|
|
24
|
+
v-bind="forwardedProps"
|
|
25
|
+
:class="
|
|
26
|
+
cn(
|
|
27
|
+
'bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*=size-])]:size-4',
|
|
28
|
+
props.class,
|
|
29
|
+
)
|
|
30
|
+
"
|
|
31
|
+
>
|
|
32
|
+
<slot name="icon">
|
|
33
|
+
<ChevronUpIcon />
|
|
34
|
+
</slot>
|
|
35
|
+
</SelectScrollUpButton>
|
|
36
|
+
</template>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SelectSeparatorProps } from 'reka-ui';
|
|
3
|
+
import type { HTMLAttributes } from 'vue';
|
|
4
|
+
import { reactiveOmit } from '@vueuse/core';
|
|
5
|
+
import { SelectSeparator } from 'reka-ui';
|
|
6
|
+
import { cn } from '../../lib/cn';
|
|
7
|
+
|
|
8
|
+
const props = defineProps<SelectSeparatorProps & { class?: HTMLAttributes['class'] }>();
|
|
9
|
+
|
|
10
|
+
const delegatedProps = reactiveOmit(props, 'class');
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<SelectSeparator
|
|
15
|
+
data-slot="select-separator"
|
|
16
|
+
v-bind="delegatedProps"
|
|
17
|
+
:class="cn('bg-border -mx-1 my-1 h-px pointer-events-none', props.class)"
|
|
18
|
+
/>
|
|
19
|
+
</template>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SelectTriggerProps } from 'reka-ui';
|
|
3
|
+
import type { HTMLAttributes } from 'vue';
|
|
4
|
+
import { reactiveOmit } from '@vueuse/core';
|
|
5
|
+
import { SelectIcon, SelectTrigger, useForwardProps } from 'reka-ui';
|
|
6
|
+
import { cn } from '../../lib/cn';
|
|
7
|
+
import { ChevronDownIcon } from '../icon';
|
|
8
|
+
|
|
9
|
+
const props = withDefaults(
|
|
10
|
+
defineProps<
|
|
11
|
+
SelectTriggerProps & { class?: HTMLAttributes['class']; size?: 'sm' | 'default' }
|
|
12
|
+
>(),
|
|
13
|
+
{ size: 'default' },
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
defineSlots<{
|
|
17
|
+
/** The value, usually a `SelectValue`. */
|
|
18
|
+
default?: () => unknown;
|
|
19
|
+
/** The arrow at the trigger's end. Defaults to the package's own chevron. */
|
|
20
|
+
icon?: () => unknown;
|
|
21
|
+
}>();
|
|
22
|
+
|
|
23
|
+
const delegatedProps = reactiveOmit(props, 'class', 'size');
|
|
24
|
+
const forwardedProps = useForwardProps(delegatedProps);
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<template>
|
|
28
|
+
<SelectTrigger
|
|
29
|
+
data-slot="select-trigger"
|
|
30
|
+
:data-size="size"
|
|
31
|
+
v-bind="forwardedProps"
|
|
32
|
+
:class="
|
|
33
|
+
cn(
|
|
34
|
+
// The resting edge is `--muted-foreground`, not `--input`: `--input` is 1.26-1.82:1
|
|
35
|
+
// against the page, which leaves the control with no visible boundary. The ring
|
|
36
|
+
// sits 2px off the edge on a gap of `--background`, because `--ring` is the same
|
|
37
|
+
// colour as `--primary` in most themes and a ring without a gap vanishes.
|
|
38
|
+
'border-muted-foreground data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring focus-visible:ring-offset-background aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive gap-1.5 rounded-lg border bg-transparent py-2 pr-2 pl-2.5 text-sm transition-colors select-none focus-visible:ring-2 focus-visible:ring-offset-2 aria-invalid:ring-3 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*=size-])]:size-4 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0',
|
|
39
|
+
props.class,
|
|
40
|
+
)
|
|
41
|
+
"
|
|
42
|
+
>
|
|
43
|
+
<slot />
|
|
44
|
+
<SelectIcon as-child>
|
|
45
|
+
<span class="text-muted-foreground pointer-events-none inline-flex">
|
|
46
|
+
<slot name="icon">
|
|
47
|
+
<ChevronDownIcon />
|
|
48
|
+
</slot>
|
|
49
|
+
</span>
|
|
50
|
+
</SelectIcon>
|
|
51
|
+
</SelectTrigger>
|
|
52
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SelectValueProps } from 'reka-ui';
|
|
3
|
+
import { SelectValue } from 'reka-ui';
|
|
4
|
+
|
|
5
|
+
const props = defineProps<SelectValueProps>();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<SelectValue data-slot="select-value" v-bind="props">
|
|
10
|
+
<slot />
|
|
11
|
+
</SelectValue>
|
|
12
|
+
</template>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { default as Select } from './Select.vue';
|
|
2
|
+
export { default as SelectContent } from './SelectContent.vue';
|
|
3
|
+
export { default as SelectGroup } from './SelectGroup.vue';
|
|
4
|
+
export { default as SelectItem } from './SelectItem.vue';
|
|
5
|
+
export { default as SelectItemText } from './SelectItemText.vue';
|
|
6
|
+
export { default as SelectLabel } from './SelectLabel.vue';
|
|
7
|
+
export { default as SelectScrollDownButton } from './SelectScrollDownButton.vue';
|
|
8
|
+
export { default as SelectScrollUpButton } from './SelectScrollUpButton.vue';
|
|
9
|
+
export { default as SelectSeparator } from './SelectSeparator.vue';
|
|
10
|
+
export { default as SelectTrigger } from './SelectTrigger.vue';
|
|
11
|
+
export { default as SelectValue } from './SelectValue.vue';
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useUiLabels } from '@noix-dev/brix-core';
|
|
3
|
+
import { computed } from 'vue';
|
|
4
|
+
import { IDLE_TIMER_ORANGE_MS, formatIdleRemaining } from '../../lib/sessionMonitor';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A small chip that counts down to the sign-out after inactivity. It takes the time left as a
|
|
8
|
+
* prop and draws it; the monitor that owns the clock is the application's (ADR 0017: state
|
|
9
|
+
* enters by props, leaves by events), so there is no timer, no injection and no event here.
|
|
10
|
+
*
|
|
11
|
+
* The number is whole minutes while a minute or more is left and seconds in the last one
|
|
12
|
+
* (`formatIdleRemaining` decides, this only draws it). From `IDLE_TIMER_ORANGE_MS` (five
|
|
13
|
+
* minutes, inclusive) the chip turns to the warning tone. `collapsed` stacks the unit under the
|
|
14
|
+
* number, for a narrow rail.
|
|
15
|
+
*
|
|
16
|
+
* COLOUR. Roles only, no `dark:` branch:
|
|
17
|
+
* - resting: a 40% `--muted` wash inside a `--border` hairline with `--muted-foreground` ink,
|
|
18
|
+
* the shape the pager's hint already ships;
|
|
19
|
+
* - warning: a 10% `--warning` wash, a 40% `--warning` edge and `--warning-on-wash` ink. The
|
|
20
|
+
* wash is an sRGB alpha, never a `color-mix`, because the gate measures an sRGB composite.
|
|
21
|
+
*
|
|
22
|
+
* GROUND. The chip does not know what it sits on, so it promises a measured floor instead of
|
|
23
|
+
* naming a ground. Measured with the tokens package's own `wash` and `contrastRatio`, in house
|
|
24
|
+
* order (kingfisher light, kingfisher dark, graphite light, graphite dark, noix light, noix
|
|
25
|
+
* dark):
|
|
26
|
+
* - warning ink over `--background`: 6.94 10.25 6.96 9.05 6.96 9.52; over `--card`: 6.94 8.89
|
|
27
|
+
* 6.96 8.25 6.96 8.54. Both are gated pairs in the contract (4.5:1), so the warning chip
|
|
28
|
+
* may sit on the page or on a card.
|
|
29
|
+
* - resting ink over `--background`: 4.57 7.04 5.41 7.20 5.34 7.69; over `--card`: 4.57 6.50
|
|
30
|
+
* 5.41 6.80 5.34 7.21; over `--sidebar`: 4.46 6.50 5.22 6.80 5.19 7.21. The sidebar's 4.46
|
|
31
|
+
* (kingfisher light) is the one reading under 4.5:1. It is inherited from the pager's hint
|
|
32
|
+
* and recorded in the contract as an unenforced pair, a palette decision left to the
|
|
33
|
+
* decision that owns it; the resting chip is within AA on the page and on a card.
|
|
34
|
+
*/
|
|
35
|
+
const props = defineProps<{
|
|
36
|
+
/** Milliseconds until the client deadline. */
|
|
37
|
+
remainingMs: number;
|
|
38
|
+
/** Puts the unit under the number instead of beside it. */
|
|
39
|
+
collapsed?: boolean;
|
|
40
|
+
}>();
|
|
41
|
+
|
|
42
|
+
const labels = useUiLabels();
|
|
43
|
+
|
|
44
|
+
const warn = computed(() => props.remainingMs <= IDLE_TIMER_ORANGE_MS);
|
|
45
|
+
const shown = computed(() => formatIdleRemaining(props.remainingMs));
|
|
46
|
+
const unit = computed(() =>
|
|
47
|
+
shown.value.unit === 'minutes' ? labels.value.idleTimerMinutes : labels.value.idleTimerSeconds,
|
|
48
|
+
);
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<template>
|
|
52
|
+
<div
|
|
53
|
+
data-slot="idle-timer"
|
|
54
|
+
data-testid="idle-timer"
|
|
55
|
+
role="timer"
|
|
56
|
+
:title="labels.idleTimerTitle"
|
|
57
|
+
:data-tone="warn ? 'warning' : 'resting'"
|
|
58
|
+
:data-collapsed="props.collapsed ? 'true' : 'false'"
|
|
59
|
+
:class="[
|
|
60
|
+
'inline-flex items-center justify-center rounded-md border px-2 py-1 text-xs tabular-nums',
|
|
61
|
+
props.collapsed ? 'flex-col gap-0 leading-tight' : 'gap-1',
|
|
62
|
+
warn
|
|
63
|
+
? 'border-warning/40 bg-warning/10 text-warning-on-wash'
|
|
64
|
+
: 'border-border bg-muted/40 text-muted-foreground',
|
|
65
|
+
]"
|
|
66
|
+
>
|
|
67
|
+
<span class="sr-only">{{ labels.idleTimerPrefix }}</span>
|
|
68
|
+
<span data-testid="idle-timer-value" class="font-semibold">{{ shown.value }}</span>
|
|
69
|
+
<span data-testid="idle-timer-unit">{{ unit }}</span>
|
|
70
|
+
</div>
|
|
71
|
+
</template>
|