nuance-ui 0.2.29 → 0.2.31

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 (64) hide show
  1. package/dist/module.d.mts +13 -0
  2. package/dist/module.d.ts +13 -0
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +87 -2
  5. package/dist/runtime/app-config.d.ts +22 -0
  6. package/dist/runtime/components/action-icon/action-icon-section.vue +4 -3
  7. package/dist/runtime/components/action-icon/action-icon.vue +4 -3
  8. package/dist/runtime/components/alert.vue +5 -4
  9. package/dist/runtime/components/avatar/avatar.d.vue.ts +1 -4
  10. package/dist/runtime/components/avatar/avatar.vue +7 -5
  11. package/dist/runtime/components/avatar/avatar.vue.d.ts +1 -4
  12. package/dist/runtime/components/badge.d.vue.ts +3 -1
  13. package/dist/runtime/components/badge.vue +12 -9
  14. package/dist/runtime/components/badge.vue.d.ts +3 -1
  15. package/dist/runtime/components/breadcrumbs.d.vue.ts +1 -4
  16. package/dist/runtime/components/breadcrumbs.vue +4 -2
  17. package/dist/runtime/components/breadcrumbs.vue.d.ts +1 -4
  18. package/dist/runtime/components/button/button.module.css +1 -1
  19. package/dist/runtime/components/button/button.vue +4 -3
  20. package/dist/runtime/components/calendar/ui/core/calendar-header.vue +9 -4
  21. package/dist/runtime/components/card/card.module.css +1 -1
  22. package/dist/runtime/components/checkbox/checkbox-indicator.vue +4 -3
  23. package/dist/runtime/components/checkbox/checkbox.vue +4 -3
  24. package/dist/runtime/components/chip/chip.vue +8 -7
  25. package/dist/runtime/components/combobox/combobox-option.vue +6 -3
  26. package/dist/runtime/components/date-time-picker.vue +4 -3
  27. package/dist/runtime/components/dialog/ui/dialog-close-button.vue +6 -2
  28. package/dist/runtime/components/files/file-upload-button.vue +4 -1
  29. package/dist/runtime/components/files/file-upload-icon.vue +5 -2
  30. package/dist/runtime/components/index.d.ts +1 -0
  31. package/dist/runtime/components/input/date-picker.vue +4 -3
  32. package/dist/runtime/components/input/email-input.vue +6 -2
  33. package/dist/runtime/components/input/number-input.vue +4 -2
  34. package/dist/runtime/components/input/password-input.vue +3 -1
  35. package/dist/runtime/components/link/lib.d.ts +2 -2
  36. package/dist/runtime/components/nav-link/nav-link.vue +4 -7
  37. package/dist/runtime/components/select.vue +3 -1
  38. package/dist/runtime/components/table/ui/table-sort-icon.vue +5 -3
  39. package/dist/runtime/components/tabs/tabs-root.d.vue.ts +1 -1
  40. package/dist/runtime/components/tabs/tabs-root.vue.d.ts +1 -1
  41. package/dist/runtime/components/theme-toggle.vue +3 -2
  42. package/dist/runtime/components/time-picker/time-picker.vue +4 -2
  43. package/dist/runtime/components/timeline.d.vue.ts +93 -0
  44. package/dist/runtime/components/timeline.vue +112 -0
  45. package/dist/runtime/components/timeline.vue.d.ts +93 -0
  46. package/dist/runtime/components/tree/_ui/tree-item.vue +9 -6
  47. package/dist/runtime/components/tree/_ui/tree-root.vue +5 -3
  48. package/dist/runtime/composables/index.d.ts +1 -0
  49. package/dist/runtime/composables/index.js +1 -0
  50. package/dist/runtime/composables/use-config.d.ts +6 -0
  51. package/dist/runtime/composables/use-config.js +12 -0
  52. package/dist/runtime/styles/colors.css +1 -1
  53. package/dist/runtime/types/icons.d.ts +51 -0
  54. package/dist/runtime/types/icons.js +0 -0
  55. package/dist/runtime/types/index.d.ts +17 -0
  56. package/dist/runtime/utils/icons/default-icons.d.ts +3 -0
  57. package/dist/runtime/utils/icons/default-icons.js +33 -0
  58. package/dist/runtime/utils/icons/index.d.ts +1 -0
  59. package/dist/runtime/utils/icons/index.js +1 -0
  60. package/dist/runtime/utils/index.d.ts +1 -0
  61. package/dist/runtime/utils/index.js +1 -0
  62. package/dist/runtime/utils/style/create-variant-color-resolver.d.ts +8 -8
  63. package/dist/runtime/utils/style/create-variant-color-resolver.js +2 -2
  64. package/package.json +1 -1
