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
@@ -1,26 +1,53 @@
1
1
  import type { NuanceColor, NuanceRadius } from '@nui/types';
2
2
  import type { BoxProps } from '../box.vue.js';
3
3
  export interface TabsRootProps extends BoxProps {
4
+ /** Value of the tab activated by default (uncontrolled) */
4
5
  defaultTab?: string;
5
- /** Tabs orientation, `'horizontal'` by default */
6
+ /**
7
+ * Tabs orientation
8
+ * @default `'horizontal'`
9
+ */
6
10
  orientation?: 'vertical' | 'horizontal';
7
- /** `TabsList` placement relative to `TabsPanel`, applicable only when `orientation="vertical"`, `'left'` by default */
11
+ /**
12
+ * `TabsList` placement relative to `TabsPanel`, applicable only when `orientation="vertical"`
13
+ * @default `'left'`
14
+ */
8
15
  placement?: 'left' | 'right';
16
+ /**
17
+ * Visual variant
18
+ * @default `'default'`
19
+ */
9
20
  variant?: 'default' | 'pills' | 'outline';
10
- /** Determines whether arrow key presses should loop though items (first to last and last to first), `true` by default */
21
+ /**
22
+ * Whether arrow key presses loop through items
23
+ * @default `true`
24
+ */
11
25
  loop?: boolean;
12
- /** Determines whether tab should be activated with arrow key press, `true` by default */
26
+ /**
27
+ * Whether a tab is activated on arrow key press
28
+ * @default `true`
29
+ */
13
30
  activateTabWithKeyboard?: boolean;
14
- /** Determines whether tab can be deactivated, `false` by default */
31
+ /**
32
+ * Whether a tab can be deactivated
33
+ * @default `false`
34
+ */
15
35
  allowTabDeactivation?: boolean;
16
- /** Changes colors of `TabsTab` components when variant is `pills` or `default`, does nothing for other variants */
36
+ /** Color from theme */
17
37
  color?: NuanceColor;
18
- /** Key of `theme.radius` or any valid CSS value to set `border-radius`, `theme.defaultRadius` by default */
38
+ /** Border radius */
19
39
  radius?: NuanceRadius;
20
- /** Determines whether tabs should have inverted styles, `false` by default */
40
+ /**
41
+ * Inverts tab styles
42
+ * @default `false`
43
+ */
21
44
  inverted?: boolean;
22
- /** If set to `false`, `TabsPanel` content will be unmounted when the associated tab is not active, `true` by default */
45
+ /**
46
+ * If `false`, panel content is unmounted when inactive
47
+ * @default `true`
48
+ */
23
49
  keepMounted?: boolean;
50
+ /** Root element id */
24
51
  id?: string;
25
52
  }
26
53
  type __VLS_Props = TabsRootProps;
@@ -58,17 +58,17 @@ useProvideTabsContext({
58
58
  </script>
59
59
 
60
60
  <template>
61
- <Box
62
- :is
63
- :style
61
+ <Box
62
+ :is
63
+ :style
64
64
  :mod='[mod, {
65
65
  orientation,
66
66
  inverted: orientation === "horizontal" && inverted,
67
67
  placement: orientation === "vertical" && placement,
68
68
  variant
69
- }]'
70
- :class='css.root'
71
- >
72
- <slot />
73
- </Box>
69
+ }]'
70
+ :class='css.root'
71
+ >
72
+ <slot />
73
+ </Box>
74
74
  </template>
@@ -1,26 +1,53 @@
1
1
  import type { NuanceColor, NuanceRadius } from '@nui/types';
2
2
  import type { BoxProps } from '../box.vue.js';
