@youcan/celeste 0.6.42 → 0.6.44

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.
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ const Mo = require("vue");
3
+ const useDelegatedProps = require("./use-delegated-props.js");
4
+ const clsx = require("./chunks/clsx.js");
5
+ const index = require("./chunks/index.js");
6
+ const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
7
+ const _hoisted_1 = { class: "celeste-checkbox-card-content" };
8
+ const _hoisted_2 = { role: "presentation" };
9
+ const _hoisted_3 = {
10
+ role: "presentation",
11
+ class: "celeste-checkbox-card-row"
12
+ };
13
+ const _sfc_main = /* @__PURE__ */ Mo.defineComponent({
14
+ __name: "checkbox-card",
15
+ props: {
16
+ for: {},
17
+ asChild: { type: Boolean },
18
+ as: {},
19
+ required: { type: Boolean },
20
+ disabled: { type: Boolean },
21
+ class: {}
22
+ },
23
+ setup(__props) {
24
+ const props = __props;
25
+ const delegatedProps = useDelegatedProps.useDelegatedProps(props, "class");
26
+ return (_ctx, _cache) => {
27
+ return Mo.openBlock(), Mo.createBlock(Mo.unref(index.Oh), Mo.mergeProps(Mo.unref(delegatedProps), {
28
+ "aria-required": _ctx.required,
29
+ "aria-disabled": _ctx.disabled,
30
+ class: Mo.unref(clsx.clsx)("celeste-checkbox-card", props.class, {
31
+ "celeste-checkbox-card-disabled": _ctx.disabled
32
+ })
33
+ }), {
34
+ default: Mo.withCtx(() => [
35
+ _ctx.$slots.image || _ctx.$slots.icon ? (Mo.openBlock(), Mo.createElementBlock("div", {
36
+ key: 0,
37
+ role: "presentation",
38
+ class: Mo.normalizeClass(["celeste-checkbox-card-preview", [_ctx.$slots.image ? "celeste-checkbox-card-preview-image" : "celeste-checkbox-card-preview-icon"]])
39
+ }, [
40
+ _ctx.$slots.image ? (Mo.openBlock(), Mo.createElementBlock(Mo.Fragment, { key: 0 }, [
41
+ _cache[0] || (_cache[0] = Mo.createElementVNode("i", {
42
+ class: "celeste-checkbox-card-preview-fallback",
43
+ "i-celeste-image-circle-fill": ""
44
+ }, null, -1)),
45
+ Mo.renderSlot(_ctx.$slots, "image", { class: "i-celeste-image-circle-fill?bg" }, void 0, true)
46
+ ], 64)) : _ctx.$slots.icon ? Mo.renderSlot(_ctx.$slots, "icon", { key: 1 }, void 0, true) : Mo.createCommentVNode("", true)
47
+ ], 2)) : Mo.createCommentVNode("", true),
48
+ Mo.createElementVNode("div", _hoisted_1, [
49
+ Mo.createElementVNode("div", _hoisted_2, [
50
+ Mo.createElementVNode("div", _hoisted_3, [
51
+ Mo.createVNode(Mo.unref(index.O), {
52
+ as: "span",
53
+ class: "celeste-checkbox-card-label"
54
+ }, {
55
+ default: Mo.withCtx(() => [
56
+ Mo.renderSlot(_ctx.$slots, "label", {}, void 0, true)
57
+ ]),
58
+ _: 3
59
+ }),
60
+ _ctx.$slots.sublabel ? (Mo.openBlock(), Mo.createBlock(Mo.unref(index.O), {
61
+ key: 0,
62
+ as: "span",
63
+ class: "celeste-checkbox-card-sublabel"
64
+ }, {
65
+ default: Mo.withCtx(() => [
66
+ Mo.renderSlot(_ctx.$slots, "sublabel", {}, void 0, true)
67
+ ]),
68
+ _: 3
69
+ })) : Mo.createCommentVNode("", true),
70
+ _ctx.$slots.badge ? (Mo.openBlock(), Mo.createBlock(Mo.unref(index.O), {
71
+ key: 1,
72
+ "as-child": "",
73
+ class: "celeste-checkbox-card-badge"
74
+ }, {
75
+ default: Mo.withCtx(() => [
76
+ Mo.renderSlot(_ctx.$slots, "badge", { disabled: _ctx.disabled }, void 0, true)
77
+ ]),
78
+ _: 3
79
+ })) : Mo.createCommentVNode("", true)
80
+ ])
81
+ ]),
82
+ _ctx.$slots.description ? (Mo.openBlock(), Mo.createBlock(Mo.unref(index.O), {
83
+ key: 0,
84
+ as: "span",
85
+ class: "celeste-checkbox-card-description"
86
+ }, {
87
+ default: Mo.withCtx(() => [
88
+ Mo.renderSlot(_ctx.$slots, "description", {}, void 0, true)
89
+ ]),
90
+ _: 3
91
+ })) : Mo.createCommentVNode("", true)
92
+ ]),
93
+ Mo.createVNode(Mo.unref(index.O), {
94
+ disabled: _ctx.disabled,
95
+ "as-child": "",
96
+ class: "celeste-checkbox-card-checkbox"
97
+ }, {
98
+ default: Mo.withCtx(() => [
99
+ Mo.renderSlot(_ctx.$slots, "default", {}, void 0, true)
100
+ ]),
101
+ _: 3
102
+ }, 8, ["disabled"])
103
+ ]),
104
+ _: 3
105
+ }, 16, ["aria-required", "aria-disabled", "class"]);
106
+ };
107
+ }
108
+ });
109
+ const checkboxCard = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-29119673"]]);
110
+ module.exports = checkboxCard;
@@ -19,10 +19,7 @@ const _sfc_main = /* @__PURE__ */ Mo.defineComponent({
19
19
  for: {},
20
20
  asChild: { type: Boolean },
21
21
  as: {},
22
- sublabel: {},
23
- information: {},
24
22
  required: { type: Boolean },
25
- description: {},
26
23
  disabled: { type: Boolean },
27
24
  class: {}
28
25
  },
@@ -108,5 +105,5 @@ const _sfc_main = /* @__PURE__ */ Mo.defineComponent({
108
105
  };
109
106
  }
110
107
  });