@@ -1,12 +1,11 @@
1
1
  <script setup>
2
- import { useVarsResolver } from "@nui/composables";
2
+ import { useConfig, useVarsResolver } from "@nui/composables";
3
3
  import {
4
- createVariantColorResolver,
5
4
  getFontSize,
6
5
  getRadius,
7
6
  getSize
8
7
  } from "@nui/utils";
9
- import { useId } from "vue";
8
+ import { computed, useId } from "vue";
10
9
  import Box from "../box.vue";
11
10
  import { useChipGroupState, useChipState } from "./lib";
12
11
  const {
@@ -17,7 +16,7 @@ const {
17
16
  variant = "filled",
18
17
  type: _type = "checkbox",
19
18
  value,
20
- icon = "gravity-ui:check",
19
+ icon: _icon,
21
20
  hideIcon = true,
22
21
  disabled: _disabled
23
22
  } = defineProps({
@@ -36,10 +35,12 @@ const id = uid || useId();
36
35
  const modelValue = defineModel({ type: Boolean, ...{ default: false } });
37
36
  const ctx = useChipGroupState();
38
37
  const { checked, onUpdate } = useChipState(ctx, modelValue, value);
39
- const disabled = ctx?.disabled || _disabled;
40
- const type = ctx ? ctx.multiple ? "checkbox" : "radio" : _type;
38
+ const disabled = computed(() => ctx?.disabled || _disabled);
39
+ const type = computed(() => ctx ? ctx.multiple ? "checkbox" : "radio" : _type);
40
+ const { icons, variantResolver } = useConfig();
41
+ const icon = computed(() => _icon ?? icons.check);
41
42
  const style = useVarsResolver((theme) => {
42
- const colors = createVariantColorResolver({ color, theme, variant });
43
+ const colors = variantResolver({ color, theme, variant });
43
44
  return {
44
45
  root: {
45
46
  "--chip-fz": getFontSize(size),
@@ -1,4 +1,5 @@
1
1
  <script setup>
2
+ import { useConfig } from "@nui/composables";
2
3
  import { computed } from "vue";
3
4
  import Box from "../box.vue";
4
5
  import css from "./combobox.module.css";
@@ -7,7 +8,7 @@ import { useComboboxState } from "./lib/context";
7
8
  const {
8
9
  data,
9
10
  iconPosition = "left",
10
- checkIcon = "gravity-ui:check",
11
+ checkIcon,
11
12
  withCheckIcon = true,
12
13
  mod: _mod,
13
14
  checked,
@@ -23,6 +24,8 @@ const {
23
24
  iconPosition: { type: String, required: false }
24
25
  });
25
26
  defineSlots();
27
+ const { icons } = useConfig();
28
+ const resolvedCheckIcon = computed(() => checkIcon ?? icons.check);
26
29
  const { onOptionSubmit } = useComboboxState();
27
30
  const mod = computed(() => [
28
31
  {
@@ -49,13 +52,13 @@ const mod = computed(() => [
49
52
  <Icon
50
53
  v-if='checked && withCheckIcon && iconPosition === "left"'
51
54
  :class='css.optionCheck'
52
- :name='data?.icon ?? checkIcon'
55
+ :name='data?.icon ?? resolvedCheckIcon'
53
56
  />
54
57
  <span>{{ data.label }}</span>
55
58
  <Icon
56
59
  v-if='checked && withCheckIcon && iconPosition === "right"'
57
60
  :class='css.optionCheck'
58
- :name='data?.icon ?? checkIcon'
61
+ :name='data?.icon ?? resolvedCheckIcon'
59
62
  />
60
63
  </slot>
61
64
  </Box>
@@ -1,6 +1,6 @@
1
1
  <script setup>
2
2
  import { format } from "@formkit/tempo";
3
- import { useDatesConfig } from "@nui/composables";
3
+ import { useConfig, useDatesConfig } from "@nui/composables";
4
4
  import { computed } from "vue";
5
5
  import ActionIcon from "./action-icon/action-icon.vue";
6
6
  import Calendar from "./calendar/calendar.vue";
@@ -79,6 +79,7 @@ const time = computed({
79
79
  }
80
80
  });
81
81
  const config = useDatesConfig(calendarProps?.config);
82
+ const { icons } = useConfig();
82
83
  const visible = computed(() => {
83
84
  if (!model.value)
84
85
  return null;
@@ -95,7 +96,7 @@ const isClearable = computed(() => clearable && !props.disabled && !props.readon
95
96
  <ButtonInput v-bind='props' :right-section-p-e>
96
97
  <template #leftSection>
97
98
  <slot name='leftSection'>
98
- <Icon name='gravity-ui:calendar' />
99
+ <Icon :name='icons.calendar' />
99
100
  </slot>
100
101
  </template>
101
102
 
@@ -105,7 +106,7 @@ const isClearable = computed(() => clearable && !props.disabled && !props.readon
105
106
  >
106
107
  <slot name='rightSection'>
107
108
  <ActionIcon
108
- icon='gravity-ui:xmark'
109
+ :icon='icons.close'
109
110
  variant='subtle'
110
111
  color='gray'
111
112
  size='sm'
@@ -1,9 +1,11 @@
1
1
  <script setup>
2
+ import { useConfig } from "@nui/composables";
3
+ import { computed } from "vue";
2
4
  import ActionIcon from "../../action-icon/action-icon.vue";
3
5
  import { useDialogState } from "../lib";
4
6
  const {
5
7
  variant = "subtle",
6
- icon = "gravity-ui:xmark",
8
+ icon,
7
9
  ...props
8
10
  } = defineProps({
9
11
  size: { type: null, required: false },
@@ -18,12 +20,14 @@ const {
18
20
  classes: { type: Object, required: false }
19
21
  });
20
22
  const close = useDialogState();
23
+ const { icons } = useConfig();
24
+ const resolvedIcon = computed(() => icon ?? icons.close);
21
25
  </script>
22
26
 
23
27
  <template>
24
28
  <ClientOnly>
25
29
  <ActionIcon
26
- :icon
30
+ :icon='resolvedIcon'
27
31
  :variant
28
32
  tabindex='0'
29
33
  v-bind='props'
@@ -1,4 +1,5 @@
1
1
  <script setup>
2
+ import { useConfig } from "@nui/composables";
2
3
  import { useFileDialog } from "@vueuse/core";
3
4
  import { computed, toValue } from "vue";
4
5
  import Button from "../button/button.vue";
@@ -7,7 +8,7 @@ const {
7
8
  accept,
8
9
  reset: _reset,
9
10
  directory,
10
- icon = "gravity-ui:plus",
11
+ icon: _icon,
11
12
  ...props
12
13
  } = defineProps({
13
14
  icon: { type: String, required: false },
@@ -36,6 +37,8 @@ const {
36
37
  document: { type: null, required: false }
37
38
  });
38
39
  const emit = defineEmits(["change", "cancel"]);
40
+ const { icons } = useConfig();
41
+ const icon = computed(() => _icon ?? icons.plus);
39
42
  const isMultiple = computed(() => {
40
43
  const val = toValue(multiple);
41
44
  return val === true || val === "" || val === "true";
@@ -1,4 +1,5 @@
1
1
  <script setup>
2
+ import { useConfig } from "@nui/composables";
2
3
  import { useFileDialog } from "@vueuse/core";
3
4
  import { computed, toValue } from "vue";
4
5
  import ActionIcon from "../action-icon/action-icon.vue";
@@ -7,7 +8,7 @@ const {
7
8
  accept,
8
9
  reset: _reset,
9
10
  directory,
10
- icon = "gravity-ui:arrow-shape-up-from-line",
11
+ icon: _icon,
11
12
  ...props
12
13
  } = defineProps({
13
14
  multiple: { type: null, required: false },
@@ -30,6 +31,8 @@ const {
30
31
  document: { type: null, required: false }
31
32
  });
32
33
  const emit = defineEmits(["change", "cancel"]);
34
+ const { icons } = useConfig();
35
+ const icon = computed(() => _icon ?? icons.upload);
33
36
  const isMultiple = computed(() => {
34
37
  const val = toValue(multiple);
35
38
  return val === true || val === "" || val === "true";
@@ -55,5 +58,5 @@ defineExpose({ files, reset });
55
58
  </script>
56
59
 
57
60
  <template>
58
- <ActionIcon :icon v-bind='props' @click='open' />
61
+ <ActionIcon :icon='icon' v-bind='props' @click='open' />
59
62
  </template>
@@ -34,6 +34,7 @@ export * from './tabs/index.js';
34
34
  export type * from './text.vue';
35
35
  export type * from './textarea.vue';
36
36
  export * from './time-picker/index.js';
37
+ export type * from './timeline.vue';
37
38
  export type * from './title.vue';
38
39
  export type * from './transition.vue';
39
40
  export * from './tree/index.js';
@@ -1,6 +1,6 @@
1
1
  <script setup>
2
2
  import { format } from "@formkit/tempo";
3
- import { useDatesConfig } from "@nui/composables";
3
+ import { useConfig, useDatesConfig } from "@nui/composables";
4
4
  import { computed } from "vue";
5
5
  import ActionIcon from "../action-icon/action-icon.vue";
6
6
  import Badge from "../badge.vue";
@@ -67,6 +67,7 @@ const {
67
67
  defineEmits(["open", "close", "select", "prev", "level", "next"]);
68
68
  const model = defineModel({ type: null });
69
69
  const config = useDatesConfig(cfg);
70
+ const { icons } = useConfig();
70
71
  const formatValue = (date) => format({ date, format: valueFormat, ...config });
71
72
  const visible = computed(() => {
72
73
  if (!model.value)
@@ -106,7 +107,7 @@ const visible = computed(() => {
106
107
  >
107
108
  <template #leftSection>
108
109
  <slot name='leftSection'>
109
- <Icon name='gravity-ui:calendar' />
110
+ <Icon :name='icons.calendar' />
110
111
  </slot>
111
112
  </template>
112
113
  <template v-if='!!$slots.rightSection' #rightSection>
@@ -124,7 +125,7 @@ const visible = computed(() => {
124
125
 
125
126
  <template #rightSection>
126
127
  <ActionIcon
127
- icon='gravity-ui:xmark'
128
+ :icon='icons.close'
128
129
  variant='subtle'
129
130
  color='gray'
130
131
  size='xs'
@@ -1,6 +1,8 @@
1
1
  <script setup>
2
+ import { useConfig } from "@nui/composables";
3
+ import { computed } from "vue";
2
4
  import TextInput from "./text-input.vue";
3
- const { icon = "gravity-ui:at", ...rest } = defineProps({
5
+ const { icon: _icon, ...rest } = defineProps({
4
6
  multiline: { type: Boolean, required: false },
5
7
  withAria: { type: Boolean, required: false },
6
8
  classes: { type: Object, required: false },
@@ -19,10 +21,12 @@ const { icon = "gravity-ui:at", ...rest } = defineProps({
19
21
  readonly: { type: Boolean, required: false },
20
22
  disabled: { type: Boolean, required: false }
21
23
  });
24
+ const { icons } = useConfig();
25
+ const icon = computed(() => _icon ?? icons.email);
22
26
  </script>
23
27
 
24
28
  <template>
25
- <TextInput type='email' :icon v-bind='rest'>
29
+ <TextInput type='email' :icon='icon' v-bind='rest'>
26
30
  <template v-if='!!$slots.leftSection' #leftSection>
27
31
  <slot name='leftSection' />
28
32
  </template>
@@ -1,4 +1,5 @@
1
1
  <script setup>
2
+ import { useConfig } from "@nui/composables";
2
3
  import { clamp } from "@vueuse/core";
3
4
  import { shallowRef } from "vue";
4
5
  import UnstyledButton from "../button/unstyled-button.vue";
@@ -31,6 +32,7 @@ const {
31
32
  rightSectionPE: { type: void 0, required: false }
32
33
  });
33
34
  const focused = shallowRef(false);
35
+ const { icons } = useConfig();
34
36
  const value = defineModel({ type: Number, ...{ default: 0 } });
35
37
  function handleWheel(event) {
36
38
  if (!focused.value)
@@ -80,14 +82,14 @@ function handleBlur() {
80
82
  :disabled='disabled || typeof value === "number" && !Number.isNaN(max) && value >= max'
81
83
  @click='value = clamp(value + step, min, max)'
82
84
  >
83
- <Icon name='gravity-ui:chevron-up' />
85
+ <Icon :name='icons.chevronUp' />
84
86
  </UnstyledButton>
85
87
  <UnstyledButton
86
88
  :class='$style.control'
87
89
  :disabled='disabled || typeof value === "number" && !Number.isNaN(min) && value <= min'
88
90
  @click='value = clamp(value - step, min, max)'
89
91
  >
90
- <Icon name='gravity-ui:chevron-down' />
92
+ <Icon :name='icons.chevronDown' />
91
93
  </UnstyledButton>
92
94
  </div>
93
95
  </slot>
@@ -1,4 +1,5 @@
1
1
  <script setup>
2
+ import { useConfig } from "@nui/composables";
2
3
  import { ref } from "vue";
3
4
  import ActionIcon from "../action-icon/action-icon.vue";
4
5
  import TextInput from "./text-input.vue";
@@ -22,6 +23,7 @@ const props = defineProps({
22
23
  disabled: { type: Boolean, required: false }
23
24
  });
24
25
  const password = ref(true);
26
+ const { icons } = useConfig();
25
27
  </script>
26
28
 
27
29
  <template>
@@ -33,7 +35,7 @@ const password = ref(true);
33
35
  <template #rightSection>
34
36
  <slot name='rightSection'>
35
37
  <ActionIcon variant='subtle' @click='password = !password'>
36
- <Icon :name='password ? "gravity-ui:eye" : "gravity-ui:eye-slash"' />
38
+ <Icon :name='password ? icons.passwordShow : icons.passwordHide' />
37
39
  </ActionIcon>
38
40
  </slot>
39
41
  </template>
@@ -1,5 +1,5 @@
1
1
  import type { NuxtLinkProps } from '#app';
2
2
  export declare function pickLinkProps<T extends NuxtLinkProps>(props: T): {
3
- link: Pick<T, "target" | "to" | "external" | "rel" | "noRel" | "prefetch" | "noPrefetch" | "replace" | "prefetchOn" | "trailingSlash" | "activeClass" | "ariaCurrentValue" | "exactActiveClass" | "prefetchedClass" | "viewTransition">;
4
- rest: Omit<T, "target" | "to" | "external" | "rel" | "noRel" | "prefetch" | "noPrefetch" | "replace" | "prefetchOn" | "trailingSlash" | "activeClass" | "ariaCurrentValue" | "exactActiveClass" | "prefetchedClass" | "viewTransition">;
3
+ link: Pick<T, "replace" | "to" | "target" | "external" | "rel" | "noRel" | "prefetch" | "noPrefetch" | "prefetchOn" | "trailingSlash" | "activeClass" | "ariaCurrentValue" | "exactActiveClass" | "prefetchedClass" | "viewTransition">;
4
+ rest: Omit<T, "replace" | "to" | "target" | "external" | "rel" | "noRel" | "prefetch" | "noPrefetch" | "prefetchOn" | "trailingSlash" | "activeClass" | "ariaCurrentValue" | "exactActiveClass" | "prefetchedClass" | "viewTransition">;
5
5
  };
@@ -1,6 +1,6 @@
1
1
  <script setup>
2
- import { useVarsResolver } from "@nui/composables";
3
- import { createVariantColorResolver, getSize } from "@nui/utils";
2
+ import { useConfig, useVarsResolver } from "@nui/composables";
3
+ import { getSize } from "@nui/utils";
4
4
  import Box from "../box.vue";
5
5
  import UnstyledButton from "../button/unstyled-button.vue";
6
6
  import { pickLinkProps } from "../link";
@@ -45,12 +45,9 @@ const {
45
45
  icon
46
46
  }
47
47
  } = pickLinkProps(props);
48
+ const { variantResolver } = useConfig();
48
49
  const style = useVarsResolver((theme) => {
49
- const {
50
- background,
51
- hover,
52
- text
53
- } = createVariantColorResolver({ variant, color, theme });
50
+ const { background, hover, text } = variantResolver({ variant, color, theme });
54
51
  return {
55
52
  root: {
56
53
  "--nl-bg": variant ? background : void 0,
@@ -1,4 +1,5 @@
1
1
  <script setup>
2
+ import { useConfig } from "@nui/composables";
2
3
  import { computed, nextTick, ref, watch } from "vue";
3
4
  import { useCombobox, useComboboxData } from "./combobox";
4
5
  import ComboboxOptionsDropdown from "./combobox/combobox-options-dropdown.vue";
@@ -49,6 +50,7 @@ const {
49
50
  disabled: { type: Boolean, required: false }
50
51
  });
51
52
  const emit = defineEmits(["clear", "select", "open", "close", "submit"]);
53
+ const { icons } = useConfig();
52
54
  const opened = defineModel("open", { type: Boolean, ...{ default: false } });
53
55
  const value = defineModel({ type: [String, Array, null], ...{ default: null } });
54
56
  const search = defineModel("search", { type: String, ...{ default: "" } });
@@ -147,7 +149,7 @@ function onSubmit(val) {
147
149
  </template>
148
150
  <template #rightSection>
149
151
  <slot name='rightSection'>
150
- <Icon name='gravity-ui:chevrons-expand-vertical' />
152
+ <Icon :name='icons.selectExpand' />
151
153
  </slot>
152
154
  </template>
153
155
  </component>
@@ -1,14 +1,16 @@
1
1
  <script setup>
2
+ import { useConfig } from "@nui/composables";
2
3
  import defu from "defu";
3
4
  import { computed } from "vue";
4
5
  const { column, icons } = defineProps({
5
6
  column: { type: Object, required: true },
6
7
  icons: { type: Object, required: false }
7
8
  });
9
+ const cfg = useConfig();
8
10
  const resolvedIcons = computed(() => defu(icons, {
9
- asc: "gravity-ui:bars-descending-align-left-arrow-up",
10
- desc: "gravity-ui:bars-descending-align-left-arrow-down",
11
- off: "gravity-ui:bars-descending-align-left"
11
+ asc: cfg.icons.sortAsc,
12
+ desc: cfg.icons.sortDesc,
13
+ off: cfg.icons.sortOff
12
14
  }));
13
15
  const name = computed(() => column.getIsSorted() ? column.getIsSorted() === "asc" ? resolvedIcons.value.asc : resolvedIcons.value.desc : resolvedIcons.value.off);
14
16
  </script>
@@ -62,8 +62,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
62
62
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
63
63
  "onUpdate:modelValue"?: ((value: string | null) => any) | undefined;
64
64
  }>, {
65
- orientation: "vertical" | "horizontal";
66
65
  variant: TabsVariant;
66
+ orientation: "vertical" | "horizontal";
67
67
  placement: "left" | "right";
68
68
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
69
69
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -62,8 +62,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
62
62
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
63
63
  "onUpdate:modelValue"?: ((value: string | null) => any) | undefined;
64
64
  }>, {
65
- orientation: "vertical" | "horizontal";
66
65
  variant: TabsVariant;
66
+ orientation: "vertical" | "horizontal";
67
67
  placement: "left" | "right";
68
68
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
69
69
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -1,5 +1,5 @@
1
1
  <script setup>
2
- import { useTheme } from "@nui/composables";
2
+ import { useConfig, useTheme } from "@nui/composables";
3
3
  import ActionIcon from "./action-icon/action-icon.vue";
4
4
  const props = defineProps({
5
5
  size: { type: null, required: false },
@@ -14,12 +14,13 @@ const props = defineProps({
14
14
  classes: { type: Object, required: false }
15
15
  });
16
16
  const theme = useTheme();
17
+ const { icons } = useConfig();
17
18
  </script>
18
19
 
19
20
  <template>
20
21
  <ActionIcon
21
22
  v-bind='props'
22
- :icon='theme.value === "light" ? "gravity-ui:moon" : "gravity-ui:sun"'
23
+ :icon='theme.value === "light" ? icons.moon : icons.sun'
23
24
  @click='theme.preference = theme.value === "light" ? "dark" : "light"'
24
25
  >
25
26
  <slot />
@@ -1,4 +1,5 @@
1
1
  <script setup>
2
+ import { useConfig } from "@nui/composables";
2
3
  import { computed } from "vue";
3
4
  import ActionIcon from "../action-icon/action-icon.vue";
4
5
  import InputBase from "../input/ui/input-base.vue";
@@ -57,6 +58,7 @@ const {
57
58
  disabled: { type: Boolean, required: false }
58
59
  });
59
60
  const model = defineModel({ type: String, ...{ default: "" } });
61
+ const { icons } = useConfig();
60
62
  const {
61
63
  values: {
62
64
  hours,
@@ -156,7 +158,7 @@ const isClearable = computed(() => clearable && !readonly && !disabled && (hours
156
158
 
157
159
  <template #leftSection>
158
160
  <slot name='leftSection'>
159
- <Icon name='gravity-ui:clock' />
161
+ <Icon :name='icons.clock' />
160
162
  </slot>
161
163
  </template>
162
164
 
@@ -166,7 +168,7 @@ const isClearable = computed(() => clearable && !readonly && !disabled && (hours
166
168
  >
167
169
  <slot name='rightSection'>
168
170
  <ActionIcon
169
- icon='gravity-ui:xmark'
171
+ :icon='icons.close'
170
172
  variant='subtle'
171
173
  color='gray'
172
174
  size='sm'
@@ -0,0 +1,93 @@
1
+ import type { AnyString, Classes, DynamicSlots, NuanceColor, NuanceRadius, NuanceSize, SlotProps } from '@nui/types';
2
+ import type { BoxProps } from './box.vue.js';
3
+ export interface TimelineItem {
4
+ /** Unique item id */
5
+ id: string;
6
+ label: string;
7
+ active?: boolean;
8
+ description?: string;
9
+ /** Icon inside bullet */
10
+ icon?: string;
11
+ /**
12
+ * Key of `theme.radius` or any valid CSS value to set `border-radius`,
13
+ * numbers are converted to rem
14
+ * @default 'xl'
15
+ */
16
+ radius?: NuanceRadius;
17
+ /**
18
+ * Key of `theme.colors` or any valid CSS color to control active item colors
19
+ * @default theme.primaryColor
20
+ */
21
+ color?: NuanceColor;
22
+ /** Controls line border style @default 'solid' */
23
+ lineVariant?: 'solid' | 'dashed' | 'dotted';
24
+ /** Value used for model-based active state */
25
+ value?: string | number;
26
+ slot?: string;
27
+ [key: string]: any;
28
+ }
29
+ export interface TimelineVars {
30
+ root: '--tl-line-width' | '--tl-size' | '--tl-color' | '--tl-radius';
31
+ }
32
+ export type TimelineSlots<T extends TimelineItem = TimelineItem> = {
33
+ bullet?: SlotProps<T>;
34
+ label?: SlotProps<T>;
35
+ content?: SlotProps<T>;
36
+ } & DynamicSlots<T, 'bullet' | 'label' | 'content', {
37
+ item: T;
38
+ }>;
39
+ export interface TimelineEmits<T extends TimelineItem = TimelineItem> {
40
+ select: [item: T, event: Event];
41
+ }
42
+ export interface TimelineProps<T extends TimelineItem> extends BoxProps {
43
+ items: T[];
44
+ /**
45
+ * Key of `theme.colors` or any valid CSS color to control active item colors
46
+ * @default theme.primaryColor
47
+ */
48
+ color?: NuanceColor;
49
+ /**
50
+ * Key of `theme.radius` or any valid CSS value to set `border-radius`, numbers are converted to rem
51
+ * @default 'full'
52
+ */
53
+ radius?: NuanceRadius;
54
+ /** Size of the bullet @default 20 */
55
+ size?: NuanceSize | AnyString;
56
+ /** Position of content relative to the bullet @default 'left' */
57
+ align?: 'right' | 'left';
58
+ /** Control width of the line */
59
+ lineWidth?: number | string;
60
+ /** If set, the active items direction is reversed without reversing items order @default false */
61
+ reverse?: boolean;
62
+ /** @default 'vertical' */
63
+ orientation?: 'horizontal' | 'vertical';
64
+ /**
65
+ * Key of item used to match against model value.
66
+ * @default 'value'
67
+ */
68
+ valueKey?: keyof T & string;
69
+ classes?: Classes<'root' | 'item' | 'body' | 'content' | 'bullet' | 'label'>;
70
+ }
71
+ declare const __VLS_export: <T extends TimelineItem>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
72
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<(TimelineProps<T> & {
73
+ modelValue?: string | number | null;
74
+ }) & {
75
+ onSelect?: ((item: T, event: Event) => any) | undefined;
76
+ "onUpdate:modelValue"?: ((value: string | number | null | undefined) => any) | undefined;
77
+ }> & (typeof globalThis extends {
78
+ __VLS_PROPS_FALLBACK: infer P;
79
+ } ? P : {});
80
+ expose: (exposed: {}) => void;
81
+ attrs: any;
82
+ slots: TimelineSlots<T>;
83
+ emit: ((evt: "select", item: T, event: Event) => void) & ((event: "update:modelValue", value: string | number | null | undefined) => void);
84
+ }>) => import("vue").VNode & {
85
+ __ctx?: Awaited<typeof __VLS_setup>;
86
+ };
87
+ declare const _default: typeof __VLS_export;
88
+ export default _default;
89
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
90
+ [K in keyof T]: T[K];
91
+ } : {
92
+ [K in keyof T as K]: T[K];
93
+ }) & {};