nuance-ui 0.2.8 → 0.2.10
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.md +9 -9
- package/README.md +75 -75
- package/dist/module.json +1 -1
- package/dist/runtime/components/action-icon/action-icon-group.vue +3 -3
- package/dist/runtime/components/action-icon/action-icon.vue +23 -23
- package/dist/runtime/components/app-shell/app-shell-aside.vue +30 -30
- package/dist/runtime/components/app-shell/app-shell-footer.vue +29 -29
- package/dist/runtime/components/app-shell/app-shell-header.vue +30 -30
- package/dist/runtime/components/app-shell/app-shell-main.vue +18 -18
- package/dist/runtime/components/app-shell/app-shell-navbar.vue +34 -34
- package/dist/runtime/components/app-shell/app-shell-section.vue +10 -10
- package/dist/runtime/components/app-shell/app-shell.vue +34 -34
- package/dist/runtime/components/box.vue +3 -3
- package/dist/runtime/components/breadcrumbs.vue +78 -78
- package/dist/runtime/components/button/button.d.vue.ts +5 -0
- package/dist/runtime/components/button/button.module.css +1 -1
- package/dist/runtime/components/button/button.vue +44 -41
- package/dist/runtime/components/button/button.vue.d.ts +5 -0
- package/dist/runtime/components/button/unstyled-button.vue +23 -23
- package/dist/runtime/components/calendar/calendar.vue +60 -60
- package/dist/runtime/components/calendar/ui/core/calendar-header.vue +95 -95
- package/dist/runtime/components/calendar/ui/core/calendar-root.vue +3 -3
- package/dist/runtime/components/calendar/ui/levels/calendar-decade.vue +40 -40
- package/dist/runtime/components/calendar/ui/levels/calendar-month.vue +77 -77
- package/dist/runtime/components/calendar/ui/levels/calendar-year.vue +40 -40
- package/dist/runtime/components/card/card-section.vue +3 -3
- package/dist/runtime/components/card/card.vue +3 -3
- package/dist/runtime/components/checkbox/checkbox-card.vue +37 -37
- package/dist/runtime/components/checkbox/checkbox-indicator.vue +117 -117
- package/dist/runtime/components/checkbox/checkbox.vue +139 -139
- package/dist/runtime/components/chip/chip-group.vue +2 -2
- package/dist/runtime/components/chip/chip.vue +200 -200
- package/dist/runtime/components/combobox/combobox-dropdown.vue +14 -14
- package/dist/runtime/components/combobox/combobox-empty.vue +3 -3
- package/dist/runtime/components/combobox/combobox-group.vue +21 -21
- package/dist/runtime/components/combobox/combobox-option-list.vue +3 -3
- package/dist/runtime/components/combobox/combobox-option.vue +22 -22
- package/dist/runtime/components/combobox/combobox-options-dropdown.vue +29 -29
- package/dist/runtime/components/combobox/combobox-root.vue +3 -3
- package/dist/runtime/components/combobox/combobox-target.vue +3 -3
- package/dist/runtime/components/container.vue +8 -8
- package/dist/runtime/components/date-time-picker.d.vue.ts +3 -3
- package/dist/runtime/components/date-time-picker.vue +66 -66
- package/dist/runtime/components/date-time-picker.vue.d.ts +3 -3
- package/dist/runtime/components/dialog/ui/dialog-close-button.vue +11 -11
- package/dist/runtime/components/dialog/ui/dialog-header.vue +5 -5
- package/dist/runtime/components/dialog/ui/dialog-title.vue +5 -5
- package/dist/runtime/components/drawer/drawer-close-button.vue +3 -3
- package/dist/runtime/components/drawer/drawer-header.vue +3 -3
- package/dist/runtime/components/drawer/drawer-root.vue +15 -15
- package/dist/runtime/components/drawer/drawer-title.vue +3 -3
- package/dist/runtime/components/files/file-upload-button.vue +13 -12
- package/dist/runtime/components/files/file-upload-icon.vue +1 -1
- package/dist/runtime/components/input/date-picker.vue +85 -85
- package/dist/runtime/components/input/email-input.vue +19 -19
- package/dist/runtime/components/input/number-input.vue +134 -134
- package/dist/runtime/components/input/password-input.vue +28 -28
- package/dist/runtime/components/input/text-input.vue +35 -35
- package/dist/runtime/components/input/ui/input-inline.vue +105 -105
- package/dist/runtime/components/input/ui/input-wrapper.vue +54 -54
- package/dist/runtime/components/link/link-button.vue +17 -16
- package/dist/runtime/components/link/link.vue +10 -10
- package/dist/runtime/components/loader/_loaders/bars-loader.vue +5 -5
- package/dist/runtime/components/loader/_loaders/dots-loader.vue +5 -5
- package/dist/runtime/components/loader/_loaders/oval-loader.vue +1 -1
- package/dist/runtime/components/modal/modal-close-button.vue +3 -3
- package/dist/runtime/components/modal/modal-header.vue +3 -3
- package/dist/runtime/components/modal/modal-root.vue +13 -13
- package/dist/runtime/components/modal/modal-title.vue +3 -3
- package/dist/runtime/components/nav-link/nav-icon-link.vue +15 -15
- package/dist/runtime/components/nav-link/nav-link.vue +132 -132
- package/dist/runtime/components/paper.vue +33 -33
- package/dist/runtime/components/popover/popover-dropdown.vue +69 -70
- package/dist/runtime/components/popover/popover-target.vue +8 -8
- package/dist/runtime/components/popover/popover.vue +1 -1
- package/dist/runtime/components/progress/progress-label.vue +3 -3
- package/dist/runtime/components/progress/progress-root.vue +3 -3
- package/dist/runtime/components/progress/progress-section.vue +8 -8
- package/dist/runtime/components/progress/progress.vue +9 -9
- package/dist/runtime/components/renderless/renderless.vue +3 -3
- package/dist/runtime/components/roving-focus/roving-focus-item.vue +14 -14
- package/dist/runtime/components/select.vue +63 -63
- package/dist/runtime/components/switch/switch-group.vue +16 -16
- package/dist/runtime/components/table/table.d.ts +30 -30
- package/dist/runtime/components/table/ui/table-sortable-header.vue +12 -11
- package/dist/runtime/components/tabs/tabs-list.vue +10 -10
- package/dist/runtime/components/tabs/tabs-panel.vue +11 -11
- package/dist/runtime/components/tabs/tabs-root.vue +8 -8
- package/dist/runtime/components/tabs/tabs-tab.vue +22 -22
- package/dist/runtime/components/text.vue +67 -67
- package/dist/runtime/components/textarea.vue +36 -36
- package/dist/runtime/components/title.vue +14 -14
- package/dist/runtime/components/transition.vue +3 -3
- package/dist/runtime/components/tree/_ui/tree-item.vue +128 -129
- package/dist/runtime/components/tree/_ui/tree-root.vue +21 -21
- package/dist/runtime/components/visually-hidden/visually-hidden-input.vue +1 -1
- package/dist/runtime/components/visually-hidden/visually-hidden.vue +9 -9
- package/dist/runtime/composables/use-style-resolver.d.ts +2 -3
- package/dist/runtime/styles/dark-theme.css +1 -1
- package/dist/runtime/types/index.d.ts +1 -0
- package/dist/runtime/types/styling.d.ts +4 -0
- package/dist/runtime/types/styling.js +0 -0
- package/dist/runtime/utils/color/parse-theme-color.d.ts +2 -2
- package/package.json +1 -1
|
@@ -49,141 +49,141 @@ function handleBlur() {
|
|
|
49
49
|
</script>
|
|
50
50
|
|
|
51
51
|
<template>
|
|
52
|
-
<InputWrapper v-bind='rest' :class='$style.root' :right-section-p-e>
|
|
53
|
-
<BaseInput>
|
|
54
|
-
<template v-if='!!$slots.leftSection || icon' #leftSection>
|
|
55
|
-
<slot name='leftSection'>
|
|
56
|
-
<Icon v-if='icon' :name='icon' />
|
|
57
|
-
</slot>
|
|
58
|
-
</template>
|
|
59
|
-
|
|
60
|
-
<template #default='{ id, css }'>
|
|
61
|
-
<input
|
|
62
|
-
:id
|
|
63
|
-
v-model='value'
|
|
64
|
-
:class='css'
|
|
65
|
-
:min
|
|
66
|
-
:max
|
|
67
|
-
:step
|
|
68
|
-
type='number'
|
|
69
|
-
@focus='focused = true'
|
|
70
|
-
@blur='handleBlur()'
|
|
71
|
-
@wheel.prevent='handleWheel'
|
|
72
|
-
>
|
|
73
|
-
</template>
|
|
74
|
-
|
|
75
|
-
<template v-if='!!$slots.rightSection || !hideControls' #rightSection>
|
|
76
|
-
<slot name='rightSection'>
|
|
77
|
-
<div :class='$style.controls'>
|
|
78
|
-
<UnstyledButton
|
|
79
|
-
:class='$style.control'
|
|
80
|
-
:disabled='disabled || typeof value === "number" && !Number.isNaN(max) && value >= max'
|
|
81
|
-
@click='value = clamp(value + step, min, max)'
|
|
82
|
-
>
|
|
83
|
-
<Icon name='gravity-ui:chevron-up' />
|
|
84
|
-
</UnstyledButton>
|
|
85
|
-
<UnstyledButton
|
|
86
|
-
:class='$style.control'
|
|
87
|
-
:disabled='disabled || typeof value === "number" && !Number.isNaN(min) && value <= min'
|
|
88
|
-
@click='value = clamp(value - step, min, max)'
|
|
89
|
-
>
|
|
90
|
-
<Icon name='gravity-ui:chevron-down' />
|
|
91
|
-
</UnstyledButton>
|
|
92
|
-
</div>
|
|
93
|
-
</slot>
|
|
94
|
-
</template>
|
|
95
|
-
</BaseInput>
|
|
96
|
-
|
|
97
|
-
<template v-if='!!$slots.label' #label>
|
|
98
|
-
<slot name='label' />
|
|
99
|
-
</template>
|
|
100
|
-
<template v-if='!!$slots.error' #error>
|
|
101
|
-
<slot name='error' />
|
|
102
|
-
</template>
|
|
103
|
-
<template v-if='!!$slots.description' #description>
|
|
104
|
-
<slot name='description' />
|
|
105
|
-
</template>
|
|
106
|
-
</InputWrapper>
|
|
52
|
+
<InputWrapper v-bind='rest' :class='$style.root' :right-section-p-e>
|
|
53
|
+
<BaseInput>
|
|
54
|
+
<template v-if='!!$slots.leftSection || icon' #leftSection>
|
|
55
|
+
<slot name='leftSection'>
|
|
56
|
+
<Icon v-if='icon' :name='icon' />
|
|
57
|
+
</slot>
|
|
58
|
+
</template>
|
|
59
|
+
|
|
60
|
+
<template #default='{ id, css }'>
|
|
61
|
+
<input
|
|
62
|
+
:id
|
|
63
|
+
v-model='value'
|
|
64
|
+
:class='css'
|
|
65
|
+
:min
|
|
66
|
+
:max
|
|
67
|
+
:step
|
|
68
|
+
type='number'
|
|
69
|
+
@focus='focused = true'
|
|
70
|
+
@blur='handleBlur()'
|
|
71
|
+
@wheel.prevent='handleWheel'
|
|
72
|
+
>
|
|
73
|
+
</template>
|
|
74
|
+
|
|
75
|
+
<template v-if='!!$slots.rightSection || !hideControls' #rightSection>
|
|
76
|
+
<slot name='rightSection'>
|
|
77
|
+
<div :class='$style.controls'>
|
|
78
|
+
<UnstyledButton
|
|
79
|
+
:class='$style.control'
|
|
80
|
+
:disabled='disabled || typeof value === "number" && !Number.isNaN(max) && value >= max'
|
|
81
|
+
@click='value = clamp(value + step, min, max)'
|
|
82
|
+
>
|
|
83
|
+
<Icon name='gravity-ui:chevron-up' />
|
|
84
|
+
</UnstyledButton>
|
|
85
|
+
<UnstyledButton
|
|
86
|
+
:class='$style.control'
|
|
87
|
+
:disabled='disabled || typeof value === "number" && !Number.isNaN(min) && value <= min'
|
|
88
|
+
@click='value = clamp(value - step, min, max)'
|
|
89
|
+
>
|
|
90
|
+
<Icon name='gravity-ui:chevron-down' />
|
|
91
|
+
</UnstyledButton>
|
|
92
|
+
</div>
|
|
93
|
+
</slot>
|
|
94
|
+
</template>
|
|
95
|
+
</BaseInput>
|
|
96
|
+
|
|
97
|
+
<template v-if='!!$slots.label' #label>
|
|
98
|
+
<slot name='label' />
|
|
99
|
+
</template>
|
|
100
|
+
<template v-if='!!$slots.error' #error>
|
|
101
|
+
<slot name='error' />
|
|
102
|
+
</template>
|
|
103
|
+
<template v-if='!!$slots.description' #description>
|
|
104
|
+
<slot name='description' />
|
|
105
|
+
</template>
|
|
106
|
+
</InputWrapper>
|
|
107
107
|
</template>
|
|
108
108
|
|
|
109
109
|
<style module lang="postcss">
|
|
110
|
-
.root {
|
|
111
|
-
--ni-right-section-width-xs: rem(17px);
|
|
112
|
-
--ni-right-section-width-sm: rem(24px);
|
|
113
|
-
--ni-right-section-width-md: rem(27px);
|
|
114
|
-
--ni-right-section-width-lg: rem(31px);
|
|
115
|
-
--ni-right-section-width-xl: rem(34px);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.controls {
|
|
119
|
-
--ni-chevron-size-xs: rem(10px);
|
|
120
|
-
--ni-chevron-size-sm: rem(14px);
|
|
121
|
-
--ni-chevron-size-md: rem(16px);
|
|
122
|
-
--ni-chevron-size-lg: rem(18px);
|
|
123
|
-
--ni-chevron-size-xl: rem(20px);
|
|
124
|
-
--ni-chevron-size: var(--ni-chevron-size-sm);
|
|
125
|
-
|
|
126
|
-
display: flex;
|
|
127
|
-
flex-direction: column;
|
|
128
|
-
|
|
129
|
-
width: 100%;
|
|
130
|
-
max-width: calc(var(--ni-chevron-size) * 1.7);
|
|
131
|
-
height: calc(var(--input-height) - rem(2px));
|
|
132
|
-
margin-inline-start: auto;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
.control {
|
|
136
|
-
--control-border: 1px solid var(--input-bd);
|
|
137
|
-
--control-radius: calc(var(--input-radius) - rem(1px));
|
|
138
|
-
|
|
139
|
-
cursor: pointer;
|
|
140
|
-
|
|
141
|
-
display: flex;
|
|
142
|
-
|
|
143
|
-
flex: 0 0 50%;
|
|
144
|
-
align-items: center;
|
|
145
|
-
justify-content: center;
|
|
146
|
-
|
|
147
|
-
width: 100%;
|
|
148
|
-
height: calc(var(--input-height) / 2 - rem(1px));
|
|
149
|
-
padding: 0;
|
|
150
|
-
border-inline-start: var(--control-border);
|
|
151
|
-
|
|
152
|
-
color: var(--color-text);
|
|
153
|
-
|
|
154
|
-
background-color: transparent;
|
|
155
|
-
|
|
156
|
-
&:where(:disabled) {
|
|
157
|
-
cursor: not-allowed;
|
|
158
|
-
|
|
159
|
-
color: var(--color-disabled-text);
|
|
160
|
-
|
|
161
|
-
opacity: 0.6;
|
|
162
|
-
background-color: transparent;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
.root[data-error] :where(&) {
|
|
166
|
-
color: var(--color-error);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
&:where(:first-of-type) {
|
|
170
|
-
border-radius: 0;
|
|
171
|
-
border-start-end-radius: var(--control-radius);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
&:last-of-type {
|
|
175
|
-
border-radius: 0;
|
|
176
|
-
border-end-end-radius: var(--control-radius);
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
@mixin hover {
|
|
180
|
-
@mixin where-light {
|
|
181
|
-
background-color: var(--color-gray-0);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
@mixin where-dark {
|
|
185
|
-
background-color: var(--color-dark-4);
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
}
|
|
110
|
+
.root {
|
|
111
|
+
--ni-right-section-width-xs: rem(17px);
|
|
112
|
+
--ni-right-section-width-sm: rem(24px);
|
|
113
|
+
--ni-right-section-width-md: rem(27px);
|
|
114
|
+
--ni-right-section-width-lg: rem(31px);
|
|
115
|
+
--ni-right-section-width-xl: rem(34px);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.controls {
|
|
119
|
+
--ni-chevron-size-xs: rem(10px);
|
|
120
|
+
--ni-chevron-size-sm: rem(14px);
|
|
121
|
+
--ni-chevron-size-md: rem(16px);
|
|
122
|
+
--ni-chevron-size-lg: rem(18px);
|
|
123
|
+
--ni-chevron-size-xl: rem(20px);
|
|
124
|
+
--ni-chevron-size: var(--ni-chevron-size-sm);
|
|
125
|
+
|
|
126
|
+
display: flex;
|
|
127
|
+
flex-direction: column;
|
|
128
|
+
|
|
129
|
+
width: 100%;
|
|
130
|
+
max-width: calc(var(--ni-chevron-size) * 1.7);
|
|
131
|
+
height: calc(var(--input-height) - rem(2px));
|
|
132
|
+
margin-inline-start: auto;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.control {
|
|
136
|
+
--control-border: 1px solid var(--input-bd);
|
|
137
|
+
--control-radius: calc(var(--input-radius) - rem(1px));
|
|
138
|
+
|
|
139
|
+
cursor: pointer;
|
|
140
|
+
|
|
141
|
+
display: flex;
|
|
142
|
+
|
|
143
|
+
flex: 0 0 50%;
|
|
144
|
+
align-items: center;
|
|
145
|
+
justify-content: center;
|
|
146
|
+
|
|
147
|
+
width: 100%;
|
|
148
|
+
height: calc(var(--input-height) / 2 - rem(1px));
|
|
149
|
+
padding: 0;
|
|
150
|
+
border-inline-start: var(--control-border);
|
|
151
|
+
|
|
152
|
+
color: var(--color-text);
|
|
153
|
+
|
|
154
|
+
background-color: transparent;
|
|
155
|
+
|
|
156
|
+
&:where(:disabled) {
|
|
157
|
+
cursor: not-allowed;
|
|
158
|
+
|
|
159
|
+
color: var(--color-disabled-text);
|
|
160
|
+
|
|
161
|
+
opacity: 0.6;
|
|
162
|
+
background-color: transparent;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.root[data-error] :where(&) {
|
|
166
|
+
color: var(--color-error);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
&:where(:first-of-type) {
|
|
170
|
+
border-radius: 0;
|
|
171
|
+
border-start-end-radius: var(--control-radius);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
&:last-of-type {
|
|
175
|
+
border-radius: 0;
|
|
176
|
+
border-end-end-radius: var(--control-radius);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
@mixin hover {
|
|
180
|
+
@mixin where-light {
|
|
181
|
+
background-color: var(--color-gray-0);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
@mixin where-dark {
|
|
185
|
+
background-color: var(--color-dark-4);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
189
|
</style>
|
|
@@ -25,32 +25,32 @@ const password = ref(true);
|
|
|
25
25
|
</script>
|
|
26
26
|
|
|
27
27
|
<template>
|
|
28
|
-
<TextInput
|
|
29
|
-
v-bind='props'
|
|
30
|
-
:type='password ? "password" : "text"'
|
|
31
|
-
right-section-p-e='all'
|
|
32
|
-
>
|
|
33
|
-
<template #rightSection>
|
|
34
|
-
<slot name='rightSection'>
|
|
35
|
-
<ActionIcon variant='subtle' @click='password = !password'>
|
|
36
|
-
<Icon v-if='password' name='gravity-ui:eye' />
|
|
37
|
-
<Icon v-else name='gravity-ui:eye-slash' />
|
|
38
|
-
</ActionIcon>
|
|
39
|
-
</slot>
|
|
40
|
-
</template>
|
|
41
|
-
|
|
42
|
-
<template v-if='!!$slots.leftSection' #leftSection>
|
|
43
|
-
<slot name='leftSection' />
|
|
44
|
-
</template>
|
|
45
|
-
|
|
46
|
-
<template v-if='!!$slots.label' #label>
|
|
47
|
-
<slot name='label' />
|
|
48
|
-
</template>
|
|
49
|
-
<template v-if='!!$slots.error' #error>
|
|
50
|
-
<slot name='error' />
|
|
51
|
-
</template>
|
|
52
|
-
<template v-if='!!$slots.description' #description>
|
|
53
|
-
<slot name='description' />
|
|
54
|
-
</template>
|
|
55
|
-
</TextInput>
|
|
28
|
+
<TextInput
|
|
29
|
+
v-bind='props'
|
|
30
|
+
:type='password ? "password" : "text"'
|
|
31
|
+
right-section-p-e='all'
|
|
32
|
+
>
|
|
33
|
+
<template #rightSection>
|
|
34
|
+
<slot name='rightSection'>
|
|
35
|
+
<ActionIcon variant='subtle' @click='password = !password'>
|
|
36
|
+
<Icon v-if='password' name='gravity-ui:eye' />
|
|
37
|
+
<Icon v-else name='gravity-ui:eye-slash' />
|
|
38
|
+
</ActionIcon>
|
|
39
|
+
</slot>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<template v-if='!!$slots.leftSection' #leftSection>
|
|
43
|
+
<slot name='leftSection' />
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<template v-if='!!$slots.label' #label>
|
|
47
|
+
<slot name='label' />
|
|
48
|
+
</template>
|
|
49
|
+
<template v-if='!!$slots.error' #error>
|
|
50
|
+
<slot name='error' />
|
|
51
|
+
</template>
|
|
52
|
+
<template v-if='!!$slots.description' #description>
|
|
53
|
+
<slot name='description' />
|
|
54
|
+
</template>
|
|
55
|
+
</TextInput>
|
|
56
56
|
</template>
|
|
@@ -32,39 +32,39 @@ defineExpose({
|
|
|
32
32
|
</script>
|
|
33
33
|
|
|
34
34
|
<template>
|
|
35
|
-
<InputWrapper v-bind='props' :class='[$attrs.class, classes?.wrapper]'>
|
|
36
|
-
<BaseInput>
|
|
37
|
-
<template v-if='!!$slots.leftSection || icon' #leftSection>
|
|
38
|
-
<slot name='leftSection'>
|
|
39
|
-
<Icon v-if='icon' :name='icon' />
|
|
40
|
-
</slot>
|
|
41
|
-
</template>
|
|
42
|
-
|
|
43
|
-
<template #default='{ id, css }'>
|
|
44
|
-
<input
|
|
45
|
-
v-bind='{ ...$attrs, class: css }'
|
|
46
|
-
:id
|
|
47
|
-
ref='input'
|
|
48
|
-
v-model='value'
|
|
49
|
-
:required
|
|
50
|
-
:disabled
|
|
51
|
-
:readonly
|
|
52
|
-
>
|
|
53
|
-
</template>
|
|
54
|
-
|
|
55
|
-
<template v-if='!!$slots.rightSection' #rightSection>
|
|
56
|
-
<slot name='rightSection' />
|
|
57
|
-
</template>
|
|
58
|
-
</BaseInput>
|
|
59
|
-
|
|
60
|
-
<template v-if='!!$slots.label' #label>
|
|
61
|
-
<slot name='label' />
|
|
62
|
-
</template>
|
|
63
|
-
<template v-if='!!$slots.error' #error>
|
|
64
|
-
<slot name='error' />
|
|
65
|
-
</template>
|
|
66
|
-
<template v-if='!!$slots.description' #description>
|
|
67
|
-
<slot name='description' />
|
|
68
|
-
</template>
|
|
69
|
-
</InputWrapper>
|
|
35
|
+
<InputWrapper v-bind='props' :class='[$attrs.class, classes?.wrapper]'>
|
|
36
|
+
<BaseInput>
|
|
37
|
+
<template v-if='!!$slots.leftSection || icon' #leftSection>
|
|
38
|
+
<slot name='leftSection'>
|
|
39
|
+
<Icon v-if='icon' :name='icon' />
|
|
40
|
+
</slot>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<template #default='{ id, css }'>
|
|
44
|
+
<input
|
|
45
|
+
v-bind='{ ...$attrs, class: css }'
|
|
46
|
+
:id
|
|
47
|
+
ref='input'
|
|
48
|
+
v-model='value'
|
|
49
|
+
:required
|
|
50
|
+
:disabled
|
|
51
|
+
:readonly
|
|
52
|
+
>
|
|
53
|
+
</template>
|
|
54
|
+
|
|
55
|
+
<template v-if='!!$slots.rightSection' #rightSection>
|
|
56
|
+
<slot name='rightSection' />
|
|
57
|
+
</template>
|
|
58
|
+
</BaseInput>
|
|
59
|
+
|
|
60
|
+
<template v-if='!!$slots.label' #label>
|
|
61
|
+
<slot name='label' />
|
|
62
|
+
</template>
|
|
63
|
+
<template v-if='!!$slots.error' #error>
|
|
64
|
+
<slot name='error' />
|
|
65
|
+
</template>
|
|
66
|
+
<template v-if='!!$slots.description' #description>
|
|
67
|
+
<slot name='description' />
|
|
68
|
+
</template>
|
|
69
|
+
</InputWrapper>
|
|
70
70
|
</template>
|
|
@@ -33,112 +33,112 @@ const style = computed(() => ({
|
|
|
33
33
|
</script>
|
|
34
34
|
|
|
35
35
|
<template>
|
|
36
|
-
<Box :style :class='$style.root' :mod='[{ "label-position": labelPosition }, mod]'>
|
|
37
|
-
<Box :is='bodyElement' :for='bodyElement === "label" ? id : void 0' :class='$style.body'>
|
|
38
|
-
<slot />
|
|
39
|
-
|
|
40
|
-
<div :class='$style.wrapper'>
|
|
41
|
-
<Box :is='labelElement' v-if='label || $slots.label' :class='$style.label' :for='labelElement === "label" ? id : void 0' :mod='{ disabled }'>
|
|
42
|
-
<slot name='label'>
|
|
43
|
-
{{ label }}
|
|
44
|
-
</slot>
|
|
45
|
-
</Box>
|
|
46
|
-
|
|
47
|
-
<Box is='p' v-if='error' :class='$style.error' :mod='{ disabled }'>
|
|
48
|
-
<slot name='error'>
|
|
49
|
-
{{ error }}
|
|
50
|
-
</slot>
|
|
51
|
-
</Box>
|
|
52
|
-
|
|
53
|
-
<Box is='p' v-else-if='description || $slots.description' :class='$style.description' :mod='{ disabled }'>
|
|
54
|
-
<slot name='description'>
|
|
55
|
-
{{ description }}
|
|
56
|
-
</slot>
|
|
57
|
-
</Box>
|
|
58
|
-
</div>
|
|
59
|
-
</Box>
|
|
60
|
-
</Box>
|
|
36
|
+
<Box :style :class='$style.root' :mod='[{ "label-position": labelPosition }, mod]'>
|
|
37
|
+
<Box :is='bodyElement' :for='bodyElement === "label" ? id : void 0' :class='$style.body'>
|
|
38
|
+
<slot />
|
|
39
|
+
|
|
40
|
+
<div :class='$style.wrapper'>
|
|
41
|
+
<Box :is='labelElement' v-if='label || $slots.label' :class='$style.label' :for='labelElement === "label" ? id : void 0' :mod='{ disabled }'>
|
|
42
|
+
<slot name='label'>
|
|
43
|
+
{{ label }}
|
|
44
|
+
</slot>
|
|
45
|
+
</Box>
|
|
46
|
+
|
|
47
|
+
<Box is='p' v-if='error' :class='$style.error' :mod='{ disabled }'>
|
|
48
|
+
<slot name='error'>
|
|
49
|
+
{{ error }}
|
|
50
|
+
</slot>
|
|
51
|
+
</Box>
|
|
52
|
+
|
|
53
|
+
<Box is='p' v-else-if='description || $slots.description' :class='$style.description' :mod='{ disabled }'>
|
|
54
|
+
<slot name='description'>
|
|
55
|
+
{{ description }}
|
|
56
|
+
</slot>
|
|
57
|
+
</Box>
|
|
58
|
+
</div>
|
|
59
|
+
</Box>
|
|
60
|
+
</Box>
|
|
61
61
|
</template>
|
|
62
62
|
|
|
63
63
|
<style lang="postcss" module>
|
|
64
|
-
.root {
|
|
65
|
-
--label-lh-xs: rem(16px);
|
|
66
|
-
--label-lh-sm: rem(20px);
|
|
67
|
-
--label-lh-md: rem(24px);
|
|
68
|
-
--label-lh-lg: rem(30px);
|
|
69
|
-
--label-lh-xl: rem(36px);
|
|
70
|
-
--label-lh: var(--label-lh-sm);
|
|
71
|
-
|
|
72
|
-
--label-fz: var(--font-size-sm);
|
|
73
|
-
|
|
74
|
-
&[data-label-position='left'] {
|
|
75
|
-
--label-order: 0;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
&[data-label-position='right'] {
|
|
79
|
-
--label-order: 1;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.body {
|
|
84
|
-
display: flex;
|
|
85
|
-
gap: var(--spacing-sm);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.wrapper {
|
|
89
|
-
--label-cursor: default;
|
|
90
|
-
|
|
91
|
-
cursor: var(--label-cursor);
|
|
92
|
-
|
|
93
|
-
display: inline-flex;
|
|
94
|
-
flex-direction: column;
|
|
95
|
-
gap: .25rem;
|
|
96
|
-
order: var(--label-order);
|
|
97
|
-
|
|
98
|
-
font-size: var(--label-fz);
|
|
99
|
-
line-height: var(--label-lh);
|
|
100
|
-
|
|
101
|
-
-webkit-tap-highlight-color: transparent;
|
|
102
|
-
|
|
103
|
-
fieldset:disabled &,
|
|
104
|
-
&[data-disabled] {
|
|
105
|
-
--label-cursor: not-allowed;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
&:empty {
|
|
109
|
-
display: none;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.label {
|
|
114
|
-
cursor: var(--label-cursor);
|
|
115
|
-
|
|
116
|
-
color: inherit;
|
|
117
|
-
|
|
118
|
-
fieldset:disabled &,
|
|
119
|
-
&:where([data-disabled]) {
|
|
120
|
-
color: var(--color-gray-5);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.error,
|
|
125
|
-
.description {
|
|
126
|
-
display: block;
|
|
127
|
-
|
|
128
|
-
margin: 0;
|
|
129
|
-
padding: 0;
|
|
130
|
-
|
|
131
|
-
line-height: 1.2;
|
|
132
|
-
overflow-wrap: break-word;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
.description {
|
|
136
|
-
font-size: var(--input-description-size, calc(var(--font-size-sm) - rem(2px)));
|
|
137
|
-
color: var(--color-dimmed);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
.error {
|
|
141
|
-
font-size: var(--input-error-size);
|
|
142
|
-
color: var(--color-error);
|
|
143
|
-
}
|
|
64
|
+
.root {
|
|
65
|
+
--label-lh-xs: rem(16px);
|
|
66
|
+
--label-lh-sm: rem(20px);
|
|
67
|
+
--label-lh-md: rem(24px);
|
|
68
|
+
--label-lh-lg: rem(30px);
|
|
69
|
+
--label-lh-xl: rem(36px);
|
|
70
|
+
--label-lh: var(--label-lh-sm);
|
|
71
|
+
|
|
72
|
+
--label-fz: var(--font-size-sm);
|
|
73
|
+
|
|
74
|
+
&[data-label-position='left'] {
|
|
75
|
+
--label-order: 0;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&[data-label-position='right'] {
|
|
79
|
+
--label-order: 1;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.body {
|
|
84
|
+
display: flex;
|
|
85
|
+
gap: var(--spacing-sm);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.wrapper {
|
|
89
|
+
--label-cursor: default;
|
|
90
|
+
|
|
91
|
+
cursor: var(--label-cursor);
|
|
92
|
+
|
|
93
|
+
display: inline-flex;
|
|
94
|
+
flex-direction: column;
|
|
95
|
+
gap: .25rem;
|
|
96
|
+
order: var(--label-order);
|
|
97
|
+
|
|
98
|
+
font-size: var(--label-fz);
|
|
99
|
+
line-height: var(--label-lh);
|
|
100
|
+
|
|
101
|
+
-webkit-tap-highlight-color: transparent;
|
|
102
|
+
|
|
103
|
+
fieldset:disabled &,
|
|
104
|
+
&[data-disabled] {
|
|
105
|
+
--label-cursor: not-allowed;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&:empty {
|
|
109
|
+
display: none;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.label {
|
|
114
|
+
cursor: var(--label-cursor);
|
|
115
|
+
|
|
116
|
+
color: inherit;
|
|
117
|
+
|
|
118
|
+
fieldset:disabled &,
|
|
119
|
+
&:where([data-disabled]) {
|
|
120
|
+
color: var(--color-gray-5);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.error,
|
|
125
|
+
.description {
|
|
126
|
+
display: block;
|
|
127
|
+
|
|
128
|
+
margin: 0;
|
|
129
|
+
padding: 0;
|
|
130
|
+
|
|
131
|
+
line-height: 1.2;
|
|
132
|
+
overflow-wrap: break-word;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.description {
|
|
136
|
+
font-size: var(--input-description-size, calc(var(--font-size-sm) - rem(2px)));
|
|
137
|
+
color: var(--color-dimmed);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.error {
|
|
141
|
+
font-size: var(--input-error-size);
|
|
142
|
+
color: var(--color-error);
|
|
143
|
+
}
|
|
144
144
|
</style>
|