111
- const checkboxLabel = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-cddafe7b"]]);
108
+ const checkboxLabel = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-ad0a5759"]]);
112
109
  module.exports = checkboxLabel;
package/dist/cjs/tag.js CHANGED
@@ -1,39 +1,46 @@
1
1
  "use strict";
2
2
  const Mo = require("vue");
3
3
  const clsx = require("./chunks/clsx.js");
4
+ const index = require("./chunks/index.js");
4
5
  const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
5
- const _hoisted_1 = ["data-tag-variant", "aria-disabled"];
6
- const _hoisted_2 = ["disabled"];
6
+ const _hoisted_1 = ["disabled"];
7
7
  const _sfc_main = /* @__PURE__ */ Mo.defineComponent({
8
8
  __name: "tag",
9
9
  props: {
10
10
  variant: { default: "stroke" },
11
11
  class: {},
12
12
  dismissable: { type: Boolean, default: false },
13
- disabled: { type: Boolean }
13
+ disabled: { type: Boolean },
14
+ asChild: { type: Boolean },
15
+ as: { default: "div" }
14
16
  },
15
17
  emits: ["dismiss"],
16
18
  setup(__props) {
17
19
  const props = __props;
18
20
  return (_ctx, _cache) => {
19
- return Mo.openBlock(), Mo.createElementBlock("div", {
21
+ return Mo.openBlock(), Mo.createBlock(Mo.unref(index.O), {
22
+ as: _ctx.as,
23
+ "as-child": _ctx.asChild,
20
24
  class: Mo.normalizeClass(Mo.unref(clsx.clsx)("celeste-tag", props.class)),
21
25
  "data-tag-variant": _ctx.variant,
22
26
  "aria-disabled": _ctx.disabled
23
- }, [
24
- Mo.renderSlot(_ctx.$slots, "default", {}, void 0, true),
25
- _ctx.dismissable ? (Mo.openBlock(), Mo.createElementBlock("button", {
26
- key: 0,
27
- disabled: _ctx.disabled,
28
- class: "celeste-tag-dismiss-button",
29
- "aria-label": "dismiss",
30
- onClick: _cache[0] || (_cache[0] = Mo.withModifiers(($event) => _ctx.$emit("dismiss"), ["prevent", "stop"]))
31
- }, _cache[1] || (_cache[1] = [
32
- Mo.createElementVNode("i", { class: "i-celeste-close-line" }, null, -1)
33
- ]), 8, _hoisted_2)) : Mo.createCommentVNode("", true)
34
- ], 10, _hoisted_1);
27
+ }, {
28
+ default: Mo.withCtx(() => [
29
+ Mo.renderSlot(_ctx.$slots, "default", {}, void 0, true),
30
+ _ctx.dismissable ? (Mo.openBlock(), Mo.createElementBlock("button", {
31
+ key: 0,
32
+ disabled: _ctx.disabled,
33
+ class: "celeste-tag-dismiss-button",
34
+ "aria-label": "dismiss",
35
+ onClick: _cache[0] || (_cache[0] = Mo.withModifiers(($event) => _ctx.$emit("dismiss"), ["prevent", "stop"]))
36
+ }, _cache[1] || (_cache[1] = [
37
+ Mo.createElementVNode("i", { class: "i-celeste-close-line" }, null, -1)
38
+ ]), 8, _hoisted_1)) : Mo.createCommentVNode("", true)
39
+ ]),
40
+ _: 3
41
+ }, 8, ["as", "as-child", "class", "data-tag-variant", "aria-disabled"]);
35
42
  };
36
43
  }
37
44
  });
