@whatsaaaa/ui-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 +24 -2
- package/dist/color-mode.d.ts +14 -0
- package/dist/color-mode.js +34 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +12 -0
- package/dist/theme/badge.d.ts +70 -0
- package/dist/theme/badge.js +116 -0
- package/dist/theme/button.d.ts +136 -0
- package/dist/theme/button.js +193 -0
- package/dist/theme/card.d.ts +29 -0
- package/dist/theme/card.js +44 -0
- package/dist/theme/checkbox.d.ts +159 -0
- package/dist/theme/checkbox.js +73 -0
- package/dist/theme/choice.d.ts +82 -0
- package/dist/theme/choice.js +124 -0
- package/dist/theme/field-group.d.ts +9 -0
- package/dist/theme/field-group.js +16 -0
- package/dist/theme/field.d.ts +263 -0
- package/dist/theme/field.js +248 -0
- package/dist/theme/file-upload.d.ts +106 -0
- package/dist/theme/file-upload.js +124 -0
- package/dist/theme/form-field.d.ts +44 -0
- package/dist/theme/form-field.js +34 -0
- package/dist/theme/index.d.ts +2349 -0
- package/dist/theme/index.js +130 -0
- package/dist/theme/input-date.d.ts +127 -0
- package/dist/theme/input-date.js +78 -0
- package/dist/theme/input-menu.d.ts +210 -0
- package/dist/theme/input-menu.js +83 -0
- package/dist/theme/input-number.d.ts +77 -0
- package/dist/theme/input-number.js +110 -0
- package/dist/theme/input-tags.d.ts +284 -0
- package/dist/theme/input-tags.js +38 -0
- package/dist/theme/input-time.d.ts +2 -0
- package/dist/theme/input-time.js +5 -0
- package/dist/theme/input.d.ts +138 -0
- package/dist/theme/input.js +48 -0
- package/dist/theme/modal.d.ts +31 -0
- package/dist/theme/modal.js +44 -0
- package/dist/theme/pin-input.d.ts +61 -0
- package/dist/theme/pin-input.js +40 -0
- package/dist/theme/radio-group.d.ts +177 -0
- package/dist/theme/radio-group.js +111 -0
- package/dist/theme/select-menu.d.ts +154 -0
- package/dist/theme/select-menu.js +22 -0
- package/dist/theme/select.d.ts +254 -0
- package/dist/theme/select.js +109 -0
- package/dist/theme/shared.d.ts +69 -0
- package/dist/theme/shared.js +103 -0
- package/dist/theme/table.d.ts +45 -0
- package/dist/theme/table.js +111 -0
- package/dist/theme/tabs.d.ts +95 -0
- package/dist/theme/tabs.js +144 -0
- package/dist/theme/tags.d.ts +40 -0
- package/dist/theme/tags.js +52 -0
- package/dist/theme/textarea.d.ts +127 -0
- package/dist/theme/textarea.js +72 -0
- package/package.json +65 -3
- package/src/index.css +123 -0
- package/src/nuxt-ui.css +148 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import badge from "./badge.js";
|
|
2
|
+
import button from "./button.js";
|
|
3
|
+
import card from "./card.js";
|
|
4
|
+
import checkbox from "./checkbox.js";
|
|
5
|
+
import fieldGroup from "./field-group.js";
|
|
6
|
+
import fileUpload from "./file-upload.js";
|
|
7
|
+
import formField from "./form-field.js";
|
|
8
|
+
import inputDate from "./input-date.js";
|
|
9
|
+
import inputMenu from "./input-menu.js";
|
|
10
|
+
import inputNumber from "./input-number.js";
|
|
11
|
+
import inputTags from "./input-tags.js";
|
|
12
|
+
import inputTime from "./input-time.js";
|
|
13
|
+
import input from "./input.js";
|
|
14
|
+
import modal from "./modal.js";
|
|
15
|
+
import pinInput from "./pin-input.js";
|
|
16
|
+
import radioGroup from "./radio-group.js";
|
|
17
|
+
import selectMenu from "./select-menu.js";
|
|
18
|
+
import select from "./select.js";
|
|
19
|
+
import { colors } from "./shared.js";
|
|
20
|
+
import table from "./table.js";
|
|
21
|
+
import tabs from "./tabs.js";
|
|
22
|
+
import textarea from "./textarea.js";
|
|
23
|
+
/*
|
|
24
|
+
* The names the design system's Tailwind entry adds to Tailwind's. tailwind-merge, which Nuxt UI
|
|
25
|
+
* resolves conflicting classes with, has to know each in its utility. Otherwise it keeps both of
|
|
26
|
+
* h-control and h-12, or of ease-standard and ease-out, so that Tailwind's order of the two
|
|
27
|
+
* decides and not which comes last; and it takes text-label or border-thick for a color, one
|
|
28
|
+
* that drops text-text or border-border, or is dropped by them.
|
|
29
|
+
*/
|
|
30
|
+
/** The text styles, as font sizes. */
|
|
31
|
+
const textStyles = [
|
|
32
|
+
'display',
|
|
33
|
+
'display-compact',
|
|
34
|
+
'h1',
|
|
35
|
+
'h1-compact',
|
|
36
|
+
'h2',
|
|
37
|
+
'h2-compact',
|
|
38
|
+
'h3',
|
|
39
|
+
'h4',
|
|
40
|
+
'lead',
|
|
41
|
+
'tagline',
|
|
42
|
+
'tagline-compact',
|
|
43
|
+
'body',
|
|
44
|
+
'body-sm',
|
|
45
|
+
'label',
|
|
46
|
+
'label-sm',
|
|
47
|
+
'caption',
|
|
48
|
+
'overline',
|
|
49
|
+
'code',
|
|
50
|
+
];
|
|
51
|
+
/** The sizes, as spacing: h-control, size-check, max-w-content. */
|
|
52
|
+
const sizes = [
|
|
53
|
+
'check',
|
|
54
|
+
'check-xs',
|
|
55
|
+
'check-sm',
|
|
56
|
+
'check-lg',
|
|
57
|
+
'check-xl',
|
|
58
|
+
'content',
|
|
59
|
+
'control',
|
|
60
|
+
'control-xs',
|
|
61
|
+
'control-sm',
|
|
62
|
+
'control-lg',
|
|
63
|
+
'control-xl',
|
|
64
|
+
'frame',
|
|
65
|
+
'icon',
|
|
66
|
+
'icon-lg',
|
|
67
|
+
'outline',
|
|
68
|
+
'sidebar',
|
|
69
|
+
'status-line',
|
|
70
|
+
'step',
|
|
71
|
+
'tab-bar',
|
|
72
|
+
'tick-sm',
|
|
73
|
+
'tick-lg',
|
|
74
|
+
];
|
|
75
|
+
/**
|
|
76
|
+
* The border widths, which Tailwind takes on every side of a border and on the dividers:
|
|
77
|
+
* tailwind-merge has no theme key for them, but a class group for each.
|
|
78
|
+
*/
|
|
79
|
+
const borderWidths = ['thin', 'medium', 'thick'];
|
|
80
|
+
const borderWidthGroups = {
|
|
81
|
+
...Object.fromEntries(['', '-x', '-y', '-s', '-e', '-bs', '-be', '-t', '-r', '-b', '-l'].map((side) => [
|
|
82
|
+
`border-w${side}`,
|
|
83
|
+
[{ [`border${side}`]: borderWidths }],
|
|
84
|
+
])),
|
|
85
|
+
'divide-x': [{ 'divide-x': borderWidths }],
|
|
86
|
+
'divide-y': [{ 'divide-y': borderWidths }],
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* The module options: the theme's colors, without secondary. Nuxt UI's transitions stay on:
|
|
90
|
+
* the component themes take them off for a reader who asks for less motion. Turned off here,
|
|
91
|
+
* Nuxt UI's generated theme types would no longer take a variant's classes slot by slot.
|
|
92
|
+
*/
|
|
93
|
+
export const theme = {
|
|
94
|
+
colors: [...colors],
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* The app config: what app.config.ts gives defineAppConfig as ui on Nuxt, and the Vite plugin
|
|
98
|
+
* takes as ui on Vue.
|
|
99
|
+
*/
|
|
100
|
+
export const ui = {
|
|
101
|
+
tv: {
|
|
102
|
+
twMergeConfig: {
|
|
103
|
+
extend: {
|
|
104
|
+
theme: { text: textStyles, spacing: sizes, ease: ['standard'] },
|
|
105
|
+
classGroups: borderWidthGroups,
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
badge,
|
|
110
|
+
button,
|
|
111
|
+
card,
|
|
112
|
+
checkbox,
|
|
113
|
+
fieldGroup,
|
|
114
|
+
fileUpload,
|
|
115
|
+
formField,
|
|
116
|
+
input,
|
|
117
|
+
inputDate,
|
|
118
|
+
inputMenu,
|
|
119
|
+
inputNumber,
|
|
120
|
+
inputTags,
|
|
121
|
+
inputTime,
|
|
122
|
+
modal,
|
|
123
|
+
pinInput,
|
|
124
|
+
radioGroup,
|
|
125
|
+
select,
|
|
126
|
+
selectMenu,
|
|
127
|
+
table,
|
|
128
|
+
tabs,
|
|
129
|
+
textarea,
|
|
130
|
+
};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/** A field of a date or a time: input-time.ts takes it too. */
|
|
2
|
+
declare const _default: {
|
|
3
|
+
slots: {
|
|
4
|
+
base: string;
|
|
5
|
+
leadingIcon: string;
|
|
6
|
+
trailingIcon: string;
|
|
7
|
+
segment: string;
|
|
8
|
+
separatorIcon: string;
|
|
9
|
+
};
|
|
10
|
+
variants: {
|
|
11
|
+
size: {
|
|
12
|
+
xs: {
|
|
13
|
+
base: string;
|
|
14
|
+
separatorIcon: string;
|
|
15
|
+
segment: string;
|
|
16
|
+
leading: string;
|
|
17
|
+
trailing: string;
|
|
18
|
+
leadingIcon: string;
|
|
19
|
+
trailingIcon: string;
|
|
20
|
+
};
|
|
21
|
+
sm: {
|
|
22
|
+
base: string;
|
|
23
|
+
separatorIcon: string;
|
|
24
|
+
segment: string;
|
|
25
|
+
leading: string;
|
|
26
|
+
trailing: string;
|
|
27
|
+
leadingIcon: string;
|
|
28
|
+
trailingIcon: string;
|
|
29
|
+
};
|
|
30
|
+
md: {
|
|
31
|
+
base: string;
|
|
32
|
+
separatorIcon: string;
|
|
33
|
+
segment: string;
|
|
34
|
+
leading: string;
|
|
35
|
+
trailing: string;
|
|
36
|
+
leadingIcon: string;
|
|
37
|
+
trailingIcon: string;
|
|
38
|
+
};
|
|
39
|
+
lg: {
|
|
40
|
+
base: string;
|
|
41
|
+
separatorIcon: string;
|
|
42
|
+
segment: string;
|
|
43
|
+
leading: string;
|
|
44
|
+
trailing: string;
|
|
45
|
+
leadingIcon: string;
|
|
46
|
+
trailingIcon: string;
|
|
47
|
+
};
|
|
48
|
+
xl: {
|
|
49
|
+
base: string;
|
|
50
|
+
separatorIcon: string;
|
|
51
|
+
segment: string;
|
|
52
|
+
leading: string;
|
|
53
|
+
trailing: string;
|
|
54
|
+
leadingIcon: string;
|
|
55
|
+
trailingIcon: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
variant: {
|
|
59
|
+
outline: string;
|
|
60
|
+
soft: string;
|
|
61
|
+
subtle: string;
|
|
62
|
+
ghost: string;
|
|
63
|
+
none: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
compoundVariants: ({
|
|
67
|
+
variant: string;
|
|
68
|
+
highlight: boolean;
|
|
69
|
+
class: string;
|
|
70
|
+
color?: undefined;
|
|
71
|
+
} | {
|
|
72
|
+
variant: string;
|
|
73
|
+
highlight: boolean;
|
|
74
|
+
color: string;
|
|
75
|
+
class: string;
|
|
76
|
+
} | {
|
|
77
|
+
fixed: boolean;
|
|
78
|
+
size: string[];
|
|
79
|
+
class: string;
|
|
80
|
+
} | {
|
|
81
|
+
leading: boolean;
|
|
82
|
+
size: "xs" | "sm" | "md" | "lg" | "xl";
|
|
83
|
+
class: string;
|
|
84
|
+
} | {
|
|
85
|
+
trailing: boolean;
|
|
86
|
+
size: "xs" | "sm" | "md" | "lg" | "xl";
|
|
87
|
+
class: string;
|
|
88
|
+
} | {
|
|
89
|
+
loading: boolean;
|
|
90
|
+
leading: boolean;
|
|
91
|
+
class: {
|
|
92
|
+
leadingIcon: string;
|
|
93
|
+
trailingIcon?: undefined;
|
|
94
|
+
};
|
|
95
|
+
trailing?: undefined;
|
|
96
|
+
} | {
|
|
97
|
+
loading: boolean;
|
|
98
|
+
leading: boolean;
|
|
99
|
+
trailing: boolean;
|
|
100
|
+
class: {
|
|
101
|
+
trailingIcon: string;
|
|
102
|
+
leadingIcon?: undefined;
|
|
103
|
+
};
|
|
104
|
+
} | ({
|
|
105
|
+
highlight: boolean;
|
|
106
|
+
} & {
|
|
107
|
+
color: import("./shared.ts").Color;
|
|
108
|
+
class: string | Record<string, string>;
|
|
109
|
+
}) | {
|
|
110
|
+
variant: string[];
|
|
111
|
+
class: string;
|
|
112
|
+
} | {
|
|
113
|
+
fieldGroup: string[];
|
|
114
|
+
class: string;
|
|
115
|
+
highlight?: undefined;
|
|
116
|
+
} | {
|
|
117
|
+
fieldGroup: string[];
|
|
118
|
+
highlight: boolean;
|
|
119
|
+
class: string;
|
|
120
|
+
} | {
|
|
121
|
+
variant: string[];
|
|
122
|
+
class: {
|
|
123
|
+
segment: string;
|
|
124
|
+
};
|
|
125
|
+
})[];
|
|
126
|
+
};
|
|
127
|
+
export default _default;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { fieldSizes, fieldWithinCompoundVariants, fieldWithinVariants, iconsWithinSizes, inGroup, } from "./field.js";
|
|
2
|
+
import { inputSlots } from "./input.js";
|
|
3
|
+
import { transition } from "./shared.js";
|
|
4
|
+
/*
|
|
5
|
+
* A date or a time typed a part at a time: the field is the text field, with its focus on the
|
|
6
|
+
* part being typed, and its parts, the segments, sit side by side in it. The part with the focus
|
|
7
|
+
* is on the tag's tint, the system's interactive tint, which reads on every variant of the field,
|
|
8
|
+
* and in forced colors in the selection's colors. A part not filled in yet and the literal between
|
|
9
|
+
* parts are the secondary text, an invalid date the danger text. Its icon is the one the app
|
|
10
|
+
* names, or Nuxt UI's, at the control's icon size.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* A segment is as wide as its figures, in figures of one width, with the room of the tint around
|
|
14
|
+
* them: a day, a month, an hour and a minute two figures, a year four, whatever their value.
|
|
15
|
+
* Nuxt UI gives each a width of its own at each size, which a year in Inter overflows.
|
|
16
|
+
*/
|
|
17
|
+
const segmentWidths = 'data-[segment=day]:w-auto data-[segment=month]:w-auto data-[segment=year]:w-auto not-data-[segment=literal]:w-auto data-[segment=day]:min-w-[calc(2ch+2*var(--ws-space-4))] data-[segment=month]:min-w-[calc(2ch+2*var(--ws-space-4))] data-[segment=year]:min-w-[calc(4ch+2*var(--ws-space-4))] data-[segment=hour]:min-w-[calc(2ch+2*var(--ws-space-4))] data-[segment=minute]:min-w-[calc(2ch+2*var(--ws-space-4))] data-[segment=second]:min-w-[calc(2ch+2*var(--ws-space-4))]';
|
|
18
|
+
/** The field at each size, and the icon between the two dates of a range at the control's size. */
|
|
19
|
+
const sizes = {
|
|
20
|
+
xs: {
|
|
21
|
+
...fieldSizes.xs,
|
|
22
|
+
...iconsWithinSizes.xs,
|
|
23
|
+
base: 'h-(--ws-control-height-xs) px-[calc(var(--ws-space-8)-var(--field-edge-extra,0px))] py-0 gap-0 text-body-sm',
|
|
24
|
+
separatorIcon: 'size-(--ws-control-icon-size-xs)',
|
|
25
|
+
segment: segmentWidths,
|
|
26
|
+
},
|
|
27
|
+
sm: {
|
|
28
|
+
...fieldSizes.sm,
|
|
29
|
+
...iconsWithinSizes.sm,
|
|
30
|
+
base: 'h-(--ws-control-height-sm) px-[calc(var(--ws-space-10)-var(--field-edge-extra,0px))] py-0 gap-0 text-body-sm',
|
|
31
|
+
separatorIcon: 'size-(--ws-control-icon-size-sm)',
|
|
32
|
+
segment: segmentWidths,
|
|
33
|
+
},
|
|
34
|
+
md: {
|
|
35
|
+
...fieldSizes.md,
|
|
36
|
+
...iconsWithinSizes.md,
|
|
37
|
+
base: 'h-(--ws-control-height-md) px-[calc(var(--ws-space-12)-var(--field-edge-extra,0px))] py-0 gap-0 text-body',
|
|
38
|
+
separatorIcon: 'size-(--ws-control-icon-size-md)',
|
|
39
|
+
segment: segmentWidths,
|
|
40
|
+
},
|
|
41
|
+
lg: {
|
|
42
|
+
...fieldSizes.lg,
|
|
43
|
+
...iconsWithinSizes.lg,
|
|
44
|
+
base: 'h-(--ws-control-height-lg) px-[calc(var(--ws-space-14)-var(--field-edge-extra,0px))] py-0 gap-0 text-body',
|
|
45
|
+
separatorIcon: 'size-(--ws-control-icon-size-lg)',
|
|
46
|
+
segment: segmentWidths,
|
|
47
|
+
},
|
|
48
|
+
xl: {
|
|
49
|
+
...fieldSizes.xl,
|
|
50
|
+
...iconsWithinSizes.xl,
|
|
51
|
+
base: 'h-(--ws-control-height-xl) px-[calc(var(--ws-space-16)-var(--field-edge-extra,0px))] py-0 gap-0 text-body',
|
|
52
|
+
separatorIcon: 'size-(--ws-control-icon-size-xl)',
|
|
53
|
+
segment: segmentWidths,
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
/** A field of a date or a time: input-time.ts takes it too. */
|
|
57
|
+
export default {
|
|
58
|
+
slots: {
|
|
59
|
+
base: `rounded-(--ws-control-radius) font-sans cursor-text ${transition}`,
|
|
60
|
+
leadingIcon: inputSlots.leadingIcon,
|
|
61
|
+
trailingIcon: inputSlots.trailingIcon,
|
|
62
|
+
segment: `rounded-(--ws-radius-sm) px-(--ws-space-4) data-[segment=literal]:px-0 tabular-nums text-(--ws-field-text-rest) data-placeholder:text-text-secondary data-[segment=literal]:text-text-secondary data-invalid:text-danger-text data-disabled:opacity-100 data-disabled:text-(--ws-field-text-disabled) forced-colors:focus:bg-[Highlight] forced-colors:focus:text-[HighlightText] forced-colors:focus:forced-color-adjust-none ${transition}`,
|
|
63
|
+
separatorIcon: 'mx-(--ws-space-4) text-(--ws-field-icon-rest)',
|
|
64
|
+
},
|
|
65
|
+
variants: {
|
|
66
|
+
size: sizes,
|
|
67
|
+
variant: fieldWithinVariants,
|
|
68
|
+
},
|
|
69
|
+
compoundVariants: [
|
|
70
|
+
...fieldWithinCompoundVariants,
|
|
71
|
+
...inGroup,
|
|
72
|
+
// over Nuxt UI's fill of each variant, and under the pointer
|
|
73
|
+
{
|
|
74
|
+
variant: ['outline', 'soft', 'subtle', 'ghost', 'none'],
|
|
75
|
+
class: { segment: 'focus:bg-tag-bg focus:text-tag-text group-hover:focus:bg-tag-bg' },
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
};
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
slots: {
|
|
3
|
+
trailing: string;
|
|
4
|
+
content: string;
|
|
5
|
+
arrow: string;
|
|
6
|
+
group: string;
|
|
7
|
+
empty: string;
|
|
8
|
+
label: string;
|
|
9
|
+
separator: string;
|
|
10
|
+
item: string;
|
|
11
|
+
itemLeadingIcon: string;
|
|
12
|
+
itemTrailing: string;
|
|
13
|
+
itemTrailingIcon: string;
|
|
14
|
+
itemDescription: string;
|
|
15
|
+
tagsItem: string;
|
|
16
|
+
tagsItemDelete: string;
|
|
17
|
+
tagsItemDeleteIcon: string;
|
|
18
|
+
tagsInput: string;
|
|
19
|
+
base: string;
|
|
20
|
+
leadingIcon: string;
|
|
21
|
+
trailingIcon: string;
|
|
22
|
+
};
|
|
23
|
+
variants: {
|
|
24
|
+
size: {
|
|
25
|
+
[k: string]: {
|
|
26
|
+
label: string;
|
|
27
|
+
item: string;
|
|
28
|
+
itemLeadingIcon: string;
|
|
29
|
+
itemTrailingIcon: string;
|
|
30
|
+
empty: string;
|
|
31
|
+
tagsItem: string;
|
|
32
|
+
tagsItemDeleteIcon: string;
|
|
33
|
+
base: string;
|
|
34
|
+
leading: string;
|
|
35
|
+
trailing: string;
|
|
36
|
+
leadingIcon: string;
|
|
37
|
+
trailingIcon: string;
|
|
38
|
+
} | {
|
|
39
|
+
label: string;
|
|
40
|
+
item: string;
|
|
41
|
+
itemLeadingIcon: string;
|
|
42
|
+
itemTrailingIcon: string;
|
|
43
|
+
empty: string;
|
|
44
|
+
tagsItem: string;
|
|
45
|
+
tagsItemDeleteIcon: string;
|
|
46
|
+
base: string;
|
|
47
|
+
leading: string;
|
|
48
|
+
trailing: string;
|
|
49
|
+
leadingIcon: string;
|
|
50
|
+
trailingIcon: string;
|
|
51
|
+
} | {
|
|
52
|
+
label: string;
|
|
53
|
+
item: string;
|
|
54
|
+
itemLeadingIcon: string;
|
|
55
|
+
itemTrailingIcon: string;
|
|
56
|
+
empty: string;
|
|
57
|
+
tagsItem: string;
|
|
58
|
+
tagsItemDeleteIcon: string;
|
|
59
|
+
base: string;
|
|
60
|
+
leading: string;
|
|
61
|
+
trailing: string;
|
|
62
|
+
leadingIcon: string;
|
|
63
|
+
trailingIcon: string;
|
|
64
|
+
} | {
|
|
65
|
+
label: string;
|
|
66
|
+
item: string;
|
|
67
|
+
itemLeadingIcon: string;
|
|
68
|
+
itemTrailingIcon: string;
|
|
69
|
+
empty: string;
|
|
70
|
+
tagsItem: string;
|
|
71
|
+
tagsItemDeleteIcon: string;
|
|
72
|
+
base: string;
|
|
73
|
+
leading: string;
|
|
74
|
+
trailing: string;
|
|
75
|
+
leadingIcon: string;
|
|
76
|
+
trailingIcon: string;
|
|
77
|
+
} | {
|
|
78
|
+
label: string;
|
|
79
|
+
item: string;
|
|
80
|
+
itemLeadingIcon: string;
|
|
81
|
+
itemTrailingIcon: string;
|
|
82
|
+
empty: string;
|
|
83
|
+
tagsItem: string;
|
|
84
|
+
tagsItemDeleteIcon: string;
|
|
85
|
+
base: string;
|
|
86
|
+
leading: string;
|
|
87
|
+
trailing: string;
|
|
88
|
+
leadingIcon: string;
|
|
89
|
+
trailingIcon: string;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
variant: {
|
|
93
|
+
outline: string;
|
|
94
|
+
soft: string;
|
|
95
|
+
subtle: string;
|
|
96
|
+
ghost: string;
|
|
97
|
+
none: string;
|
|
98
|
+
};
|
|
99
|
+
virtualize: {
|
|
100
|
+
false: {
|
|
101
|
+
viewport: string;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
compoundVariants: ({
|
|
106
|
+
variant: string;
|
|
107
|
+
highlight: boolean;
|
|
108
|
+
class: string;
|
|
109
|
+
color?: undefined;
|
|
110
|
+
} | {
|
|
111
|
+
variant: string;
|
|
112
|
+
highlight: boolean;
|
|
113
|
+
color: string;
|
|
114
|
+
class: string;
|
|
115
|
+
} | {
|
|
116
|
+
fixed: boolean;
|
|
117
|
+
size: string[];
|
|
118
|
+
class: string;
|
|
119
|
+
} | {
|
|
120
|
+
leading: boolean;
|
|
121
|
+
size: "xs" | "sm" | "md" | "lg" | "xl";
|
|
122
|
+
class: string;
|
|
123
|
+
} | {
|
|
124
|
+
trailing: boolean;
|
|
125
|
+
size: "xs" | "sm" | "md" | "lg" | "xl";
|
|
126
|
+
class: string;
|
|
127
|
+
} | {
|
|
128
|
+
loading: boolean;
|
|
129
|
+
leading: boolean;
|
|
130
|
+
class: {
|
|
131
|
+
leadingIcon: string;
|
|
132
|
+
trailingIcon?: undefined;
|
|
133
|
+
};
|
|
134
|
+
trailing?: undefined;
|
|
135
|
+
} | {
|
|
136
|
+
loading: boolean;
|
|
137
|
+
leading: boolean;
|
|
138
|
+
trailing: boolean;
|
|
139
|
+
class: {
|
|
140
|
+
trailingIcon: string;
|
|
141
|
+
leadingIcon?: undefined;
|
|
142
|
+
};
|
|
143
|
+
} | ({
|
|
144
|
+
highlight: boolean;
|
|
145
|
+
} & {
|
|
146
|
+
color: import("./shared.ts").Color;
|
|
147
|
+
class: string | Record<string, string>;
|
|
148
|
+
}) | {
|
|
149
|
+
variant: string[];
|
|
150
|
+
class: string;
|
|
151
|
+
} | {
|
|
152
|
+
fieldGroup: string[];
|
|
153
|
+
class: {
|
|
154
|
+
root: string;
|
|
155
|
+
};
|
|
156
|
+
highlight?: undefined;
|
|
157
|
+
} | {
|
|
158
|
+
fieldGroup: string[];
|
|
159
|
+
highlight: boolean;
|
|
160
|
+
class: {
|
|
161
|
+
root: string;
|
|
162
|
+
};
|
|
163
|
+
} | {
|
|
164
|
+
variant: string;
|
|
165
|
+
size: string;
|
|
166
|
+
class: {
|
|
167
|
+
leading: string;
|
|
168
|
+
trailing: string;
|
|
169
|
+
};
|
|
170
|
+
} | {
|
|
171
|
+
multiple: boolean;
|
|
172
|
+
size: "xs" | "sm" | "md" | "lg" | "xl";
|
|
173
|
+
class: {
|
|
174
|
+
leading: string;
|
|
175
|
+
trailing: string;
|
|
176
|
+
base: string;
|
|
177
|
+
} | {
|
|
178
|
+
leading: string;
|
|
179
|
+
trailing: string;
|
|
180
|
+
base: string;
|
|
181
|
+
} | {
|
|
182
|
+
leading: string;
|
|
183
|
+
trailing: string;
|
|
184
|
+
base: string;
|
|
185
|
+
} | {
|
|
186
|
+
leading: string;
|
|
187
|
+
trailing: string;
|
|
188
|
+
base: string;
|
|
189
|
+
} | {
|
|
190
|
+
leading: string;
|
|
191
|
+
trailing: string;
|
|
192
|
+
base: string;
|
|
193
|
+
};
|
|
194
|
+
} | {
|
|
195
|
+
multiple: boolean;
|
|
196
|
+
variant: string;
|
|
197
|
+
class: string;
|
|
198
|
+
} | {
|
|
199
|
+
multiple: boolean;
|
|
200
|
+
class: string;
|
|
201
|
+
variant?: undefined;
|
|
202
|
+
} | {
|
|
203
|
+
multiple: boolean;
|
|
204
|
+
variant: string[];
|
|
205
|
+
class: {
|
|
206
|
+
tagsItem: string;
|
|
207
|
+
};
|
|
208
|
+
})[];
|
|
209
|
+
};
|
|
210
|
+
export default _default;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { fieldCompoundVariants, fieldSizes, fieldVariants, fieldWithinCompoundVariants, fieldWithinVariants, iconsWithinSizes, inGroupRoot, } from "./field.js";
|
|
2
|
+
import { bareIcons, inputSlots } from "./input.js";
|
|
3
|
+
import { listMotion, selectSlots, selectVariants } from "./select.js";
|
|
4
|
+
import { tag, tagDelete, tagDeleteIcon, tagDeleteIconSize, tagOfField, tagOnRaised, tagsFieldSizes, tagsInput, } from "./tags.js";
|
|
5
|
+
/*
|
|
6
|
+
* A text field whose list opens under it as it is typed in: the field is the text field, and the
|
|
7
|
+
* list draws what the select menu's draws, from the select menu's theme. With several values the
|
|
8
|
+
* field is a field of tags, which tags.ts draws, with its focus on the text field inside it.
|
|
9
|
+
*/
|
|
10
|
+
const sizes = Object.fromEntries(['xs', 'sm', 'md', 'lg', 'xl'].map((size) => {
|
|
11
|
+
const { label, item, itemLeadingIcon, itemTrailingIcon, empty } = selectVariants.size[size];
|
|
12
|
+
return [
|
|
13
|
+
size,
|
|
14
|
+
{
|
|
15
|
+
...fieldSizes[size],
|
|
16
|
+
label,
|
|
17
|
+
item,
|
|
18
|
+
itemLeadingIcon,
|
|
19
|
+
itemTrailingIcon,
|
|
20
|
+
empty,
|
|
21
|
+
tagsItem: tagOfField[size],
|
|
22
|
+
tagsItemDeleteIcon: tagDeleteIconSize,
|
|
23
|
+
},
|
|
24
|
+
];
|
|
25
|
+
}));
|
|
26
|
+
/** With several values, the field of tags at each size, its icons inside its edge. */
|
|
27
|
+
const tagsFields = ['xs', 'sm', 'md', 'lg', 'xl'].map((size) => ({
|
|
28
|
+
multiple: true,
|
|
29
|
+
size,
|
|
30
|
+
class: { base: tagsFieldSizes[size], ...iconsWithinSizes[size] },
|
|
31
|
+
}));
|
|
32
|
+
export default {
|
|
33
|
+
slots: {
|
|
34
|
+
...inputSlots,
|
|
35
|
+
trailing: 'disabled:opacity-100',
|
|
36
|
+
// the list's panel, which Nuxt UI opens with its own motion
|
|
37
|
+
content: `${selectSlots.content} ${listMotion}`,
|
|
38
|
+
arrow: selectSlots.arrow,
|
|
39
|
+
group: selectSlots.group,
|
|
40
|
+
empty: selectSlots.empty,
|
|
41
|
+
label: selectSlots.label,
|
|
42
|
+
separator: selectSlots.separator,
|
|
43
|
+
item: selectSlots.item,
|
|
44
|
+
itemLeadingIcon: selectSlots.itemLeadingIcon,
|
|
45
|
+
itemTrailing: selectSlots.itemTrailing,
|
|
46
|
+
itemTrailingIcon: selectSlots.itemTrailingIcon,
|
|
47
|
+
itemDescription: selectSlots.itemDescription,
|
|
48
|
+
tagsItem: tag,
|
|
49
|
+
tagsItemDelete: tagDelete,
|
|
50
|
+
tagsItemDeleteIcon: tagDeleteIcon,
|
|
51
|
+
tagsInput,
|
|
52
|
+
},
|
|
53
|
+
variants: {
|
|
54
|
+
size: sizes,
|
|
55
|
+
variant: fieldVariants,
|
|
56
|
+
virtualize: {
|
|
57
|
+
false: { viewport: selectSlots.viewport },
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
compoundVariants: [
|
|
61
|
+
// Nuxt UI takes the edge off a field of one value after the variants have drawn it, and
|
|
62
|
+
// fades it disabled and dims its placeholder: the text field's are drawn over them
|
|
63
|
+
{
|
|
64
|
+
multiple: false,
|
|
65
|
+
variant: ['outline', 'soft', 'subtle', 'ghost'],
|
|
66
|
+
class: 'border-(length:--ws-control-border-width-rest)',
|
|
67
|
+
},
|
|
68
|
+
{ multiple: false, class: 'disabled:opacity-100 placeholder:text-text-secondary' },
|
|
69
|
+
// with several values the field is one with the focus inside it, disabled by data-disabled
|
|
70
|
+
...Object.entries(fieldWithinVariants).map(([variant, classes]) => ({
|
|
71
|
+
multiple: true,
|
|
72
|
+
variant,
|
|
73
|
+
class: classes,
|
|
74
|
+
})),
|
|
75
|
+
...bareIcons,
|
|
76
|
+
...tagsFields,
|
|
77
|
+
...fieldCompoundVariants,
|
|
78
|
+
...inGroupRoot,
|
|
79
|
+
// with several values the field shows the focus of the text field inside it
|
|
80
|
+
...fieldWithinCompoundVariants.map((compound) => ({ ...compound, multiple: true })),
|
|
81
|
+
{ multiple: true, variant: ['soft', 'subtle'], class: { tagsItem: tagOnRaised } },
|
|
82
|
+
],
|
|
83
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
slots: {
|
|
3
|
+
base: string;
|
|
4
|
+
increment: string;
|
|
5
|
+
decrement: string;
|
|
6
|
+
};
|
|
7
|
+
variants: {
|
|
8
|
+
size: {
|
|
9
|
+
xs: string;
|
|
10
|
+
sm: string;
|
|
11
|
+
md: string;
|
|
12
|
+
lg: string;
|
|
13
|
+
xl: string;
|
|
14
|
+
};
|
|
15
|
+
variant: {
|
|
16
|
+
outline: string;
|
|
17
|
+
soft: string;
|
|
18
|
+
subtle: string;
|
|
19
|
+
ghost: string;
|
|
20
|
+
none: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
compoundVariants: ({
|
|
24
|
+
variant: string;
|
|
25
|
+
highlight: boolean;
|
|
26
|
+
class: string;
|
|
27
|
+
color?: undefined;
|
|
28
|
+
} | {
|
|
29
|
+
variant: string;
|
|
30
|
+
highlight: boolean;
|
|
31
|
+
color: string;
|
|
32
|
+
class: string;
|
|
33
|
+
} | {
|
|
34
|
+
fixed: boolean;
|
|
35
|
+
size: string[];
|
|
36
|
+
class: string;
|
|
37
|
+
} | ({
|
|
38
|
+
highlight: boolean;
|
|
39
|
+
} & {
|
|
40
|
+
color: import("./shared.ts").Color;
|
|
41
|
+
class: string | Record<string, string>;
|
|
42
|
+
}) | {
|
|
43
|
+
variant: string[];
|
|
44
|
+
class: string;
|
|
45
|
+
} | {
|
|
46
|
+
fieldGroup: string[];
|
|
47
|
+
class: {
|
|
48
|
+
root: string;
|
|
49
|
+
};
|
|
50
|
+
highlight?: undefined;
|
|
51
|
+
} | {
|
|
52
|
+
fieldGroup: string[];
|
|
53
|
+
highlight: boolean;
|
|
54
|
+
class: {
|
|
55
|
+
root: string;
|
|
56
|
+
};
|
|
57
|
+
} | {
|
|
58
|
+
decrement: boolean;
|
|
59
|
+
size: "xs" | "sm" | "md" | "lg" | "xl";
|
|
60
|
+
class: string;
|
|
61
|
+
} | {
|
|
62
|
+
increment: boolean;
|
|
63
|
+
size: "xs" | "sm" | "md" | "lg" | "xl";
|
|
64
|
+
class: string;
|
|
65
|
+
} | {
|
|
66
|
+
orientation: string;
|
|
67
|
+
size: "xs" | "sm" | "md" | "lg" | "xl";
|
|
68
|
+
class: {
|
|
69
|
+
decrement: string;
|
|
70
|
+
increment: string;
|
|
71
|
+
};
|
|
72
|
+
} | {
|
|
73
|
+
orientation: string;
|
|
74
|
+
class: string;
|
|
75
|
+
})[];
|
|
76
|
+
};
|
|
77
|
+
export default _default;
|