@youcan/celeste 0.6.74 → 0.6.75

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 (72) hide show
  1. package/dist/celeste.css +178 -148
  2. package/dist/cjs/alert.js +1 -1
  3. package/dist/cjs/chunks/sidebar-separator.vue_vue_type_style_index_0_lang.js +1 -0
  4. package/dist/cjs/hint-text.js +1 -1
  5. package/dist/cjs/index.js +3 -3
  6. package/dist/cjs/scroll-area.js +42 -2
  7. package/dist/cjs/scroll-bar.js +7 -14
  8. package/dist/cjs/tooltip-content.js +1 -1
  9. package/dist/components/scroll-area/scroll-area.d.ts +1 -1
  10. package/dist/components/scroll-area/scroll-bar.d.ts +1 -1
  11. package/dist/es/alert.js +1 -1
  12. package/dist/es/checkbox-card.js +1 -1
  13. package/dist/es/checkbox-label.js +1 -1
  14. package/dist/es/chunks/content-divider.vue_vue_type_style_index_0_lang.js +1 -1
  15. package/dist/es/chunks/index.js +45 -45
  16. package/dist/es/chunks/sidebar-separator.vue_vue_type_style_index_0_lang.js +1 -0
  17. package/dist/es/combobox-empty.js +1 -1
  18. package/dist/es/combobox-group.js +1 -1
  19. package/dist/es/combobox-input.js +1 -1
  20. package/dist/es/combobox-item.js +1 -1
  21. package/dist/es/combobox-list.js +1 -1
  22. package/dist/es/combobox-root.js +1 -1
  23. package/dist/es/combobox-separator.js +1 -1
  24. package/dist/es/combobox-trigger.js +1 -1
  25. package/dist/es/command-group.js +1 -1
  26. package/dist/es/command-input.js +1 -1
  27. package/dist/es/command-item.js +1 -1
  28. package/dist/es/command-list.js +1 -1
  29. package/dist/es/command-root.js +1 -1
  30. package/dist/es/command-separator.js +1 -1
  31. package/dist/es/digit-input-slot.js +1 -1
  32. package/dist/es/digit-input.js +1 -1
  33. package/dist/es/dropdown-menu-content.js +1 -1
  34. package/dist/es/dropdown-menu-group.js +1 -1
  35. package/dist/es/dropdown-menu-item.js +1 -1
  36. package/dist/es/dropdown-menu-label.js +1 -1
  37. package/dist/es/dropdown-menu-separator.js +1 -1
  38. package/dist/es/dropdown-menu-sub-content.js +1 -1
  39. package/dist/es/dropdown-menu-sub-trigger.js +1 -1
  40. package/dist/es/dropdown-menu-trigger.js +1 -1
  41. package/dist/es/dropdown-menu.js +1 -1
  42. package/dist/es/hint-text.js +1 -1
  43. package/dist/es/index.js +87 -87
  44. package/dist/es/label.js +1 -1
  45. package/dist/es/modal-content.js +1 -1
  46. package/dist/es/modal-header.js +1 -1
  47. package/dist/es/pagination-content.js +1 -1
  48. package/dist/es/pagination-ellipsis.js +1 -1
  49. package/dist/es/pagination.js +1 -1
  50. package/dist/es/popover-content.js +1 -1
  51. package/dist/es/popover-trigger.js +1 -1
  52. package/dist/es/progress-bar.js +1 -1
  53. package/dist/es/progress-circle.js +1 -1
  54. package/dist/es/radio-group-card.js +1 -1
  55. package/dist/es/radio-group-label.js +1 -1
  56. package/dist/es/scroll-area.js +42 -2
  57. package/dist/es/scroll-bar.js +8 -15
  58. package/dist/es/sheet-content.js +1 -1
  59. package/dist/es/sheet-description.js +1 -1
  60. package/dist/es/sheet-title.js +1 -1
  61. package/dist/es/tab-menu-content.js +1 -1
  62. package/dist/es/tab-menu-item.js +1 -1
  63. package/dist/es/tooltip-content.js +1 -1
  64. package/package.json +3 -3
  65. package/src/components/alert/alert.vue +1 -1
  66. package/src/components/hint-text/hint-text.vue +1 -1
  67. package/src/components/scroll-area/scroll-area.vue +22 -8
  68. package/src/components/scroll-area/scroll-bar.vue +33 -17
  69. package/src/components/scroll-area/stories/scroll-area.stories.ts +184 -0
  70. package/src/components/tooltip/tooltip-content.vue +1 -0
  71. package/dist/cjs/chunks/scroll-area.js +0 -41
  72. package/dist/es/chunks/scroll-area.js +0 -42