38
- const tag = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-0011e3b8"]]);
45
+ const tag = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-368b7ec0"]]);
39
46
  module.exports = tag;
@@ -1,10 +1,7 @@
1
1
  import { HTMLAttributes } from 'vue';
2
2
  import { LabelProps } from 'radix-vue';
3
3
  type __VLS_Props = LabelProps & {
4
- sublabel?: string;
5
- information?: string;
6
4
  required?: boolean;
7
- description?: string;
8
5
  disabled?: boolean;
9
6
  class?: HTMLAttributes['class'];
10
7
  };
@@ -1,5 +1,6 @@
1
1
  import { HTMLAttributes } from 'vue';
2
- export interface TagProps {
2
+ import { PrimitiveProps } from 'radix-vue';
3
+ export interface TagProps extends PrimitiveProps {
3
4
  variant?: 'stroke' | 'gray';
4
5
  class?: HTMLAttributes['class'];
5
6
  dismissable?: boolean;
@@ -15,7 +16,8 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<Ta
15
16
  }>, {
16
17
  variant: "stroke" | "gray";
17
18
  dismissable: boolean;
18
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>, {
19
+ as: import('radix-vue').AsTag | import('vue').Component;
20
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, {
19
21
  default?(_: {}): any;
20
22
  }>;
21
23
  export default _default;
@@ -0,0 +1,111 @@
1
+ import { defineComponent, openBlock, createBlock, unref, mergeProps, withCtx, createElementBlock, normalizeClass, Fragment, createElementVNode, renderSlot, createCommentVNode, createVNode } from "vue";
2
+ import { useDelegatedProps } from "./use-delegated-props.js";
3
+ import { c as clsx } from "./chunks/clsx.js";
4
+ import { L as Oh, g as O } from "./chunks/index.js";
5
+ import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
6
+ const _hoisted_1 = { class: "celeste-checkbox-card-content" };
7
+ const _hoisted_2 = { role: "presentation" };
8
+ const _hoisted_3 = {
9
+ role: "presentation",
10
+ class: "celeste-checkbox-card-row"
11
+ };
12
+ const _sfc_main = /* @__PURE__ */ defineComponent({
13
+ __name: "checkbox-card",
14
+ props: {
15
+ for: {},
16
+ asChild: { type: Boolean },
17
+ as: {},
18
+ required: { type: Boolean },
19
+ disabled: { type: Boolean },
20
+ class: {}
21
+ },
22
+ setup(__props) {
23
+ const props = __props;
24
+ const delegatedProps = useDelegatedProps(props, "class");
25
+ return (_ctx, _cache) => {
26
+ return openBlock(), createBlock(unref(Oh), mergeProps(unref(delegatedProps), {
27
+ "aria-required": _ctx.required,
28
+ "aria-disabled": _ctx.disabled,
29
+ class: unref(clsx)("celeste-checkbox-card", props.class, {
30
+ "celeste-checkbox-card-disabled": _ctx.disabled
31
+ })
32
+ }), {
33
+ default: withCtx(() => [
34
+ _ctx.$slots.image || _ctx.$slots.icon ? (openBlock(), createElementBlock("div", {
35
+ key: 0,
36
+ role: "presentation",
37
+ class: normalizeClass(["celeste-checkbox-card-preview", [_ctx.$slots.image ? "celeste-checkbox-card-preview-image" : "celeste-checkbox-card-preview-icon"]])
38
+ }, [
39
+ _ctx.$slots.image ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
40
+ _cache[0] || (_cache[0] = createElementVNode("i", {
41
+ class: "celeste-checkbox-card-preview-fallback",
42
+ "i-celeste-image-circle-fill": ""
43
+ }, null, -1)),
44
+ renderSlot(_ctx.$slots, "image", { class: "i-celeste-image-circle-fill?bg" }, void 0, true)
45
+ ], 64)) : _ctx.$slots.icon ? renderSlot(_ctx.$slots, "icon", { key: 1 }, void 0, true) : createCommentVNode("", true)
46
+ ], 2)) : createCommentVNode("", true),
47
+ createElementVNode("div", _hoisted_1, [
48
+ createElementVNode("div", _hoisted_2, [
49
+ createElementVNode("div", _hoisted_3, [
50
+ createVNode(unref(O), {
51
+ as: "span",
52
+ class: "celeste-checkbox-card-label"
53
+ }, {
54
+ default: withCtx(() => [
55
+ renderSlot(_ctx.$slots, "label", {}, void 0, true)
56
+ ]),
57
+ _: 3
58
+ }),
59
+ _ctx.$slots.sublabel ? (openBlock(), createBlock(unref(O), {
60
+ key: 0,
61
+ as: "span",
62
+ class: "celeste-checkbox-card-sublabel"
63
+ }, {
64
+ default: withCtx(() => [
65
+ renderSlot(_ctx.$slots, "sublabel", {}, void 0, true)
66
+ ]),
67
+ _: 3
68
+ })) : createCommentVNode("", true),
69
+ _ctx.$slots.badge ? (openBlock(), createBlock(unref(O), {
70
+ key: 1,
71
+ "as-child": "",
72
+ class: "celeste-checkbox-card-badge"
73
+ }, {
74
+ default: withCtx(() => [
75
+ renderSlot(_ctx.$slots, "badge", { disabled: _ctx.disabled }, void 0, true)
76
+ ]),
77
+ _: 3
78
+ })) : createCommentVNode("", true)
79
+ ])
80
+ ]),
81
+ _ctx.$slots.description ? (openBlock(), createBlock(unref(O), {
82
+ key: 0,
83
+ as: "span",
84
+ class: "celeste-checkbox-card-description"
85
+ }, {
86
+ default: withCtx(() => [
87
+ renderSlot(_ctx.$slots, "description", {}, void 0, true)
88
+ ]),
89
+ _: 3
90
+ })) : createCommentVNode("", true)
91
+ ]),
92
+ createVNode(unref(O), {
93
+ disabled: _ctx.disabled,
94
+ "as-child": "",
95
+ class: "celeste-checkbox-card-checkbox"
96
+ }, {
97
+ default: withCtx(() => [
98
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
99
+ ]),
100
+ _: 3
101
+ }, 8, ["disabled"])
102
+ ]),
103
+ _: 3
104
+ }, 16, ["aria-required", "aria-disabled", "class"]);
105
+ };
106
+ }
107
+ });
108
+ const checkboxCard = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-29119673"]]);
109
+ export {
110
+ checkboxCard as default
111
+ };
@@ -18,10 +18,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
18
18
  for: {},
