nuance-ui 0.1.8 → 0.1.9

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.
Files changed (43) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/action-icon/action-icon.d.vue.ts +1 -0
  3. package/dist/runtime/components/action-icon/action-icon.vue.d.ts +1 -0
  4. package/dist/runtime/components/alert.d.vue.ts +48 -0
  5. package/dist/runtime/components/alert.vue +178 -0
  6. package/dist/runtime/components/alert.vue.d.ts +48 -0
  7. package/dist/runtime/components/app-shell/app-shell-main.vue +1 -0
  8. package/dist/runtime/components/button/button.d.vue.ts +1 -0
  9. package/dist/runtime/components/button/button.vue.d.ts +1 -0
  10. package/dist/runtime/components/index.d.ts +1 -0
  11. package/dist/runtime/components/index.js +1 -0
  12. package/dist/runtime/components/input/number-input.vue +12 -16
  13. package/dist/runtime/components/input/ui/input-base.d.vue.ts +3 -3
  14. package/dist/runtime/components/input/ui/input-base.vue +2 -2
  15. package/dist/runtime/components/input/ui/input-base.vue.d.ts +3 -3
  16. package/dist/runtime/components/nav-link/nav-link.vue +10 -10
  17. package/dist/runtime/components/progress/index.d.ts +3 -0
  18. package/dist/runtime/components/progress/index.js +0 -0
  19. package/dist/runtime/components/progress/progress-label.d.vue.ts +14 -0
  20. package/dist/runtime/components/progress/progress-label.vue +14 -0
  21. package/dist/runtime/components/progress/progress-label.vue.d.ts +14 -0
  22. package/dist/runtime/components/progress/progress-root.d.vue.ts +25 -0
  23. package/dist/runtime/components/progress/progress-root.vue +31 -0
  24. package/dist/runtime/components/progress/progress-root.vue.d.ts +25 -0
  25. package/dist/runtime/components/progress/progress-section.d.vue.ts +25 -0
  26. package/dist/runtime/components/progress/progress-section.vue +42 -0
  27. package/dist/runtime/components/progress/progress-section.vue.d.ts +25 -0
  28. package/dist/runtime/components/progress/progress.d.vue.ts +16 -0
  29. package/dist/runtime/components/progress/progress.module.css +1 -0
  30. package/dist/runtime/components/progress/progress.vue +39 -0
  31. package/dist/runtime/components/progress/progress.vue.d.ts +16 -0
  32. package/dist/runtime/components/tree/_ui/tree-item.vue +8 -7
  33. package/dist/runtime/components/tree/_ui/tree-root.d.vue.ts +11 -5
  34. package/dist/runtime/components/tree/_ui/tree-root.vue +15 -5
  35. package/dist/runtime/components/tree/_ui/tree-root.vue.d.ts +11 -5
  36. package/dist/runtime/components/tree/lib/context.d.ts +9 -1
  37. package/dist/runtime/components/tree/lib/context.js +16 -15
  38. package/dist/runtime/components/tree/tree.vue +15 -5
  39. package/dist/runtime/styles/colors.css +1 -1
  40. package/dist/runtime/styles/light-theme.css +1 -1
  41. package/dist/runtime/utils/tree.d.ts +19 -0
  42. package/dist/runtime/utils/tree.js +16 -16
  43. package/package.json +1 -1
package/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^4.0.0"
6
6
  },
