@kuina-ui/vue 0.4.0 → 0.6.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 +143 -143
- package/dist/components/slider/RangeSlider.vue.d.ts +55 -0
- package/dist/components/slider/Slider.vue.d.ts +49 -0
- package/dist/components/slider/SliderHeader.vue.d.ts +30 -0
- package/dist/components/slider/index.d.ts +5 -0
- package/dist/components/slider/slider.theme.d.ts +33 -0
- package/dist/elements/segmented-control/SegmentedControl.vue.d.ts +35 -0
- package/dist/elements/segmented-control/index.d.ts +2 -0
- package/dist/elements/segmented-control/segmented-control.theme.d.ts +62 -0
- package/dist/elements/slider-control/SliderControl.vue.d.ts +35 -0
- package/dist/elements/slider-control/index.d.ts +3 -0
- package/dist/elements/slider-control/slider-control.theme.d.ts +38 -0
- package/dist/elements/slider-control/useSliderMarksLayout.d.ts +6 -0
- package/dist/elements/tooltip/Tooltip.vue.d.ts +48 -0
- package/dist/elements/tooltip/index.d.ts +2 -0
- package/dist/elements/tooltip/tooltip.theme.d.ts +29 -0
- package/dist/elements/tooltip/useTooltipOpenState.d.ts +17 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +1 -1
- package/dist/nuxt.js +1 -1
- package/dist/shared/composables/useNumberFieldTyping.d.ts +21 -0
- package/dist/shared/composables/usePointerGraceArea.d.ts +11 -0
- package/dist/shared/composables/useSlidingThumb.d.ts +12 -0
- package/dist/shared/types/pointer-grace-area.d.ts +12 -0
- package/dist/shared/types/slider.d.ts +6 -0
- package/dist/shared/utils/createDebouncedCallback.d.ts +5 -0
- package/dist/shared/utils/findFirstRenderedVNode.d.ts +3 -0
- package/dist/shared/utils/pointerGraceArea.d.ts +11 -0
- package/dist/shared/utils/resolvePressScale.d.ts +2 -0
- package/dist/shared/utils/shiftFloatingPosition.d.ts +3 -0
- package/dist/shared/utils/sliderPosition.d.ts +11 -0
- package/dist/shared/utils/sliderThumbs.d.ts +13 -0
- package/dist/shared/utils/steppedValue.d.ts +18 -0
- package/dist/{src-ChY11Hfy.js → src-Rouj5r7z.js} +3583 -1972
- package/package.json +75 -75
- package/src/index.css +1 -0
- package/src/shared/styles/utilities/slider-mark-position.css +8 -0
package/README.md
CHANGED
|
@@ -1,143 +1,143 @@
|
|
|
1
|
-
<picture>
|
|
2
|
-
<source media="(prefers-color-scheme: dark)" srcset=".github/assets/kuina-logo-dark.svg" />
|
|
3
|
-
<img src=".github/assets/kuina-logo-light.svg" alt="Kuina UI logo" height="64" />
|
|
4
|
-
</picture>
|
|
5
|
-
|
|
6
|
-
# Kuina UI — Vue
|
|
7
|
-
|
|
8
|
-
[![npm version][npm-version-src]][npm-version-href]
|
|
9
|
-
[![Vue][vue-src]][vue-href]
|
|
10
|
-
[![Nuxt][nuxt-src]][nuxt-href]
|
|
11
|
-
[![Tailwind CSS][tailwindcss-src]][tailwindcss-href]
|
|
12
|
-
|
|
13
|
-
Kuina UI is a library of accessible, typed [Vue](https://vuejs.org) components built from scratch with [Tailwind CSS v4](https://tailwindcss.com/), in light and dark themes. It works as a module in [Nuxt](https://nuxt.com) and with plain imports in any Vue app.
|
|
14
|
-
|
|
15
|
-
> [!NOTE]
|
|
16
|
-
> Kuina UI is in early development.
|
|
17
|
-
|
|
18
|
-
## Documentation
|
|
19
|
-
|
|
20
|
-
The documentation lives in its own repository: [Kuina-UI/docs](https://github.com/Kuina-UI/docs).
|
|
21
|
-
|
|
22
|
-
## Installation
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
npm install @kuina-ui/vue tailwindcss
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
### Nuxt
|
|
29
|
-
|
|
30
|
-
1. Add the Kuina UI module in your `nuxt.config.ts`:
|
|
31
|
-
|
|
32
|
-
```ts
|
|
33
|
-
export default defineNuxtConfig({
|
|
34
|
-
modules: ['@kuina-ui/vue/nuxt'],
|
|
35
|
-
css: ['~/assets/css/main.css']
|
|
36
|
-
})
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
2. Import Tailwind CSS and Kuina UI in your `app/assets/css/main.css`:
|
|
40
|
-
|
|
41
|
-
```css
|
|
42
|
-
@import "tailwindcss";
|
|
43
|
-
@import "@kuina-ui/vue";
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
3. Set the theme on `<html>` in your `app.vue`:
|
|
47
|
-
|
|
48
|
-
```vue
|
|
49
|
-
<script setup lang="ts">
|
|
50
|
-
useHead({
|
|
51
|
-
htmlAttrs: { 'data-theme': 'light' }
|
|
52
|
-
})
|
|
53
|
-
</script>
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
Components are registered for you: write `<KButton>` anywhere, no import needed.
|
|
57
|
-
|
|
58
|
-
### Vue
|
|
59
|
-
|
|
60
|
-
1. Install the Tailwind CSS Vite plugin and add it to your `vite.config.ts`:
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
npm install @tailwindcss/vite
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
```ts
|
|
67
|
-
import { defineConfig } from 'vite'
|
|
68
|
-
import vue from '@vitejs/plugin-vue'
|
|
69
|
-
import tailwindcss from '@tailwindcss/vite'
|
|
70
|
-
|
|
71
|
-
export default defineConfig({
|
|
72
|
-
plugins: [vue(), tailwindcss()]
|
|
73
|
-
})
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
2. Import Tailwind CSS and Kuina UI in your `src/assets/main.css`, then load it in `main.ts`:
|
|
77
|
-
|
|
78
|
-
```css
|
|
79
|
-
@import "tailwindcss";
|
|
80
|
-
@import "@kuina-ui/vue";
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
```ts
|
|
84
|
-
import './assets/main.css'
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
3. Set the theme on `<html>` in your `index.html`:
|
|
88
|
-
|
|
89
|
-
```html
|
|
90
|
-
<html lang="en" data-theme="light">
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
4. Import the components you use:
|
|
94
|
-
|
|
95
|
-
```vue
|
|
96
|
-
<script setup lang="ts">
|
|
97
|
-
import { KButton } from '@kuina-ui/vue'
|
|
98
|
-
</script>
|
|
99
|
-
|
|
100
|
-
<template>
|
|
101
|
-
<KButton>Save</KButton>
|
|
102
|
-
</template>
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
## Themes
|
|
106
|
-
|
|
107
|
-
Kuina UI comes in a light and a dark theme. `data-theme` on `<html>` picks it: set it to `light` or `dark`, and every component follows, along with the `light:` and `dark:` variants in your own classes.
|
|
108
|
-
|
|
109
|
-
## Contribution
|
|
110
|
-
|
|
111
|
-
Found a bug or have an idea? [Open an issue](https://github.com/Kuina-UI/vue/issues/new).
|
|
112
|
-
|
|
113
|
-
Commit messages follow [Conventional Commits](https://www.conventionalcommits.org/) (`feat: …`, `fix: …`, `chore: …`), in English.
|
|
114
|
-
|
|
115
|
-
## Credits
|
|
116
|
-
|
|
117
|
-
- [vuejs/core](https://github.com/vuejs/core)
|
|
118
|
-
- [vitejs/vite](https://github.com/vitejs/vite)
|
|
119
|
-
- [nuxt/nuxt](https://github.com/nuxt/nuxt)
|
|
120
|
-
- [tailwindlabs/tailwindcss](https://github.com/tailwindlabs/tailwindcss)
|
|
121
|
-
- [lucide-icons/lucide](https://github.com/lucide-icons/lucide)
|
|
122
|
-
- [nuxt-content/docus](https://github.com/nuxt-content/docus)
|
|
123
|
-
|
|
124
|
-
## Support Kuina UI
|
|
125
|
-
|
|
126
|
-
Kuina UI is free and open source. If it saves you time, you can support its development:
|
|
127
|
-
|
|
128
|
-
- [GitHub Sponsors](https://github.com/sponsors/mgcodeur)
|
|
129
|
-
- [Open Collective](https://opencollective.com/mgcodeur)
|
|
130
|
-
- [Ko-fi](https://ko-fi.com/mgcodeur)
|
|
131
|
-
|
|
132
|
-
## License
|
|
133
|
-
|
|
134
|
-
[MIT](LICENSE): free to use, modify and redistribute, including for commercial projects.
|
|
135
|
-
|
|
136
|
-
[npm-version-src]: https://img.shields.io/npm/v/@kuina-ui/vue?color=18181B
|
|
137
|
-
[npm-version-href]: https://npmjs.com/package/@kuina-ui/vue
|
|
138
|
-
[vue-src]: https://img.shields.io/badge/Vue-18181B?logo=vuedotjs
|
|
139
|
-
[vue-href]: https://vuejs.org
|
|
140
|
-
[nuxt-src]: https://img.shields.io/badge/Nuxt-18181B?logo=nuxt
|
|
141
|
-
[nuxt-href]: https://nuxt.com
|
|
142
|
-
[tailwindcss-src]: https://img.shields.io/badge/Tailwind_CSS-18181B?logo=tailwindcss
|
|
143
|
-
[tailwindcss-href]: https://tailwindcss.com
|
|
1
|
+
<picture>
|
|
2
|
+
<source media="(prefers-color-scheme: dark)" srcset=".github/assets/kuina-logo-dark.svg" />
|
|
3
|
+
<img src=".github/assets/kuina-logo-light.svg" alt="Kuina UI logo" height="64" />
|
|
4
|
+
</picture>
|
|
5
|
+
|
|
6
|
+
# Kuina UI — Vue
|
|
7
|
+
|
|
8
|
+
[![npm version][npm-version-src]][npm-version-href]
|
|
9
|
+
[![Vue][vue-src]][vue-href]
|
|
10
|
+
[![Nuxt][nuxt-src]][nuxt-href]
|
|
11
|
+
[![Tailwind CSS][tailwindcss-src]][tailwindcss-href]
|
|
12
|
+
|
|
13
|
+
Kuina UI is a library of accessible, typed [Vue](https://vuejs.org) components built from scratch with [Tailwind CSS v4](https://tailwindcss.com/), in light and dark themes. It works as a module in [Nuxt](https://nuxt.com) and with plain imports in any Vue app.
|
|
14
|
+
|
|
15
|
+
> [!NOTE]
|
|
16
|
+
> Kuina UI is in early development.
|
|
17
|
+
|
|
18
|
+
## Documentation
|
|
19
|
+
|
|
20
|
+
The documentation lives in its own repository: [Kuina-UI/docs](https://github.com/Kuina-UI/docs).
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm install @kuina-ui/vue tailwindcss
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Nuxt
|
|
29
|
+
|
|
30
|
+
1. Add the Kuina UI module in your `nuxt.config.ts`:
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
export default defineNuxtConfig({
|
|
34
|
+
modules: ['@kuina-ui/vue/nuxt'],
|
|
35
|
+
css: ['~/assets/css/main.css']
|
|
36
|
+
})
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
2. Import Tailwind CSS and Kuina UI in your `app/assets/css/main.css`:
|
|
40
|
+
|
|
41
|
+
```css
|
|
42
|
+
@import "tailwindcss";
|
|
43
|
+
@import "@kuina-ui/vue";
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
3. Set the theme on `<html>` in your `app.vue`:
|
|
47
|
+
|
|
48
|
+
```vue
|
|
49
|
+
<script setup lang="ts">
|
|
50
|
+
useHead({
|
|
51
|
+
htmlAttrs: { 'data-theme': 'light' }
|
|
52
|
+
})
|
|
53
|
+
</script>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Components are registered for you: write `<KButton>` anywhere, no import needed.
|
|
57
|
+
|
|
58
|
+
### Vue
|
|
59
|
+
|
|
60
|
+
1. Install the Tailwind CSS Vite plugin and add it to your `vite.config.ts`:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npm install @tailwindcss/vite
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
import { defineConfig } from 'vite'
|
|
68
|
+
import vue from '@vitejs/plugin-vue'
|
|
69
|
+
import tailwindcss from '@tailwindcss/vite'
|
|
70
|
+
|
|
71
|
+
export default defineConfig({
|
|
72
|
+
plugins: [vue(), tailwindcss()]
|
|
73
|
+
})
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
2. Import Tailwind CSS and Kuina UI in your `src/assets/main.css`, then load it in `main.ts`:
|
|
77
|
+
|
|
78
|
+
```css
|
|
79
|
+
@import "tailwindcss";
|
|
80
|
+
@import "@kuina-ui/vue";
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
import './assets/main.css'
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
3. Set the theme on `<html>` in your `index.html`:
|
|
88
|
+
|
|
89
|
+
```html
|
|
90
|
+
<html lang="en" data-theme="light">
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
4. Import the components you use:
|
|
94
|
+
|
|
95
|
+
```vue
|
|
96
|
+
<script setup lang="ts">
|
|
97
|
+
import { KButton } from '@kuina-ui/vue'
|
|
98
|
+
</script>
|
|
99
|
+
|
|
100
|
+
<template>
|
|
101
|
+
<KButton>Save</KButton>
|
|
102
|
+
</template>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Themes
|
|
106
|
+
|
|
107
|
+
Kuina UI comes in a light and a dark theme. `data-theme` on `<html>` picks it: set it to `light` or `dark`, and every component follows, along with the `light:` and `dark:` variants in your own classes.
|
|
108
|
+
|
|
109
|
+
## Contribution
|
|
110
|
+
|
|
111
|
+
Found a bug or have an idea? [Open an issue](https://github.com/Kuina-UI/vue/issues/new).
|
|
112
|
+
|
|
113
|
+
Commit messages follow [Conventional Commits](https://www.conventionalcommits.org/) (`feat: …`, `fix: …`, `chore: …`), in English.
|
|
114
|
+
|
|
115
|
+
## Credits
|
|
116
|
+
|
|
117
|
+
- [vuejs/core](https://github.com/vuejs/core)
|
|
118
|
+
- [vitejs/vite](https://github.com/vitejs/vite)
|
|
119
|
+
- [nuxt/nuxt](https://github.com/nuxt/nuxt)
|
|
120
|
+
- [tailwindlabs/tailwindcss](https://github.com/tailwindlabs/tailwindcss)
|
|
121
|
+
- [lucide-icons/lucide](https://github.com/lucide-icons/lucide)
|
|
122
|
+
- [nuxt-content/docus](https://github.com/nuxt-content/docus)
|
|
123
|
+
|
|
124
|
+
## Support Kuina UI
|
|
125
|
+
|
|
126
|
+
Kuina UI is free and open source. If it saves you time, you can support its development:
|
|
127
|
+
|
|
128
|
+
- [GitHub Sponsors](https://github.com/sponsors/mgcodeur)
|
|
129
|
+
- [Open Collective](https://opencollective.com/mgcodeur)
|
|
130
|
+
- [Ko-fi](https://ko-fi.com/mgcodeur)
|
|
131
|
+
|
|
132
|
+
## License
|
|
133
|
+
|
|
134
|
+
[MIT](LICENSE): free to use, modify and redistribute, including for commercial projects.
|
|
135
|
+
|
|
136
|
+
[npm-version-src]: https://img.shields.io/npm/v/@kuina-ui/vue?color=18181B
|
|
137
|
+
[npm-version-href]: https://npmjs.com/package/@kuina-ui/vue
|
|
138
|
+
[vue-src]: https://img.shields.io/badge/Vue-18181B?logo=vuedotjs
|
|
139
|
+
[vue-href]: https://vuejs.org
|
|
140
|
+
[nuxt-src]: https://img.shields.io/badge/Nuxt-18181B?logo=nuxt
|
|
141
|
+
[nuxt-href]: https://nuxt.com
|
|
142
|
+
[tailwindcss-src]: https://img.shields.io/badge/Tailwind_CSS-18181B?logo=tailwindcss
|
|
143
|
+
[tailwindcss-href]: https://tailwindcss.com
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { SliderControlSlotName } from '../../elements/slider-control';
|
|
2
|
+
import type { SliderMark, SliderRange } from '../../shared/types/slider';
|
|
3
|
+
import type { ClassNameValue } from '../../shared/utils/tv';
|
|
4
|
+
import type { SliderSlotName } from './slider.theme';
|
|
5
|
+
export interface RangeSliderProps {
|
|
6
|
+
label?: string;
|
|
7
|
+
min?: number;
|
|
8
|
+
max?: number;
|
|
9
|
+
step?: number;
|
|
10
|
+
minRange?: number;
|
|
11
|
+
resetValue?: SliderRange;
|
|
12
|
+
resetLabel?: string;
|
|
13
|
+
startLabel?: string;
|
|
14
|
+
endLabel?: string;
|
|
15
|
+
unit?: string;
|
|
16
|
+
prefixUnit?: string;
|
|
17
|
+
marks?: SliderMark[];
|
|
18
|
+
trackColor?: string;
|
|
19
|
+
rangeColor?: string;
|
|
20
|
+
name?: string;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
ui?: Partial<Record<SliderSlotName | 'container' | Exclude<SliderControlSlotName, 'root'>, ClassNameValue>>;
|
|
23
|
+
class?: ClassNameValue;
|
|
24
|
+
}
|
|
25
|
+
export interface RangeSliderSlots {
|
|
26
|
+
label?: () => unknown;
|
|
27
|
+
}
|
|
28
|
+
declare const _default: typeof __VLS_export;
|
|
29
|
+
export default _default;
|
|
30
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<RangeSliderProps & {
|
|
31
|
+
modelValue?: SliderRange;
|
|
32
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
33
|
+
blur: (blurEvent: FocusEvent) => any;
|
|
34
|
+
focus: (focusEvent: FocusEvent) => any;
|
|
35
|
+
"update:modelValue": (value: SliderRange | undefined) => any;
|
|
36
|
+
}, string, import("vue").PublicProps, Readonly<RangeSliderProps & {
|
|
37
|
+
modelValue?: SliderRange;
|
|
38
|
+
}> & Readonly<{
|
|
39
|
+
onBlur?: ((blurEvent: FocusEvent) => any) | undefined;
|
|
40
|
+
onFocus?: ((focusEvent: FocusEvent) => any) | undefined;
|
|
41
|
+
"onUpdate:modelValue"?: ((value: SliderRange | undefined) => any) | undefined;
|
|
42
|
+
}>, {
|
|
43
|
+
max: number;
|
|
44
|
+
min: number;
|
|
45
|
+
step: number;
|
|
46
|
+
minRange: number;
|
|
47
|
+
resetLabel: string;
|
|
48
|
+
startLabel: string;
|
|
49
|
+
endLabel: string;
|
|
50
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, RangeSliderSlots>;
|
|
51
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
52
|
+
new (): {
|
|
53
|
+
$slots: S;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { SliderControlSlotName } from '../../elements/slider-control';
|
|
2
|
+
import type { SliderMark } from '../../shared/types/slider';
|
|
3
|
+
import type { ClassNameValue } from '../../shared/utils/tv';
|
|
4
|
+
import type { SliderSlotName } from './slider.theme';
|
|
5
|
+
export interface SliderProps {
|
|
6
|
+
label?: string;
|
|
7
|
+
min?: number;
|
|
8
|
+
max?: number;
|
|
9
|
+
step?: number;
|
|
10
|
+
resetValue?: number;
|
|
11
|
+
resetLabel?: string;
|
|
12
|
+
unit?: string;
|
|
13
|
+
prefixUnit?: string;
|
|
14
|
+
marks?: SliderMark[];
|
|
15
|
+
trackColor?: string;
|
|
16
|
+
rangeColor?: string;
|
|
17
|
+
name?: string;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
ui?: Partial<Record<SliderSlotName | 'container' | Exclude<SliderControlSlotName, 'root'>, ClassNameValue>>;
|
|
20
|
+
class?: ClassNameValue;
|
|
21
|
+
}
|
|
22
|
+
export interface SliderSlots {
|
|
23
|
+
label?: () => unknown;
|
|
24
|
+
}
|
|
25
|
+
declare const _default: typeof __VLS_export;
|
|
26
|
+
export default _default;
|
|
27
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<SliderProps & {
|
|
28
|
+
modelValue?: number;
|
|
29
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
30
|
+
blur: (blurEvent: FocusEvent) => any;
|
|
31
|
+
focus: (focusEvent: FocusEvent) => any;
|
|
32
|
+
"update:modelValue": (value: number | undefined) => any;
|
|
33
|
+
}, string, import("vue").PublicProps, Readonly<SliderProps & {
|
|
34
|
+
modelValue?: number;
|
|
35
|
+
}> & Readonly<{
|
|
36
|
+
onBlur?: ((blurEvent: FocusEvent) => any) | undefined;
|
|
37
|
+
onFocus?: ((focusEvent: FocusEvent) => any) | undefined;
|
|
38
|
+
"onUpdate:modelValue"?: ((value: number | undefined) => any) | undefined;
|
|
39
|
+
}>, {
|
|
40
|
+
max: number;
|
|
41
|
+
min: number;
|
|
42
|
+
step: number;
|
|
43
|
+
resetLabel: string;
|
|
44
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, SliderSlots>;
|
|
45
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
46
|
+
new (): {
|
|
47
|
+
$slots: S;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ClassNameValue } from '../../shared/utils/tv';
|
|
2
|
+
import type { SliderSlotName } from './slider.theme';
|
|
3
|
+
export interface SliderHeaderProps {
|
|
4
|
+
labelId: string;
|
|
5
|
+
labelTargetId: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
showsResetButton: boolean;
|
|
8
|
+
resetLabel: string;
|
|
9
|
+
hidesResetButton: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
ui?: Partial<Record<SliderSlotName, ClassNameValue>>;
|
|
12
|
+
}
|
|
13
|
+
export interface SliderHeaderSlots {
|
|
14
|
+
label?: () => unknown;
|
|
15
|
+
default?: () => unknown;
|
|
16
|
+
}
|
|
17
|
+
declare const _default: typeof __VLS_export;
|
|
18
|
+
export default _default;
|
|
19
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<SliderHeaderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
20
|
+
reset: () => any;
|
|
21
|
+
valueClick: (clickEvent: MouseEvent) => any;
|
|
22
|
+
}, string, import("vue").PublicProps, Readonly<SliderHeaderProps> & Readonly<{
|
|
23
|
+
onReset?: (() => any) | undefined;
|
|
24
|
+
onValueClick?: ((clickEvent: MouseEvent) => any) | undefined;
|
|
25
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, SliderHeaderSlots>;
|
|
26
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
27
|
+
new (): {
|
|
28
|
+
$slots: S;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as KRangeSlider } from './RangeSlider.vue';
|
|
2
|
+
export type { RangeSliderProps, RangeSliderSlots } from './RangeSlider.vue';
|
|
3
|
+
export { default as KSlider } from './Slider.vue';
|
|
4
|
+
export type { SliderProps, SliderSlots } from './Slider.vue';
|
|
5
|
+
export type { SliderMark, SliderRange } from '../../shared/types/slider';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type VariantProps } from '../../shared/utils/tv';
|
|
2
|
+
export declare const sliderTheme: import("tailwind-variants").TVReturnType<{
|
|
3
|
+
disabled: {
|
|
4
|
+
true: {
|
|
5
|
+
root: string;
|
|
6
|
+
value: string;
|
|
7
|
+
valueInput: string;
|
|
8
|
+
};
|
|
9
|
+
false: {
|
|
10
|
+
value: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
hidesResetButton: {
|
|
14
|
+
true: {
|
|
15
|
+
resetButton: string;
|
|
16
|
+
};
|
|
17
|
+
false: {
|
|
18
|
+
reset: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
}, {
|
|
22
|
+
root: string;
|
|
23
|
+
header: string;
|
|
24
|
+
label: string;
|
|
25
|
+
reset: string;
|
|
26
|
+
resetButton: string;
|
|
27
|
+
value: string;
|
|
28
|
+
valueInput: string;
|
|
29
|
+
unit: string;
|
|
30
|
+
valueSeparator: string;
|
|
31
|
+
}, undefined, undefined, undefined, undefined>;
|
|
32
|
+
export type SliderThemeVariants = VariantProps<typeof sliderTheme>;
|
|
33
|
+
export type SliderSlotName = keyof ReturnType<typeof sliderTheme>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
import type { ClassNameValue } from '../../shared/utils/tv';
|
|
3
|
+
import type { SegmentedControlSlotName, SegmentedControlThemeVariants } from './segmented-control.theme';
|
|
4
|
+
export interface SegmentedControlOption {
|
|
5
|
+
value: string;
|
|
6
|
+
label: string;
|
|
7
|
+
icon?: Component;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface SegmentedControlProps {
|
|
11
|
+
ariaLabel: string;
|
|
12
|
+
options: SegmentedControlOption[];
|
|
13
|
+
name?: string;
|
|
14
|
+
size?: SegmentedControlThemeVariants['size'];
|
|
15
|
+
pill?: boolean;
|
|
16
|
+
block?: boolean;
|
|
17
|
+
square?: boolean;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
ui?: Partial<Record<SegmentedControlSlotName, ClassNameValue>>;
|
|
20
|
+
class?: ClassNameValue;
|
|
21
|
+
}
|
|
22
|
+
declare const _default: typeof __VLS_export;
|
|
23
|
+
export default _default;
|
|
24
|
+
declare const __VLS_export: import("vue").DefineComponent<SegmentedControlProps & {
|
|
25
|
+
modelValue?: string;
|
|
26
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
27
|
+
"update:modelValue": (value: string | undefined) => any;
|
|
28
|
+
}, string, import("vue").PublicProps, Readonly<SegmentedControlProps & {
|
|
29
|
+
modelValue?: string;
|
|
30
|
+
}> & Readonly<{
|
|
31
|
+
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
32
|
+
}>, {
|
|
33
|
+
pill: boolean;
|
|
34
|
+
size: "3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl";
|
|
35
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { type VariantProps } from '../../shared/utils/tv';
|
|
2
|
+
export declare const segmentedControlTheme: import("tailwind-variants").TVReturnType<{
|
|
3
|
+
size: Record<"3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl", {
|
|
4
|
+
root: string[];
|
|
5
|
+
content: string;
|
|
6
|
+
icon: string;
|
|
7
|
+
}>;
|
|
8
|
+
pill: {
|
|
9
|
+
true: {
|
|
10
|
+
root: string;
|
|
11
|
+
thumb: string;
|
|
12
|
+
option: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
block: {
|
|
16
|
+
true: {
|
|
17
|
+
root: string;
|
|
18
|
+
option: string;
|
|
19
|
+
};
|
|
20
|
+
false: {
|
|
21
|
+
root: string;
|
|
22
|
+
option: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
square: {
|
|
26
|
+
true: string;
|
|
27
|
+
};
|
|
28
|
+
disabled: {
|
|
29
|
+
true: {
|
|
30
|
+
root: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
optionDisabled: {
|
|
34
|
+
true: {
|
|
35
|
+
option: string;
|
|
36
|
+
};
|
|
37
|
+
false: {
|
|
38
|
+
option: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
isThumbPlaced: {
|
|
42
|
+
true: string;
|
|
43
|
+
false: {
|
|
44
|
+
thumb: string;
|
|
45
|
+
option: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
animatesThumb: {
|
|
49
|
+
true: {
|
|
50
|
+
thumb: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
}, {
|
|
54
|
+
root: string;
|
|
55
|
+
thumb: string;
|
|
56
|
+
option: string;
|
|
57
|
+
input: string;
|
|
58
|
+
content: string;
|
|
59
|
+
icon: string;
|
|
60
|
+
}, undefined, undefined, undefined, undefined>;
|
|
61
|
+
export type SegmentedControlThemeVariants = VariantProps<typeof segmentedControlTheme>;
|
|
62
|
+
export type SegmentedControlSlotName = keyof ReturnType<typeof segmentedControlTheme>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { SliderMark } from '../../shared/types/slider';
|
|
2
|
+
import type { ClassNameValue } from '../../shared/utils/tv';
|
|
3
|
+
import type { SliderControlSlotName } from './slider-control.theme';
|
|
4
|
+
export interface SliderControlProps {
|
|
5
|
+
min: number;
|
|
6
|
+
max: number;
|
|
7
|
+
step: number;
|
|
8
|
+
minRange?: number;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
name?: string;
|
|
11
|
+
marks?: SliderMark[];
|
|
12
|
+
trackColor?: string;
|
|
13
|
+
rangeColor?: string;
|
|
14
|
+
thumbLabels?: string[];
|
|
15
|
+
thumbAttributes?: Record<string, unknown>;
|
|
16
|
+
ui?: Partial<Record<SliderControlSlotName, ClassNameValue>>;
|
|
17
|
+
class?: ClassNameValue;
|
|
18
|
+
}
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
21
|
+
declare const __VLS_export: import("vue").DefineComponent<SliderControlProps & {
|
|
22
|
+
modelValue: number[];
|
|
23
|
+
}, {
|
|
24
|
+
isPointerPressing: import("vue").Ref<boolean, boolean>;
|
|
25
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
26
|
+
"update:modelValue": (value: number[]) => any;
|
|
27
|
+
}, string, import("vue").PublicProps, Readonly<SliderControlProps & {
|
|
28
|
+
modelValue: number[];
|
|
29
|
+
}> & Readonly<{
|
|
30
|
+
"onUpdate:modelValue"?: ((value: number[]) => any) | undefined;
|
|
31
|
+
}>, {
|
|
32
|
+
marks: SliderMark[];
|
|
33
|
+
minRange: number;
|
|
34
|
+
thumbLabels: string[];
|
|
35
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type VariantProps } from '../../shared/utils/tv';
|
|
2
|
+
export declare const sliderControlTheme: import("tailwind-variants").TVReturnType<{
|
|
3
|
+
disabled: {
|
|
4
|
+
true: {
|
|
5
|
+
control: string;
|
|
6
|
+
thumb: string;
|
|
7
|
+
};
|
|
8
|
+
false: {
|
|
9
|
+
thumb: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
isActiveThumb: {
|
|
13
|
+
true: {
|
|
14
|
+
thumbAnchor: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
marksLayout: {
|
|
18
|
+
inline: string;
|
|
19
|
+
wrapped: {
|
|
20
|
+
mark: string;
|
|
21
|
+
};
|
|
22
|
+
hidden: {
|
|
23
|
+
mark: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
}, {
|
|
27
|
+
root: string;
|
|
28
|
+
control: string;
|
|
29
|
+
track: string;
|
|
30
|
+
range: string;
|
|
31
|
+
thumbAnchor: string;
|
|
32
|
+
thumb: string;
|
|
33
|
+
marks: string;
|
|
34
|
+
mark: string;
|
|
35
|
+
markLabel: string;
|
|
36
|
+
}, undefined, undefined, undefined, undefined>;
|
|
37
|
+
export type SliderControlThemeVariants = VariantProps<typeof sliderControlTheme>;
|
|
38
|
+
export type SliderControlSlotName = keyof ReturnType<typeof sliderControlTheme>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ShallowRef, type WatchSource } from 'vue';
|
|
2
|
+
import type { SliderMarksLayout } from '../../shared/types/slider';
|
|
3
|
+
/** Fit the mark labels under the track: wrap their words when they collide, then hide them all when they still do. */
|
|
4
|
+
export declare function useSliderMarksLayout(marksElement: Readonly<ShallowRef<HTMLElement | null>>, layoutSources: WatchSource[]): {
|
|
5
|
+
marksLayout: import("vue").Ref<SliderMarksLayout, SliderMarksLayout>;
|
|
6
|
+
};
|