19
19
  asChild: { type: Boolean },
20
20
  as: {},
21
- sublabel: {},
22
- information: {},
23
21
  required: { type: Boolean },
24
- description: {},
25
22
  disabled: { type: Boolean },
26
23
  class: {}
27
24
  },
@@ -107,7 +104,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
107
104
  };
108
105
  }
109
106
  });
110
- const checkboxLabel = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-cddafe7b"]]);
107
+ const checkboxLabel = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ad0a5759"]]);
111
108
  export {
112
109
  checkboxLabel as default
113
110
  };
package/dist/es/tag.js CHANGED
@@ -1,40 +1,47 @@
1
- import { defineComponent, openBlock, createElementBlock, normalizeClass, unref, renderSlot, withModifiers, createElementVNode, createCommentVNode } from "vue";
1
+ import { defineComponent, openBlock, createBlock, unref, normalizeClass, withCtx, renderSlot, createElementBlock, withModifiers, createElementVNode, createCommentVNode } from "vue";
2
2
  import { c as clsx } from "./chunks/clsx.js";
3
+ import { g as O } from "./chunks/index.js";
3
4
  import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
4
- const _hoisted_1 = ["data-tag-variant", "aria-disabled"];
5
- const _hoisted_2 = ["disabled"];
5
+ const _hoisted_1 = ["disabled"];
6
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
7
7
  __name: "tag",
