nuance-ui 0.2.7 → 0.2.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 (172) hide show
  1. package/LICENSE.md +9 -9
  2. package/README.md +75 -75
  3. package/dist/module.json +1 -1
  4. package/dist/runtime/components/action-icon/action-icon-group.vue +3 -3
  5. package/dist/runtime/components/action-icon/action-icon.d.vue.ts +1 -1
  6. package/dist/runtime/components/action-icon/action-icon.vue.d.ts +1 -1
  7. package/dist/runtime/components/app-shell/app-shell-aside.vue +30 -30
  8. package/dist/runtime/components/app-shell/app-shell-footer.vue +29 -29
  9. package/dist/runtime/components/app-shell/app-shell-header.vue +30 -30
  10. package/dist/runtime/components/app-shell/app-shell-main.vue +18 -18
  11. package/dist/runtime/components/app-shell/app-shell-navbar.vue +34 -34
  12. package/dist/runtime/components/app-shell/app-shell-section.vue +10 -10
  13. package/dist/runtime/components/app-shell/app-shell.vue +34 -34
  14. package/dist/runtime/components/breadcrumbs.vue +78 -78
  15. package/dist/runtime/components/button/button.d.vue.ts +5 -3
  16. package/dist/runtime/components/button/button.vue +7 -3
  17. package/dist/runtime/components/button/button.vue.d.ts +5 -3
  18. package/dist/runtime/components/button/unstyled-button.vue +23 -23
  19. package/dist/runtime/components/calendar/calendar.d.vue.ts +1 -1
  20. package/dist/runtime/components/calendar/calendar.vue.d.ts +1 -1
  21. package/dist/runtime/components/calendar/types.d.ts +4 -3
  22. package/dist/runtime/components/calendar/ui/core/calendar-header.d.vue.ts +7 -1
  23. package/dist/runtime/components/calendar/ui/core/calendar-header.vue +95 -95
  24. package/dist/runtime/components/calendar/ui/core/calendar-header.vue.d.ts +7 -1
  25. package/dist/runtime/components/calendar/ui/core/calendar-root.vue +3 -3
  26. package/dist/runtime/components/calendar/ui/levels/calendar-decade.d.vue.ts +3 -1
  27. package/dist/runtime/components/calendar/ui/levels/calendar-decade.vue +40 -40
  28. package/dist/runtime/components/calendar/ui/levels/calendar-decade.vue.d.ts +3 -1
  29. package/dist/runtime/components/calendar/ui/levels/calendar-month.d.vue.ts +2 -1
  30. package/dist/runtime/components/calendar/ui/levels/calendar-month.vue.d.ts +2 -1
  31. package/dist/runtime/components/calendar/ui/levels/calendar-year.d.vue.ts +3 -1
  32. package/dist/runtime/components/calendar/ui/levels/calendar-year.vue +40 -40
  33. package/dist/runtime/components/calendar/ui/levels/calendar-year.vue.d.ts +3 -1
  34. package/dist/runtime/components/card/card-section.d.vue.ts +2 -1
  35. package/dist/runtime/components/card/card-section.vue +3 -3
  36. package/dist/runtime/components/card/card-section.vue.d.ts +2 -1
  37. package/dist/runtime/components/card/card.d.vue.ts +1 -0
  38. package/dist/runtime/components/card/card.vue +3 -3
  39. package/dist/runtime/components/card/card.vue.d.ts +1 -0
  40. package/dist/runtime/components/checkbox/checkbox-card.d.vue.ts +4 -1
  41. package/dist/runtime/components/checkbox/checkbox-card.vue.d.ts +4 -1
  42. package/dist/runtime/components/checkbox/checkbox-indicator.d.vue.ts +6 -0
  43. package/dist/runtime/components/checkbox/checkbox-indicator.vue +117 -117
  44. package/dist/runtime/components/checkbox/checkbox-indicator.vue.d.ts +6 -0
  45. package/dist/runtime/components/checkbox/checkbox.d.vue.ts +12 -2
  46. package/dist/runtime/components/checkbox/checkbox.vue.d.ts +12 -2
  47. package/dist/runtime/components/chip/chip-group.d.vue.ts +3 -0
  48. package/dist/runtime/components/chip/chip-group.vue +2 -2
  49. package/dist/runtime/components/chip/chip-group.vue.d.ts +3 -0
  50. package/dist/runtime/components/chip/chip.d.vue.ts +9 -0
  51. package/dist/runtime/components/chip/chip.vue.d.ts +9 -0
  52. package/dist/runtime/components/combobox/combobox-dropdown.vue +14 -14
  53. package/dist/runtime/components/combobox/combobox-empty.vue +3 -3
  54. package/dist/runtime/components/combobox/combobox-group.d.vue.ts +1 -0
  55. package/dist/runtime/components/combobox/combobox-group.vue +21 -21
  56. package/dist/runtime/components/combobox/combobox-group.vue.d.ts +1 -0
  57. package/dist/runtime/components/combobox/combobox-option-list.vue +3 -3
  58. package/dist/runtime/components/combobox/combobox-option.d.vue.ts +3 -0
  59. package/dist/runtime/components/combobox/combobox-option.vue +22 -22
  60. package/dist/runtime/components/combobox/combobox-option.vue.d.ts +3 -0
  61. package/dist/runtime/components/combobox/combobox-options-dropdown.d.vue.ts +10 -0
  62. package/dist/runtime/components/combobox/combobox-options-dropdown.vue.d.ts +10 -0
  63. package/dist/runtime/components/combobox/combobox-root.d.vue.ts +8 -4
  64. package/dist/runtime/components/combobox/combobox-root.vue +3 -3
  65. package/dist/runtime/components/combobox/combobox-root.vue.d.ts +8 -4
  66. package/dist/runtime/components/combobox/combobox-target.vue +3 -3
  67. package/dist/runtime/components/combobox/types.d.ts +11 -0
  68. package/dist/runtime/components/container.d.vue.ts +2 -0
  69. package/dist/runtime/components/container.vue +8 -8
  70. package/dist/runtime/components/container.vue.d.ts +2 -0
  71. package/dist/runtime/components/date-time-picker.d.vue.ts +3 -3
  72. package/dist/runtime/components/date-time-picker.vue +66 -66
  73. package/dist/runtime/components/date-time-picker.vue.d.ts +3 -3
  74. package/dist/runtime/components/dialog/types.d.ts +1 -0
  75. package/dist/runtime/components/dialog/ui/dialog-close-button.vue +11 -11
  76. package/dist/runtime/components/dialog/ui/dialog-header.vue +5 -5
  77. package/dist/runtime/components/dialog/ui/dialog-title.vue +5 -5
  78. package/dist/runtime/components/drawer/drawer-close-button.vue +3 -3
  79. package/dist/runtime/components/drawer/drawer-header.vue +3 -3
  80. package/dist/runtime/components/drawer/drawer-root.vue +15 -15
  81. package/dist/runtime/components/drawer/drawer-title.vue +3 -3
  82. package/dist/runtime/components/files/file-upload-button.d.vue.ts +4 -2
  83. package/dist/runtime/components/files/file-upload-button.vue.d.ts +4 -2
  84. package/dist/runtime/components/files/file-upload-icon.d.vue.ts +4 -2
  85. package/dist/runtime/components/files/file-upload-icon.vue.d.ts +4 -2
  86. package/dist/runtime/components/input/date-picker.vue +85 -85
  87. package/dist/runtime/components/input/email-input.d.vue.ts +5 -5
  88. package/dist/runtime/components/input/email-input.vue +21 -22
  89. package/dist/runtime/components/input/email-input.vue.d.ts +5 -5
  90. package/dist/runtime/components/input/lib/input-wrapper.context.d.ts +8 -2
  91. package/dist/runtime/components/input/number-input.d.vue.ts +7 -5
  92. package/dist/runtime/components/input/number-input.vue +136 -132
  93. package/dist/runtime/components/input/number-input.vue.d.ts +7 -5
  94. package/dist/runtime/components/input/password-input.vue +29 -28
  95. package/dist/runtime/components/input/text-input.d.vue.ts +7 -5
  96. package/dist/runtime/components/input/text-input.vue +6 -3
  97. package/dist/runtime/components/input/text-input.vue.d.ts +7 -5
  98. package/dist/runtime/components/input/ui/input-inline.d.vue.ts +7 -3
  99. package/dist/runtime/components/input/ui/input-inline.vue.d.ts +7 -3
  100. package/dist/runtime/components/input/ui/input-wrapper.d.vue.ts +4 -1
  101. package/dist/runtime/components/input/ui/input-wrapper.vue.d.ts +4 -1
  102. package/dist/runtime/components/link/link-button.vue +17 -16
  103. package/dist/runtime/components/link/link.vue +10 -10
  104. package/dist/runtime/components/loader/_loaders/bars-loader.vue +5 -5
  105. package/dist/runtime/components/loader/_loaders/dots-loader.vue +5 -5
  106. package/dist/runtime/components/loader/_loaders/oval-loader.vue +1 -1
  107. package/dist/runtime/components/modal/modal-close-button.vue +3 -3
  108. package/dist/runtime/components/modal/modal-header.vue +3 -3
  109. package/dist/runtime/components/modal/modal-root.vue +13 -13
  110. package/dist/runtime/components/modal/modal-title.vue +3 -3
  111. package/dist/runtime/components/nav-link/nav-icon-link.vue +15 -15
  112. package/dist/runtime/components/nav-link/nav-link.d.vue.ts +6 -4
  113. package/dist/runtime/components/nav-link/nav-link.vue +135 -131
  114. package/dist/runtime/components/nav-link/nav-link.vue.d.ts +6 -4
  115. package/dist/runtime/components/paper.d.vue.ts +3 -1
  116. package/dist/runtime/components/paper.vue.d.ts +3 -1
  117. package/dist/runtime/components/popover/popover-dropdown.vue +69 -70
  118. package/dist/runtime/components/popover/popover-target.vue +8 -8
  119. package/dist/runtime/components/popover/popover.vue +1 -1
  120. package/dist/runtime/components/progress/progress-label.vue +3 -3
  121. package/dist/runtime/components/progress/progress-root.vue +3 -3
  122. package/dist/runtime/components/progress/progress-section.d.vue.ts +1 -1
  123. package/dist/runtime/components/progress/progress-section.vue +8 -8
  124. package/dist/runtime/components/progress/progress-section.vue.d.ts +1 -1
  125. package/dist/runtime/components/progress/progress.vue +9 -9
  126. package/dist/runtime/components/renderless/renderless.vue +3 -3
  127. package/dist/runtime/components/roving-focus/roving-focus-item.vue +14 -14
  128. package/dist/runtime/components/select.d.vue.ts +2 -0
  129. package/dist/runtime/components/select.vue.d.ts +2 -0
  130. package/dist/runtime/components/switch/switch-group.vue +16 -16
  131. package/dist/runtime/components/table/table.d.ts +30 -30
  132. package/dist/runtime/components/table/types.d.ts +10 -1
  133. package/dist/runtime/components/table/ui/table-sortable-header.vue +12 -11
  134. package/dist/runtime/components/tabs/tabs-list.d.vue.ts +2 -0
  135. package/dist/runtime/components/tabs/tabs-list.vue +10 -10
  136. package/dist/runtime/components/tabs/tabs-list.vue.d.ts +2 -0
  137. package/dist/runtime/components/tabs/tabs-panel.d.vue.ts +1 -0
  138. package/dist/runtime/components/tabs/tabs-panel.vue +11 -11
  139. package/dist/runtime/components/tabs/tabs-panel.vue.d.ts +1 -0
  140. package/dist/runtime/components/tabs/tabs-root.d.vue.ts +36 -9
  141. package/dist/runtime/components/tabs/tabs-root.vue +8 -8
  142. package/dist/runtime/components/tabs/tabs-root.vue.d.ts +36 -9
  143. package/dist/runtime/components/tabs/tabs-tab.d.vue.ts +7 -3
  144. package/dist/runtime/components/tabs/tabs-tab.vue +25 -22
  145. package/dist/runtime/components/tabs/tabs-tab.vue.d.ts +7 -3
  146. package/dist/runtime/components/text.d.vue.ts +6 -1
  147. package/dist/runtime/components/text.vue +67 -67
  148. package/dist/runtime/components/text.vue.d.ts +6 -1
  149. package/dist/runtime/components/textarea.d.vue.ts +7 -5
  150. package/dist/runtime/components/textarea.vue +38 -35
  151. package/dist/runtime/components/textarea.vue.d.ts +7 -5
  152. package/dist/runtime/components/title.d.vue.ts +5 -0
  153. package/dist/runtime/components/title.vue +14 -14
  154. package/dist/runtime/components/title.vue.d.ts +5 -0
  155. package/dist/runtime/components/transition.d.vue.ts +12 -2
  156. package/dist/runtime/components/transition.vue +3 -3
  157. package/dist/runtime/components/transition.vue.d.ts +12 -2
  158. package/dist/runtime/components/tree/_ui/tree-item.d.vue.ts +1 -0
  159. package/dist/runtime/components/tree/_ui/tree-item.vue +128 -129
  160. package/dist/runtime/components/tree/_ui/tree-item.vue.d.ts +1 -0
  161. package/dist/runtime/components/tree/_ui/tree-root.d.vue.ts +8 -0
  162. package/dist/runtime/components/tree/_ui/tree-root.vue +21 -21
  163. package/dist/runtime/components/tree/_ui/tree-root.vue.d.ts +8 -0
  164. package/dist/runtime/components/tree/lib/context.d.ts +15 -0
  165. package/dist/runtime/components/tree/types.d.ts +9 -0
  166. package/dist/runtime/components/visually-hidden/visually-hidden-input.d.vue.ts +2 -0
  167. package/dist/runtime/components/visually-hidden/visually-hidden-input.vue.d.ts +2 -0
  168. package/dist/runtime/components/visually-hidden/visually-hidden.d.vue.ts +1 -0
  169. package/dist/runtime/components/visually-hidden/visually-hidden.vue +9 -9
  170. package/dist/runtime/components/visually-hidden/visually-hidden.vue.d.ts +1 -0
  171. package/dist/runtime/styles/dark-theme.css +1 -1
  172. package/package.json +1 -1
