frappe-ui 0.1.190 → 0.1.192

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "frappe-ui",
3
- "version": "0.1.190",
3
+ "version": "0.1.192",
4
4
  "description": "A set of components and utilities for rapid UI development",
5
5
  "main": "./src/index.ts",
6
6
  "type": "module",
@@ -1,66 +1,64 @@
1
1
  <template>
2
2
  <Tooltip :text="tooltip" :disabled="!tooltip?.length">
3
- <div class="flex h-fit w-fit">
4
- <button
5
- v-bind="$attrs"
6
- :class="buttonClasses"
7
- @click="handleClick"
8
- :disabled="isDisabled"
9
- :ariaLabel="ariaLabel"
10
- ref="rootRef"
11
- >
12
- <LoadingIndicator
13
- v-if="loading"
14
- :class="{
15
- 'h-3 w-3': size == 'sm',
16
- 'h-[13.5px] w-[13.5px]': size == 'md',
17
- 'h-[15px] w-[15px]': size == 'lg',
18
- 'h-4.5 w-4.5': size == 'xl' || size == '2xl',
19
- }"
3
+ <button
4
+ v-bind="$attrs"
5
+ :class="buttonClasses"
6
+ @click="handleClick"
7
+ :disabled="isDisabled"
8
+ :ariaLabel="ariaLabel"
9
+ ref="rootRef"
10
+ >
11
+ <LoadingIndicator
12
+ v-if="loading"
13
+ :class="{
14
+ 'h-3 w-3': size == 'sm',
15
+ 'h-[13.5px] w-[13.5px]': size == 'md',
16
+ 'h-[15px] w-[15px]': size == 'lg',
17
+ 'h-4.5 w-4.5': size == 'xl' || size == '2xl',
18
+ }"
19
+ />
20
+ <slot name="prefix" v-else-if="$slots['prefix'] || iconLeft">
21
+ <FeatherIcon
22
+ v-if="iconLeft && typeof iconLeft === 'string'"
23
+ :name="iconLeft"
24
+ :class="slotClasses"
25
+ aria-hidden="true"
20
26
  />
21
- <slot name="prefix" v-else-if="$slots['prefix'] || iconLeft">
22
- <FeatherIcon
23
- v-if="iconLeft && typeof iconLeft === 'string'"
24
- :name="iconLeft"
25
- :class="slotClasses"
26
- aria-hidden="true"
27
- />
28
- <component v-else-if="iconLeft" :is="iconLeft" :class="slotClasses" />
29
- </slot>
30
-
31
- <template v-if="loading && loadingText">{{ loadingText }}</template>
32
- <template v-else-if="isIconButton && !loading">
33
- <FeatherIcon
34
- v-if="icon && typeof icon === 'string'"
35
- :name="icon"
36
- :class="slotClasses"
37
- :aria-label="label"
38
- />
39
- <component v-else-if="icon" :is="icon" :class="slotClasses" />
40
- <slot name="icon" v-else-if="$slots.icon" />
41
- <div v-else-if="hasLucideIconInDefaultSlot" :class="slotClasses">
42
- <slot>{{ label }}</slot>
43
- </div>
44
- </template>
45
- <span v-else :class="{ 'sr-only': isIconButton }" class="truncate">
27
+ <component v-else-if="iconLeft" :is="iconLeft" :class="slotClasses" />
28
+ </slot>
29
+
30
+ <template v-if="loading && loadingText">{{ loadingText }}</template>
31
+ <template v-else-if="isIconButton && !loading">
32
+ <FeatherIcon
33
+ v-if="icon && typeof icon === 'string'"
34
+ :name="icon"
35
+ :class="slotClasses"
36
+ :aria-label="label"
37
+ />
38
+ <component v-else-if="icon" :is="icon" :class="slotClasses" />
39
+ <slot name="icon" v-else-if="$slots.icon" />
40
+ <div v-else-if="hasLucideIconInDefaultSlot" :class="slotClasses">
46
41
  <slot>{{ label }}</slot>
47
- </span>
48
-
49
- <slot name="suffix">
50
- <FeatherIcon
51
- v-if="iconRight && typeof iconRight === 'string'"
52
- :name="iconRight"
53
- :class="slotClasses"
54
- aria-hidden="true"
55
- />
42
+ </div>
43
+ </template>
44
+ <span v-else :class="{ 'sr-only': isIconButton }" class="truncate">
45
+ <slot>{{ label }}</slot>
46
+ </span>
47
+
48
+ <slot name="suffix">
49
+ <FeatherIcon
50
+ v-if="iconRight && typeof iconRight === 'string'"
51
+ :name="iconRight"
52
+ :class="slotClasses"
53
+ aria-hidden="true"
54
+ />
56
55
  <component
57
56
  v-else-if="iconRight"
58
57
  :is="iconRight"
59
58
  :class="slotClasses"
60
59
  />
61
- </slot>
62
- </button>
63
- </div>
60
+ </slot>
61
+ </button>
64
62
  </Tooltip>
65
63
  </template>
66
64
  <script lang="ts" setup>
@@ -179,7 +177,7 @@ const buttonClasses = computed(() => {
179
177
  }
180
178
 
181
179
  return [
182
- 'inline-flex items-center justify-center gap-2 transition-colors focus:outline-none',
180
+ 'inline-flex items-center justify-center gap-2 transition-colors focus:outline-none shrink-0',
183
181
  isDisabled.value ? disabledClasses : variantClasses,
184
182
  focusClasses,
185
183
  sizeClasses,
@@ -9,6 +9,7 @@
9
9
  : 'hover:bg-surface-gray-2'
10
10
  "
11
11
  variant="ghost"
12
+ :accesskey="props.accessKey"
12
13
  >
13
14
  <template #icon>
14
15
  <div
@@ -44,6 +44,7 @@
44
44
  v-for="item in props.items"
45
45
  :key="item.label"
46
46
  :label="item.label"
47
+ :accessKey="item.accessKey"
47
48
  :icon="item.icon"
48
49
  :suffix="item.suffix"
49
50
  :to="item.to"
@@ -13,6 +13,7 @@ export type SidebarHeaderProps = {
13
13
 
14
14
  export type SidebarItemProps = {
15
15
  label: string
16
+ accessKey?: string
16
17
  icon?: any // Icon component
17
18
  suffix?: string
18
19
  to?: RouteLocationRaw
@@ -34,7 +34,7 @@ const delayDuration = computed(() => props.hoverDelay * 1000)
34
34
  </TooltipTrigger>
35
35
  <TooltipPortal>
36
36
  <TooltipContent
37
- v-if="props.text || $slots.body"
37
+ v-if="props.text || $slots.body || $slots.content"
38
38
  :side="props.placement"
39
39
  :side-offset="4"
40
40
  class="z-[100]"