8
8
  props: {
9
9
  variant: { default: "stroke" },
10
10
  class: {},
11
11
  dismissable: { type: Boolean, default: false },
12
- disabled: { type: Boolean }
12
+ disabled: { type: Boolean },
13
+ asChild: { type: Boolean },
14
+ as: { default: "div" }
13
15
  },
14
16
  emits: ["dismiss"],
15
17
  setup(__props) {
16
18
  const props = __props;
17
19
  return (_ctx, _cache) => {
18
- return openBlock(), createElementBlock("div", {
20
+ return openBlock(), createBlock(unref(O), {
21
+ as: _ctx.as,
22
+ "as-child": _ctx.asChild,
19
23
  class: normalizeClass(unref(clsx)("celeste-tag", props.class)),
20
24
  "data-tag-variant": _ctx.variant,
21
25
  "aria-disabled": _ctx.disabled
22
- }, [
23
- renderSlot(_ctx.$slots, "default", {}, void 0, true),
24
- _ctx.dismissable ? (openBlock(), createElementBlock("button", {
25
- key: 0,
26
- disabled: _ctx.disabled,
27
- class: "celeste-tag-dismiss-button",
28
- "aria-label": "dismiss",
29
- onClick: _cache[0] || (_cache[0] = withModifiers(($event) => _ctx.$emit("dismiss"), ["prevent", "stop"]))
30
- }, _cache[1] || (_cache[1] = [
31
- createElementVNode("i", { class: "i-celeste-close-line" }, null, -1)
32
- ]), 8, _hoisted_2)) : createCommentVNode("", true)
33
- ], 10, _hoisted_1);
26
+ }, {
27
+ default: withCtx(() => [
28
+ renderSlot(_ctx.$slots, "default", {}, void 0, true),
29
+ _ctx.dismissable ? (openBlock(), createElementBlock("button", {
30
+ key: 0,
31
+ disabled: _ctx.disabled,
32
+ class: "celeste-tag-dismiss-button",
33
+ "aria-label": "dismiss",
34
+ onClick: _cache[0] || (_cache[0] = withModifiers(($event) => _ctx.$emit("dismiss"), ["prevent", "stop"]))
35
+ }, _cache[1] || (_cache[1] = [
36
+ createElementVNode("i", { class: "i-celeste-close-line" }, null, -1)
37
+ ]), 8, _hoisted_1)) : createCommentVNode("", true)
38
+ ]),
39
+ _: 3
40
+ }, 8, ["as", "as-child", "class", "data-tag-variant", "aria-disabled"]);
34
41
  };
35
42
  }
36
43
  });