3
3
  export interface TabsRootProps extends BoxProps {
4
+ /** Value of the tab activated by default (uncontrolled) */
4
5
  defaultTab?: string;
5
- /** Tabs orientation, `'horizontal'` by default */
6
+ /**
7
+ * Tabs orientation
8
+ * @default `'horizontal'`
9
+ */
6
10
  orientation?: 'vertical' | 'horizontal';
7
- /** `TabsList` placement relative to `TabsPanel`, applicable only when `orientation="vertical"`, `'left'` by default */
11
+ /**
12
+ * `TabsList` placement relative to `TabsPanel`, applicable only when `orientation="vertical"`
13
+ * @default `'left'`
14
+ */
8
15
  placement?: 'left' | 'right';
16
+ /**
17
+ * Visual variant
18
+ * @default `'default'`
19
+ */
9
20
  variant?: 'default' | 'pills' | 'outline';
10
- /** Determines whether arrow key presses should loop though items (first to last and last to first), `true` by default */
21
+ /**
22
+ * Whether arrow key presses loop through items
23
+ * @default `true`
24
+ */
11
25
  loop?: boolean;
12
- /** Determines whether tab should be activated with arrow key press, `true` by default */
26
+ /**
27
+ * Whether a tab is activated on arrow key press
28
+ * @default `true`
29
+ */
13
30
  activateTabWithKeyboard?: boolean;
14
- /** Determines whether tab can be deactivated, `false` by default */
31
+ /**
32
+ * Whether a tab can be deactivated
33
+ * @default `false`
34
+ */
15
35
  allowTabDeactivation?: boolean;
16
- /** Changes colors of `TabsTab` components when variant is `pills` or `default`, does nothing for other variants */
36
+ /** Color from theme */
17
37
  color?: NuanceColor;
18
- /** Key of `theme.radius` or any valid CSS value to set `border-radius`, `theme.defaultRadius` by default */
38
+ /** Border radius */
19
39
  radius?: NuanceRadius;
20
- /** Determines whether tabs should have inverted styles, `false` by default */
40
+ /**
41
+ * Inverts tab styles
42
+ * @default `false`
43
+ */
21
44
  inverted?: boolean;
22
- /** If set to `false`, `TabsPanel` content will be unmounted when the associated tab is not active, `true` by default */
45
+ /**
46
+ * If `false`, panel content is unmounted when inactive
47
+ * @default `true`
48
+ */
23
49
  keepMounted?: boolean;
50
+ /** Root element id */
24
51
  id?: string;
25
52
  }
26
53
  type __VLS_Props = TabsRootProps;
@@ -1,15 +1,19 @@
1
1
  import type { Mod } from '@nui/utils';
2
2
  export interface TabsTabProps {
3
+ /** Tab value, must match the corresponding `TabsPanel` value */
3
4
  value: string;
5
+ /** Element modifiers transformed into `data-` attributes, falsy values are removed */
4
6
  mod?: Mod | Mod[];
7
+ /** Icon displayed before the label */
8
+ icon?: string;
5
9
  }
6
- declare var __VLS_10: {}, __VLS_12: {}, __VLS_14: {};
10
+ declare var __VLS_10: {}, __VLS_17: {}, __VLS_19: {};
7
11
  type __VLS_Slots = {} & {
8
12
  leftSection?: (props: typeof __VLS_10) => any;
9
13
  } & {
10
- default?: (props: typeof __VLS_12) => any;
14
+ default?: (props: typeof __VLS_17) => any;
11
15
  } & {
12
- rightSection?: (props: typeof __VLS_14) => any;
16
+ rightSection?: (props: typeof __VLS_19) => any;
13
17
  };
14
18
  declare const __VLS_base: import("vue").DefineComponent<TabsTabProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<TabsTabProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
19
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -3,39 +3,42 @@ import { computed } from "vue";
3
3
  import UnstyledButton from "../button/unstyled-button.vue";
4
4
  import { useTabsState } from "./lib";
5
5
  import css from "./tabs.module.css";