@@ -1,4 +1,6 @@
1
1
  <script setup lang="ts">
2
+ import type { HTMLAttributes } from 'vue';
3
+ import { useDelegatedProps } from '@/composables';
2
4
  import clsx from 'clsx';
3
5
  import {
4
6
  ScrollAreaCorner,
@@ -6,24 +8,36 @@ import {
6
8
  type ScrollAreaRootProps,
7
9
  ScrollAreaViewport,
8
10
  } from 'radix-vue';
9
- import { computed, type HTMLAttributes } from 'vue';
10
11
  import ScrollBar from './scroll-bar.vue';
11
12
 
12
13
  const props = defineProps<ScrollAreaRootProps & { class?: HTMLAttributes['class'] }>();
13
14
 
14
- const delegatedProps = computed(() => {
15
- const { class: _, ...delegated } = props;
16
-
17
- return delegated;
18
- });
15
+ const delegatedProps = useDelegatedProps(props, 'class');
19
16
  </script>
20
17
 
21
18
  <template>
22
- <ScrollAreaRoot v-bind="delegatedProps" :class="clsx('relative overflow-hidden', props.class)">
23
- <ScrollAreaViewport class="h-full w-full rounded-[inherit]">
19
+ <ScrollAreaRoot
20
+ v-bind="delegatedProps"
21
+ :class="clsx('celeste-scroll-area', props.class)"
22
+ >
23
+ <ScrollAreaViewport class="celeste-scroll-area-viewport">
24
24
  <slot />
25
25
  </ScrollAreaViewport>
26
26
  <ScrollBar />
27
+ <ScrollBar orientation="horizontal" />
27
28
  <ScrollAreaCorner />
28
29
  </ScrollAreaRoot>
29
30
  </template>
31
+
32
+ <style scoped lang="scss">
33
+ .celeste-scroll-area {
34
+ position: relative;
35
+ overflow: hidden;
36
+ }
37
+
38
+ :deep(.celeste-scroll-area-viewport) {
39
+ width: 100%;
40
+ height: 100%;
41
+ border-radius: inherit;
42
+ }
43
+ </style>
@@ -1,36 +1,52 @@
1
1
  <script setup lang="ts">
2
+ import type { HTMLAttributes } from 'vue';
3
+ import { useDelegatedProps } from '@/composables';
2
4
  import clsx from 'clsx';
3
5
  import { ScrollAreaScrollbar, type ScrollAreaScrollbarProps, ScrollAreaThumb } from 'radix-vue';
4
- import { computed, type HTMLAttributes } from 'vue';
5
6
 
6
7
  const props = withDefaults(defineProps<ScrollAreaScrollbarProps & { class?: HTMLAttributes['class'] }>(), {
7
8
  orientation: 'vertical',
8
9
  });
9
10
 
10
- const delegatedProps = computed(() => {
11
- const { class: _, ...delegated } = props;
12
-
13
- return delegated;
14
- });
11
+ const delegatedProps = useDelegatedProps(props, 'class');
15
12
  </script>
16
13
 
17
14
  <template>
18
15
  <ScrollAreaScrollbar
19
16
  v-bind="delegatedProps"
20
- :class="
21
- clsx('flex touch-none select-none transition-colors',
22
- orientation === 'vertical'
23
- && 'h-full w-1.5 border-l border-l-transparent p-px',
24
- orientation === 'horizontal'
25
- && 'h-1.5 flex-col border-t border-t-transparent p-px',
26
- props.class)"
17
+ :class="clsx('celeste-scroll-bar', props.class)"
27
18
  >
28
- <ScrollAreaThumb class="thumb relative flex-1 rounded-full" />
19
+ <ScrollAreaThumb class="celeste-scroll-bar-thumb" />
29
20
  </ScrollAreaScrollbar>
30
21
  </template>
31
22
 
32
- <style scoped>
33
- .thumb {
34
- background-color: var(--color-bg-soft-200);
23
+ <style scoped lang="scss">
24
+ .celeste-scroll-bar {
25
+ --bar-size: 8px;
26
+
27
+ display: flex;
28
+ user-select: none;
29
+ touch-action: none;
30
+
31
+ &[data-orientation='vertical'] {
32
+ width: var(--bar-size);
33
+ height: 100%;
34
+ padding: var(--spacing-2);
35
+ border-inline-start: 1px solid transparent;
36
+ }
37
+
38
+ &[data-orientation='horizontal'] {
39
+ flex-direction: column;
40
+ height: var(--bar-size);
41
+ padding: var(--spacing-2);
42
+ border-block-start: 1px solid transparent;
43
+ }
44
+ }
45
+
46
+ .celeste-scroll-bar-thumb {
47
+ position: relative;
48
+ flex: 1;
49
+ border-radius: calc(infinity * 1px);
50
+ background-color: var(--color-bg-sub-300);
35
51
  }
36
52
  </style>
@@ -0,0 +1,184 @@
1
+ import type { Meta, StoryObj } from '@storybook/vue3-vite';
2
+ import ScrollBar from '@/components/scroll-area/scroll-bar.vue';
3
+ import ScrollArea from '../scroll-area.vue';
4
+
5
+ const meta: Meta<typeof ScrollArea> = {
6
+ title: 'Components/ScrollArea',
7
+ component: ScrollArea,
8
+ };
9
+
10
+ export default meta;
11
+
12
+ type Story = StoryObj<typeof ScrollArea>;
13
+
14
+ export const Default: Story = {
15
+ args: {},
16
+
17
+ render: args => ({
18
+ components: { ScrollArea },
19
+ setup() {
20
+ return { args };
21
+ },
22
+ template: `
23
+ <ScrollArea v-bind="args" style="height: 200px; width: 350px; border: 1px solid #e5e7eb; border-radius: 6px; padding: 8px;">
24
+ <div style="padding-right: 16px;">
25
+ <h4 style="margin-bottom: 16px; font-size: 14px; font-weight: 500;">Tags</h4>
26
+ <div style="display: flex; flex-direction: column; gap: 8px;">
27
+ <div v-for="tag in tags" :key="tag" style="font-size: 14px;">
28
+ {{ tag }}
29
+ </div>
30
+ </div>
31
+ </div>
32
+ </ScrollArea>
33
+ `,
34
+ data() {
35
+ return {
36
+ tags: Array.from({ length: 50 }).map(
37
+ (_, i, a) => `v1.2.0-beta.${a.length - i}`,
38
+ ),
39
+ };
40
+ },
41
+ }),
42
+ };
43
+
44
+ export const VerticalScroll: Story = {
45
+ args: {},
46
+
47
+ render: args => ({
48
+ components: { ScrollArea },
49
+ setup() {
50
+ return { args };
51
+ },
52
+ template: `
53
+ <ScrollArea v-bind="args" style="height: 300px; width: 450px; border: 1px solid #e5e7eb; border-radius: 6px; padding: 8px;">
54
+ <div style="display: flex; flex-direction: column; gap: 16px; padding-right: 16px;">
55
+ <div v-for="item in items" :key="item.id" style="border-radius: 8px; background-color: #f9fafb; padding: 8px;">
56
+ <h3 style="font-weight: 600; font-size: 14px; margin-bottom: 8px;">{{ item.title }}</h3>
57
+ <p style="font-size: 14px; color: #6b7280;">{{ item.description }}</p>
58
+ </div>
59
+ </div>
60
+ </ScrollArea>
61
+ `,
62
+ data() {
63
+ return {
64
+ items: Array.from({ length: 20 }).map((_, i) => ({
65
+ id: i + 1,
66
+ title: `Item ${i + 1}`,
67
+ description: 'This is a sample description for the scroll area item. It demonstrates vertical scrolling.',
68
+ })),
69
+ };
70
+ },
71
+ }),
72
+ };
73
+
74
+ export const HorizontalScroll: Story = {
75
+ args: {},
76
+
77
+ render: args => ({
78
+ components: { ScrollArea },
79
+ setup() {
80
+ return { args };
81
+ },
82
+ template: `
83
+ <ScrollArea v-bind="args" style="width: 600px; white-space: nowrap; border: 1px solid #e5e7eb; border-radius: 6px;">
84
+ <div style="display: flex; width: max-content; gap: 16px; padding: 8px;">
85
+ <div v-for="item in items" :key="item" style="flex-shrink: 0;">
86
+ <div style="height: 150px; width: 150px; border-radius: 6px; background-color: #f3f4f6; display: flex; align-items: center; justify-content: center;">
87
+ <span style="font-size: 14px; font-weight: 500;">{{ item }}</span>
88
+ </div>
89
+ </div>
90
+ </div>
91
+ </ScrollArea>
92
+ `,
93
+ data() {
94
+ return {
95
+ items: Array.from({ length: 15 }).map((_, i) => `Card ${i + 1}`),
96
+ };
97
+ },
98
+ }),
99
+ };
100
+
101
+ export const BothDirections: Story = {
102
+ args: {},
103
+
104
+ render: args => ({
105
+ components: { ScrollArea },
106
+ setup() {
107
+ return { args };
108
+ },
109
+ template: `
110
+ <ScrollArea v-bind="args" style="height: 400px; width: 500px; border: 1px solid #e5e7eb; border-radius: 6px;">
111
+ <div style="padding: 8px;">
112
+ <table style="width: max-content;">
113
+ <thead>
114
+ <tr style="border-bottom: 1px solid #e5e7eb;">
115
+ <th v-for="col in columns" :key="col" style="padding: 8px 16px; text-align: left; font-size: 14px; font-weight: 500;">
116
+ {{ col }}
117
+ </th>
118
+ </tr>
119
+ </thead>
120
+ <tbody>
121
+ <tr v-for="row in rows" :key="row" style="border-bottom: 1px solid #e5e7eb;">
122
+ <td v-for="col in columns" :key="col" style="padding: 8px 16px; font-size: 14px;">
123
+ Cell {{ row }}-{{ col }}
124
+ </td>
125
+ </tr>
126
+ </tbody>
127
+ </table>
128
+ </div>
129
+ </ScrollArea>
130
+ `,
131
+ data() {
132
+ return {
133
+ columns: Array.from({ length: 10 }).map((_, i) => `Column ${i + 1}`),
134
+ rows: Array.from({ length: 30 }).map((_, i) => i + 1),
135
+ };
136
+ },
137
+ }),
138
+ };
139
+
140
+ export const LongContent: Story = {
141
+ args: {},
142
+
143
+ render: args => ({
144
+ components: { ScrollArea },
145
+ setup() {
146
+ return { args };
147
+ },
148
+ template: `
149
+ <ScrollArea v-bind="args" style="height: 500px; width: 700px; border: 1px solid #e5e7eb; border-radius: 6px; padding: 16px;">
150
+ <div style="padding-right: 16px;">
151
+ <h1 style="font-size: 24px; font-weight: 700; margin-bottom: 16px;">Lorem Ipsum</h1>
152
+ <p v-for="i in 15" :key="i" style="margin-bottom: 16px; line-height: 1.6;">
153
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor
154
+ incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
155
+ exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute
156
+ irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
157
+ pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia
158
+ deserunt mollit anim id est laborum.
159
+ </p>
160
+ </div>
161
+ </ScrollArea>
162
+ `,
163
+ }),
164
+ };
165
+
166
+ export const CustomStyling: Story = {
167
+ args: {},
168
+
169
+ render: args => ({
170
+ components: { ScrollArea, ScrollBar },
171
+ setup() {
172
+ return { args };
173
+ },
174
+ template: `
175
+ <ScrollArea v-bind="args" style="height: 250px; width: 400px; border-radius: 8px; border: 2px solid #c7d2fe; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); padding: 12px; background: linear-gradient(to bottom right, #eff6ff, #eef2ff);">
176
+ <div style="display: flex; flex-direction: column; gap: 12px; padding-right: 16px;">
177
+ <div v-for="n in 20" :key="n" style="border-radius: 6px; background-color: white; padding: 12px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);">
178
+ <p style="font-size: 14px; font-weight: 500; color: #312e81;">Custom styled item {{ n }}</p>
179
+ </div>
180
+ </div>
181
+ </ScrollArea>
182
+ `,
183
+ }),
184
+ };
@@ -70,6 +70,7 @@ export interface TooltipContentProps extends PrimitiveProps {
70
70
  :deep(.celeste-tooltip-content) {
71
71
  display: flex;
72
72
  position: relative;
73
+ z-index: 50;
73
74
  align-items: flex-start;
74
75
  width: auto;
75
76
  max-width: calc(var(--radix-tooltip-content-available-width) / 1.5);
@@ -1,41 +0,0 @@
1
- "use strict";
2
- const No = require("vue");
3
- const clsx = require("./clsx.js");
4
- const index = require("./index.js");
5
- const scrollBar = require("../scroll-bar.js");
6
- const _sfc_main = /* @__PURE__ */ No.defineComponent({
7
- __name: "scroll-area",
8
- props: {
9
- type: {},
10
- dir: {},
11
- scrollHideDelay: {},
12
- asChild: { type: Boolean },
13
- as: {},
14
- class: {}
15
- },
16
- setup(__props) {
17
- const props = __props;
18
- const delegatedProps = No.computed(() => {
19
- const { class: _, ...delegated } = props;
20
- return delegated;
21
- });
22
- return (_ctx, _cache) => {
23
- return No.openBlock(), No.createBlock(No.unref(index.Vy), No.mergeProps(delegatedProps.value, {
24
- class: No.unref(clsx.clsx)("relative overflow-hidden", props.class)
25
- }), {
26
- default: No.withCtx(() => [
27
- No.createVNode(No.unref(index.Fy), { class: "h-full w-full rounded-[inherit]" }, {
28
- default: No.withCtx(() => [
29
- No.renderSlot(_ctx.$slots, "default")
30
- ]),
31
- _: 3
32
- }),
33
- No.createVNode(scrollBar),
34
- No.createVNode(No.unref(index.zy))
35
- ]),
36
- _: 3
37
- }, 16, ["class"]);
38
- };
39
- }
40
- });
41
- exports._sfc_main = _sfc_main;
@@ -1,42 +0,0 @@
1
- import { defineComponent, computed, createBlock, openBlock, unref, mergeProps, withCtx, createVNode, renderSlot } from "vue";
2
- import { c as clsx } from "./clsx.js";
3
- import { V as Vy, F as Fy, z as zy } from "./index.js";
4
- import ScrollBar from "../scroll-bar.js";
5
- const _sfc_main = /* @__PURE__ */ defineComponent({
6
- __name: "scroll-area",
7
- props: {
8
- type: {},
9
- dir: {},
10
- scrollHideDelay: {},
11
- asChild: { type: Boolean },
12
- as: {},
13
- class: {}
14
- },
15
- setup(__props) {
16
- const props = __props;
17
- const delegatedProps = computed(() => {
18
- const { class: _, ...delegated } = props;
19
- return delegated;
20
- });
21
- return (_ctx, _cache) => {
22
- return openBlock(), createBlock(unref(Vy), mergeProps(delegatedProps.value, {
23
- class: unref(clsx)("relative overflow-hidden", props.class)
24
- }), {
25
- default: withCtx(() => [
26
- createVNode(unref(Fy), { class: "h-full w-full rounded-[inherit]" }, {
27
- default: withCtx(() => [
28
- renderSlot(_ctx.$slots, "default")
29
- ]),
30
- _: 3
31
- }),
32
- createVNode(ScrollBar),
33
- createVNode(unref(zy))
34
- ]),
35
- _: 3
36
- }, 16, ["class"]);
37
- };
38
- }
39
- });
40
- export {
41
- _sfc_main as _
42
- };