37
- const tag = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-0011e3b8"]]);
44
+ const tag = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-368b7ec0"]]);
38
45
  export {
39
46
  tag as default
40
47
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@youcan/celeste",
3
3
  "type": "module",
4
- "version": "0.6.42",
4
+ "version": "0.6.44",
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.42",
48
- "@youcan/celeste-tokens": "0.6.42"
47
+ "@youcan/celeste-icons": "0.6.44",
48
+ "@youcan/celeste-tokens": "0.6.44"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@chromatic-com/storybook": "^4.0.0",
@@ -0,0 +1,222 @@
1
+ <script setup lang="ts">
2
+ import type { LabelProps } from 'radix-vue';
3
+ import type { HTMLAttributes } from 'vue';
4
+ import { useDelegatedProps } from '@/composables/use-delegated-props';
5
+ import clsx from 'clsx';
6
+ import { Label, Primitive } from 'radix-vue';
7
+
8
+ const props = defineProps<LabelProps & {
9
+ required?: boolean;
10
+ disabled?: boolean;
11
+ class?: HTMLAttributes['class'];
12
+ }>();
13
+
14
+ const delegatedProps = useDelegatedProps(props, 'class');
15
+ </script>
16
+
17
+ <template>
18
+ <Label
19
+ v-bind="delegatedProps"
20
+ :aria-required="required"
21
+ :aria-disabled="disabled"
22
+ :class="
23
+ clsx('celeste-checkbox-card', props.class, {
24
+ 'celeste-checkbox-card-disabled': disabled,
25
+ })
26
+ "
27
+ >
28
+
29
+ <div
30
+ v-if="$slots.image || $slots.icon"
31
+ role="presentation"
32
+ class="celeste-checkbox-card-preview"
33
+ :class="[$slots.image ? 'celeste-checkbox-card-preview-image' : 'celeste-checkbox-card-preview-icon']"
34
+ >
35
+ <template v-if="$slots.image">
36
+ <i class="celeste-checkbox-card-preview-fallback" i-celeste-image-circle-fill />
37
+ <slot class="i-celeste-image-circle-fill?bg" name="image" />
38
+ </template>
39
+
40
+ <template v-else-if="$slots.icon">
41
+ <slot name="icon" />
42
+ </template>
43
+ </div>
44
+
45
+ <div class="celeste-checkbox-card-content">
46
+ <div role="presentation">
47
+ <div role="presentation" class="celeste-checkbox-card-row">
48
+ <Primitive as="span" class="celeste-checkbox-card-label">
49
+ <slot name="label" />
50
+ </Primitive>
51
+
52
+ <Primitive
53
+ v-if="$slots.sublabel"
54
+ as="span"
55
+ class="celeste-checkbox-card-sublabel"
56
+ >
57
+ <slot name="sublabel" />
58
+ </Primitive>
59
+ <Primitive
60
+ v-if="$slots.badge"
61
+ as-child
62
+ class="celeste-checkbox-card-badge"
63
+ >
64
+ <slot :disabled="disabled" name="badge" />
65
+ </Primitive>
66
+ </div>
67
+ </div>
68
+
69
+ <Primitive
70
+ v-if="$slots.description"
71
+ as="span"
72
+ class="celeste-checkbox-card-description"
73
+ >
74
+ <slot name="description" />
75
+ </Primitive>
76
+ </div>
77
+
78
+ <Primitive
79
+ :disabled="disabled"
80
+ as-child
81
+ class="celeste-checkbox-card-checkbox"
82
+ >
83
+ <slot />
84
+ </Primitive>
85
+
86
+ </Label>
87
+ </template>
88
+
89
+ <style lang="scss" scoped>
90
+ * {
91
+ box-sizing: border-box;
92
+ }
93
+
94
+ .celeste-checkbox-card {
95
+ display: flex;
96
+ align-items: flex-start;
97
+ padding: var(--spacing-16);
98
+ transition: all var(--animation-fast) ease-out;
99
+ border: 1px solid var(--color-stroke-soft-200);
100
+ border-radius: var(--radius-12);
101
+ background-color: var(--color-bg-white-0);
102
+ box-shadow: var(--shadow-regular-xs);
103
+ color: var(--color-text-strong-950);
104
+ font: var(--paragraph-sm);
105
+ gap: var(--spacing-14);
106
+
107
+ &:not(.celeste-checkbox-card-disabled) {
108
+ cursor: pointer;
109
+ }
110
+
111
+ &:has([data-state='checked']):not(.celeste-checkbox-card-disabled) {
112
+ border-color: var(--color-primary-base);
113
+ box-shadow: none;
114
+ }
115
+
116
+ &:hover:not(.celeste-checkbox-card-disabled),
117
+ &:focus-visible:not(.celeste-checkbox-card-disabled) {
118
+ background-color: var(--color-bg-weak-50);
119
+ box-shadow: none;
120
+
121
+ &:not(:has([data-state='checked'])) {
122
+ border-color: transparent;
123
+ }
124
+ }
125
+ }
126
+
127
+ .celeste-checkbox-card-disabled {
128
+ cursor: not-allowed;
129
+
130
+ .celeste-checkbox-card-label {
131
+ color: var(--color-text-sub-600);
132
+ }
133
+
134
+ .celeste-checkbox-card-sublabel {
135
+ color: var(--color-text-soft-400);
136
+ }
137
+
138
+ .celeste-checkbox-card-description {
139
+ color: var(--color-text-soft-400);
140
+ }
141
+ }
142
+
143
+ .celeste-checkbox-card-preview {
144
+ display: flex;
145
+ position: relative;
146
+ flex-shrink: 0;
147
+ align-items: center;
148
+ justify-content: center;
149
+ width: 40px;
150
+ height: 40px;
151
+ overflow: hidden;
152
+ border: 1px solid var(--color-stroke-soft-200);
153
+ border-radius: var(--radius-full);
154
+ background-color: var(--color-bg-white-0);
155
+ box-shadow: var(--shadow-regular-xs);
156
+ }
157
+
158
+ .celeste-checkbox-card-preview-image {
159
+ border: none;
160
+
161
+ i {
162
+ position: absolute;
163
+ z-index: 0;
164
+ top: 50%;
165
+ left: 50%;
166
+ width: 20px;
167
+ height: 20px;
168
+ transform: translate(-50%, -50%);
169
+ color: var(--color-icon-sub-600);
170
+ }
171
+
172
+ :deep(img) {
173
+ z-index: 1000;
174
+ }
175
+ }
176
+
177
+ .celeste-checkbox-card-preview-icon {
178
+ i {
179
+ width: 20px;
180
+ height: 20px;
181
+ color: var(--color-icon-sub-600);
182
+ }
183
+ }
184
+
185
+ .celeste-checkbox-card-content {
186
+ display: flex;
187
+ flex-direction: column;
188
+ gap: var(--spacing-4);
189
+ }
190
+
191
+ .celeste-checkbox-card-row {
192
+ display: flex;
193
+ flex-shrink: 1;
194
+ align-items: center;
195
+ gap: var(--spacing-8);
196
+ }
197
+
198
+ .celeste-checkbox-card-label {
199
+ flex-shrink: 1;
200
+ min-width: 0;
201
+ overflow: hidden;
202
+ color: var(--color-text-strong-950);
203
+ font: var(--label-sm);
204
+ text-overflow: ellipsis;
205
+ white-space: nowrap;
206
+ }
207
+
208
+ .celeste-checkbox-card-sublabel {
209
+ flex-shrink: 1;
210
+ min-width: 0;
211
+ overflow: hidden;
212
+ color: var(--color-text-sub-600);
213
+ font: var(--paragraph-xs);
214
+ text-overflow: ellipsis;
215
+ white-space: nowrap;
216
+ }
217
+
218
+ .celeste-checkbox-card-description {
219
+ color: var(--color-text-sub-600);
220
+ font: var(--paragraph-xs);
221
+ }
222
+ </style>
@@ -5,10 +5,7 @@ import clsx from 'clsx';
5
5
  import { Label, type LabelProps, Primitive } from 'radix-vue';
6
6
 
7
7
  const props = defineProps<LabelProps & {
8
- sublabel?: string;
9
- information?: string;
10
8
  required?: boolean;
11
- description?: string;
12
9
  disabled?: boolean;
13
10
  class?: HTMLAttributes['class'];
14
11
  }>();