6
- const { value, mod } = defineProps({
6
+ const { value, mod, icon } = defineProps({
7
7
  value: { type: String, required: true },
8
- mod: { type: [Object, Array], required: false }
8
+ mod: { type: [Object, Array], required: false },
9
+ icon: { type: String, required: false }
9
10
  });
10
11
  const ctx = useTabsState();
11
12
  const active = computed(() => value === ctx?.active.value);
12
13
  </script>
13
14
 
14
15
  <template>
15
- <UnstyledButton
16
- :id='ctx?.getTabId(value)'
16
+ <UnstyledButton
17
+ :id='ctx?.getTabId(value)'
17
18
  :mod='[mod, {
18
19
  variant: ctx?.variant,
19
20
  active,
20
21
  orientation: ctx?.orientation,
21
22
  inverted: ctx?.inverted,
22
23
  placement: ctx?.orientation === "vertical" && ctx.placement
23
- }]'
24
- :class='css.tab'
25
- role='tab'
26
- :aria-selected='active'
27
- :tabindex='$attrs?.tabIndex !== void 0 ? $attrs?.tabIndex : active || ctx?.active.value === null ? 0 : -1'
28
- :aria-controls='ctx?.getPanelId(value)'
29
- @click='ctx?.onUpdate(value)'
30
- >
31
- <span v-if='$slots.leftSection' :class='css.tabSection' data-position='left'>
32
- <slot name='leftSection' />
33
- </span>
34
- <span v-if='$slots.default' :class='css.tabLabel'>
35
- <slot />
36
- </span>
37
- <span v-if='$slots.rightSection' :class='css.tabSection' data-position='right'>
38
- <slot name='rightSection' />
39
- </span>
40
- </UnstyledButton>
24
+ }]'
25
+ :class='css.tab'
26
+ role='tab'
27
+ :aria-selected='active'
28
+ :tabindex='$attrs?.tabIndex !== void 0 ? $attrs?.tabIndex : active || ctx?.active.value === null ? 0 : -1'
29
+ :aria-controls='ctx?.getPanelId(value)'
30
+ @click='ctx?.onUpdate(value)'
31
+ >
32
+ <span v-if='$slots.leftSection || icon' :class='css.tabSection' data-position='left'>
33
+ <slot name='leftSection'>
34
+ <Icon v-if='icon' :name='icon' />
35
+ </slot>
36
+ </span>
37
+ <span v-if='$slots.default' :class='css.tabLabel'>
38
+ <slot />
39
+ </span>
40
+ <span v-if='$slots.rightSection' :class='css.tabSection' data-position='right'>
41
+ <slot name='rightSection' />
42
+ </span>
43
+ </UnstyledButton>
41
44
  </template>
@@ -1,15 +1,19 @@
1
1
  import type { Mod } from '@nui/utils';
2
2
  export interface TabsTabProps {
3
+ /** Tab value, must match the corresponding `TabsPanel` value */
3
4
  value: string;
5
+ /** Element modifiers transformed into `data-` attributes, falsy values are removed */
4
6
  mod?: Mod | Mod[];
7
+ /** Icon displayed before the label */
8
+ icon?: string;
5
9
  }
6
- declare var __VLS_10: {}, __VLS_12: {}, __VLS_14: {};
10
+ declare var __VLS_10: {}, __VLS_17: {}, __VLS_19: {};
7
11
  type __VLS_Slots = {} & {
8
12
  leftSection?: (props: typeof __VLS_10) => any;
9
13
  } & {
10
- default?: (props: typeof __VLS_12) => any;
14
+ default?: (props: typeof __VLS_17) => any;
11
15
  } & {
12
- rightSection?: (props: typeof __VLS_14) => any;
16
+ rightSection?: (props: typeof __VLS_19) => any;
13
17
  };
14
18
  declare const __VLS_base: import("vue").DefineComponent<TabsTabProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<TabsTabProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
19
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -14,12 +14,17 @@ export interface TextProps extends BoxProps {
14
14
  inline?: boolean;
15
15
  /** Determines whether font properties should be inherited from the parent, `false` by default */
16
16
  inherit?: boolean;
17
- /** Gradient configuration, ignored when `variant` is not `gradient`, `theme.defaultGradient` by default */
17
+ /** Gradient configuration (used with `variant="gradient"`) */
18
18
  gradient?: NuanceGradient;
19
+ /** Visual variant */
19
20
  variant?: 'text' | 'gradient';
21
+ /** Font size token */
20
22
  fz?: NuanceSize | `h${TitleOrder}` | string;
23
+ /** Line height token */
21
24
  lh?: NuanceSize | string;
25
+ /** Font weight */
22
26
  fw?: CSSProperties['font-weight'];
27
+ /** Text color from theme */
23
28
  c?: NuanceColor | 'dimmed';
24
29
  }
25
30
  declare var __VLS_8: {};