@@ -33,85 +33,85 @@ const breadcrumbs = computed(() => unref(items) ?? []);
33
33
  </script>
34
34
 
35
35
  <template>
36
- <Box :is :mod :style :class='$style.root' aria-label='breadcrumb'>
37
- <template v-for='(item, ix) in breadcrumbs' :key='item.to'>
38
- <li :class='$style.breadcrumb' role='presentation' aria-hidden='true'>
39
- <slot
40
- :name='item.slot ?? "item"'
41
- :item='item'
42
- :ix='ix'
43
- :active='item.active ?? ix === breadcrumbs.length - 1'
44
- >
45
- <Button
46
- :size
47
- :variant
48
- :class='$style.item'
49
- :mod='{ active: item.active ?? ix === breadcrumbs.length - 1 }'
50
- :color='item.active ?? ix === breadcrumbs.length - 1 ? color : inactive'
51
- @click.stop.prevent='$emit("click", item)'
52
- >
53
- <template v-if='item?.icon' #leftSection>
54
- <Icon :name='item.icon' :class='$style.icon' />
55
- </template>
56
- {{ item.label }}
57
- </Button>
58
- </slot>
59
- </li>
60
- <li v-if='ix < breadcrumbs.length - 1' role='presentation' aria-hidden='true' :class='$style.separator'>
61
- <slot name='separator'>
62
- <Icon :name='separator' />
63
- </slot>
64
- </li>
65
- </template>
66
- </Box>
36
+ <Box :is :mod :style :class='$style.root' aria-label='breadcrumb'>
37
+ <template v-for='(item, ix) in breadcrumbs' :key='item.to'>
38
+ <li :class='$style.breadcrumb' role='presentation' aria-hidden='true'>
39
+ <slot
40
+ :name='item.slot ?? "item"'
41
+ :item='item'
42
+ :ix='ix'
43
+ :active='item.active ?? ix === breadcrumbs.length - 1'
44
+ >
45
+ <Button
46
+ :size
47
+ :variant
48
+ :class='$style.item'
49
+ :mod='{ active: item.active ?? ix === breadcrumbs.length - 1 }'
50
+ :color='item.active ?? ix === breadcrumbs.length - 1 ? color : inactive'
51
+ @click.stop.prevent='$emit("click", item)'
52
+ >
53
+ <template v-if='item?.icon' #leftSection>
54
+ <Icon :name='item.icon' :class='$style.icon' />
55
+ </template>
56
+ {{ item.label }}
57
+ </Button>
58
+ </slot>
59
+ </li>
60
+ <li v-if='ix < breadcrumbs.length - 1' role='presentation' aria-hidden='true' :class='$style.separator'>
61
+ <slot name='separator'>
62
+ <Icon :name='separator' />
63
+ </slot>
64
+ </li>
65
+ </template>
66
+ </Box>
67
67
  </template>
