@sewadah/selaras 0.9.0 → 0.10.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/README.md +11 -0
- package/dist/agent/catalog.json +1 -1
- package/dist/module.json +1 -1
- package/dist/runtime/components/Checkbox.d.vue.ts +6 -4
- package/dist/runtime/components/Checkbox.vue +30 -22
- package/dist/runtime/components/Checkbox.vue.d.ts +6 -4
- package/dist/runtime/components/DatePicker.d.vue.ts +27 -27
- package/dist/runtime/components/DatePicker.vue +58 -99
- package/dist/runtime/components/DatePicker.vue.d.ts +27 -27
- package/dist/runtime/components/Editable.d.vue.ts +91 -0
- package/dist/runtime/components/Editable.vue +257 -0
- package/dist/runtime/components/Editable.vue.d.ts +91 -0
- package/dist/runtime/components/Input.vue +21 -22
- package/dist/runtime/components/Textarea.vue +20 -23
- package/dist/runtime/components/Toolbar.d.vue.ts +25 -0
- package/dist/runtime/components/Toolbar.vue +35 -0
- package/dist/runtime/components/Toolbar.vue.d.ts +25 -0
- package/dist/runtime/components/ToolbarButton.d.vue.ts +20 -0
- package/dist/runtime/components/ToolbarButton.vue +46 -0
- package/dist/runtime/components/ToolbarButton.vue.d.ts +20 -0
- package/dist/runtime/components/ToolbarSeparator.d.vue.ts +10 -0
- package/dist/runtime/components/ToolbarSeparator.vue +22 -0
- package/dist/runtime/components/ToolbarSeparator.vue.d.ts +10 -0
- package/dist/runtime/components/ToolbarToggleGroup.d.vue.ts +37 -0
- package/dist/runtime/components/ToolbarToggleGroup.vue +44 -0
- package/dist/runtime/components/ToolbarToggleGroup.vue.d.ts +37 -0
- package/dist/runtime/internal/ComboboxSelectBase.vue +41 -50
- package/dist/runtime/internal/FieldClearButton.d.vue.ts +21 -0
- package/dist/runtime/internal/FieldClearButton.vue +30 -0
- package/dist/runtime/internal/FieldClearButton.vue.d.ts +21 -0
- package/dist/runtime/internal/ListboxOption.d.vue.ts +2 -1
- package/dist/runtime/internal/ListboxOption.vue +3 -2
- package/dist/runtime/internal/ListboxOption.vue.d.ts +2 -1
- package/dist/runtime/theme/date-picker.d.ts +27 -0
- package/dist/runtime/theme/date-picker.js +6 -3
- package/dist/runtime/theme/editable.d.ts +155 -0
- package/dist/runtime/theme/editable.js +25 -0
- package/dist/runtime/theme/field-clear-button.d.ts +56 -0
- package/dist/runtime/theme/field-clear-button.js +15 -0
- package/dist/runtime/theme/input.d.ts +0 -9
- package/dist/runtime/theme/input.js +5 -12
- package/dist/runtime/theme/listbox.js +1 -1
- package/dist/runtime/theme/select.d.ts +9 -0
- package/dist/runtime/theme/select.js +11 -10
- package/dist/runtime/theme/textarea.d.ts +0 -9
- package/dist/runtime/theme/textarea.js +4 -4
- package/dist/runtime/theme/toolbar-button.d.ts +65 -0
- package/dist/runtime/theme/toolbar-button.js +21 -0
- package/dist/runtime/theme/toolbar-separator.d.ts +35 -0
- package/dist/runtime/theme/toolbar-separator.js +8 -0
- package/dist/runtime/theme/toolbar-toggle-group.d.ts +74 -0
- package/dist/runtime/theme/toolbar-toggle-group.js +13 -0
- package/dist/runtime/theme/toolbar.d.ts +35 -0
- package/dist/runtime/theme/toolbar.js +11 -0
- package/dist/runtime/theme-config.d.ts +36 -0
- package/dist/runtime/types/index.d.ts +5 -0
- package/dist/runtime/utils/field-clear.d.ts +9 -0
- package/dist/runtime/utils/field-clear.js +7 -0
- package/dist/runtime/utils/icons.d.ts +1 -0
- package/dist/runtime/utils/icons.js +1 -0
- package/dist/runtime/utils/messages.d.ts +4 -0
- package/dist/runtime/utils/messages.js +4 -0
- package/dist/runtime/utils/toolbar.d.ts +9 -0
- package/dist/runtime/utils/toolbar.js +1 -0
- package/package.json +9 -2
- package/skills/selaras/SKILL.md +4 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import Button from "../components/Button.vue";
|
|
4
|
+
import Icon from "../components/Icon.vue";
|
|
5
|
+
import { useIcons } from "../composables/use-icons";
|
|
6
|
+
import { useMessages } from "../composables/use-messages";
|
|
7
|
+
import { fieldClearButtonTheme } from "../theme/field-clear-button";
|
|
8
|
+
import { resolveSlot, useComponentTheme, useRootProps } from "../utils/ui";
|
|
9
|
+
defineOptions({ inheritAttrs: false });
|
|
10
|
+
const props = defineProps({
|
|
11
|
+
size: { type: String, required: false },
|
|
12
|
+
ui: { type: Object, required: false }
|
|
13
|
+
});
|
|
14
|
+
const theme = useComponentTheme("fieldClearButton", fieldClearButtonTheme);
|
|
15
|
+
const ui = computed(() => theme.value({ size: props.size }));
|
|
16
|
+
const rootProps = useRootProps(() => ui.value.base, () => props.ui?.base);
|
|
17
|
+
const iconProps = computed(() => resolveSlot(ui.value.icon, props.ui?.leadingIcon));
|
|
18
|
+
const icons = useIcons();
|
|
19
|
+
const messages = useMessages();
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<Button :size="size" variant="ghost" color="neutral" square :aria-label="messages.clear" v-bind="rootProps" :ui="{ leadingIcon: iconProps }" @mousedown.prevent>
|
|
24
|
+
<template #icon="{ class: iconClass }">
|
|
25
|
+
<slot :class="iconClass">
|
|
26
|
+
<Icon :name="icons.close" :class="iconClass" />
|
|
27
|
+
</slot>
|
|
28
|
+
</template>
|
|
29
|
+
</Button>
|
|
30
|
+
</template>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ButtonThemeSlots } from '../theme/button.js';
|
|
2
|
+
import type { UiProp } from '../utils/ui.js';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
size?: 'sm' | 'md' | 'lg';
|
|
5
|
+
ui?: UiProp<ButtonThemeSlots>;
|
|
6
|
+
};
|
|
7
|
+
declare var __VLS_11: {
|
|
8
|
+
class: unknown;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_Slots = {} & {
|
|
11
|
+
default?: (props: typeof __VLS_11) => any;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
18
|
+
new (): {
|
|
19
|
+
$slots: S;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ListboxThemeSlots } from '../theme/listbox.js';
|
|
2
|
+
import type { ColorRole } from '../utils/color-registry.js';
|
|
2
3
|
import type { ResolvedItemOption } from './combobox-select.js';
|
|
3
4
|
type __VLS_Props = {
|
|
4
5
|
option: ResolvedItemOption;
|
|
@@ -7,7 +8,7 @@ type __VLS_Props = {
|
|
|
7
8
|
disabled?: boolean;
|
|
8
9
|
checkbox?: boolean;
|
|
9
10
|
descriptionKey: string;
|
|
10
|
-
color:
|
|
11
|
+
color: ColorRole;
|
|
11
12
|
size?: 'sm' | 'md' | 'lg';
|
|
12
13
|
parts: Record<ListboxThemeSlots, Record<string, unknown>>;
|
|
13
14
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { ListboxItem, ListboxItemIndicator } from "reka-ui";
|
|
3
3
|
import { computed } from "vue";
|
|
4
|
+
import Checkbox from "../components/Checkbox.vue";
|
|
4
5
|
import Icon from "../components/Icon.vue";
|
|
5
6
|
import { useIcons } from "../composables/use-icons";
|
|
6
7
|
const props = defineProps({
|
|
@@ -10,7 +11,7 @@ const props = defineProps({
|
|
|
10
11
|
disabled: { type: Boolean, required: false },
|
|
11
12
|
checkbox: { type: Boolean, required: false },
|
|
12
13
|
descriptionKey: { type: String, required: true },
|
|
13
|
-
color: { type:
|
|
14
|
+
color: { type: null, required: true },
|
|
14
15
|
size: { type: String, required: false },
|
|
15
16
|
parts: { type: Object, required: true }
|
|
16
17
|
});
|
|
@@ -22,7 +23,7 @@ const icon = computed(() => typeof record.value?.icon === "string" ? record.valu
|
|
|
22
23
|
|
|
23
24
|
<template>
|
|
24
25
|
<ListboxItem :value="option.value" :text-value="option.label" :disabled="disabled || option.disabled" v-bind="parts.item">
|
|
25
|
-
<
|
|
26
|
+
<Checkbox v-if="checkbox" :model-value="selected" :color="color" :size="size" :data-state="selected ? 'checked' : 'unchecked'" decorative variant="default" v-bind="parts.checkbox" />
|
|
26
27
|
<slot :item="option.raw" :index="index" :selected="selected" :disabled="!!(disabled || option.disabled)">
|
|
27
28
|
<Icon v-if="icon" :name="icon" v-bind="parts.icon" />
|
|
28
29
|
<span v-bind="parts.itemContent">
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ListboxThemeSlots } from '../theme/listbox.js';
|
|
2
|
+
import type { ColorRole } from '../utils/color-registry.js';
|
|
2
3
|
import type { ResolvedItemOption } from './combobox-select.js';
|
|
3
4
|
type __VLS_Props = {
|
|
4
5
|
option: ResolvedItemOption;
|
|
@@ -7,7 +8,7 @@ type __VLS_Props = {
|
|
|
7
8
|
disabled?: boolean;
|
|
8
9
|
checkbox?: boolean;
|
|
9
10
|
descriptionKey: string;
|
|
10
|
-
color:
|
|
11
|
+
color: ColorRole;
|
|
11
12
|
size?: 'sm' | 'md' | 'lg';
|
|
12
13
|
parts: Record<ListboxThemeSlots, Record<string, unknown>>;
|
|
13
14
|
};
|
|
@@ -2,12 +2,18 @@ export declare const datePickerTheme: import("tailwind-variants").TVReturnType<{
|
|
|
2
2
|
size: {
|
|
3
3
|
sm: {
|
|
4
4
|
field: string;
|
|
5
|
+
buttonClear: string;
|
|
6
|
+
triggerIcon: string;
|
|
5
7
|
};
|
|
6
8
|
md: {
|
|
7
9
|
field: string;
|
|
10
|
+
buttonClear: string;
|
|
11
|
+
triggerIcon: string;
|
|
8
12
|
};
|
|
9
13
|
lg: {
|
|
10
14
|
field: string;
|
|
15
|
+
buttonClear: string;
|
|
16
|
+
triggerIcon: string;
|
|
11
17
|
};
|
|
12
18
|
};
|
|
13
19
|
invalid: {
|
|
@@ -25,6 +31,9 @@ export declare const datePickerTheme: import("tailwind-variants").TVReturnType<{
|
|
|
25
31
|
field: string;
|
|
26
32
|
segment: string;
|
|
27
33
|
separator: string;
|
|
34
|
+
clear: string;
|
|
35
|
+
buttonClear: string;
|
|
36
|
+
triggerIcon: string;
|
|
28
37
|
content: string;
|
|
29
38
|
mobileContent: string;
|
|
30
39
|
header: string;
|
|
@@ -42,12 +51,18 @@ export declare const datePickerTheme: import("tailwind-variants").TVReturnType<{
|
|
|
42
51
|
size: {
|
|
43
52
|
sm: {
|
|
44
53
|
field: string;
|
|
54
|
+
buttonClear: string;
|
|
55
|
+
triggerIcon: string;
|
|
45
56
|
};
|
|
46
57
|
md: {
|
|
47
58
|
field: string;
|
|
59
|
+
buttonClear: string;
|
|
60
|
+
triggerIcon: string;
|
|
48
61
|
};
|
|
49
62
|
lg: {
|
|
50
63
|
field: string;
|
|
64
|
+
buttonClear: string;
|
|
65
|
+
triggerIcon: string;
|
|
51
66
|
};
|
|
52
67
|
};
|
|
53
68
|
invalid: {
|
|
@@ -65,6 +80,9 @@ export declare const datePickerTheme: import("tailwind-variants").TVReturnType<{
|
|
|
65
80
|
field: string;
|
|
66
81
|
segment: string;
|
|
67
82
|
separator: string;
|
|
83
|
+
clear: string;
|
|
84
|
+
buttonClear: string;
|
|
85
|
+
triggerIcon: string;
|
|
68
86
|
content: string;
|
|
69
87
|
mobileContent: string;
|
|
70
88
|
header: string;
|
|
@@ -82,12 +100,18 @@ export declare const datePickerTheme: import("tailwind-variants").TVReturnType<{
|
|
|
82
100
|
size: {
|
|
83
101
|
sm: {
|
|
84
102
|
field: string;
|
|
103
|
+
buttonClear: string;
|
|
104
|
+
triggerIcon: string;
|
|
85
105
|
};
|
|
86
106
|
md: {
|
|
87
107
|
field: string;
|
|
108
|
+
buttonClear: string;
|
|
109
|
+
triggerIcon: string;
|
|
88
110
|
};
|
|
89
111
|
lg: {
|
|
90
112
|
field: string;
|
|
113
|
+
buttonClear: string;
|
|
114
|
+
triggerIcon: string;
|
|
91
115
|
};
|
|
92
116
|
};
|
|
93
117
|
invalid: {
|
|
@@ -105,6 +129,9 @@ export declare const datePickerTheme: import("tailwind-variants").TVReturnType<{
|
|
|
105
129
|
field: string;
|
|
106
130
|
segment: string;
|
|
107
131
|
separator: string;
|
|
132
|
+
clear: string;
|
|
133
|
+
buttonClear: string;
|
|
134
|
+
triggerIcon: string;
|
|
108
135
|
content: string;
|
|
109
136
|
mobileContent: string;
|
|
110
137
|
header: string;
|
|
@@ -18,6 +18,9 @@ export const datePickerTheme = tv({
|
|
|
18
18
|
// Between the two segment groups in range mode - a plain en dash, not an
|
|
19
19
|
// arrow glyph, so there's nothing directional to mirror under RTL.
|
|
20
20
|
separator: "px-0.5 text-[var(--selaras-resolved-text-muted)]",
|
|
21
|
+
clear: "shrink-0",
|
|
22
|
+
buttonClear: "absolute top-1/2 -translate-y-1/2",
|
|
23
|
+
triggerIcon: "shrink-0",
|
|
21
24
|
// Copied from theme/dropdown.ts's `content` - the more complete of this
|
|
22
25
|
// library's two floating-panel precedents (directional slide-in, not
|
|
23
26
|
// just fade/zoom).
|
|
@@ -55,9 +58,9 @@ export const datePickerTheme = tv({
|
|
|
55
58
|
},
|
|
56
59
|
variants: {
|
|
57
60
|
size: {
|
|
58
|
-
sm: { field: "h-8 px-2.5 text-sm" },
|
|
59
|
-
md: { field: "h-10 px-3 text-sm" },
|
|
60
|
-
lg: { field: "h-11 px-3.5 text-base" }
|
|
61
|
+
sm: { field: "h-8 px-2.5 text-sm", buttonClear: "end-8", triggerIcon: "size-4" },
|
|
62
|
+
md: { field: "h-10 px-3 text-sm", buttonClear: "end-10", triggerIcon: "size-4.5" },
|
|
63
|
+
lg: { field: "h-11 px-3.5 text-base", buttonClear: "end-11", triggerIcon: "size-5" }
|
|
61
64
|
},
|
|
62
65
|
invalid: {
|
|
63
66
|
true: { field: "ring-[var(--_selaras-color-border)] hover:ring-[var(--_selaras-color-border)] focus-within:ring-[var(--_selaras-color-focus)]" }
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
export declare const editableTheme: import("tailwind-variants").TVReturnType<{
|
|
2
|
+
size: {
|
|
3
|
+
sm: {
|
|
4
|
+
preview: string;
|
|
5
|
+
input: string;
|
|
6
|
+
};
|
|
7
|
+
md: {
|
|
8
|
+
preview: string;
|
|
9
|
+
input: string;
|
|
10
|
+
controls: string;
|
|
11
|
+
};
|
|
12
|
+
lg: {
|
|
13
|
+
preview: string;
|
|
14
|
+
input: string;
|
|
15
|
+
controls: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
color: {
|
|
19
|
+
primary: "";
|
|
20
|
+
secondary: "";
|
|
21
|
+
neutral: "";
|
|
22
|
+
success: "";
|
|
23
|
+
danger: "";
|
|
24
|
+
warning: "";
|
|
25
|
+
info: "";
|
|
26
|
+
};
|
|
27
|
+
multiline: {
|
|
28
|
+
true: {
|
|
29
|
+
preview: string;
|
|
30
|
+
input: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
empty: {
|
|
34
|
+
true: {
|
|
35
|
+
preview: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
invalid: {
|
|
39
|
+
true: {
|
|
40
|
+
input: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
}, {
|
|
44
|
+
root: string;
|
|
45
|
+
area: string;
|
|
46
|
+
preview: string;
|
|
47
|
+
input: string;
|
|
48
|
+
controls: string;
|
|
49
|
+
edit: string;
|
|
50
|
+
submit: string;
|
|
51
|
+
cancel: string;
|
|
52
|
+
}, undefined, {
|
|
53
|
+
size: {
|
|
54
|
+
sm: {
|
|
55
|
+
preview: string;
|
|
56
|
+
input: string;
|
|
57
|
+
};
|
|
58
|
+
md: {
|
|
59
|
+
preview: string;
|
|
60
|
+
input: string;
|
|
61
|
+
controls: string;
|
|
62
|
+
};
|
|
63
|
+
lg: {
|
|
64
|
+
preview: string;
|
|
65
|
+
input: string;
|
|
66
|
+
controls: string;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
color: {
|
|
70
|
+
primary: "";
|
|
71
|
+
secondary: "";
|
|
72
|
+
neutral: "";
|
|
73
|
+
success: "";
|
|
74
|
+
danger: "";
|
|
75
|
+
warning: "";
|
|
76
|
+
info: "";
|
|
77
|
+
};
|
|
78
|
+
multiline: {
|
|
79
|
+
true: {
|
|
80
|
+
preview: string;
|
|
81
|
+
input: string;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
empty: {
|
|
85
|
+
true: {
|
|
86
|
+
preview: string;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
invalid: {
|
|
90
|
+
true: {
|
|
91
|
+
input: string;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
}, {
|
|
95
|
+
root: string;
|
|
96
|
+
area: string;
|
|
97
|
+
preview: string;
|
|
98
|
+
input: string;
|
|
99
|
+
controls: string;
|
|
100
|
+
edit: string;
|
|
101
|
+
submit: string;
|
|
102
|
+
cancel: string;
|
|
103
|
+
}, import("tailwind-variants").TVReturnTypeLike<{
|
|
104
|
+
size: {
|
|
105
|
+
sm: {
|
|
106
|
+
preview: string;
|
|
107
|
+
input: string;
|
|
108
|
+
};
|
|
109
|
+
md: {
|
|
110
|
+
preview: string;
|
|
111
|
+
input: string;
|
|
112
|
+
controls: string;
|
|
113
|
+
};
|
|
114
|
+
lg: {
|
|
115
|
+
preview: string;
|
|
116
|
+
input: string;
|
|
117
|
+
controls: string;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
color: {
|
|
121
|
+
primary: "";
|
|
122
|
+
secondary: "";
|
|
123
|
+
neutral: "";
|
|
124
|
+
success: "";
|
|
125
|
+
danger: "";
|
|
126
|
+
warning: "";
|
|
127
|
+
info: "";
|
|
128
|
+
};
|
|
129
|
+
multiline: {
|
|
130
|
+
true: {
|
|
131
|
+
preview: string;
|
|
132
|
+
input: string;
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
empty: {
|
|
136
|
+
true: {
|
|
137
|
+
preview: string;
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
invalid: {
|
|
141
|
+
true: {
|
|
142
|
+
input: string;
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
}, {
|
|
146
|
+
root: string;
|
|
147
|
+
area: string;
|
|
148
|
+
preview: string;
|
|
149
|
+
input: string;
|
|
150
|
+
controls: string;
|
|
151
|
+
edit: string;
|
|
152
|
+
submit: string;
|
|
153
|
+
cancel: string;
|
|
154
|
+
}>>;
|
|
155
|
+
export type EditableThemeSlots = keyof (typeof editableTheme)['slots'];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { tv } from "tailwind-variants";
|
|
2
|
+
export const editableTheme = tv({
|
|
3
|
+
slots: {
|
|
4
|
+
root: "relative inline-flex w-full items-start gap-2",
|
|
5
|
+
area: "relative min-w-0 flex-1",
|
|
6
|
+
preview: "flex w-full items-center rounded-[var(--selaras-resolved-radius-md)] bg-transparent text-start text-[var(--selaras-resolved-text-default)] outline-none transition-colors hover:bg-[var(--selaras-resolved-surface-elevated)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--_selaras-color-focus)] disabled:opacity-50 disabled:cursor-not-allowed",
|
|
7
|
+
input: "w-full rounded-[var(--selaras-resolved-radius-md)] bg-[var(--selaras-resolved-surface-default)] text-[var(--selaras-resolved-text-default)] ring-1 ring-inset ring-[var(--selaras-resolved-border-default)] placeholder:text-[var(--selaras-resolved-text-muted)] outline-none transition-[color,background-color,box-shadow] not-focus:hover:ring-[var(--selaras-resolved-border-hover)] hover:bg-[var(--selaras-resolved-surface-elevated)] focus:ring-2 focus:ring-[var(--_selaras-color-focus)] disabled:opacity-50 disabled:pointer-events-none",
|
|
8
|
+
controls: "flex shrink-0 items-center gap-1",
|
|
9
|
+
edit: "",
|
|
10
|
+
submit: "",
|
|
11
|
+
cancel: ""
|
|
12
|
+
},
|
|
13
|
+
variants: {
|
|
14
|
+
size: {
|
|
15
|
+
sm: { preview: "min-h-8 px-2.5 text-sm", input: "h-8 px-2.5 text-sm" },
|
|
16
|
+
md: { preview: "min-h-10 px-3 text-sm", input: "h-10 px-3 text-sm", controls: "py-1" },
|
|
17
|
+
lg: { preview: "min-h-11 px-3.5 text-base", input: "h-11 px-3.5 text-base", controls: "py-0.5" }
|
|
18
|
+
},
|
|
19
|
+
color: { primary: "", secondary: "", neutral: "", success: "", danger: "", warning: "", info: "" },
|
|
20
|
+
multiline: { true: { preview: "whitespace-pre-wrap break-words py-2", input: "h-auto py-2" } },
|
|
21
|
+
empty: { true: { preview: "text-[var(--selaras-resolved-text-muted)]" } },
|
|
22
|
+
invalid: { true: { input: "ring-[var(--_selaras-color-border)] focus:ring-[var(--_selaras-color-focus)]" } }
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: { size: "md", color: "primary" }
|
|
25
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export declare const fieldClearButtonTheme: import("tailwind-variants").TVReturnType<{
|
|
2
|
+
size: {
|
|
3
|
+
sm: {
|
|
4
|
+
base: string;
|
|
5
|
+
icon: string;
|
|
6
|
+
};
|
|
7
|
+
md: {
|
|
8
|
+
base: string;
|
|
9
|
+
icon: string;
|
|
10
|
+
};
|
|
11
|
+
lg: {
|
|
12
|
+
base: string;
|
|
13
|
+
icon: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
}, {
|
|
17
|
+
base: string;
|
|
18
|
+
icon: string;
|
|
19
|
+
}, undefined, {
|
|
20
|
+
size: {
|
|
21
|
+
sm: {
|
|
22
|
+
base: string;
|
|
23
|
+
icon: string;
|
|
24
|
+
};
|
|
25
|
+
md: {
|
|
26
|
+
base: string;
|
|
27
|
+
icon: string;
|
|
28
|
+
};
|
|
29
|
+
lg: {
|
|
30
|
+
base: string;
|
|
31
|
+
icon: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
}, {
|
|
35
|
+
base: string;
|
|
36
|
+
icon: string;
|
|
37
|
+
}, import("tailwind-variants").TVReturnTypeLike<{
|
|
38
|
+
size: {
|
|
39
|
+
sm: {
|
|
40
|
+
base: string;
|
|
41
|
+
icon: string;
|
|
42
|
+
};
|
|
43
|
+
md: {
|
|
44
|
+
base: string;
|
|
45
|
+
icon: string;
|
|
46
|
+
};
|
|
47
|
+
lg: {
|
|
48
|
+
base: string;
|
|
49
|
+
icon: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
}, {
|
|
53
|
+
base: string;
|
|
54
|
+
icon: string;
|
|
55
|
+
}>>;
|
|
56
|
+
export type FieldClearButtonThemeSlots = keyof (typeof fieldClearButtonTheme)['slots'];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { tv } from "tailwind-variants";
|
|
2
|
+
export const fieldClearButtonTheme = tv({
|
|
3
|
+
slots: {
|
|
4
|
+
base: "shrink-0 rounded-full text-[var(--selaras-resolved-text-muted)] hover:bg-[var(--selaras-resolved-border-default)] hover:text-[var(--selaras-resolved-text-default)] active:bg-[var(--selaras-resolved-border-hover)] focus-visible:outline-offset-0",
|
|
5
|
+
icon: "shrink-0"
|
|
6
|
+
},
|
|
7
|
+
variants: {
|
|
8
|
+
size: {
|
|
9
|
+
sm: { base: "size-6", icon: "size-4" },
|
|
10
|
+
md: { base: "size-7", icon: "size-4.5" },
|
|
11
|
+
lg: { base: "size-8", icon: "size-5" }
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
defaultVariants: { size: "md" }
|
|
15
|
+
});
|
|
@@ -4,19 +4,16 @@ export declare const inputTheme: import("tailwind-variants").TVReturnType<{
|
|
|
4
4
|
base: string;
|
|
5
5
|
leadingIcon: string;
|
|
6
6
|
trailingIcon: string;
|
|
7
|
-
clear: string;
|
|
8
7
|
};
|
|
9
8
|
md: {
|
|
10
9
|
base: string;
|
|
11
10
|
leadingIcon: string;
|
|
12
11
|
trailingIcon: string;
|
|
13
|
-
clear: string;
|
|
14
12
|
};
|
|
15
13
|
lg: {
|
|
16
14
|
base: string;
|
|
17
15
|
leadingIcon: string;
|
|
18
16
|
trailingIcon: string;
|
|
19
|
-
clear: string;
|
|
20
17
|
};
|
|
21
18
|
};
|
|
22
19
|
color: {
|
|
@@ -53,19 +50,16 @@ export declare const inputTheme: import("tailwind-variants").TVReturnType<{
|
|
|
53
50
|
base: string;
|
|
54
51
|
leadingIcon: string;
|
|
55
52
|
trailingIcon: string;
|
|
56
|
-
clear: string;
|
|
57
53
|
};
|
|
58
54
|
md: {
|
|
59
55
|
base: string;
|
|
60
56
|
leadingIcon: string;
|
|
61
57
|
trailingIcon: string;
|
|
62
|
-
clear: string;
|
|
63
58
|
};
|
|
64
59
|
lg: {
|
|
65
60
|
base: string;
|
|
66
61
|
leadingIcon: string;
|
|
67
62
|
trailingIcon: string;
|
|
68
|
-
clear: string;
|
|
69
63
|
};
|
|
70
64
|
};
|
|
71
65
|
color: {
|
|
@@ -102,19 +96,16 @@ export declare const inputTheme: import("tailwind-variants").TVReturnType<{
|
|
|
102
96
|
base: string;
|
|
103
97
|
leadingIcon: string;
|
|
104
98
|
trailingIcon: string;
|
|
105
|
-
clear: string;
|
|
106
99
|
};
|
|
107
100
|
md: {
|
|
108
101
|
base: string;
|
|
109
102
|
leadingIcon: string;
|
|
110
103
|
trailingIcon: string;
|
|
111
|
-
clear: string;
|
|
112
104
|
};
|
|
113
105
|
lg: {
|
|
114
106
|
base: string;
|
|
115
107
|
leadingIcon: string;
|
|
116
108
|
trailingIcon: string;
|
|
117
|
-
clear: string;
|
|
118
109
|
};
|
|
119
110
|
};
|
|
120
111
|
color: {
|
|
@@ -16,21 +16,14 @@ export const inputTheme = tv({
|
|
|
16
16
|
trailingIcon: "absolute end-2.5 shrink-0 text-[var(--selaras-resolved-text-muted)]",
|
|
17
17
|
// A separate slot from trailingIcon (not reused) - that one is a
|
|
18
18
|
// decorative, non-interactive icon; this is a real dismiss button.
|
|
19
|
-
//
|
|
20
|
-
|
|
21
|
-
// than the library's usual rounded-md) come from Button's own theme;
|
|
22
|
-
// this slot only positions it and shrinks it below the input's full
|
|
23
|
-
// height (Button's own size steps match that height exactly, which
|
|
24
|
-
// once centered still touches both edges with zero margin) - explicit
|
|
25
|
-
// top-1/2 -translate-y-1/2 centering, not the root's items-center,
|
|
26
|
-
// since position:absolute drops it out of that flex flow.
|
|
27
|
-
clear: "absolute end-1 top-1/2 -translate-y-1/2 shrink-0 rounded-full"
|
|
19
|
+
// The shared clear control owns its target size, icon, and feedback.
|
|
20
|
+
clear: "absolute end-1 top-1/2 -translate-y-1/2"
|
|
28
21
|
},
|
|
29
22
|
variants: {
|
|
30
23
|
size: {
|
|
31
|
-
sm: { base: "h-8 px-2.5 text-sm", leadingIcon: "size-4", trailingIcon: "size-4"
|
|
32
|
-
md: { base: "h-10 px-3 text-sm", leadingIcon: "size-4.5", trailingIcon: "size-4.5"
|
|
33
|
-
lg: { base: "h-11 px-3.5 text-base", leadingIcon: "size-5", trailingIcon: "size-5"
|
|
24
|
+
sm: { base: "h-8 px-2.5 text-sm", leadingIcon: "size-4", trailingIcon: "size-4" },
|
|
25
|
+
md: { base: "h-10 px-3 text-sm", leadingIcon: "size-4.5", trailingIcon: "size-4.5" },
|
|
26
|
+
lg: { base: "h-11 px-3.5 text-base", leadingIcon: "size-5", trailingIcon: "size-5" }
|
|
34
27
|
},
|
|
35
28
|
// Focus-ring color only - the resting ring stays --selaras-resolved-border-default regardless
|
|
36
29
|
// of `color`, matching a Nuxt-ecosystem component kit's own Input
|
|
@@ -15,7 +15,7 @@ export const listboxTheme = tv({
|
|
|
15
15
|
itemContent: "flex min-w-0 flex-1 flex-col gap-0.5",
|
|
16
16
|
icon: "size-4 shrink-0",
|
|
17
17
|
indicator: "ms-auto flex size-4 shrink-0 items-center justify-center text-[var(--_selaras-color-indicator)]",
|
|
18
|
-
checkbox: "pointer-events-none
|
|
18
|
+
checkbox: "pointer-events-none shrink-0",
|
|
19
19
|
empty: "px-3 py-6 text-center text-sm text-[var(--selaras-resolved-text-muted)]"
|
|
20
20
|
},
|
|
21
21
|
variants: {
|
|
@@ -2,12 +2,15 @@ export declare const selectTheme: import("tailwind-variants").TVReturnType<{
|
|
|
2
2
|
size: {
|
|
3
3
|
sm: {
|
|
4
4
|
trigger: string;
|
|
5
|
+
icon: string;
|
|
5
6
|
};
|
|
6
7
|
md: {
|
|
7
8
|
trigger: string;
|
|
9
|
+
icon: string;
|
|
8
10
|
};
|
|
9
11
|
lg: {
|
|
10
12
|
trigger: string;
|
|
13
|
+
icon: string;
|
|
11
14
|
};
|
|
12
15
|
};
|
|
13
16
|
color: {
|
|
@@ -51,12 +54,15 @@ export declare const selectTheme: import("tailwind-variants").TVReturnType<{
|
|
|
51
54
|
size: {
|
|
52
55
|
sm: {
|
|
53
56
|
trigger: string;
|
|
57
|
+
icon: string;
|
|
54
58
|
};
|
|
55
59
|
md: {
|
|
56
60
|
trigger: string;
|
|
61
|
+
icon: string;
|
|
57
62
|
};
|
|
58
63
|
lg: {
|
|
59
64
|
trigger: string;
|
|
65
|
+
icon: string;
|
|
60
66
|
};
|
|
61
67
|
};
|
|
62
68
|
color: {
|
|
@@ -100,12 +106,15 @@ export declare const selectTheme: import("tailwind-variants").TVReturnType<{
|
|
|
100
106
|
size: {
|
|
101
107
|
sm: {
|
|
102
108
|
trigger: string;
|
|
109
|
+
icon: string;
|
|
103
110
|
};
|
|
104
111
|
md: {
|
|
105
112
|
trigger: string;
|
|
113
|
+
icon: string;
|
|
106
114
|
};
|
|
107
115
|
lg: {
|
|
108
116
|
trigger: string;
|
|
117
|
+
icon: string;
|
|
109
118
|
};
|
|
110
119
|
};
|
|
111
120
|
color: {
|
|
@@ -23,13 +23,14 @@ export const selectTheme = tv({
|
|
|
23
23
|
// soft (the same pairing Chip's own soft variant uses) clears 6.5:1.
|
|
24
24
|
chipOverflow: "inline-flex items-center rounded-[var(--selaras-resolved-radius-sm)] bg-[var(--_selaras-color-subtle)] px-2 py-0.5 text-xs text-[var(--_selaras-color-text)]",
|
|
25
25
|
icon: "shrink-0 text-[var(--selaras-resolved-text-muted)]",
|
|
26
|
-
//
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
// Layout only; FieldClearButton owns the shared interaction treatment.
|
|
27
|
+
clear: "",
|
|
28
|
+
dropdown: "inline-flex shrink-0 items-center justify-center rounded-[var(--selaras-resolved-radius-sm)] p-0.5 text-[var(--selaras-resolved-text-muted)] transition-colors hover:bg-[var(--selaras-resolved-border-default)] hover:text-[var(--selaras-resolved-text-default)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--_selaras-color-focus)]",
|
|
29
|
+
searchWrapper: "box-content flex h-9 items-center gap-2 border-b border-[var(--selaras-resolved-border-default)] px-2",
|
|
30
|
+
// The popup owns its search row height. Inside a trigger, stretch the
|
|
31
|
+
// editor into the available space instead of adding a fixed input
|
|
32
|
+
// height to the trigger's vertical padding.
|
|
33
|
+
searchInput: "min-w-16 flex-1 self-stretch bg-transparent text-sm text-[var(--selaras-resolved-text-default)] outline-none placeholder:text-[var(--selaras-resolved-text-muted)]",
|
|
33
34
|
content: "z-[var(--selaras-resolved-z-dropdown)] max-h-72 min-w-[var(--reka-combobox-trigger-width)] overflow-hidden rounded-[var(--selaras-resolved-radius-md)] bg-[var(--selaras-resolved-surface-default)] shadow-[var(--selaras-resolved-shadow-md)] ring-1 ring-[var(--selaras-resolved-border-default)] data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
34
35
|
// The `adaptive` path's own content wrapper - none of `content`'s
|
|
35
36
|
// own popover chrome (ring/shadow/rounded/animate-in, sized off the
|
|
@@ -49,9 +50,9 @@ export const selectTheme = tv({
|
|
|
49
50
|
},
|
|
50
51
|
variants: {
|
|
51
52
|
size: {
|
|
52
|
-
sm: { trigger: "min-h-8 text-sm" },
|
|
53
|
-
md: { trigger: "min-h-10" },
|
|
54
|
-
lg: { trigger: "min-h-11 text-base" }
|
|
53
|
+
sm: { trigger: "min-h-8 py-1 text-sm", icon: "size-4" },
|
|
54
|
+
md: { trigger: "min-h-10", icon: "size-4.5" },
|
|
55
|
+
lg: { trigger: "min-h-11 text-base", icon: "size-5" }
|
|
55
56
|
},
|
|
56
57
|
// Registered custom roles have no finite Tailwind Variants branch. Keep
|
|
57
58
|
// the semantic focus styling in the base slot so every registered role
|