pimelon-ui 0.1.232 → 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": "pimelon-ui",
3
- "version": "0.1.232",
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>
@@ -12,11 +12,11 @@ import { h } from 'vue'
12
12
 
13
13
  const props = defineProps<TabProps>()
14
14
 
15
- const indicatorXCss = `left-0 bottom-0 h-[2px] w-[--reka-tabs-indicator-size] transition-[width,transform]
15
+ const indicatorXCss = `left-0 bottom-0 h-[2px] w-[--reka-tabs-indicator-size] transition-[width,transform]
16
16
  translate-x-[--reka-tabs-indicator-position] translate-y-[1px]`
17
17
 
18
- const indicatorYCss = `right-0 w-[1px] h-[--reka-tabs-indicator-size] transition-[height,transform]
19
- translate-y-[--reka-tabs-indicator-position] translate-x-[1px]`
18
+ const indicatorYCss = `right-0 top-0 w-[2px] h-[--reka-tabs-indicator-size]
19
+ translate-y-[--reka-tabs-indicator-position] transition-[height,transform]`
20
20
 
21
21
  // Using a plain <button> element via `h('button')` to avoid picking up
22
22
  // the globally registered Button component and its styles.
@@ -31,8 +31,11 @@ const Btn = h('button')
31
31
  :default-value="props.tabs[0].label"
32
32
  >
33
33
  <TabsList
34
- class="relative min-h-fit flex data-[orientation=vertical]:flex-col p-1 border-b data-[orientation=vertical]:border-r "
35
- :class="{ 'overflow-x-auto overflow-y-hidden': !props.vertical }"
34
+ class="relative min-h-fit flex data-[orientation=vertical]:flex-col p-1 border-b data-[orientation=vertical]:border-r gap-5"
35
+ :class="{
36
+ 'overflow-x-auto overflow-y-hidden px-5': !props.vertical,
37
+ 'py-3': props.vertical,
38
+ }"
36
39
  >
37
40
  <TabsIndicator
38
41
  class="absolute rounded-full duration-300"
@@ -46,8 +49,8 @@ const Btn = h('button')
46
49
  <component
47
50
  :is="tab.route ? 'router-link' : Btn"
48
51
  :to="tab.route"
49
- class="flex items-center gap-1.5 text-base text-ink-gray-5 duration-300 ease-in-out hover:text-ink-gray-9 p-2.5 data-[state=active]:text-ink-gray-9"
50
- :class="{ 'py-2.5': props.vertical }"
52
+ class="flex items-center gap-1.5 text-base text-ink-gray-5 duration-300 ease-in-out hover:text-ink-gray-9 data-[state=active]:text-ink-gray-9"
53
+ :class="{ 'px-2.5': props.vertical, 'py-2.5': !props.vertical }"
51
54
  >
52
55
  <component v-if="tab.icon" :is="tab.icon" class="size-4">
53
56
  </component>