68
68
 
69
69
  <style module lang="postcss">
70
- .root {
71
- --bc-spacing: var(--spacing-xs);
72
-
73
- display: flex;
74
- flex-wrap: wrap;
75
- gap: var(--bc-spacing);
76
- align-items: center;
77
- }
78
-
79
- .breadcrumb {
80
- line-height: 1;
81
-
82
- color: var(--color-text);
83
- white-space: nowrap;
84
- -webkit-tap-highlight-color: transparent;
85
-
86
- }
87
-
88
- .item {
89
- display: flex;
90
- gap: .25rem;
91
- align-items: center;
92
-
93
- font-weight: 600;
94
- text-transform: capitalize;
95
- }
96
-
97
- .icon {
98
- width: 1.2em;
99
- height: 1.2em;
100
- }
101
-
102
- .separator {
103
- display: flex;
104
- align-items: center;
105
- justify-content: center;
106
-
107
- line-height: 1;
108
-
109
- @mixin where-light {
110
- color: var(--color-gray-7);
111
- }
112
-
113
- @mixin where-dark {
114
- color: var(--color-dark-2);
115
- }
116
- }
70
+ .root {
71
+ --bc-spacing: var(--spacing-xs);
72
+
73
+ display: flex;
74
+ flex-wrap: wrap;
75
+ gap: var(--bc-spacing);
76
+ align-items: center;
77
+ }
78
+
79
+ .breadcrumb {
80
+ line-height: 1;
81
+
82
+ color: var(--color-text);
83
+ white-space: nowrap;
84
+ -webkit-tap-highlight-color: transparent;
85
+
86
+ }
87
+
88
+ .item {
89
+ display: flex;
90
+ gap: .25rem;
91
+ align-items: center;
92
+
93
+ font-weight: 600;
94
+ text-transform: capitalize;
95
+ }
96
+
97
+ .icon {
98
+ width: 1.2em;
99
+ height: 1.2em;
100
+ }
101
+
102
+ .separator {
103
+ display: flex;
104
+ align-items: center;
105
+ justify-content: center;
106
+
107
+ line-height: 1;
108
+
109
+ @mixin where-light {
110
+ color: var(--color-gray-7);
111
+ }
112
+
113
+ @mixin where-dark {
114
+ color: var(--color-dark-2);
115
+ }
116
+ }
117
117
  </style>
