nuance-ui 0.1.19 → 0.1.21

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.
package/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^4.0.0"
6
6
  },
7
- "version": "0.1.19",
7
+ "version": "0.1.21",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
@@ -1,7 +1,7 @@
1
1
  import type { NuanceColor, NuanceGradient, NuanceRadius, NuanceSize } from '@nui/types';
2
2
  import type { BoxProps } from '../box.vue.js';
3
3
  export interface ActionIconProps {
4
- size?: NuanceSize | `compact-${NuanceSize}` | string;
4
+ size?: NuanceSize | `input-${NuanceSize}` | string;
5
5
  variant?: 'filled' | 'light' | 'outline' | 'subtle' | 'default' | 'gradient';
6
6
  gradient?: NuanceGradient;
7
7
  loading?: boolean;
@@ -1,7 +1,7 @@
1
1
  import type { NuanceColor, NuanceGradient, NuanceRadius, NuanceSize } from '@nui/types';
2
2
  import type { BoxProps } from '../box.vue.js';
3
3
  export interface ActionIconProps {
4
- size?: NuanceSize | `compact-${NuanceSize}` | string;
4
+ size?: NuanceSize | `input-${NuanceSize}` | string;
5
5
  variant?: 'filled' | 'light' | 'outline' | 'subtle' | 'default' | 'gradient';
6
6
  gradient?: NuanceGradient;
7
7
  loading?: boolean;
@@ -2,6 +2,7 @@
2
2
  import { useTheme } from "@nui/composals";
3
3
  import { getThemeColor } from "@nui/utils";
4
4
  import { computed, watch } from "vue";
5
+ import ActionIcon from "../../action-icon/action-icon.vue";
5
6
  import Button from "../../button/button.vue";
6
7
  import Loader from "../../loader/loader.vue";
7
8
  import RovingFocusItem from "../../roving-focus/roving-focus-item.vue";
@@ -60,6 +61,7 @@ const { handleClick, handleKeyDown } = useTreeItemHandlers(path, isFolder, expan
60
61
  :aria-level='level'
61
62
  :aria-selected='selected'
62
63
  :mod='{ active, selected, "tree-item": path }'
64
+ right-section-p-e='all'
63
65
  @click.prevent='handleClick'
64
66
  @keydown.prevent='handleKeyDown'
65
67
  >
@@ -83,6 +85,18 @@ const { handleClick, handleKeyDown } = useTreeItemHandlers(path, isFolder, expan
83
85
  </template>
84
86
 
85
87
  {{ name ?? path }}
88
+
89
+ <template v-if='isFolder' #rightSection>
90
+ <ActionIcon
91
+ icon='gravity-ui:chevron-down'
92
+ size='sm'
93
+ :color='ctx.color'
94
+ :classes='{ root: $style.chevron, icon: $style["chevron-icon"] }'
95
+ :mod='{ expanded }'
96
+ variant='subtle'
97
+ @click.stop='ctx.toggle("expand", path)'
98
+ />
99
+ </template>
86
100
  </Button>
87
101
  </RovingFocusItem>
88
102
 
@@ -117,6 +131,22 @@ const { handleClick, handleKeyDown } = useTreeItemHandlers(path, isFolder, expan
117
131
  height: var(--tree-icon-size);
118
132
  }
119
133
 
134
+ .chevron {
135
+ color: var(--color-dimmed);
136
+
137
+ transition: transform .3s ease-in-out;
138
+
139
+ &:hover {
140
+ color: var(--color-dimmed);
141
+
142
+ background-color: transparent;
143
+ }
144
+
145
+ &[data-expanded] .chevron-icon {
146
+ transform: rotate(-180deg);
147
+ }
148
+ }
149
+
120
150
  .list {
121
151
  display: grid;
122
152
  gap: .25rem;
@@ -1,5 +1,6 @@
1
1
  import type { NuanceColor } from '@nui/types';
2
2
  import type { AsyncData } from '#app';
3
+ import type { FetchError } from 'ofetch';
3
4
  export interface TreeModels {
4
5
  active: string | null;
5
6
  tree: TreeItem[];
@@ -13,7 +14,7 @@ export interface TreeEmits {
13
14
  * Required pass instance of `useFetch`/`useAsyncData` with `{ immediate: false }`
14
15
  * Root path will be queried immediate with path `/`
15
16
  */
16
- export type TreeLoader = (path: string) => AsyncData<TreeItem[], unknown>;
17
+ export type TreeLoader = (path: string) => AsyncData<TreeItem[], FetchError<any>>;
17
18
  export type TreeItemType = 'file' | 'directory';
18
19
  export interface TreeItem {
19
20
  /** @IconifyIcon */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuance-ui",
3
- "version": "0.1.19",
3
+ "version": "0.1.21",
4
4
  "description": "A UI Library for Modern Web Apps, powered by Vue.",
5
5
  "repository": {
6
6
  "type": "git",