7
- "version": "0.1.8",
7
+ "version": "0.1.9",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
@@ -7,6 +7,7 @@ export interface ActionIconProps {
7
7
  loading?: boolean;
8
8
  color?: NuanceColor;
9
9
  radius?: NuanceRadius;
10
+ /** Styles API */
10
11
  classes?: {
11
12
  root?: string;
12
13
  icon?: string;
@@ -7,6 +7,7 @@ export interface ActionIconProps {
7
7
  loading?: boolean;
8
8
  color?: NuanceColor;
9
9
  radius?: NuanceRadius;
10
+ /** Styles API */
10
11
  classes?: {
11
12
  root?: string;
12
13
  icon?: string;
@@ -0,0 +1,48 @@
1
+ import type { NuanceColor, NuanceRadius } from '@nui/types';
2
+ import type { BoxProps } from './box.vue.js';
3
+ export interface AlertProps extends BoxProps {
4
+ variant?: 'filled' | 'light' | 'outline' | 'default';
5
+ /** Key of `theme.radius` or any valid CSS value to set border-radius @default `theme.defaultRadius` */
6
+ radius?: NuanceRadius;
7
+ /** Key of `theme.colors` or any valid CSS color @default `theme.primaryColor` */
8
+ color?: NuanceColor;
9
+ /** Alert title */
10
+ title?: string;
11
+ /** Icon displayed next to the title */
12
+ icon?: string;
13
+ /** Determines whether close button should be displayed @default `false` */
14
+ withCloseButton?: boolean;
15
+ /** Called when the close button is clicked */
16
+ onClose?: () => void;
17
+ /** Close button `aria-label` */
18
+ closeButtonLabel?: string;
19
+ /** Styles API */
20
+ classes?: {
21
+ root?: string;
22
+ icon?: string;
23
+ body?: string;
24
+ title?: string;
25
+ label?: string;
26
+ message?: string;
27
+ closeButton?: string;
28
+ };
29
+ }
30
+ declare var __VLS_15: {}, __VLS_21: {};
31
+ type __VLS_Slots = {} & {
32
+ title?: (props: typeof __VLS_15) => any;
33
+ } & {
34
+ default?: (props: typeof __VLS_21) => any;
35
+ };
36
+ declare const __VLS_base: import("vue").DefineComponent<AlertProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
37
+ close: () => any;
38
+ }, string, import("vue").PublicProps, Readonly<AlertProps> & Readonly<{
39
+ onClose?: (() => any) | undefined;
40
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
41
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
42
+ declare const _default: typeof __VLS_export;
43
+ export default _default;
44
+ type __VLS_WithSlots<T, S> = T & {
45
+ new (): {
46
+ $slots: S;
47
+ };
48
+ };
@@ -0,0 +1,178 @@
1
+ <script setup>
2
+ import ActionIcon from "@nui/components/action-icon/action-icon.vue";
3
+ import { useStyleResolver } from "@nui/composals";
4
+ import { createVariantColorResolver, getRadius } from "@nui/utils";
5
+ import { computed, useId } from "vue";
6
+ import Box from "./box.vue";
7
+ const {
8
+ mod,
9
+ icon,
10
+ color,
11
+ title,
12
+ radius,
13
+ variant = "light",
14
+ withCloseButton,
15
+ classes
16
+ } = defineProps({
17
+ variant: { type: String, required: false },
18
+ radius: { type: [String, Number], required: false },
19
+ color: { type: null, required: false },
20
+ title: { type: String, required: false },
21
+ icon: { type: String, required: false },
22
+ withCloseButton: { type: Boolean, required: false },
23
+ onClose: { type: Function, required: false },
24
+ closeButtonLabel: { type: String, required: false },
25
+ classes: { type: Object, required: false },
26
+ is: { type: null, required: false },
27
+ mod: { type: [Object, Array, null], required: false }
28
+ });
29
+ defineEmits(["close"]);
30
+ const id = useId();
31
+ const style = computed(() => useStyleResolver((theme) => {
32
+ const { background, border, text } = createVariantColorResolver({
33
+ variant,
34
+ color,
35
+ theme
36
+ });
37
+ return {
38
+ "--alert-radius": radius === void 0 ? void 0 : getRadius(radius),
39
+ "--alert-bg": color || variant ? background : void 0,
40
+ "--alert-color": text,
41
+ "--alert-bd": color || variant ? border : void 0
42
+ };
43
+ }));
44
+ </script>
45
+
46
+ <template>
47
+ <Box
48
+ role='alert'
49
+ :style
50
+ :class='[$style.root, classes?.root]'
51
+ :mod='[{ variant }, mod]'
52
+ :aria-describedby='$slots.default ? `${id}-body` : void 0'
53
+ :aria-labelledby='$slots.label ? `${id}-title` : void 0'
54
+ >
55
+ <Icon
56
+ v-if='icon'
57
+ :name='icon'
58
+ :class='[$style.icon, classes?.icon]'
59
+ />
60
+
61
+ <div :class='[$style.body, classes?.body]'>
62
+ <Box v-if='title || $slots.title' :class='[$style.title, classes?.title]'>
63
+ <span :id='`${id}-title`' :class='[$style.label, classes?.label]'>
64
+ <slot name='title'>
65
+ {{ title }}
66
+ </slot>
67
+ </span>
68
+ </Box>
69
+
70
+ <Box
71
+ v-if='$slots.default'
72
+ :id='`${id}-body`'
73
+ :class='[$style.message, classes?.message]'
74
+ :mod='{ variant }'
75
+ >
76
+ <slot />
77
+ </Box>
78
+ </div>
79
+
80
+ <ActionIcon
81
+ v-if='withCloseButton'
82
+ :class='[$style.closeButton, classes?.closeButton]'
83
+ variant='subtle'
84
+ icon='gravity-ui:xmark'
85
+ size='sm'
86
+ :color
87
+ @click='$emit("close")'
88
+ />
89
+ </Box>
90
+ </template>
91
+
92
+ <style module lang="postcss">
93
+ .root {
94
+ --alert-radius: var(--radius-default);
95
+ --alert-bg: var(--color-primary-light);
96
+ --alert-bd: 1px solid transparent;
97
+ --alert-color: var(--color-primary-light-color);
98
+
99
+ position: relative;
100
+
101
+ overflow: hidden;
102
+ display: flex;
103
+ gap: var(--spacing-md);
104
+
105
+ padding: var(--spacing-md) var(--spacing-md);
106
+ border: var(--alert-bd);
107
+ border-radius: var(--alert-radius);
108
+
109
+ color: var(--alert-color);
110
+
111
+ background-color: var(--alert-bg);
112
+ }
113
+
114
+ .body {
115
+ display: flex;
116
+ flex: 1;
117
+ flex-direction: column;
118
+ gap: var(--spacing-xs);
119
+ }
120
+
121
+ .title {
122
+ display: flex;
123
+ align-items: center;
124
+ justify-content: space-between;
125
+
126
+ font-size: var(--font-size-sm);
127
+ font-weight: 700;
128
+ }
129
+
130
+ .label {
131
+ overflow: hidden;
132
+ display: block;
133
+
134
+ text-overflow: ellipsis;
135
+ }
136
+
137
+ .icon {
138
+ display: flex;
139
+ align-items: center;
140
+ justify-content: flex-start;
141
+
142
+ width: 1.25rem;
143
+ height: 1.25rem;
144
+ margin-top: 1px;
145
+
146
+ line-height: 1;
147
+ }
148
+
149
+ .message {
150
+ overflow: hidden;
151
+
152
+ font-size: var(--font-size-sm);
153
+ text-overflow: ellipsis;
154
+
155
+ :where([data-mantine-color-scheme='light']) & {
156
+ color: var(--color-black);
157
+ }
158
+
159
+ :where([data-mantine-color-scheme='dark']) & {
160
+ color: var(--color-white);
161
+ }
162
+
163
+ &:where([data-variant='filled']) {
164
+ color: var(--alert-color);
165
+ }
166
+
167
+ &:where([data-variant='white']) {
168
+ color: var(--color-black);
169
+ }
170
+ }
171
+
172
+ .closeButton {
173
+ width: 20px;
174
+ height: 20px;
175
+
176
+ color: var(--alert-color);
177
+ }
178
+ </style>
@@ -0,0 +1,48 @@
1
+ import type { NuanceColor, NuanceRadius } from '@nui/types';
2
+ import type { BoxProps } from './box.vue.js';
3
+ export interface AlertProps extends BoxProps {
4
+ variant?: 'filled' | 'light' | 'outline' | 'default';
5
+ /** Key of `theme.radius` or any valid CSS value to set border-radius @default `theme.defaultRadius` */
6
+ radius?: NuanceRadius;
7
+ /** Key of `theme.colors` or any valid CSS color @default `theme.primaryColor` */
8
+ color?: NuanceColor;
9
+ /** Alert title */
10
+ title?: string;
11
+ /** Icon displayed next to the title */
12
+ icon?: string;
13
+ /** Determines whether close button should be displayed @default `false` */
14
+ withCloseButton?: boolean;
15
+ /** Called when the close button is clicked */
16
+ onClose?: () => void;
17
+ /** Close button `aria-label` */
18
+ closeButtonLabel?: string;
19
+ /** Styles API */
20
+ classes?: {
21
+ root?: string;
22
+ icon?: string;
23
+ body?: string;
24
+ title?: string;
25
+ label?: string;
26
+ message?: string;
27
+ closeButton?: string;
28
+ };
29
+ }
30
+ declare var __VLS_15: {}, __VLS_21: {};
31
+ type __VLS_Slots = {} & {
32
+ title?: (props: typeof __VLS_15) => any;
33
+ } & {
34
+ default?: (props: typeof __VLS_21) => any;
35
+ };
36
+ declare const __VLS_base: import("vue").DefineComponent<AlertProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
37
+ close: () => any;
38
+ }, string, import("vue").PublicProps, Readonly<AlertProps> & Readonly<{
39
+ onClose?: (() => any) | undefined;
40
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
41
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
42
+ declare const _default: typeof __VLS_export;
43
+ export default _default;
44
+ type __VLS_WithSlots<T, S> = T & {
45
+ new (): {
46
+ $slots: S;
47
+ };
48
+ };
@@ -15,6 +15,7 @@ const { mod } = defineProps({
15
15
  <style module lang="postcss">
16
16
  .root {
17
17
  display: grid;
18
+ align-content: flex-start;
18
19
 
19
20
  min-height: 100dvh;
20
21
  padding-top: calc(var(--app-shell-header-offset, 0rem) + var(--app-shell-padding));
@@ -8,6 +8,7 @@ export interface ButtonProps extends BoxProps {
8
8
  loading?: boolean;
9
9
  color?: NuanceColor;
10
10
  radius?: NuanceRadius;
11
+ /** Styles API */
11
12
  classes?: {
12
13
  root?: string;
13
14
  inner?: string;
@@ -8,6 +8,7 @@ export interface ButtonProps extends BoxProps {
8
8
  loading?: boolean;
9
9
  color?: NuanceColor;
10
10
  radius?: NuanceRadius;
11
+ /** Styles API */
11
12
  classes?: {
12
13
  root?: string;
13
14
  inner?: string;
@@ -17,6 +17,7 @@ export * from './modal/index.js';
17
17
  export * from './nav-link/index.js';
18
18
  export * from './paper.vue.js';
19
19
  export * from './popover/index.js';
20
+ export * from './progress/index.js';
20
21
  export * from './roving-focus/index.js';
21
22
  export * from './select/index.js';
22
23
  export * from './tabs/index.js';
@@ -17,6 +17,7 @@ export * from "./modal/index.js";
17
17
  export * from "./nav-link/index.js";
18
18
  export * from "./paper.vue";
19
19
  export * from "./popover/index.js";
20
+ export * from "./progress/index.js";
20
21
  export * from "./roving-focus/index.js";
21
22
  export * from "./select/index.js";
22
23
  export * from "./tabs/index.js";
@@ -1,6 +1,6 @@
1
1
  <script setup>
2
- import { clamp, useCounter } from "@vueuse/core";
3
- import { shallowRef, useId, watch } from "vue";
2
+ import { clamp } from "@vueuse/core";
3
+ import { shallowRef, useId } from "vue";
4
4
  import UnstyledButton from "../button/unstyled-button.vue";
5
5
  import BaseInput from "./ui/input-base.vue";
6
6
  import InputWrapper from "./ui/input-wrapper.vue";
@@ -31,25 +31,21 @@ const {
31
31
  rightSectionPE: { type: null, required: false }
32
32
  });
33
33
  const id = useId();
34
- const value = defineModel({ type: Number, ...{ default: 0 } });
35
- const { count, inc, dec, set } = useCounter(value, { min, max });
36
34
  const focused = shallowRef(false);
37
- watch(count, () => {
38
- value.value = count.value;
39
- });
35
+ const value = defineModel({ type: Number, ...{ default: 0 } });
40
36
  function handleWheel(event) {
41
37
  if (!focused.value)
42
38
  return;
43
39
  if (Math.abs(event.deltaY) <= Math.abs(event.deltaX))
44
40
  return;
45
41
  if (event.deltaY > 0)
46
- dec(step);
42
+ value.value = clamp(value.value + step, min, max);
47
43
  else if (event.deltaY < 0)
48
- inc(step);
44
+ value.value = clamp(value.value - step, min, max);
49
45
  }
50
46
  function handleBlur() {
51
47
  focused.value = false;
52
- set(clamp(count.value, min, max));
48
+ value.value = clamp(value.value, min, max);
53
49
  }
54
50
  </script>
55
51
 
@@ -57,12 +53,12 @@ function handleBlur() {
57
53
  <InputWrapper v-bind='rest' :id :class='$style.root' :right-section-p-e>
58
54
  <BaseInput
59
55
  :id
60
- :value='count'
61
- :readonly
62
- :disabled
63
- :step
56
+ v-model='value'
64
57
  :min
65
58
  :max
59
+ :step
60
+ :readonly
61
+ :disabled
66
62
  type='number'
67
63
  @focus='focused = true'
68
64
  @blur='handleBlur()'
@@ -77,14 +73,14 @@ function handleBlur() {
77
73
  <UnstyledButton
78
74
  :class='$style.control'
79
75
  :disabled='disabled || typeof value === "number" && !Number.isNaN(max) && value >= max'
80
- @click='inc(step)'
76
+ @click='value = clamp(value + step, min, max)'
81
77
  >
82
78
  <Icon name='gravity-ui:chevron-up' />
83
79
  </UnstyledButton>
84
80
  <UnstyledButton
85
81
  :class='$style.control'
86
82
  :disabled='disabled || typeof value === "number" && !Number.isNaN(min) && value <= min'
87
- @click='dec(step)'
83
+ @click='value = clamp(value - step, min, max)'
88
84
  >
89
85
  <Icon name='gravity-ui:chevron-down' />
90
86
  </UnstyledButton>
@@ -4,7 +4,7 @@ import type { InputBaseProps } from '../types/index.js';
4
4
  export interface BaseInputProps extends InputBaseProps, Omit<WrapperContext, 'id'> {
5
5
  id: string;
6
6
  is?: 'input' | 'textarea' | Component;
7
- modelValue?: string;
7
+ modelValue?: string | number;
8
8
  }
9
9
  declare var __VLS_6: {}, __VLS_17: {};
10
10
  type __VLS_Slots = {} & {
@@ -15,9 +15,9 @@ type __VLS_Slots = {} & {
15
15
  declare const __VLS_base: import("vue").DefineComponent<BaseInputProps, {
16
16
  ref: Readonly<import("vue").ShallowRef<any>>;
17
17
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
18
- "update:modelValue": (value: string | undefined) => any;
18
+ "update:modelValue": (value: string | number | undefined) => any;
19
19
  }, string, import("vue").PublicProps, Readonly<BaseInputProps> & Readonly<{
20
- "onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
20
+ "onUpdate:modelValue"?: ((value: string | number | undefined) => any) | undefined;
21
21
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
22
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
23
23
  declare const _default: typeof __VLS_export;
@@ -1,7 +1,7 @@
1
1
  <script setup>
2
- import Box from "@nui/components/box.vue";
3
2
  import { getFontSize, getRadius, getSize } from "@nui/utils";
4
3
  import { computed, useTemplateRef } from "vue";
4
+ import Box from "../../box.vue";
5
5
  import { useInputWrapperState } from "../lib/input-wrapper.context";
6
6
  const {
7
7
  is = "input",
@@ -12,7 +12,7 @@ const {
12
12
  } = defineProps({
13
13
  id: { type: String, required: true },
14
14
  is: { type: null, required: false },
15
- modelValue: { type: String, required: false },
15
+ modelValue: { type: [String, Number], required: false },
16
16
  readonly: { type: Boolean, required: false },
17
17
  disabled: { type: Boolean, required: false },
18
18
  required: { type: Boolean, required: false },
@@ -4,7 +4,7 @@ import type { InputBaseProps } from '../types/index.js';
4
4
  export interface BaseInputProps extends InputBaseProps, Omit<WrapperContext, 'id'> {
5
5
  id: string;
6
6
  is?: 'input' | 'textarea' | Component;
7
- modelValue?: string;
7
+ modelValue?: string | number;
8
8
  }
9
9
  declare var __VLS_6: {}, __VLS_17: {};
10
10
  type __VLS_Slots = {} & {
@@ -15,9 +15,9 @@ type __VLS_Slots = {} & {
15
15
  declare const __VLS_base: import("vue").DefineComponent<BaseInputProps, {
16
16
  ref: Readonly<import("vue").ShallowRef<any>>;
17
17
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
18
- "update:modelValue": (value: string | undefined) => any;
18
+ "update:modelValue": (value: string | number | undefined) => any;
19
19
  }, string, import("vue").PublicProps, Readonly<BaseInputProps> & Readonly<{
20
- "onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
20
+ "onUpdate:modelValue"?: ((value: string | number | undefined) => any) | undefined;
21
21
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
22
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
23
23
  declare const _default: typeof __VLS_export;
@@ -121,6 +121,16 @@ const style = useStyleResolver((theme) => {
121
121
  opacity: 0.4;
122
122
  }
123
123
 
124
+ &:hover {
125
+ @mixin where-light {
126
+ background-color: var(--color-gray-0);
127
+ }
128
+
129
+ @mixin where-dark {
130
+ background-color: var(--color-dark-6);
131
+ }
132
+ }
133
+
124
134
  &:where([data-active], [aria-current='page']) {
125
135
  color: var(--nl-color);
126
136
 
@@ -135,16 +145,6 @@ const style = useStyleResolver((theme) => {
135
145
  background-color: var(--nl-hover);
136
146
  }
137
147
  }
138
-
139
- @mixin hover {
140
- @mixin where-light {
141
- background-color: var(--color-gray-0);
142
- }
143
-
144
- @mixin where-dark {
145
- background-color: var(--color-dark-6);
146
- }
147
- }
148
148
  }
149
149
 
150
150
  .section {
@@ -0,0 +1,3 @@
1
+ export type * from './progress-root.vue';
2
+ export type * from './progress-section.vue';
3
+ export type * from './progress.vue';
File without changes
@@ -0,0 +1,14 @@
1
+ import type { BoxProps } from '@nui/components';
2
+ declare var __VLS_6: {};
3
+ type __VLS_Slots = {} & {
4
+ default?: (props: typeof __VLS_6) => any;
5
+ };
6
+ declare const __VLS_base: import("vue").DefineComponent<BoxProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<BoxProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
8
+ declare const _default: typeof __VLS_export;
9
+ export default _default;
10
+ type __VLS_WithSlots<T, S> = T & {
11
+ new (): {
12
+ $slots: S;
13
+ };
14
+ };
@@ -0,0 +1,14 @@
1
+ <script setup>
2
+ import Box from "../box.vue";
3
+ import css from "./progress.module.css";
4
+ const props = defineProps({
5
+ is: { type: null, required: false },
6
+ mod: { type: [Object, Array, null], required: false }
7
+ });
8
+ </script>
9
+
10
+ <template>
11
+ <Box v-bind='props' :class='css.label'>
12
+ <slot />
13
+ </Box>
14
+ </template>
@@ -0,0 +1,14 @@
1
+ import type { BoxProps } from '@nui/components';
2
+ declare var __VLS_6: {};
3
+ type __VLS_Slots = {} & {
4
+ default?: (props: typeof __VLS_6) => any;
5
+ };
6
+ declare const __VLS_base: import("vue").DefineComponent<BoxProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<BoxProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
8
+ declare const _default: typeof __VLS_export;
9
+ export default _default;
10
+ type __VLS_WithSlots<T, S> = T & {
11
+ new (): {
12
+ $slots: S;
13
+ };
14
+ };
@@ -0,0 +1,25 @@
1
+ import type { BoxProps } from '@nui/components';
2
+ import type { NuanceRadius, NuanceSize } from '@nui/types';
3
+ export interface ProgressRootProps extends BoxProps {
4
+ /** Controls track height @default `'md'` */
5
+ size?: NuanceSize | string;
6
+ /** Key of `theme.radius` or any valid CSS value to set `border-radius` @default `theme.defaultRadius` */
7
+ radius?: NuanceRadius;
8
+ /** Controls sections width transition duration, value is specified in ms @default `100` */
9
+ transitionDuration?: number;
10
+ /** Controls orientation @default `'horizontal'` */
11
+ orientation?: 'horizontal' | 'vertical';
12
+ }
13
+ declare var __VLS_6: {};
14
+ type __VLS_Slots = {} & {
15
+ default?: (props: typeof __VLS_6) => any;
16
+ };
17
+ declare const __VLS_base: import("vue").DefineComponent<ProgressRootProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ProgressRootProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
19
+ declare const _default: typeof __VLS_export;
20
+ export default _default;
21
+ type __VLS_WithSlots<T, S> = T & {
22
+ new (): {
23
+ $slots: S;
24
+ };
25
+ };
@@ -0,0 +1,31 @@
1
+ <script setup>
2
+ import { getRadius, getSize } from "@nui/utils";
3
+ import { computed } from "vue";
4
+ import Box from "../box.vue";
5
+ import css from "./progress.module.css";
6
+ const {
7
+ orientation,
8
+ mod,
9
+ size,
10
+ radius,
11
+ transitionDuration
12
+ } = defineProps({
13
+ size: { type: String, required: false },
14
+ radius: { type: [String, Number], required: false },
15
+ transitionDuration: { type: Number, required: false },
16
+ orientation: { type: String, required: false },
17
+ is: { type: null, required: false },
18
+ mod: { type: [Object, Array, null], required: false }
19
+ });
20
+ const style = computed(() => ({
21
+ "--progress-size": getSize(size, "progress-size"),
22
+ "--progress-radius": radius === void 0 ? void 0 : getRadius(radius),
23
+ "--progress-transition-duration": typeof transitionDuration === "number" ? `${transitionDuration}ms` : void 0
24
+ }));
25
+ </script>
26
+
27
+ <template>
28
+ <Box :style :class='css.root' :mod='[{ orientation }, mod]'>
29
+ <slot />
30
+ </Box>
31
+ </template>
@@ -0,0 +1,25 @@
1
+ import type { BoxProps } from '@nui/components';
2
+ import type { NuanceRadius, NuanceSize } from '@nui/types';
3
+ export interface ProgressRootProps extends BoxProps {
4
+ /** Controls track height @default `'md'` */
5
+ size?: NuanceSize | string;
6
+ /** Key of `theme.radius` or any valid CSS value to set `border-radius` @default `theme.defaultRadius` */
7
+ radius?: NuanceRadius;
8
+ /** Controls sections width transition duration, value is specified in ms @default `100` */
9
+ transitionDuration?: number;
10
+ /** Controls orientation @default `'horizontal'` */
11
+ orientation?: 'horizontal' | 'vertical';
12
+ }
13
+ declare var __VLS_6: {};
14
+ type __VLS_Slots = {} & {
15
+ default?: (props: typeof __VLS_6) => any;
16
+ };
17
+ declare const __VLS_base: import("vue").DefineComponent<ProgressRootProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ProgressRootProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
19
+ declare const _default: typeof __VLS_export;
20
+ export default _default;
21
+ type __VLS_WithSlots<T, S> = T & {
22
+ new (): {
23
+ $slots: S;
24
+ };
25
+ };