@@ -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 },
@@ -72,7 +74,7 @@ const style = computed(() => useStyleResolver((theme) => {
72
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
@@ -87,13 +89,15 @@ const style = computed(() => useStyleResolver((theme) => {
87
89
 
88
90
  <span :class='[css.inner, classes?.inner]'>
89
91
  <span
90
- v-if='$slots.leftSection'
92
+ v-if='$slots.leftSection || icon'
91
93
  :class='[css.section, classes?.section]'
92
94
  data-position='left'
93
95
  v-bind='leftSectionProps'
94
96
  :style='style.leftSection'
95
97
  >
96
- <slot name='leftSection' />
98
+ <slot name='leftSection'>
99
+ <Icon v-if='icon' :name='icon' />
100
+ </slot>
97
101
  </span>
98
102
 
99
103
  <span :class='[css.label, classes?.label]'>
@@ -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>;
@@ -9,30 +9,30 @@ const { is = "button", ...props } = defineProps({
9
9
  </script>
10
10
 
11
11
  <template>
12
- <Box :is :class='$style.unstyled' v-bind='props' type='button'>
13
- <slot />
14
- </Box>
12
+ <Box :is :class='$style.unstyled' v-bind='props' type='button'>
13
+ <slot />
14
+ </Box>
15
15
  </template>
16
16
 
17
17
  <style module lang="postcss">
18
- :where(.unstyled) {
19
- touch-action: manipulation;
20
- cursor: pointer;
21
-
22
- padding: 0;
23
- border: 0;
24
-
25
- font-size: var(--font-size-md);
26
- color: inherit;
27
- text-align: left;
28
- text-decoration: none;
29
-
30
- appearance: none;
31
- background-color: transparent;
32
- -webkit-tap-highlight-color: transparent;
33
-
34
- @mixin where-rtl {
35
- text-align: right;
36
- }
37
- }
18
+ :where(.unstyled) {
19
+ touch-action: manipulation;
20
+ cursor: pointer;
21
+
22
+ padding: 0;
23
+ border: 0;
24
+
25
+ font-size: var(--font-size-md);
26
+ color: inherit;
27
+ text-align: left;
28
+ text-decoration: none;
29
+
30
+ appearance: none;
31
+ background-color: transparent;
32
+ -webkit-tap-highlight-color: transparent;
33
+
34
+ @mixin where-rtl {
35
+ text-align: right;
36
+ }
37
+ }
38
38
  </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;
@@ -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 {
@@ -26,102 +26,102 @@ defineEmits(["prev", "level", "next"]);
26
26
  </script>
27
27
 
28
28
  <template>
29
- <Box :is v-bind='props' :class='$style.header'>
30
- <UnstyledButton
31
- v-if='withPrev'
32
- aria-label='Previous page'
33
- :disabled='prevDisabled?.()'
34
- :class='$style.control'
35
- @click='$emit("prev")'
36
- >
37
- <Icon :name='prevIcon' :class='$style.icon' />
38
- </UnstyledButton>
39
-
40
- <UnstyledButton
41
- :disabled
42
- :class='$style.level'
43
- @click='$emit("level")'
44
- >
45
- <slot />
46
- </UnstyledButton>
47
-
48
- <UnstyledButton
49
- v-if='withNext'
50
- aria-label='Next page'
51
- :disabled='nextDisabled?.()'
52
- :class='$style.control'
53
- @click='$emit("next")'
54
- >
55
- <Icon :name='nextIcon' :class='$style.icon' />
56
- </UnstyledButton>
57
- </Box>
29
+ <Box :is v-bind='props' :class='$style.header'>
30
+ <UnstyledButton
31
+ v-if='withPrev'
32
+ aria-label='Previous page'
33
+ :disabled='prevDisabled?.()'
34
+ :class='$style.control'
35
+ @click='$emit("prev")'
36
+ >
37
+ <Icon :name='prevIcon' :class='$style.icon' />
38
+ </UnstyledButton>
39
+
40
+ <UnstyledButton
41
+ :disabled
42
+ :class='$style.level'
43
+ @click='$emit("level")'
44
+ >
45
+ <slot />
46
+ </UnstyledButton>
47
+
48
+ <UnstyledButton
49
+ v-if='withNext'
50
+ aria-label='Next page'
51
+ :disabled='nextDisabled?.()'
52
+ :class='$style.control'
53
+ @click='$emit("next")'
54
+ >
55
+ <Icon :name='nextIcon' :class='$style.icon' />
56
+ </UnstyledButton>
57
+ </Box>
58
58
  </template>
59
59
 
60
60
  <style lang="postcss" module>
61
- .header {
62
- --dch-control-size-xs: rem(30px);
63
- --dch-control-size-sm: rem(36px);
64
- --dch-control-size-md: rem(42px);
65
- --dch-control-size-lg: rem(48px);
66
- --dch-control-size-xl: rem(54px);
67
- --dch-control-size: var(--dch-control-size-sm);
68
-
69
- --dch-control-radius: var(--radius-default);
70
-
71
- display: flex;
72
- }
73
-
74
- .level,
75
- .control {
76
- cursor: pointer;
77
- user-select: none;
78
-
79
- display: flex;
80
- align-items: center;
81
- justify-content: center;
82
-
83
- height: var(--dch-control-size);
84
- border-radius: var(--dch-control-radius);
85
-
86
- opacity: 1;
87
-
88
- &:where([data-static]) {
89
- cursor: default;
90
- }
91
-
92
- &:hover {
93
- &:where(:not([data-static], :disabled)) {
94
- @mixin light {
95
- background-color: var(--color-gray-0);
96
- }
97
-
98
- @mixin dark {
99
- background-color: var(--color-dark-5);
100
- }
101
- }
102
- }
103
-
104
- &:where(:disabled) {
105
- cursor: not-allowed;
106
-
107
- opacity: 0.2;
108
- }
109
- }
110
-
111
- .level {
112
- flex: 1;
113
-
114
- font-size: var(--dch-fz, var(--font-size-sm));
115
- font-weight: 500;
116
- text-transform: capitalize;
117
- }
118
-
119
- .control {
120
- width: var(--dch-control-size);
121
- }
122
-
123
- .icon {
124
- width: 60%;
125
- height: 60%;
126
- }
61
+ .header {
62
+ --dch-control-size-xs: rem(30px);
63
+ --dch-control-size-sm: rem(36px);
64
+ --dch-control-size-md: rem(42px);
65
+ --dch-control-size-lg: rem(48px);
66
+ --dch-control-size-xl: rem(54px);
67
+ --dch-control-size: var(--dch-control-size-sm);
68
+
69
+ --dch-control-radius: var(--radius-default);
70
+
71
+ display: flex;
72
+ }
73
+
74
+ .level,
75
+ .control {
76
+ cursor: pointer;
77
+ user-select: none;
78
+
79
+ display: flex;
80
+ align-items: center;
81
+ justify-content: center;
82
+
83
+ height: var(--dch-control-size);
84
+ border-radius: var(--dch-control-radius);
85
+
86
+ opacity: 1;
87
+
88
+ &:where([data-static]) {
89
+ cursor: default;
90
+ }
91
+
92
+ &:hover {
93
+ &:where(:not([data-static], :disabled)) {
94
+ @mixin light {
95
+ background-color: var(--color-gray-0);
96
+ }
97
+
98
+ @mixin dark {
99
+ background-color: var(--color-dark-5);
100
+ }
101
+ }
102
+ }
103
+
104
+ &:where(:disabled) {
105
+ cursor: not-allowed;
106
+
107
+ opacity: 0.2;
108
+ }
109
+ }
110
+
111
+ .level {
112
+ flex: 1;
113
+
114
+ font-size: var(--dch-fz, var(--font-size-sm));
115
+ font-weight: 500;
116
+ text-transform: capitalize;
117
+ }
118
+
119
+ .control {
120
+ width: var(--dch-control-size);
121
+ }
122
+
123
+ .icon {
124
+ width: 60%;
125
+ height: 60%;
126
+ }
127
127
  </style>
@@ -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 {
@@ -73,7 +73,7 @@ useCalendarSelection({
73
73
  </script>
74
74
 
75
75
  <template>
76
- <Box>
77
- <slot :config />
78
- </Box>
76
+ <Box>
77
+ <slot :config />
78
+ </Box>
79
79
  </template>
@@ -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, {