nuance-ui 0.2.7 → 0.2.8

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 (118) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/action-icon/action-icon.d.vue.ts +1 -1
  3. package/dist/runtime/components/action-icon/action-icon.vue +23 -23
  4. package/dist/runtime/components/action-icon/action-icon.vue.d.ts +1 -1
  5. package/dist/runtime/components/box.vue +3 -3
  6. package/dist/runtime/components/button/button.d.vue.ts +5 -3
  7. package/dist/runtime/components/button/button.vue +43 -39
  8. package/dist/runtime/components/button/button.vue.d.ts +5 -3
  9. package/dist/runtime/components/calendar/calendar.d.vue.ts +1 -1
  10. package/dist/runtime/components/calendar/calendar.vue +60 -60
  11. package/dist/runtime/components/calendar/calendar.vue.d.ts +1 -1
  12. package/dist/runtime/components/calendar/types.d.ts +4 -3
  13. package/dist/runtime/components/calendar/ui/core/calendar-header.d.vue.ts +7 -1
  14. package/dist/runtime/components/calendar/ui/core/calendar-header.vue.d.ts +7 -1
  15. package/dist/runtime/components/calendar/ui/levels/calendar-decade.d.vue.ts +3 -1
  16. package/dist/runtime/components/calendar/ui/levels/calendar-decade.vue.d.ts +3 -1
  17. package/dist/runtime/components/calendar/ui/levels/calendar-month.d.vue.ts +2 -1
  18. package/dist/runtime/components/calendar/ui/levels/calendar-month.vue +77 -77
  19. package/dist/runtime/components/calendar/ui/levels/calendar-month.vue.d.ts +2 -1
  20. package/dist/runtime/components/calendar/ui/levels/calendar-year.d.vue.ts +3 -1
  21. package/dist/runtime/components/calendar/ui/levels/calendar-year.vue.d.ts +3 -1
  22. package/dist/runtime/components/card/card-section.d.vue.ts +2 -1
  23. package/dist/runtime/components/card/card-section.vue.d.ts +2 -1
  24. package/dist/runtime/components/card/card.d.vue.ts +1 -0
  25. package/dist/runtime/components/card/card.vue.d.ts +1 -0
  26. package/dist/runtime/components/checkbox/checkbox-card.d.vue.ts +4 -1
  27. package/dist/runtime/components/checkbox/checkbox-card.vue +37 -37
  28. package/dist/runtime/components/checkbox/checkbox-card.vue.d.ts +4 -1
  29. package/dist/runtime/components/checkbox/checkbox-indicator.d.vue.ts +6 -0
  30. package/dist/runtime/components/checkbox/checkbox-indicator.vue.d.ts +6 -0
  31. package/dist/runtime/components/checkbox/checkbox.d.vue.ts +12 -2
  32. package/dist/runtime/components/checkbox/checkbox.vue +139 -139
  33. package/dist/runtime/components/checkbox/checkbox.vue.d.ts +12 -2
  34. package/dist/runtime/components/chip/chip-group.d.vue.ts +3 -0
  35. package/dist/runtime/components/chip/chip-group.vue.d.ts +3 -0
  36. package/dist/runtime/components/chip/chip.d.vue.ts +9 -0
  37. package/dist/runtime/components/chip/chip.vue +200 -200
  38. package/dist/runtime/components/chip/chip.vue.d.ts +9 -0
  39. package/dist/runtime/components/combobox/combobox-group.d.vue.ts +1 -0
  40. package/dist/runtime/components/combobox/combobox-group.vue.d.ts +1 -0
  41. package/dist/runtime/components/combobox/combobox-option.d.vue.ts +3 -0
  42. package/dist/runtime/components/combobox/combobox-option.vue.d.ts +3 -0
  43. package/dist/runtime/components/combobox/combobox-options-dropdown.d.vue.ts +10 -0
  44. package/dist/runtime/components/combobox/combobox-options-dropdown.vue +29 -29
  45. package/dist/runtime/components/combobox/combobox-options-dropdown.vue.d.ts +10 -0
  46. package/dist/runtime/components/combobox/combobox-root.d.vue.ts +8 -4
  47. package/dist/runtime/components/combobox/combobox-root.vue.d.ts +8 -4
  48. package/dist/runtime/components/combobox/types.d.ts +11 -0
  49. package/dist/runtime/components/container.d.vue.ts +2 -0
  50. package/dist/runtime/components/container.vue.d.ts +2 -0
  51. package/dist/runtime/components/dialog/types.d.ts +1 -0
  52. package/dist/runtime/components/files/file-upload-button.d.vue.ts +4 -2
  53. package/dist/runtime/components/files/file-upload-button.vue +12 -12
  54. package/dist/runtime/components/files/file-upload-button.vue.d.ts +4 -2
  55. package/dist/runtime/components/files/file-upload-icon.d.vue.ts +4 -2
  56. package/dist/runtime/components/files/file-upload-icon.vue +1 -1
  57. package/dist/runtime/components/files/file-upload-icon.vue.d.ts +4 -2
  58. package/dist/runtime/components/input/email-input.d.vue.ts +5 -5
  59. package/dist/runtime/components/input/email-input.vue +5 -6
  60. package/dist/runtime/components/input/email-input.vue.d.ts +5 -5
  61. package/dist/runtime/components/input/lib/input-wrapper.context.d.ts +8 -2
  62. package/dist/runtime/components/input/number-input.d.vue.ts +7 -5
  63. package/dist/runtime/components/input/number-input.vue +6 -2
  64. package/dist/runtime/components/input/number-input.vue.d.ts +7 -5
  65. package/dist/runtime/components/input/password-input.vue +1 -0
  66. package/dist/runtime/components/input/text-input.d.vue.ts +7 -5
  67. package/dist/runtime/components/input/text-input.vue +37 -34
  68. package/dist/runtime/components/input/text-input.vue.d.ts +7 -5
  69. package/dist/runtime/components/input/ui/input-inline.d.vue.ts +7 -3
  70. package/dist/runtime/components/input/ui/input-inline.vue +105 -105
  71. package/dist/runtime/components/input/ui/input-inline.vue.d.ts +7 -3
  72. package/dist/runtime/components/input/ui/input-wrapper.d.vue.ts +4 -1
  73. package/dist/runtime/components/input/ui/input-wrapper.vue +54 -54
  74. package/dist/runtime/components/input/ui/input-wrapper.vue.d.ts +4 -1
  75. package/dist/runtime/components/link/link-button.vue +1 -0
  76. package/dist/runtime/components/nav-link/nav-link.d.vue.ts +6 -4
  77. package/dist/runtime/components/nav-link/nav-link.vue +7 -3
  78. package/dist/runtime/components/nav-link/nav-link.vue.d.ts +6 -4
  79. package/dist/runtime/components/paper.d.vue.ts +3 -1
  80. package/dist/runtime/components/paper.vue +33 -33
  81. package/dist/runtime/components/paper.vue.d.ts +3 -1
  82. package/dist/runtime/components/progress/progress-section.d.vue.ts +1 -1
  83. package/dist/runtime/components/progress/progress-section.vue.d.ts +1 -1
  84. package/dist/runtime/components/select.d.vue.ts +2 -0
  85. package/dist/runtime/components/select.vue +63 -63
  86. package/dist/runtime/components/select.vue.d.ts +2 -0
  87. package/dist/runtime/components/table/types.d.ts +10 -1
  88. package/dist/runtime/components/table/ui/table-sortable-header.vue +1 -0
  89. package/dist/runtime/components/tabs/tabs-list.d.vue.ts +2 -0
  90. package/dist/runtime/components/tabs/tabs-list.vue.d.ts +2 -0
  91. package/dist/runtime/components/tabs/tabs-panel.d.vue.ts +1 -0
  92. package/dist/runtime/components/tabs/tabs-panel.vue.d.ts +1 -0
  93. package/dist/runtime/components/tabs/tabs-root.d.vue.ts +36 -9
  94. package/dist/runtime/components/tabs/tabs-root.vue.d.ts +36 -9
  95. package/dist/runtime/components/tabs/tabs-tab.d.vue.ts +7 -3
  96. package/dist/runtime/components/tabs/tabs-tab.vue +7 -4
  97. package/dist/runtime/components/tabs/tabs-tab.vue.d.ts +7 -3
  98. package/dist/runtime/components/text.d.vue.ts +6 -1
  99. package/dist/runtime/components/text.vue.d.ts +6 -1
  100. package/dist/runtime/components/textarea.d.vue.ts +7 -5
  101. package/dist/runtime/components/textarea.vue +6 -3
  102. package/dist/runtime/components/textarea.vue.d.ts +7 -5
  103. package/dist/runtime/components/title.d.vue.ts +5 -0
  104. package/dist/runtime/components/title.vue.d.ts +5 -0
  105. package/dist/runtime/components/transition.d.vue.ts +12 -2
  106. package/dist/runtime/components/transition.vue.d.ts +12 -2
  107. package/dist/runtime/components/tree/_ui/tree-item.d.vue.ts +1 -0
  108. package/dist/runtime/components/tree/_ui/tree-item.vue.d.ts +1 -0
  109. package/dist/runtime/components/tree/_ui/tree-root.d.vue.ts +8 -0
  110. package/dist/runtime/components/tree/_ui/tree-root.vue.d.ts +8 -0
  111. package/dist/runtime/components/tree/lib/context.d.ts +15 -0
  112. package/dist/runtime/components/tree/types.d.ts +9 -0
  113. package/dist/runtime/components/visually-hidden/visually-hidden-input.d.vue.ts +2 -0
  114. package/dist/runtime/components/visually-hidden/visually-hidden-input.vue +1 -1
  115. package/dist/runtime/components/visually-hidden/visually-hidden-input.vue.d.ts +2 -0
  116. package/dist/runtime/components/visually-hidden/visually-hidden.d.vue.ts +1 -0
  117. package/dist/runtime/components/visually-hidden/visually-hidden.vue.d.ts +1 -0
  118. 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.2.7",