@@ -51,74 +51,74 @@ const style = computed(() => useStyleResolver((theme) => ({
51
51
  </script>
52
52
 
53
53
  <template>
54
- <Box :is v-bind='rest' :mod='_mod' :class='$style.root' :style>
55
- <slot />
56
- </Box>
54
+ <Box :is v-bind='rest' :mod='_mod' :class='$style.root' :style>
55
+ <slot />
56
+ </Box>
57
57
  </template>
58
58
 
59
59
  <style module lang="postcss">
60
- .root {
61
- --text-fz: var(--font-size-sm);
62
- --text-lh: var(--line-height-sm);
63
- --text-color: inherit;
64
- --text-fw: normal;
65
- --text-gradient: none;
66
- --text-line-clamp: none;
67
-
68
- margin: 0;
69
- padding: 0;
70
-
71
- font-size: var(--text-fz);
72
- font-weight: var(--text-fw);
73
- line-height: var(--text-lh);
74
- color: var(--text-color);
75
- text-decoration: none;
76
- -webkit-tap-highlight-color: transparent;
77
-
78
- &:where([data-truncate]) {
79
- overflow: hidden;
80
-
81
- text-overflow: ellipsis;
82
- white-space: nowrap;
83
- }
84
-
85
- &:where([data-truncate='start']) {
86
- direction: rtl;
87
-
88
- text-align: right;
89
-
90
- @mixin where-rtl {
91
- direction: ltr;
92
-
93
- text-align: left;
94
- }
95
- }
96
-
97
- &:where([data-variant='gradient']) {
98
- background-image: var(--text-gradient);
99
- -webkit-background-clip: text;
100
- background-clip: text;
101
- -webkit-text-fill-color: transparent;
102
- }
103
-
104
- &:where([data-line-clamp]) {
105
- overflow: hidden;
106
- display: -webkit-box;
107
- -webkit-box-orient: vertical;
108
- -webkit-line-clamp: var(--text-line-clamp);
109
-
110
- text-overflow: ellipsis;
111
- }
112
-
113
- &:where([data-inherit]) {
114
- font-size: inherit;
115
- font-weight: inherit;
116
- line-height: inherit;
117
- color: inherit;
118
- }
119
-
120
- &:where([data-inline]) {
121
- line-height: 1;
122
- }
123
- }
60
+ .root {
61
+ --text-fz: var(--font-size-sm);
62
+ --text-lh: var(--line-height-sm);
63
+ --text-color: inherit;
64
+ --text-fw: normal;
65
+ --text-gradient: none;
66
+ --text-line-clamp: none;
67
+
68
+ margin: 0;
69
+ padding: 0;
70
+
71
+ font-size: var(--text-fz);
72
+ font-weight: var(--text-fw);
73
+ line-height: var(--text-lh);
74
+ color: var(--text-color);
75
+ text-decoration: none;
76
+ -webkit-tap-highlight-color: transparent;
77
+
78
+ &:where([data-truncate]) {
79
+ overflow: hidden;
80
+
81
+ text-overflow: ellipsis;
82
+ white-space: nowrap;
83
+ }
84
+
85
+ &:where([data-truncate='start']) {
86
+ direction: rtl;
87
+
88
+ text-align: right;
89
+
90
+ @mixin where-rtl {
91
+ direction: ltr;
92
+
93
+ text-align: left;
94
+ }
95
+ }
96
+
97
+ &:where([data-variant='gradient']) {
98
+ background-image: var(--text-gradient);
99
+ -webkit-background-clip: text;
100
+ background-clip: text;
101
+ -webkit-text-fill-color: transparent;
102
+ }
103
+
104
+ &:where([data-line-clamp]) {
105
+ overflow: hidden;
106
+ display: -webkit-box;
107
+ -webkit-box-orient: vertical;
108
+ -webkit-line-clamp: var(--text-line-clamp);
109
+
110
+ text-overflow: ellipsis;
111
+ }
112
+
113
+ &:where([data-inherit]) {
114
+ font-size: inherit;
115
+ font-weight: inherit;
116
+ line-height: inherit;
117
+ color: inherit;
118
+ }
119
+
120
+ &:where([data-inline]) {
121
+ line-height: 1;
122
+ }
123
+ }
124
124
  </style>
@@ -14,12 +14,17 @@ export interface TextProps extends BoxProps {
14
14
  inline?: boolean;
15
15
  /** Determines whether font properties should be inherited from the parent, `false` by default */
16
16
  inherit?: boolean;
17
- /** Gradient configuration, ignored when `variant` is not `gradient`, `theme.defaultGradient` by default */
17
+ /** Gradient configuration (used with `variant="gradient"`) */
18
18
  gradient?: NuanceGradient;
19
+ /** Visual variant */
19
20
  variant?: 'text' | 'gradient';
21
+ /** Font size token */
20
22
  fz?: NuanceSize | `h${TitleOrder}` | string;
23
+ /** Line height token */
21
24
  lh?: NuanceSize | string;
25
+ /** Font weight */
22
26
  fw?: CSSProperties['font-weight'];
27
+ /** Text color from theme */
23
28
  c?: NuanceColor | 'dimmed';
24
29
  }
25
30
  declare var __VLS_8: {};
@@ -1,22 +1,24 @@
1
1
  import type { InputBaseProps, InputWrapperProps } from './input/index.js';
2
2
  export interface TextareaProps extends InputWrapperProps, InputBaseProps {
3
+ /** Icon displayed in the left section */
4
+ icon?: string;
3
5
  }
4
6
  type __VLS_Props = TextareaProps;
5
7
  type __VLS_ModelProps = {
6
8
  modelValue?: string;
7
9
  };
8
10
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
9
- declare var __VLS_15: {}, __VLS_19: {}, __VLS_22: {}, __VLS_25: {}, __VLS_28: {};
11
+ declare var __VLS_15: {}, __VLS_24: {}, __VLS_27: {}, __VLS_30: {}, __VLS_33: {};
10
12
  type __VLS_Slots = {} & {
11
13
  leftSection?: (props: typeof __VLS_15) => any;
12
14
  } & {
13
- rightSection?: (props: typeof __VLS_19) => any;
15
+ rightSection?: (props: typeof __VLS_24) => any;
14
16
  } & {
15
- label?: (props: typeof __VLS_22) => any;
17
+ label?: (props: typeof __VLS_27) => any;
16
18
  } & {
17
- error?: (props: typeof __VLS_25) => any;
19
+ error?: (props: typeof __VLS_30) => any;
18
20
  } & {
19
- description?: (props: typeof __VLS_28) => any;
21
+ description?: (props: typeof __VLS_33) => any;
20
22
  };
21
23
  declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
22
24
  $el: HTMLTextAreaElement | null | undefined;
@@ -3,7 +3,8 @@ import { unrefElement, useTextareaAutosize } from "@vueuse/core";
3
3
  import { useTemplateRef } from "vue";
4
4
  import InputBase from "./input/ui/input-base.vue";
5
5
  import InputWrapper from "./input/ui/input-wrapper.vue";
6
- const props = defineProps({
6
+ const { icon, ...props } = defineProps({
7
+ icon: { type: String, required: false },
7
8
  error: { type: String, required: false },
8
9
  description: { type: String, required: false },
9
10
  label: { type: String, required: false },
@@ -32,40 +33,42 @@ defineExpose({
32
33
  </script>
33
34
 
34
35
  <template>
35
- <InputWrapper v-bind='props' :multiline :class='$attrs?.class'>
36
- <InputBase>
37
- <template v-if='!!$slots.leftSection' #leftSection>
38
- <slot name='leftSection' />
39
- </template>
40
-
41
- <template #default='{ id, css }'>
42
- <textarea
43
- v-bind='{ ...$attrs, class: void 0 }'
44
- :id
45
- ref='input'
46
- v-model='model'
47
- :class='[css, $style.textarea]'
48
- :required='props.required'
49
- :disabled='props.required'
50
- :readonly='props.readonly'
51
- />
52
- </template>
53
-
54
- <template v-if='!!$slots.rightSection' #rightSection>
55
- <slot name='rightSection' />
56
- </template>
57
- </InputBase>
58
-
59
- <template v-if='!!$slots.label' #label>
60
- <slot name='label' />
61
- </template>
62
- <template v-if='!!$slots.error' #error>
63
- <slot name='error' />
64
- </template>
65
- <template v-if='!!$slots.description' #description>
66
- <slot name='description' />
67
- </template>
68
- </InputWrapper>
36
+ <InputWrapper v-bind='props' :multiline :class='$attrs?.class'>
37
+ <InputBase>
38
+ <template v-if='!!$slots.leftSection || icon' #leftSection>
39
+ <slot name='leftSection'>
40
+ <Icon v-if='icon' :name='icon' />
41
+ </slot>
42
+ </template>
43
+
44
+ <template #default='{ id, css }'>
45
+ <textarea
46
+ v-bind='{ ...$attrs, class: void 0 }'
47
+ :id
48
+ ref='input'
49
+ v-model='model'
50
+ :class='[css, $style.textarea]'
51
+ :required='props.required'
52
+ :disabled='props.required'
53
+ :readonly='props.readonly'
54
+ />
55
+ </template>
56
+
57
+ <template v-if='!!$slots.rightSection' #rightSection>
58
+ <slot name='rightSection' />
59
+ </template>
60
+ </InputBase>
61
+
62
+ <template v-if='!!$slots.label' #label>
63
+ <slot name='label' />
64
+ </template>
65
+ <template v-if='!!$slots.error' #error>
66
+ <slot name='error' />
67
+ </template>
68
+ <template v-if='!!$slots.description' #description>
69
+ <slot name='description' />
70
+ </template>
71
+ </InputWrapper>
69
72
  </template>
70
73
 
71
74
  <style module>
@@ -1,22 +1,24 @@
1
1
  import type { InputBaseProps, InputWrapperProps } from './input/index.js';
2
2
  export interface TextareaProps extends InputWrapperProps, InputBaseProps {
3
+ /** Icon displayed in the left section */
4
+ icon?: string;
3
5
  }
4
6
  type __VLS_Props = TextareaProps;
5
7
  type __VLS_ModelProps = {
6
8
  modelValue?: string;
7
9
  };
8
10
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
9
- declare var __VLS_15: {}, __VLS_19: {}, __VLS_22: {}, __VLS_25: {}, __VLS_28: {};
11
+ declare var __VLS_15: {}, __VLS_24: {}, __VLS_27: {}, __VLS_30: {}, __VLS_33: {};
10
12
  type __VLS_Slots = {} & {
11
13
  leftSection?: (props: typeof __VLS_15) => any;
12
14
  } & {
13
- rightSection?: (props: typeof __VLS_19) => any;
15
+ rightSection?: (props: typeof __VLS_24) => any;
14
16
  } & {
15
- label?: (props: typeof __VLS_22) => any;
17
+ label?: (props: typeof __VLS_27) => any;
16
18
  } & {
17
- error?: (props: typeof __VLS_25) => any;
19
+ error?: (props: typeof __VLS_30) => any;
18
20
  } & {
19
- description?: (props: typeof __VLS_28) => any;
21
+ description?: (props: typeof __VLS_33) => any;
20
22
  };
21
23
  declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
22
24
  $el: HTMLTextAreaElement | null | undefined;
@@ -1,6 +1,11 @@
1
1
  import type { TextProps } from './text.vue.js';
2
2
  export interface TitleProps extends Omit<TextProps, 'is'> {
3
+ /**
4
+ * Heading level
5
+ * @default `'2'`
6
+ */
3
7
  order?: '1' | '2' | '3' | '4' | '5' | '6';
8
+ /** CSS `text-wrap` value */
4
9
  textWrap?: 'wrap' | 'nowrap' | 'balance' | 'pretty' | 'stable';
5
10
  }
6
11
  declare var __VLS_8: {};
@@ -26,21 +26,21 @@ const style = computed(() => ({ "--title-text-wrap": textWrap }));
26
26
  </script>
27
27
 
28
28
  <template>
29
- <Text
30
- :is='`h${order}`'
31
- v-bind='rest'
32
- :size='size || `h${order}`'
33
- :class='$style.root'
34
- :style
35
- >
36
- <slot />
37
- </Text>
29
+ <Text
30
+ :is='`h${order}`'
31
+ v-bind='rest'
32
+ :size='size || `h${order}`'
33
+ :class='$style.root'
34
+ :style
35
+ >
36
+ <slot />
37
+ </Text>
38
38
  </template>
39
39
 
40
40
  <style module lang="postcss">
41
- .root {
42
- --title-text-wrap: pretty;
43
-
44
- text-wrap: var(--title-text-wrap);
45
- }
41
+ .root {
42
+ --title-text-wrap: pretty;
43
+
44
+ text-wrap: var(--title-text-wrap);
45
+ }
46
46
  </style>
@@ -1,6 +1,11 @@
1
1
  import type { TextProps } from './text.vue.js';
2
2
  export interface TitleProps extends Omit<TextProps, 'is'> {
3
+ /**
4
+ * Heading level
5
+ * @default `'2'`
6
+ */
3
7
  order?: '1' | '2' | '3' | '4' | '5' | '6';
8
+ /** CSS `text-wrap` value */
4
9
  textWrap?: 'wrap' | 'nowrap' | 'balance' | 'pretty' | 'stable';
5
10
  }
6
11
  declare var __VLS_8: {};