frappe-ui 0.1.233 → 0.1.234

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.233",
3
+ "version": "0.1.234",
4
4
  "description": "A set of components and utilities for rapid UI development",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -2,6 +2,8 @@
2
2
  import { ref } from 'vue'
3
3
  import Select from './Select.vue'
4
4
  import LucideUser from '~icons/lucide/user'
5
+ import LucideRotate from '~icons/lucide/rotate-ccw'
6
+ import { SelectItemText } from 'reka-ui'
5
7
 
6
8
  const value = ref('')
7
9
  const options = [
@@ -14,7 +16,7 @@ const options = [
14
16
  ]
15
17
  </script>
16
18
  <template>
17
- <Story :layout="{ width: 500, type: 'grid' }">
19
+ <Story :layout="{ width: 300, type: 'grid' }">
18
20
  <Variant title="Default">
19
21
  <div class="p-2">
20
22
  <Select :options="options" v-model="value" />
@@ -30,5 +32,47 @@ const options = [
30
32
  </Select>
31
33
  </div>
32
34
  </Variant>
35
+
36
+ <Variant title="Custom footer slot">
37
+ <div class="p-2">
38
+ <Select :options="options" v-model="value">
39
+ <template #footer>
40
+ <div class="grid gap-1">
41
+ <hr />
42
+ <Button variant='ghost'>
43
+ <template #prefix>
44
+ <LucideRotate class="size-4 text-ink-gray-9" />
45
+ </template>
46
+ Reset
47
+ </Button>
48
+ </div>
49
+ </template>
50
+ </Select>
51
+ </div>
52
+ </Variant>
53
+
54
+ <Variant title="Custom option slot">
55
+ <div class="p-2">
56
+ <Select :options="options" v-model="value">
57
+ <template #option="{ option }">
58
+ <div class="inline-flex gap-2 items-center">
59
+ <Avatar
60
+ size="sm"
61
+ image="https://avatars.fastly.steamstatic.com/9ebf36bd3dc6c34f2d79ccf5d63e00eb7866321e_full.jpg"
62
+ />
63
+ <SelectItemText> {{ option.label }} </SelectItemText>
64
+ </div>
65
+ </template>
66
+ </Select>
67
+ </div>
68
+ </Variant>
69
+
70
+ <Variant title="No suffix">
71
+ <div class="p-2">
72
+ <Select :options="options" v-model="value">
73
+ <template #suffix> {{ ' ' }} </template>
74
+ </Select>
75
+ </div>
76
+ </Variant>
33
77
  </Story>
34
78
  </template>
@@ -91,7 +91,9 @@ const selectOptions = computed(() => {
91
91
  >
92
92
  <slot name="prefix" />
93
93
  <SelectValue :placeholder="props.placeholder" />
94
- <LucideChevronDown class="size-4 text-ink-gray-4 ml-auto" />
94
+ <slot name="suffix">
95
+ <LucideChevronDown class="size-4 text-ink-gray-4 ml-auto" />
96
+ </slot>
95
97
  </SelectTrigger>
96
98
 
97
99
  <SelectPortal>
@@ -109,10 +111,14 @@ const selectOptions = computed(() => {
109
111
  :class="[sizeClasses, paddingClasses, fontSizeClasses]"
110
112
  class="text-base text-ink-gray-9 flex items-center relative data-[highlighted]:bg-surface-gray-2 border-0 [data-state=checked]:bg-surface-gray-2 data-[disabled]:text-ink-gray-4"
111
113
  >
112
- <SelectItemText>
113
- {{ option.label }}
114
- </SelectItemText>
114
+ <slot name="option" v-bind="{ option }">
115
+ <SelectItemText>
116
+ {{ option.label }}
117
+ </SelectItemText>
118
+ </slot>
115
119
  </SelectItem>
120
+
121
+ <slot name="footer" />
116
122
  </SelectViewport>
117
123
  </SelectContent>
118
124
  </SelectPortal>