7
+ "version": "0.2.8",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
@@ -18,7 +18,7 @@ export interface ActionIconProps {
18
18
  radius?: NuanceRadius;
19
19
  /** Styles API */
20
20
  classes?: Classes<'root' | 'icon'>;
21
- /** Modifiers passed through to the underlying `Box` */
21
+ /** Element modifiers transformed into `data-` attributes, falsy values are removed */
22
22
  mod?: BoxProps['mod'];
23
23
  /** Icon name rendered inside the button when no default slot is provided */
24
24
  icon?: string;
@@ -47,27 +47,27 @@ const style = computed(() => useStyleResolver((theme) => {
47
47
  </script>
48
48
 
49
49
  <template>
50
- <Box
51
- is='button'
52
- type='button'
53
- :mod='[{ loading }, mod]'
54
- :style
55
- :class='[css.root, classes?.root]'
56
- :disabled='(!disabled ? loading : disabled) || void 0'
57
- >
58
- <Transition name='slide-down'>
59
- <Loader
60
- v-if='loading'
61
- color='var(--ai-color)'
62
- size='calc(var(--ai-size) * .55)'
63
- :class='css.loader'
64
- />
65
- </Transition>
66
-
67
- <span :class='[css.icon, classes?.icon]'>
68
- <slot>
69
- <Icon v-if='icon' :name='icon' :class='css["icon-element"]' />
70
- </slot>
71
- </span>
72
- </Box>
50
+ <Box
51
+ is='button'
52
+ type='button'
53
+ :mod='[{ loading }, mod]'
54
+ :style
55
+ :class='[css.root, classes?.root]'
56
+ :disabled='(!disabled ? loading : disabled) || void 0'
57
+ >
58
+ <Transition name='slide-down'>
59
+ <Loader
60
+ v-if='loading'
61
+ color='var(--ai-color)'
62
+ size='calc(var(--ai-size) * .55)'
63
+ :class='css.loader'
64
+ />
65
+ </Transition>
66
+
67
+ <span :class='[css.icon, classes?.icon]'>
68
+ <slot>
69
+ <Icon v-if='icon' :name='icon' :class='css["icon-element"]' />
70
+ </slot>
71
+ </span>
72
+ </Box>
73
73
  </template>
@@ -18,7 +18,7 @@ export interface ActionIconProps {
18
18
  radius?: NuanceRadius;
19
19
  /** Styles API */
20
20
  classes?: Classes<'root' | 'icon'>;
21
- /** Modifiers passed through to the underlying `Box` */
21
+ /** Element modifiers transformed into `data-` attributes, falsy values are removed */
22
22
  mod?: BoxProps['mod'];
23
23
  /** Icon name rendered inside the button when no default slot is provided */
24
24
  icon?: string;
@@ -16,7 +16,7 @@ const _mod = computed(() => {
16
16
  </script>
17
17
 
18
18
  <template>
19
- <component :is v-bind='_mod'>
20
- <slot />
21
- </component>
19
+ <component :is v-bind='_mod'>
20
+ <slot />
21
+ </component>
22
22
  </template>
@@ -28,6 +28,8 @@ export interface ButtonProps extends BoxProps {
28
28
  leftSectionPE?: CSSStyleDeclaration['pointerEvents'];
29
29
  /** Extra attributes forwarded to the left section element */
30
30
  leftSectionProps?: HTMLAttributes;
31
+ /** Icon displayed before the label */
32
+ icon?: string;
31
33
  /**
32
34
  * `pointer-events` value for the right section
33
35
  * @default `'all'`
@@ -36,13 +38,13 @@ export interface ButtonProps extends BoxProps {
36
38
  /** Extra attributes forwarded to the right section element */
37
39
  rightSectionProps?: HTMLAttributes;
38
40
  }
39
- declare var __VLS_19: {}, __VLS_21: {}, __VLS_23: {};
41
+ declare var __VLS_19: {}, __VLS_26: {}, __VLS_28: {};
40
42
  type __VLS_Slots = {} & {
41
43
  leftSection?: (props: typeof __VLS_19) => any;
42
44
  } & {
43
- default?: (props: typeof __VLS_21) => any;
45
+ default?: (props: typeof __VLS_26) => any;
44
46
  } & {
45
- rightSection?: (props: typeof __VLS_23) => any;
47
+ rightSection?: (props: typeof __VLS_28) => any;
46
48
  };
47
49
  declare const __VLS_base: import("vue").DefineComponent<ButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ButtonProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
48
50
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -13,6 +13,7 @@ const {
13
13
  gradient,
14
14
  loading,
15
15
  classes,
16
+ icon,
16
17
  leftSectionPE = "none",
17
18
  leftSectionProps,
18
19
  rightSectionPE = "all",
@@ -31,6 +32,7 @@ const {
31
32
  classes: { type: Object, required: false },
32
33
  leftSectionPE: { type: null, required: false },
33
34
  leftSectionProps: { type: Object, required: false },
35
+ icon: { type: String, required: false },
34
36
  rightSectionPE: { type: null, required: false },
35
37
  rightSectionProps: { type: Object, required: false },
36
38
  is: { type: null, required: false },
@@ -67,48 +69,50 @@ const style = computed(() => useStyleResolver((theme) => {
67
69
  </script>
68
70
 
69
71
  <template>
70
- <Box
71
- :is
72
- type='button'
72
+ <Box
73
+ :is
74
+ type='button'
73
75
  :mod='[
74
76
  {
75
- "with-left-section": !!$slots?.leftSection,
77
+ "with-left-section": !!$slots?.leftSection || !!icon,
76
78
  "with-right-section": !!$slots?.rightSection
77
79
  },
78
80
  mod
79
- ]'
80
- :style='style.root'
81
- :class='[css.root, classes?.root]'
82
- :disabled='loading'
83
- >
84
- <Transition name='fade-down'>
85
- <Loader v-show='loading' :class='css.loader' :color :size />
86
- </Transition>
87
-
88
- <span :class='[css.inner, classes?.inner]'>
89
- <span
90
- v-if='$slots.leftSection'
91
- :class='[css.section, classes?.section]'
92
- data-position='left'
93
- v-bind='leftSectionProps'
94
- :style='style.leftSection'
95
- >
96
- <slot name='leftSection' />
97
- </span>
98
-
99
- <span :class='[css.label, classes?.label]'>
100
- <slot />
101
- </span>
102
-
103
- <span
104
- v-if='$slots.rightSection'
105
- data-position='right'
106
- :class='[css.section, classes?.section]'
107
- v-bind='rightSectionProps'
108
- :style='style.rightSection'
109
- >
110
- <slot name='rightSection' />
111
- </span>
112
- </span>
113
- </Box>
81
+ ]'
82
+ :style='style.root'
83
+ :class='[css.root, classes?.root]'
84
+ :disabled='loading'
85
+ >
86
+ <Transition name='fade-down'>
87
+ <Loader v-show='loading' :class='css.loader' :color :size />
88
+ </Transition>
89
+
90
+ <span :class='[css.inner, classes?.inner]'>
91
+ <span
92
+ v-if='$slots.leftSection || icon'
93
+ :class='[css.section, classes?.section]'
94
+ data-position='left'
95
+ v-bind='leftSectionProps'
96
+ :style='style.leftSection'
97
+ >
98
+ <slot name='leftSection'>
99
+ <Icon v-if='icon' :name='icon' />
100
+ </slot>
101
+ </span>
102
+
103
+ <span :class='[css.label, classes?.label]'>
104
+ <slot />
105
+ </span>
106
+
107
+ <span
108
+ v-if='$slots.rightSection'
109
+ data-position='right'
110
+ :class='[css.section, classes?.section]'
111
+ v-bind='rightSectionProps'
112
+ :style='style.rightSection'
113
+ >
114
+ <slot name='rightSection' />
115
+ </span>
116
+ </span>
117
+ </Box>
114
118
  </template>
@@ -28,6 +28,8 @@ export interface ButtonProps extends BoxProps {
28
28
  leftSectionPE?: CSSStyleDeclaration['pointerEvents'];
29
29
  /** Extra attributes forwarded to the left section element */
30
30
  leftSectionProps?: HTMLAttributes;
31
+ /** Icon displayed before the label */
32
+ icon?: string;
31
33
  /**
32
34
  * `pointer-events` value for the right section
33
35
  * @default `'all'`
@@ -36,13 +38,13 @@ export interface ButtonProps extends BoxProps {
36
38
  /** Extra attributes forwarded to the right section element */
37
39
  rightSectionProps?: HTMLAttributes;
38
40
  }
39
- declare var __VLS_19: {}, __VLS_21: {}, __VLS_23: {};
41
+ declare var __VLS_19: {}, __VLS_26: {}, __VLS_28: {};
40
42
  type __VLS_Slots = {} & {
41
43
  leftSection?: (props: typeof __VLS_19) => any;
42
44
  } & {
43
- default?: (props: typeof __VLS_21) => any;
45
+ default?: (props: typeof __VLS_26) => any;
44
46
  } & {
45
- rightSection?: (props: typeof __VLS_23) => any;
47
+ rightSection?: (props: typeof __VLS_28) => any;
46
48
  };
47
49
  declare const __VLS_base: import("vue").DefineComponent<ButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ButtonProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
48
50
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -3,7 +3,7 @@ import type { NuanceSize } from '@nui/types';
3
3
  import type { CalendarLevel, DateSelection, SelectionMode } from './types.js';
4
4
  import type { CalendarRootProps } from './ui/core/index.js';
5
5
  export interface CalendarProps<T extends SelectionMode = 'single'> extends CalendarRootProps<T> {
6
- /** Controls size */
6
+ /** Component size */
7
7
  size?: NuanceSize | string;
8
8
  /** Determines whether week numbers should be displayed @default `false` */
9
9
  withWeekNumbers?: boolean;
@@ -42,86 +42,86 @@ const [calendars, nav] = useCalendarNavigation({
42
42
  </script>
43
43
 
44
44
  <template>
45
- <CalendarRoot
46
- v-slot='{ config }'
47
- v-model:date='date'
48
- v-model:select='select'
49
- v-bind='props'
50
- :class='$style.content'
51
- @select='(select) => $emit("select", select)'
52
- >
53
- <section v-for='(calendar, ix) in calendars' :key='`calendar-${ix}`'>
54
- <CalendarHeader
55
- :with-prev='ix === 0'
56
- :with-next='ix === calendars.length - 1'
57
- :prev-disabled='nav.isPrevDisabled'
58
- :next-disabled='nav.isNextDisabled'
45
+ <CalendarRoot
46
+ v-slot='{ config }'
47
+ v-model:date='date'
48
+ v-model:select='select'
49
+ v-bind='props'
50
+ :class='$style.content'
51
+ @select='(select) => $emit("select", select)'
52
+ >
53
+ <section v-for='(calendar, ix) in calendars' :key='`calendar-${ix}`'>
54
+ <CalendarHeader
55
+ :with-prev='ix === 0'
56
+ :with-next='ix === calendars.length - 1'
57
+ :prev-disabled='nav.isPrevDisabled'
58
+ :next-disabled='nav.isNextDisabled'
59
59
  @prev='() => {
60
60
  nav.move(-1);
61
61
  $emit("prev");
62
- }'
62
+ }'
63
63
  @next='() => {
64
64
  nav.move(1);
65
65
  $emit("next");
66
- }'
66
+ }'
67
67
  @level='() => {
68
68
  level = nav.nextLevel();
69
69
  $emit("level");
70
- }'
71
- >
72
- <slot name='level' :config>
73
- {{ nav.getLevelLabel(calendar, config) }}
74
- </slot>
75
- </CalendarHeader>
76
-
77
- <CalendarMonth
78
- v-if='level === "month"'
79
- :month='calendar'
80
- :with-week-numbers='props.withWeekNumbers'
81
- :with-cell-spacing='props.withCellSpacing'
82
- :size
83
- >
84
- <template v-if='!!$slots.weekday' #weekday>
85
- <slot name='weekday' />
86
- </template>
87
-
88
- <slot name='day' />
89
- </CalendarMonth>
90
- <CalendarYear
91
- v-if='level === "year"'
92
- :year='calendar'
93
- :size
94
- :selectable='props.minLevel === "year"'
70
+ }'
71
+ >
72
+ <slot name='level' :config>
73
+ {{ nav.getLevelLabel(calendar, config) }}
74
+ </slot>
75
+ </CalendarHeader>
76
+
77
+ <CalendarMonth
78
+ v-if='level === "month"'
79
+ :month='calendar'
80
+ :with-week-numbers='props.withWeekNumbers'
81
+ :with-cell-spacing='props.withCellSpacing'
82
+ :size
83
+ >
84
+ <template v-if='!!$slots.weekday' #weekday>
85
+ <slot name='weekday' />
86
+ </template>
87
+
88
+ <slot name='day' />
89
+ </CalendarMonth>
90
+ <CalendarYear
91
+ v-if='level === "year"'
92
+ :year='calendar'
93
+ :size
94
+ :selectable='props.minLevel === "year"'
95
95
  @select='(month) => {
96
96
  if (props.minLevel !== "year") {
97
97
  level = nav.prevLevel();
98
98
  date = month;
99
99
  }
100
- }'
101
- />
102
- <CalendarDecade
103
- v-if='level === "decade"'
104
- :date='calendar'
105
- :size
106
- :selectable='props.minLevel === "decade"'
100
+ }'
101
+ />
102
+ <CalendarDecade
103
+ v-if='level === "decade"'
104
+ :date='calendar'
105
+ :size
106
+ :selectable='props.minLevel === "decade"'
107
107
  @select='(year) => {
108
108
  if (props.minLevel !== "decade") {
109
109
  level = nav.prevLevel();
110
110
  date = year;
111
111
  }
112
- }'
113
- />
114
- </section>
115
- </CalendarRoot>
112
+ }'
113
+ />
114
+ </section>
115
+ </CalendarRoot>
116
116
  </template>
117
117
 
118
118
  <style lang="postcss" module>
119
- .content {
120
- --calendar-cell-spacing: rem(1px);
121
-
122
- display: flex;
123
- gap: var(--spacing-sm);
124
-
125
- width: fit-content;
126
- }
119
+ .content {
120
+ --calendar-cell-spacing: rem(1px);
121
+
122
+ display: flex;
123
+ gap: var(--spacing-sm);
124
+
125
+ width: fit-content;
126
+ }
127
127
  </style>
@@ -3,7 +3,7 @@ import type { NuanceSize } from '@nui/types';
3
3
  import type { CalendarLevel, DateSelection, SelectionMode } from './types.js';
4
4
  import type { CalendarRootProps } from './ui/core/index.js';
5
5
  export interface CalendarProps<T extends SelectionMode = 'single'> extends CalendarRootProps<T> {
6
- /** Controls size */
6
+ /** Component size */
7
7
  size?: NuanceSize | string;
8
8
  /** Determines whether week numbers should be displayed @default `false` */
9
9
  withWeekNumbers?: boolean;
@@ -1,13 +1,14 @@
1
1
  import type { FormatOptions } from '@formkit/tempo';
2
2
  import type { CalendarHeaderEmits } from './ui/core/index.js';
3
- /**
4
- * `@formkit/tempo` config
5
- */
3
+ /** `@formkit/tempo` format options without the `date` field */
6
4
  export type CalendarSettings = Omit<FormatOptions, 'date'>;
5
+ /** Calendar drill-down level */
7
6
  export type CalendarLevel = 'month' | 'year' | 'decade';
7
+ /** Date selection mode */
8
8
  export type SelectionMode = 'single' | 'range' | 'week' | 'multiple';
9
9
  /** ISO string value */
10
10
  export type Selection = string | null;
11
+ /** Selected value shape based on the selection mode */
11
12
  export type DateSelection<T extends SelectionMode = 'single'> = T extends 'single' ? Selection : T extends 'range' ? [Selection, Selection] : T extends 'week' ? [Selection, Selection] : T extends 'multiple' ? Selection[] : never;
12
13
  export interface CalendarEmits<T extends SelectionMode = 'single'> extends CalendarHeaderEmits {
13
14
  select: [date: DateSelection<T>];
@@ -1,12 +1,18 @@
1
1
  import type { BoxProps } from '../../../box.vue.js';
2
2
  export interface CalendarHeaderProps extends BoxProps {
3
+ /** Icon for the previous navigation button */
3
4
  prevIcon?: string;
5
+ /** Icon for the next navigation button */
4
6
  nextIcon?: string;
7
+ /** Whether the previous button is rendered */
5
8
  withPrev?: boolean;
9
+ /** Whether the next button is rendered */
6
10
  withNext?: boolean;
11
+ /** Returns true when the next button should be disabled */
7
12
  nextDisabled?: () => boolean;
13
+ /** Returns true when the previous button should be disabled */
8
14
  prevDisabled?: () => boolean;
9
- /** Label disabled state */
15
+ /** Disables the level label button */
10
16
  disabled?: boolean;
11
17
  }
12
18
  export interface CalendarHeaderEmits {
@@ -1,12 +1,18 @@
1
1
  import type { BoxProps } from '../../../box.vue.js';
2
2
  export interface CalendarHeaderProps extends BoxProps {
3
+ /** Icon for the previous navigation button */
3
4
  prevIcon?: string;
5
+ /** Icon for the next navigation button */
4
6
  nextIcon?: string;
7
+ /** Whether the previous button is rendered */
5
8
  withPrev?: boolean;
9
+ /** Whether the next button is rendered */
6
10
  withNext?: boolean;
11
+ /** Returns true when the next button should be disabled */
7
12
  nextDisabled?: () => boolean;
13
+ /** Returns true when the previous button should be disabled */
8
14
  prevDisabled?: () => boolean;
9
- /** Label disabled state */
15
+ /** Disables the level label button */
10
16
  disabled?: boolean;
11
17
  }
12
18
  export interface CalendarHeaderEmits {
@@ -2,9 +2,11 @@ import type { DateInput } from '@formkit/tempo';
2
2
  import type { NuanceSize } from '@nui/types';
3
3
  import type { CalendarCellProps } from '../core/index.js';
4
4
  export interface CalendarDecadeProps extends CalendarCellProps {
5
+ /** Start date of the decade */
5
6
  date: DateInput;
6
- /** Controls size */
7
+ /** Component size */
7
8
  size?: NuanceSize | string;
9
+ /** Allows selecting a year as the final value without drilling down */
8
10
  selectable?: boolean;
9
11
  }
10
12
  declare const __VLS_export: import("vue").DefineComponent<CalendarDecadeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -2,9 +2,11 @@ import type { DateInput } from '@formkit/tempo';
2
2
  import type { NuanceSize } from '@nui/types';
3
3
  import type { CalendarCellProps } from '../core/index.js';
4
4
  export interface CalendarDecadeProps extends CalendarCellProps {
5
+ /** Start date of the decade */
5
6
  date: DateInput;
6
- /** Controls size */
7
+ /** Component size */
7
8
  size?: NuanceSize | string;
9
+ /** Allows selecting a year as the final value without drilling down */
8
10
  selectable?: boolean;
9
11
  }
10
12
  declare const __VLS_export: import("vue").DefineComponent<CalendarDecadeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -1,10 +1,11 @@
1
1
  import type { DateInput } from '@formkit/tempo';
2
2
  import type { NuanceSize } from '@nui/types';
3
3
  export interface CalendarMonthProps {
4
+ /** ISO string of the month to render */
4
5
  month: string;
5
6
  /** Detects the presence of spaces between cells. @default `true` */
6
7
  withCellSpacing?: boolean;
7
- /** Controls size */
8
+ /** Component size */
8
9
  size?: NuanceSize | string;
9
10
  /** Determines whether week numbers should be displayed @default `false` */
10
11
  withWeekNumbers?: boolean;