@youcan/celeste 0.6.56 → 0.6.57
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/celeste.css +146 -52
- package/dist/cjs/chunks/use-color-model.js +3 -0
- package/dist/cjs/table-body.js +23 -0
- package/dist/cjs/table-caption.js +23 -0
- package/dist/cjs/table-cell.js +25 -0
- package/dist/cjs/table-empty.js +43 -0
- package/dist/cjs/table-footer.js +23 -0
- package/dist/cjs/table-head.js +24 -0
- package/dist/cjs/table-header.js +20 -0
- package/dist/cjs/table-row.js +31 -0
- package/dist/cjs/table.js +26 -0
- package/dist/components/table/index.d.ts +18 -0
- package/dist/components/table/table-body.d.ts +13 -0
- package/dist/components/table/table-caption.d.ts +13 -0
- package/dist/components/table/table-cell.d.ts +16 -0
- package/dist/components/table/table-empty.d.ts +16 -0
- package/dist/components/table/table-footer.d.ts +13 -0
- package/dist/components/table/table-head.d.ts +16 -0
- package/dist/components/table/table-header.d.ts +13 -0
- package/dist/components/table/table-row.d.ts +16 -0
- package/dist/components/table/table.d.ts +13 -0
- package/dist/es/checkbox-card.js +1 -1
- package/dist/es/checkbox-label.js +1 -1
- package/dist/es/chunks/index.js +56 -56
- package/dist/es/chunks/modal-close.js +1 -1
- package/dist/es/chunks/select-group.js +1 -1
- package/dist/es/chunks/use-color-model.js +3 -0
- package/dist/es/combobox-group.js +1 -1
- package/dist/es/combobox-input.js +1 -1
- package/dist/es/combobox-item.js +1 -1
- package/dist/es/combobox-list.js +1 -1
- package/dist/es/combobox-root.js +1 -1
- package/dist/es/combobox-separator.js +1 -1
- package/dist/es/combobox-trigger.js +1 -1
- package/dist/es/command-group.js +1 -1
- package/dist/es/command-input.js +1 -1
- package/dist/es/command-item.js +1 -1
- package/dist/es/command-list.js +1 -1
- package/dist/es/command-root.js +1 -1
- package/dist/es/command-separator.js +1 -1
- package/dist/es/digit-input-slot.js +1 -1
- package/dist/es/digit-input.js +1 -1
- package/dist/es/dropdown-menu-content.js +1 -1
- package/dist/es/dropdown-menu-group.js +1 -1
- package/dist/es/dropdown-menu-item.js +1 -1
- package/dist/es/dropdown-menu-label.js +1 -1
- package/dist/es/dropdown-menu-separator.js +1 -1
- package/dist/es/dropdown-menu-sub-content.js +1 -1
- package/dist/es/dropdown-menu-sub-trigger.js +1 -1
- package/dist/es/dropdown-menu-trigger.js +1 -1
- package/dist/es/dropdown-menu.js +1 -1
- package/dist/es/label.js +1 -1
- package/dist/es/modal-content.js +1 -1
- package/dist/es/modal-header.js +1 -1
- package/dist/es/popover-content.js +1 -1
- package/dist/es/popover-trigger.js +1 -1
- package/dist/es/progress-bar.js +1 -1
- package/dist/es/progress-circle.js +1 -1
- package/dist/es/radio-group-card.js +1 -1
- package/dist/es/radio-group-label.js +1 -1
- package/dist/es/scroll-bar.js +1 -1
- package/dist/es/segmented-control-item.js +1 -1
- package/dist/es/segmented-control.js +1 -1
- package/dist/es/select-content.js +1 -1
- package/dist/es/select-item.js +1 -1
- package/dist/es/select-trigger.js +1 -1
- package/dist/es/select-value.js +1 -1
- package/dist/es/table-body.js +24 -0
- package/dist/es/table-caption.js +24 -0
- package/dist/es/table-cell.js +26 -0
- package/dist/es/table-empty.js +44 -0
- package/dist/es/table-footer.js +24 -0
- package/dist/es/table-head.js +25 -0
- package/dist/es/table-header.js +21 -0
- package/dist/es/table-row.js +32 -0
- package/dist/es/table.js +27 -0
- package/dist/es/tooltip.js +1 -1
- package/package.json +4 -3
- package/src/components/color-picker/composable/use-color-model.ts +4 -0
- package/src/components/table/index.ts +26 -0
- package/src/components/table/stories/table.stories.ts +138 -0
- package/src/components/table/table-body.vue +24 -0
- package/src/components/table/table-caption.vue +26 -0
- package/src/components/table/table-cell.vue +49 -0
- package/src/components/table/table-empty.vue +43 -0
- package/src/components/table/table-footer.vue +24 -0
- package/src/components/table/table-head.vue +47 -0
- package/src/components/table/table-header.vue +18 -0
- package/src/components/table/table-row.vue +52 -0
- package/src/components/table/table.vue +36 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, normalizeClass, unref, renderSlot } from "vue";
|
|
2
|
+
import { c as clsx } from "./chunks/clsx.js";
|
|
3
|
+
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
4
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
|
+
__name: "table-cell",
|
|
6
|
+
props: {
|
|
7
|
+
class: {},
|
|
8
|
+
end: { type: Boolean, default: false }
|
|
9
|
+
},
|
|
10
|
+
setup(__props) {
|
|
11
|
+
const props = __props;
|
|
12
|
+
return (_ctx, _cache) => {
|
|
13
|
+
return openBlock(), createElementBlock("td", {
|
|
14
|
+
class: normalizeClass(unref(clsx)("celeste-table-cell", props.class, {
|
|
15
|
+
"celeste-table-cell-align-end": props.end
|
|
16
|
+
}))
|
|
17
|
+
}, [
|
|
18
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
19
|
+
], 2);
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const TableCell = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5f65ee4a"]]);
|
|
24
|
+
export {
|
|
25
|
+
TableCell as default
|
|
26
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { defineComponent, openBlock, createBlock, unref, withCtx, createVNode, mergeProps, createElementVNode, renderSlot } from "vue";
|
|
2
|
+
import { c as clsx } from "./chunks/clsx.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
/* empty css */
|
|
5
|
+
import TableCell from "./table-cell.js";
|
|
6
|
+
import { useDelegatedProps } from "./use-delegated-props.js";
|
|
7
|
+
/* empty css */
|
|
8
|
+
/* empty css */
|
|
9
|
+
import TableRow from "./table-row.js";
|
|
10
|
+
/* empty css */
|
|
11
|
+
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
12
|
+
const _hoisted_1 = { class: "celeste-table-empty-content" };
|
|
13
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
14
|
+
__name: "table-empty",
|
|
15
|
+
props: {
|
|
16
|
+
colspan: { default: 1 },
|
|
17
|
+
class: {}
|
|
18
|
+
},
|
|
19
|
+
setup(__props) {
|
|
20
|
+
const props = __props;
|
|
21
|
+
const delegated = useDelegatedProps(props, "class");
|
|
22
|
+
return (_ctx, _cache) => {
|
|
23
|
+
return openBlock(), createBlock(unref(TableRow), null, {
|
|
24
|
+
default: withCtx(() => [
|
|
25
|
+
createVNode(unref(TableCell), mergeProps(unref(delegated), {
|
|
26
|
+
class: unref(clsx)("celeste-table-empty", props.class)
|
|
27
|
+
}), {
|
|
28
|
+
default: withCtx(() => [
|
|
29
|
+
createElementVNode("div", _hoisted_1, [
|
|
30
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
31
|
+
])
|
|
32
|
+
]),
|
|
33
|
+
_: 3
|
|
34
|
+
}, 16, ["class"])
|
|
35
|
+
]),
|
|
36
|
+
_: 3
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
const tableEmpty = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-1c0042ab"]]);
|
|
42
|
+
export {
|
|
43
|
+
tableEmpty as default
|
|
44
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, normalizeClass, unref, renderSlot } from "vue";
|
|
2
|
+
import { c as clsx } from "./chunks/clsx.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
5
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
+
__name: "table-footer",
|
|
7
|
+
props: {
|
|
8
|
+
class: {}
|
|
9
|
+
},
|
|
10
|
+
setup(__props) {
|
|
11
|
+
const props = __props;
|
|
12
|
+
return (_ctx, _cache) => {
|
|
13
|
+
return openBlock(), createElementBlock("tfoot", {
|
|
14
|
+
class: normalizeClass(unref(clsx)("celeste-table-footer", props.class))
|
|
15
|
+
}, [
|
|
16
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
17
|
+
], 2);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
const tableFooter = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-50b76b8f"]]);
|
|
22
|
+
export {
|
|
23
|
+
tableFooter as default
|
|
24
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, normalizeClass, unref, renderSlot } from "vue";
|
|
2
|
+
import { c as clsx } from "./chunks/clsx.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
5
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
+
__name: "table-head",
|
|
7
|
+
props: {
|
|
8
|
+
class: {},
|
|
9
|
+
end: { type: Boolean, default: false }
|
|
10
|
+
},
|
|
11
|
+
setup(__props) {
|
|
12
|
+
const props = __props;
|
|
13
|
+
return (_ctx, _cache) => {
|
|
14
|
+
return openBlock(), createElementBlock("th", {
|
|
15
|
+
class: normalizeClass(unref(clsx)("celeste-table-head", props.class, { "celeste-table-head-align-end": props.end }))
|
|
16
|
+
}, [
|
|
17
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
18
|
+
], 2);
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
const tableHead = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-76a52252"]]);
|
|
23
|
+
export {
|
|
24
|
+
tableHead as default
|
|
25
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, normalizeClass, unref, renderSlot } from "vue";
|
|
2
|
+
import { c as clsx } from "./chunks/clsx.js";
|
|
3
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4
|
+
__name: "table-header",
|
|
5
|
+
props: {
|
|
6
|
+
class: {}
|
|
7
|
+
},
|
|
8
|
+
setup(__props) {
|
|
9
|
+
const props = __props;
|
|
10
|
+
return (_ctx, _cache) => {
|
|
11
|
+
return openBlock(), createElementBlock("thead", {
|
|
12
|
+
class: normalizeClass(unref(clsx)("celeste-table-header", props.class))
|
|
13
|
+
}, [
|
|
14
|
+
renderSlot(_ctx.$slots, "default")
|
|
15
|
+
], 2);
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
export {
|
|
20
|
+
_sfc_main as default
|
|
21
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, Fragment, createElementVNode, normalizeClass, unref, renderSlot } from "vue";
|
|
2
|
+
import { c as clsx } from "./chunks/clsx.js";
|
|
3
|
+
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
4
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
|
+
__name: "table-row",
|
|
6
|
+
props: {
|
|
7
|
+
class: {},
|
|
8
|
+
hoverable: { type: Boolean, default: true }
|
|
9
|
+
},
|
|
10
|
+
setup(__props) {
|
|
11
|
+
const props = __props;
|
|
12
|
+
return (_ctx, _cache) => {
|
|
13
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
14
|
+
createElementVNode("tr", {
|
|
15
|
+
class: normalizeClass(unref(clsx)("celeste-table-row", props.class, { "celeste-table-row-hoverable": props.hoverable }))
|
|
16
|
+
}, [
|
|
17
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
18
|
+
], 2),
|
|
19
|
+
_cache[0] || (_cache[0] = createElementVNode("tr", {
|
|
20
|
+
"aria-hidden": "true",
|
|
21
|
+
class: "celeste-table-row-divider"
|
|
22
|
+
}, [
|
|
23
|
+
createElementVNode("td", { colspan: "100" })
|
|
24
|
+
], -1))
|
|
25
|
+
], 64);
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
const TableRow = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5a7011d2"]]);
|
|
30
|
+
export {
|
|
31
|
+
TableRow as default
|
|
32
|
+
};
|
package/dist/es/table.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, createElementVNode, normalizeClass, unref, renderSlot } from "vue";
|
|
2
|
+
import { c as clsx } from "./chunks/clsx.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
5
|
+
const _hoisted_1 = { class: "celeste-table-wrapper" };
|
|
6
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
|
+
__name: "table",
|
|
8
|
+
props: {
|
|
9
|
+
class: {}
|
|
10
|
+
},
|
|
11
|
+
setup(__props) {
|
|
12
|
+
const props = __props;
|
|
13
|
+
return (_ctx, _cache) => {
|
|
14
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
15
|
+
createElementVNode("table", {
|
|
16
|
+
class: normalizeClass(unref(clsx)("celeste-table", props.class))
|
|
17
|
+
}, [
|
|
18
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
19
|
+
], 2)
|
|
20
|
+
]);
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
const table = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8ed967fe"]]);
|
|
25
|
+
export {
|
|
26
|
+
table as default
|
|
27
|
+
};
|
package/dist/es/tooltip.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, ref, openBlock, createBlock, unref, withCtx, createVNode, mergeProps, renderSlot, createElementBlock, normalizeClass, createCommentVNode, createElementVNode, toDisplayString } from "vue";
|
|
2
2
|
import CompactButton from "./compact-button.js";
|
|
3
3
|
import { c as clsx } from "./chunks/clsx.js";
|
|
4
|
-
import { x as xe,
|
|
4
|
+
import { x as xe, aC as Lg, aD as zg, aE as Kg, aF as jg, aG as Hg, aH as Wg } from "./chunks/index.js";
|
|
5
5
|
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
6
6
|
const _hoisted_1 = { class: "celeste-tooltip-content-box" };
|
|
7
7
|
const _hoisted_2 = {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@youcan/celeste",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.6.
|
|
4
|
+
"version": "0.6.57",
|
|
5
5
|
"author": "YouCan <tech@youcan.shop>",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"youcan",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"radix-vue": "^1.9.12",
|
|
45
45
|
"tinycolor2": "^1.6.0",
|
|
46
46
|
"vue-sonner": "^2.0.2",
|
|
47
|
-
"@youcan/celeste-icons": "0.6.
|
|
48
|
-
"@youcan/celeste-tokens": "0.6.
|
|
47
|
+
"@youcan/celeste-icons": "0.6.57",
|
|
48
|
+
"@youcan/celeste-tokens": "0.6.57"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@chromatic-com/storybook": "^4.1.1",
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"@storybook/addon-knobs": "^8.0.1",
|
|
54
54
|
"@storybook/addon-onboarding": "^9.1.10",
|
|
55
55
|
"@storybook/vue3-vite": "^9.1.10",
|
|
56
|
+
"@tanstack/vue-table": "^8.20.5",
|
|
56
57
|
"@tsconfig/node20": "^20.1.4",
|
|
57
58
|
"@types/jsdom": "^21.1.7",
|
|
58
59
|
"@types/tinycolor2": "^1.4.6",
|
|
@@ -36,5 +36,9 @@ export function defineColorModel(props: useTinyColorModelProps, emit: any): Writ
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
function transformToOriginalInputFormat(color: tinycolor.Instance, originalFormat?: TinyColorFormat): any {
|
|
39
|
+
if (originalFormat === 'hex' && color.getAlpha() < 1) {
|
|
40
|
+
return color.toString('hex8');
|
|
41
|
+
}
|
|
42
|
+
|
|
39
43
|
return color.toString(originalFormat);
|
|
40
44
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export * from './table-body.vue';
|
|
2
|
+
export { default as TableBody } from './table-body.vue';
|
|
3
|
+
|
|
4
|
+
export * from './table-caption.vue';
|
|
5
|
+
export { default as TableCaption } from './table-caption.vue';
|
|
6
|
+
|
|
7
|
+
export * from './table-cell.vue';
|
|
8
|
+
export { default as TableCell } from './table-cell.vue';
|
|
9
|
+
|
|
10
|
+
export * from './table-empty.vue';
|
|
11
|
+
export { default as TableEmpty } from './table-empty.vue';
|
|
12
|
+
|
|
13
|
+
export * from './table-footer.vue';
|
|
14
|
+
export { default as TableFooter } from './table-footer.vue';
|
|
15
|
+
|
|
16
|
+
export * from './table-head.vue';
|
|
17
|
+
export { default as TableHead } from './table-head.vue';
|
|
18
|
+
|
|
19
|
+
export * from './table-header.vue';
|
|
20
|
+
export { default as TableHeader } from './table-header.vue';
|
|
21
|
+
|
|
22
|
+
export * from './table-row.vue';
|
|
23
|
+
export { default as TableRow } from './table-row.vue';
|
|
24
|
+
|
|
25
|
+
export * from './table.vue';
|
|
26
|
+
export { default as Table } from './table.vue';
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3-vite';
|
|
2
|
+
import Badge from '../../badge/badge.vue';
|
|
3
|
+
import TableBody from '../table-body.vue';
|
|
4
|
+
import TableCaption from '../table-caption.vue';
|
|
5
|
+
import TableCell from '../table-cell.vue';
|
|
6
|
+
import TableEmpty from '../table-empty.vue';
|
|
7
|
+
import TableFooter from '../table-footer.vue';
|
|
8
|
+
import TableHead from '../table-head.vue';
|
|
9
|
+
import TableHeader from '../table-header.vue';
|
|
10
|
+
import TableRow from '../table-row.vue';
|
|
11
|
+
import Table from '../table.vue';
|
|
12
|
+
|
|
13
|
+
const meta: Meta<typeof Table> = {
|
|
14
|
+
title: 'Components/Table',
|
|
15
|
+
component: Table,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default meta;
|
|
19
|
+
|
|
20
|
+
type Story = StoryObj<typeof Table>;
|
|
21
|
+
|
|
22
|
+
const invoices = [
|
|
23
|
+
{
|
|
24
|
+
invoice: 'INV001',
|
|
25
|
+
paymentStatus: 'Paid',
|
|
26
|
+
totalAmount: '$250.00',
|
|
27
|
+
paymentMethod: 'Credit Card',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
invoice: 'INV002',
|
|
31
|
+
paymentStatus: 'Pending',
|
|
32
|
+
totalAmount: '$150.00',
|
|
33
|
+
paymentMethod: 'PayPal',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
invoice: 'INV003',
|
|
37
|
+
paymentStatus: 'Unpaid',
|
|
38
|
+
totalAmount: '$350.00',
|
|
39
|
+
paymentMethod: 'Bank Transfer',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
invoice: 'INV004',
|
|
43
|
+
paymentStatus: 'Paid',
|
|
44
|
+
totalAmount: '$450.00',
|
|
45
|
+
paymentMethod: 'Credit Card',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
invoice: 'INV005',
|
|
49
|
+
paymentStatus: 'Paid',
|
|
50
|
+
totalAmount: '$550.00',
|
|
51
|
+
paymentMethod: 'PayPal',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
invoice: 'INV006',
|
|
55
|
+
paymentStatus: 'Pending',
|
|
56
|
+
totalAmount: '$200.00',
|
|
57
|
+
paymentMethod: 'Bank Transfer',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
invoice: 'INV007',
|
|
61
|
+
paymentStatus: 'Unpaid',
|
|
62
|
+
totalAmount: '$300.00',
|
|
63
|
+
paymentMethod: 'Credit Card',
|
|
64
|
+
},
|
|
65
|
+
];
|
|
66
|
+
|
|
67
|
+
export const Default: Story = {
|
|
68
|
+
render: args => ({
|
|
69
|
+
components: {
|
|
70
|
+
Table,
|
|
71
|
+
TableBody,
|
|
72
|
+
TableCaption,
|
|
73
|
+
TableCell,
|
|
74
|
+
TableFooter,
|
|
75
|
+
TableHead,
|
|
76
|
+
TableHeader,
|
|
77
|
+
TableRow,
|
|
78
|
+
Badge,
|
|
79
|
+
},
|
|
80
|
+
setup() {
|
|
81
|
+
return { args, invoices };
|
|
82
|
+
},
|
|
83
|
+
template: `
|
|
84
|
+
<Table v-bind="args">
|
|
85
|
+
<TableCaption>A list of your recent invoices.</TableCaption>
|
|
86
|
+
<TableHeader>
|
|
87
|
+
<TableRow>
|
|
88
|
+
<TableHead>Invoice</TableHead>
|
|
89
|
+
<TableHead>Status</TableHead>
|
|
90
|
+
<TableHead>Method</TableHead>
|
|
91
|
+
<TableHead end>Amount</TableHead>
|
|
92
|
+
</TableRow>
|
|
93
|
+
</TableHeader>
|
|
94
|
+
<TableBody>
|
|
95
|
+
<TableRow hoverable v-for="invoice in invoices" :key="invoice.invoice">
|
|
96
|
+
<TableCell>{{ invoice.invoice }}</TableCell>
|
|
97
|
+
<TableCell>{{ invoice.paymentStatus }}</TableCell>
|
|
98
|
+
<TableCell>{{ invoice.paymentMethod }}</TableCell>
|
|
99
|
+
<TableCell end>{{ invoice.totalAmount }}</TableCell>
|
|
100
|
+
</TableRow>
|
|
101
|
+
</TableBody>
|
|
102
|
+
</Table>
|
|
103
|
+
`,
|
|
104
|
+
}),
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export const Empty: Story = {
|
|
108
|
+
render: args => ({
|
|
109
|
+
components: {
|
|
110
|
+
Table,
|
|
111
|
+
TableBody,
|
|
112
|
+
TableEmpty,
|
|
113
|
+
TableHead,
|
|
114
|
+
TableHeader,
|
|
115
|
+
TableRow,
|
|
116
|
+
},
|
|
117
|
+
setup() {
|
|
118
|
+
return { args };
|
|
119
|
+
},
|
|
120
|
+
template: `
|
|
121
|
+
<Table v-bind="args">
|
|
122
|
+
<TableHeader>
|
|
123
|
+
<TableRow>
|
|
124
|
+
<TableHead>Invoice</TableHead>
|
|
125
|
+
<TableHead>Status</TableHead>
|
|
126
|
+
<TableHead>Method</TableHead>
|
|
127
|
+
<TableHead>Amount</TableHead>
|
|
128
|
+
</TableRow>
|
|
129
|
+
</TableHeader>
|
|
130
|
+
<TableBody>
|
|
131
|
+
<TableEmpty colspan="4">
|
|
132
|
+
No results found.
|
|
133
|
+
</TableEmpty>
|
|
134
|
+
</TableBody>
|
|
135
|
+
</Table>
|
|
136
|
+
`,
|
|
137
|
+
}),
|
|
138
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
|
|
5
|
+
const props = defineProps<TableBodyProps>();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
export interface TableBodyProps {
|
|
10
|
+
class?: HTMLAttributes['class'];
|
|
11
|
+
}
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<tbody :class="clsx('celeste-table-body', props.class)">
|
|
16
|
+
<slot />
|
|
17
|
+
</tbody>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<style scoped>
|
|
21
|
+
.celeste-table-body {
|
|
22
|
+
font: var(--paragraph-sm);
|
|
23
|
+
}
|
|
24
|
+
</style>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
|
|
5
|
+
const props = defineProps<TableCaptionProps>();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
export interface TableCaptionProps {
|
|
10
|
+
class?: HTMLAttributes['class'];
|
|
11
|
+
}
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<caption :class="clsx('celeste-table-caption', props.class)">
|
|
16
|
+
<slot />
|
|
17
|
+
</caption>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<style scoped>
|
|
21
|
+
.celeste-table-caption {
|
|
22
|
+
padding-block: var(--spacing-16);
|
|
23
|
+
color: var(--color-text-soft-400);
|
|
24
|
+
font: var(--paragraph-sm);
|
|
25
|
+
}
|
|
26
|
+
</style>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
|
|
5
|
+
const props = withDefaults(
|
|
6
|
+
defineProps<TableCellProps>(),
|
|
7
|
+
{ end: false },
|
|
8
|
+
);
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<script lang="ts">
|
|
12
|
+
export interface TableCellProps {
|
|
13
|
+
class?: HTMLAttributes['class'];
|
|
14
|
+
end?: boolean;
|
|
15
|
+
}
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<td
|
|
20
|
+
:class="clsx('celeste-table-cell', props.class, {
|
|
21
|
+
'celeste-table-cell-align-end': props.end,
|
|
22
|
+
})"
|
|
23
|
+
>
|
|
24
|
+
<slot />
|
|
25
|
+
</td>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<style scoped>
|
|
29
|
+
.celeste-table-cell {
|
|
30
|
+
padding: var(--spacing-12) var(--spacing-12);
|
|
31
|
+
transition: background-color var(--animation-fast) ease;
|
|
32
|
+
background-color: var(--color-bg-white-0);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.celeste-table-cell:first-child {
|
|
36
|
+
position: relative;
|
|
37
|
+
border-start-start-radius: var(--radius-12);
|
|
38
|
+
border-end-start-radius: var(--radius-12);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.celeste-table-cell:last-child {
|
|
42
|
+
border-start-end-radius: var(--radius-12);
|
|
43
|
+
border-end-end-radius: var(--radius-12);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.celeste-table-cell-align-end {
|
|
47
|
+
text-align: end;
|
|
48
|
+
}
|
|
49
|
+
</style>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue';
|
|
3
|
+
import { TableCell, TableRow } from '@/components/table';
|
|
4
|
+
import { useDelegatedProps } from '@/composables/use-delegated-props';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
|
|
7
|
+
const props = withDefaults(
|
|
8
|
+
defineProps<TableEmptyProps>(),
|
|
9
|
+
{ colspan: 1 },
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
const delegated = useDelegatedProps(props, 'class');
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<script lang="ts">
|
|
16
|
+
export interface TableEmptyProps {
|
|
17
|
+
colspan?: number;
|
|
18
|
+
class?: HTMLAttributes['class'];
|
|
19
|
+
}
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<TableRow>
|
|
24
|
+
<TableCell v-bind="delegated" :class="clsx('celeste-table-empty', props.class)">
|
|
25
|
+
<div class="celeste-table-empty-content">
|
|
26
|
+
<slot />
|
|
27
|
+
</div>
|
|
28
|
+
</TableCell>
|
|
29
|
+
</TableRow>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<style scoped>
|
|
33
|
+
.celeste-table-empty {
|
|
34
|
+
align-self: middle;
|
|
35
|
+
white-space: nowrap;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.celeste-table-empty-content {
|
|
39
|
+
display: flex;
|
|
40
|
+
place-items: center;
|
|
41
|
+
justify-content: center;
|
|
42
|
+
}
|
|
43
|
+
</style>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
|
|
5
|
+
const props = defineProps<TableFooterProps>();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
export interface TableFooterProps {
|
|
10
|
+
class?: HTMLAttributes['class'];
|
|
11
|
+
}
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<tfoot :class="clsx('celeste-table-footer', props.class)">
|
|
16
|
+
<slot />
|
|
17
|
+
</tfoot>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<style scoped>
|
|
21
|
+
.celeste-table-footer {
|
|
22
|
+
background-color: var(--color-bg-weak-50);
|
|
23
|
+
}
|
|
24
|
+
</style>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
|
|
5
|
+
const props = withDefaults(
|
|
6
|
+
defineProps<TableHeadProps>(),
|
|
7
|
+
{ end: false },
|
|
8
|
+
);
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<script lang="ts">
|
|
12
|
+
export interface TableHeadProps {
|
|
13
|
+
class?: HTMLAttributes['class'];
|
|
14
|
+
end?: boolean;
|
|
15
|
+
}
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<th
|
|
20
|
+
:class="clsx('celeste-table-head', props.class, { 'celeste-table-head-align-end': props.end })"
|
|
21
|
+
>
|
|
22
|
+
<slot />
|
|
23
|
+
</th>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<style scoped>
|
|
27
|
+
.celeste-table-head {
|
|
28
|
+
padding: var(--spacing-8) var(--spacing-12);
|
|
29
|
+
background: var(--color-bg-weak-50);
|
|
30
|
+
color: var(--color-text-sub-600);
|
|
31
|
+
font: var(--paragraph-sm);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.celeste-table-head-align-end {
|
|
35
|
+
text-align: end;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.celeste-table-head:first-child {
|
|
39
|
+
border-start-start-radius: var(--radius-8);
|
|
40
|
+
border-end-start-radius: var(--radius-8);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.celeste-table-head:last-child {
|
|
44
|
+
border-start-end-radius: var(--radius-8);
|
|
45
|
+
border-end-end-radius: var(--radius-8);
|
|
46
|
+
}
|
|
47
|
+
</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
|
|
5
|
+
const props = defineProps<TableHeaderProps>();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
export interface TableHeaderProps {
|
|
10
|
+
class?: HTMLAttributes['class'];
|
|
11
|
+
}
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<thead :class="clsx('celeste-table-header', props.class)">
|
|
16
|
+
<slot />
|
|
17
|
+
</thead>
|
|
18
|
+
</template>
|