@youcan/celeste 0.6.48 → 0.6.50

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 (93) hide show
  1. package/dist/celeste.css +333 -120
  2. package/dist/cjs/chunks/counter-input.vue_vue_type_style_index_0_lang.js +70 -0
  3. package/dist/cjs/chunks/index.js +684 -0
  4. package/dist/cjs/counter-input.js +3 -0
  5. package/dist/cjs/index.js +9 -0
  6. package/dist/cjs/modal-header.js +1 -1
  7. package/dist/cjs/popover-content.js +5 -8
  8. package/dist/cjs/radio-group-card.js +110 -0
  9. package/dist/cjs/radio-group-label.js +109 -0
  10. package/dist/components/counter-input/counter-input.d.ts +17 -0
  11. package/dist/components/counter-input/index.d.ts +2 -0
  12. package/dist/components/index.d.ts +1 -0
  13. package/dist/components/radio-group/index.d.ts +4 -0
  14. package/dist/components/radio-group/radio-group-card.d.ts +34 -0
  15. package/dist/components/radio-group/radio-group-label.d.ts +29 -0
  16. package/dist/es/button.js +1 -1
  17. package/dist/es/checkbox-card.js +1 -1
  18. package/dist/es/checkbox-label.js +1 -1
  19. package/dist/es/chunks/counter-input.vue_vue_type_style_index_0_lang.js +71 -0
  20. package/dist/es/chunks/index.js +754 -70
  21. package/dist/es/chunks/index3.js +1 -1
  22. package/dist/es/chunks/radio-group-item.vue_vue_type_style_index_0_lang.js +1 -1
  23. package/dist/es/chunks/switch.vue_vue_type_style_index_0_lang.js +1 -1
  24. package/dist/es/combobox-group.js +1 -1
  25. package/dist/es/combobox-input.js +1 -1
  26. package/dist/es/combobox-item.js +1 -1
  27. package/dist/es/combobox-list.js +1 -1
  28. package/dist/es/combobox-root.js +1 -1
  29. package/dist/es/combobox-separator.js +1 -1
  30. package/dist/es/combobox-trigger.js +1 -1
  31. package/dist/es/command-group.js +1 -1
  32. package/dist/es/command-input.js +1 -1
  33. package/dist/es/command-item.js +1 -1
  34. package/dist/es/command-list.js +1 -1
  35. package/dist/es/command-root.js +1 -1
  36. package/dist/es/command-separator.js +1 -1
  37. package/dist/es/compact-button.js +1 -1
  38. package/dist/es/context-menu-item.js +1 -1
  39. package/dist/es/counter-input.js +4 -0
  40. package/dist/es/digit-input-group.js +1 -1
  41. package/dist/es/digit-input-slot.js +1 -1
  42. package/dist/es/digit-input.js +1 -1
  43. package/dist/es/dropdown-menu-content.js +1 -1
  44. package/dist/es/dropdown-menu-group.js +1 -1
  45. package/dist/es/dropdown-menu-item.js +1 -1
  46. package/dist/es/dropdown-menu-label.js +1 -1
  47. package/dist/es/dropdown-menu-separator.js +1 -1
  48. package/dist/es/dropdown-menu-sub-content.js +1 -1
  49. package/dist/es/dropdown-menu-sub-trigger.js +1 -1
  50. package/dist/es/dropdown-menu-trigger.js +1 -1
  51. package/dist/es/dropdown-menu.js +1 -1
  52. package/dist/es/dropdown.js +1 -1
  53. package/dist/es/fancy-button.js +1 -1
  54. package/dist/es/index.js +48 -39
  55. package/dist/es/label.js +1 -1
  56. package/dist/es/link-button.js +1 -1
  57. package/dist/es/modal-content.js +1 -1
  58. package/dist/es/modal-header.js +2 -2
  59. package/dist/es/popover-content.js +7 -10
  60. package/dist/es/popover-trigger.js +1 -1
  61. package/dist/es/progress-bar.js +1 -1
  62. package/dist/es/progress-circle.js +1 -1
  63. package/dist/es/radio-group-card.js +111 -0
  64. package/dist/es/radio-group-label.js +110 -0
  65. package/dist/es/scroll-bar.js +1 -1
  66. package/dist/es/segmented-control-item.js +1 -1
  67. package/dist/es/segmented-control.js +1 -1
  68. package/dist/es/select-content.js +1 -1
  69. package/dist/es/select-item.js +1 -1
  70. package/dist/es/select-trigger.js +1 -1
  71. package/dist/es/select-value.js +1 -1
  72. package/dist/es/social-button.js +1 -1
  73. package/dist/es/tab-menu-content.js +1 -1
  74. package/dist/es/tab-menu-item.js +1 -1
  75. package/dist/es/tab-menu-list.js +1 -1
  76. package/dist/es/tab-menu.js +1 -1
  77. package/dist/es/tag.js +1 -1
  78. package/dist/es/text-input.js +1 -1
  79. package/dist/es/tooltip.js +1 -1
  80. package/package.json +3 -3
  81. package/src/components/counter-input/counter-input.vue +131 -0
  82. package/src/components/counter-input/index.ts +2 -0
  83. package/src/components/counter-input/stories/counter-input.stories.ts +149 -0
  84. package/src/components/digit-input/stories/digit-input.stories.ts +1 -1
  85. package/src/components/index.ts +1 -0
  86. package/src/components/modal/modal-header.vue +1 -1
  87. package/src/components/popover/popover-content.vue +3 -7
  88. package/src/components/radio-group/index.ts +6 -0
  89. package/src/components/radio-group/radio-group-card.vue +221 -0
  90. package/src/components/radio-group/radio-group-label.vue +108 -0
  91. package/src/components/radio-group/stories/radio-group-card.stories.ts +297 -0
  92. package/src/components/radio-group/stories/radio-group.stories.ts +25 -15
  93. package/src/components/text-input/stories/text-input.stories.ts +1 -1
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, useCssVars, computed, openBlock, createElementBlock, toDisplayString, createCommentVNode, createElementVNode, renderSlot, createTextVNode, createVNode, unref, mergeProps, withCtx } from "vue";
2
2
  import { useDelegatedProps } from "./use-delegated-props.js";
3
3
  import { c as clsx } from "./chunks/clsx.js";
4
- import { ap as By, aq as Iy } from "./chunks/index.js";
4
+ import { at as By, au as Iy } from "./chunks/index.js";
5
5
  import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
6
6
  const _hoisted_1 = ["data-layout"];
7
7
  const _hoisted_2 = {
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, useCssVars, computed, openBlock, createBlock, unref, mergeProps, withCtx, createVNode, createElementBlock, createElementVNode, renderSlot, createTextVNode, toDisplayString, createCommentVNode } from "vue";
2
2
  import { useDelegatedProps } from "./use-delegated-props.js";
3
3
  import { c as clsx } from "./chunks/clsx.js";
4
- import { ap as By, aq as Iy } from "./chunks/index.js";
4
+ import { at as By, au as Iy } from "./chunks/index.js";
5
5
  import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
6
6
  const _hoisted_1 = ["width", "height"];
7
7
  const _hoisted_2 = ["cx", "cy", "r"];
@@ -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 { X as Oh, l as O } from "./chunks/index.js";
5
+ import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
6
+ const _hoisted_1 = { class: "celeste-radio-card-content" };
7
+ const _hoisted_2 = { role: "presentation" };
8
+ const _hoisted_3 = {
9
+ role: "presentation",
10
+ class: "celeste-radio-card-row"
11
+ };
12
+ const _sfc_main = /* @__PURE__ */ defineComponent({
13
+ __name: "radio-group-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-radio-card", props.class, {
30
+ "celeste-radio-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-radio-card-preview", [_ctx.$slots.image ? "celeste-radio-card-preview-image" : "celeste-radio-card-preview-icon"]])
38
+ }, [
39
+ _ctx.$slots.image ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
40
+ _cache[0] || (_cache[0] = createElementVNode("i", {
41
+ class: "celeste-radio-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-radio-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-radio-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-radio-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-radio-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-radio-card-radio"
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 radioGroupCard = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c0db864b"]]);
109
+ export {
110
+ radioGroupCard as default
111
+ };
@@ -0,0 +1,110 @@
1
+ import { defineComponent, openBlock, createBlock, unref, mergeProps, withCtx, createVNode, renderSlot, createElementVNode, createCommentVNode } from "vue";
2
+ import { useDelegatedProps } from "./use-delegated-props.js";
3
+ import { c as clsx } from "./chunks/clsx.js";
4
+ import { X as Oh, l as O } from "./chunks/index.js";
5
+ import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
6
+ const _hoisted_1 = { role: "presentation" };
7
+ const _hoisted_2 = {
8
+ role: "presentation",
9
+ class: "celeste-radio-label-row"
10
+ };
11
+ const _hoisted_3 = {
12
+ role: "presentation",
13
+ class: "celeste-radio-label-content"
14
+ };
15
+ const _sfc_main = /* @__PURE__ */ defineComponent({
16
+ __name: "radio-group-label",
17
+ props: {
18
+ for: {},
19
+ asChild: { type: Boolean },
20
+ as: {},
21
+ required: { type: Boolean },
22
+ disabled: { type: Boolean },
23
+ class: {}
24
+ },
25
+ setup(__props) {
26
+ const props = __props;
27
+ const delegatedProps = useDelegatedProps(props, "class");
28
+ return (_ctx, _cache) => {
29
+ return openBlock(), createBlock(unref(Oh), mergeProps(unref(delegatedProps), {
30
+ "aria-required": _ctx.required,
31
+ "aria-disabled": _ctx.disabled,
32
+ class: unref(clsx)("celeste-radio-label", props.class)
33
+ }), {
34
+ default: withCtx(() => [
35
+ createVNode(unref(O), {
36
+ "as-child": "",
37
+ class: "celeste-radio-label-radio"
38
+ }, {
39
+ default: withCtx(() => [
40
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
41
+ ]),
42
+ _: 3
43
+ }),
44
+ createElementVNode("div", _hoisted_1, [
45
+ createElementVNode("div", _hoisted_2, [
46
+ createElementVNode("div", null, [
47
+ createVNode(unref(O), {
48
+ as: "span",
49
+ class: "celeste-radio-label-label"
50
+ }, {
51
+ default: withCtx(() => [
52
+ renderSlot(_ctx.$slots, "label", {}, void 0, true)
53
+ ]),
54
+ _: 3
55
+ }),
56
+ _ctx.$slots.sublabel ? (openBlock(), createBlock(unref(O), {
57
+ key: 0,
58
+ as: "span",
59
+ class: "celeste-radio-label-sublabel"
60
+ }, {
61
+ default: withCtx(() => [
62
+ renderSlot(_ctx.$slots, "sublabel", {}, void 0, true)
63
+ ]),
64
+ _: 3
65
+ })) : createCommentVNode("", true)
66
+ ]),
67
+ _ctx.$slots.badge ? (openBlock(), createBlock(unref(O), {
68
+ key: 0,
69
+ "as-child": "",
70
+ class: "celeste-radio-label-badge"
71
+ }, {
72
+ default: withCtx(() => [
73
+ renderSlot(_ctx.$slots, "badge", {}, void 0, true)
74
+ ]),
75
+ _: 3
76
+ })) : createCommentVNode("", true)
77
+ ]),
78
+ createElementVNode("div", _hoisted_3, [
79
+ _ctx.$slots.description ? (openBlock(), createBlock(unref(O), {
80
+ key: 0,
81
+ as: "span",
82
+ class: "celeste-radio-label-description"
83
+ }, {
84
+ default: withCtx(() => [
85
+ renderSlot(_ctx.$slots, "description", {}, void 0, true)
86
+ ]),
87
+ _: 3
88
+ })) : createCommentVNode("", true),
89
+ _ctx.$slots.linkButton ? (openBlock(), createBlock(unref(O), {
90
+ key: 1,
91
+ "as-child": "",
92
+ class: "celeste-radio-label-link-button"
93
+ }, {
94
+ default: withCtx(() => [
95
+ renderSlot(_ctx.$slots, "linkButton", {}, void 0, true)
96
+ ]),
97
+ _: 3
98
+ })) : createCommentVNode("", true)
99
+ ])
100
+ ])
101
+ ]),
102
+ _: 3
103
+ }, 16, ["aria-required", "aria-disabled", "class"]);
104
+ };
105
+ }
106
+ });
107
+ const radioGroupLabel = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-32cb773e"]]);
108
+ export {
109
+ radioGroupLabel as default
110
+ };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, computed, openBlock, createBlock, unref, mergeProps, withCtx, createVNode } from "vue";
2
2
  import { c as clsx } from "./chunks/clsx.js";
3
- import { M as My, V as Vy } from "./chunks/index.js";
3
+ import { U as My, V as Vy } from "./chunks/index.js";
4
4
  import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
5
5
  const _sfc_main = /* @__PURE__ */ defineComponent({
6
6
  __name: "scroll-bar",
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, openBlock, createBlock, unref, mergeProps, withCtx, renderSlot } from "vue";
2
2
  import { useDelegatedProps } from "./use-delegated-props.js";
3
3
  import { c as clsx } from "./chunks/clsx.js";
4
- import { J as sv } from "./chunks/index.js";
4
+ import { S as sv } from "./chunks/index.js";
5
5
  import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
6
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
7
7
  __name: "segmented-control-item",
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, openBlock, createBlock, unref, mergeProps, withCtx, renderSlot } from "vue";
2
2
  import { useDelegatedProps } from "./use-delegated-props.js";
3
3
  import { c as clsx } from "./chunks/clsx.js";
4
- import { x as xe, I as lv } from "./chunks/index.js";
4
+ import { x as xe, P as lv } from "./chunks/index.js";
5
5
  import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
6
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
7
7
  __name: "segmented-control",
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, openBlock, createBlock, unref, withCtx, createVNode, mergeProps, renderSlot } from "vue";
2
2
  import { useDelegatedProps } from "./use-delegated-props.js";
3
3
  import { c as clsx } from "./chunks/clsx.js";
4
- import { x as xe, ar as zy, as as Ky, at as Xy } from "./chunks/index.js";
4
+ import { x as xe, av as zy, aw as Ky, ax as Xy } from "./chunks/index.js";
5
5
  import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
6
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
7
7
  __name: "select-content",
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, openBlock, createBlock, unref, mergeProps, withCtx, createVNode, renderSlot, createElementVNode } from "vue";
2
2
  import { useDelegatedProps } from "./use-delegated-props.js";
3
3
  import { c as clsx } from "./chunks/clsx.js";
4
- import { au as jy, av as Yy, aw as Uy } from "./chunks/index.js";
4
+ import { ay as jy, az as Yy, aA as Uy } from "./chunks/index.js";
5
5
  import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
6
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
7
7
  __name: "select-item",
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, openBlock, createBlock, unref, mergeProps, withCtx, renderSlot, createVNode, createElementVNode } from "vue";
2
2
  import { useDelegatedProps } from "./use-delegated-props.js";
3
3
  import { c as clsx } from "./chunks/clsx.js";
4
- import { ax as Ly, ay as eg } from "./chunks/index.js";
4
+ import { aB as Ly, aC as eg } from "./chunks/index.js";
5
5
  import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
6
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
7
7
  __name: "select-trigger",
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, openBlock, createBlock, unref, mergeProps, withCtx, renderSlot } from "vue";
2
2
  import { useDelegatedProps } from "./use-delegated-props.js";
3
3
  import { c as clsx } from "./chunks/clsx.js";
4
- import { az as Qy } from "./chunks/index.js";
4
+ import { aD as Qy } from "./chunks/index.js";
5
5
  import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
6
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
7
7
  __name: "select-value",
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, openBlock, createBlock, unref, normalizeClass, withCtx, createElementVNode, createElementBlock, toDisplayString, createCommentVNode } from "vue";
2
2
  import { c as clsx } from "./chunks/clsx.js";
3
- import { g as O } from "./chunks/index.js";
3
+ import { l as O } from "./chunks/index.js";
4
4
  /* empty css */
5
5
  import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
6
6
  const _hoisted_1 = {
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, openBlock, createBlock, unref, mergeProps, withCtx, renderSlot } from "vue";
2
2
  import { useDelegatedProps } from "./use-delegated-props.js";
3
3
  import { c as clsx } from "./chunks/clsx.js";
4
- import { H as bg } from "./chunks/index.js";
4
+ import { M as bg } from "./chunks/index.js";
5
5
  import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
6
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
7
7
  __name: "tab-menu-content",
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, openBlock, createBlock, unref, mergeProps, withCtx, renderSlot, createElementBlock, createCommentVNode } from "vue";
2
2
  import { useDelegatedProps } from "./use-delegated-props.js";
3
3
  import { c as clsx } from "./chunks/clsx.js";
4
- import { A as At, E as Cg } from "./chunks/index.js";
4
+ import { A as At, L as Cg } from "./chunks/index.js";
5
5
  import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
6
6
  const _hoisted_1 = {
7
7
  key: 0,
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, openBlock, createBlock, unref, mergeProps, withCtx, renderSlot } from "vue";
2
2
  import { useDelegatedProps } from "./use-delegated-props.js";
3
3
  import { c as clsx } from "./chunks/clsx.js";
4
- import { D as gg } from "./chunks/index.js";
4
+ import { J as gg } from "./chunks/index.js";
5
5
  import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
6
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
7
7
  __name: "tab-menu-list",
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, openBlock, createBlock, unref, mergeProps, withCtx, renderSlot } from "vue";
2
- import { x as xe, C as yg } from "./chunks/index.js";
2
+ import { x as xe, I as yg } from "./chunks/index.js";
3
3
  import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
4
4
  const _sfc_main = /* @__PURE__ */ defineComponent({
5
5
  __name: "tab-menu",
package/dist/es/tag.js CHANGED
@@ -1,6 +1,6 @@
1
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
+ import { l as O } from "./chunks/index.js";
4
4
  import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
5
5
  const _hoisted_1 = ["disabled"];
6
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, mergeModels, computed, useModel, openBlock, createElementBlock, normalizeClass, unref, createVNode, withCtx, renderSlot, withDirectives, createElementVNode, mergeProps, vModelDynamic, createBlock } from "vue";
2
2
  import { uid } from "./crypto.js";
3
3
  import { c as clsx } from "./chunks/clsx.js";
4
- import { g as O } from "./chunks/index.js";
4
+ import { l as O } from "./chunks/index.js";
5
5
  import TextInputButton from "./text-input-button.js";
6
6
  import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
7
7
  const _hoisted_1 = ["for", "size", "has-error"];
@@ -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, aA as Lg, aB as zg, aC as Kg, aD as jg, aE as Hg, aF as Wg } from "./chunks/index.js";
4
+ import { x as xe, aE as Lg, aF as zg, aG as Kg, aH as jg, aI as Hg, aJ 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.48",
4
+ "version": "0.6.50",
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-tokens": "0.6.48",
48
- "@youcan/celeste-icons": "0.6.48"
47
+ "@youcan/celeste-icons": "0.6.50",
48
+ "@youcan/celeste-tokens": "0.6.50"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@chromatic-com/storybook": "^4.0.0",
@@ -0,0 +1,131 @@
1
+ <script setup lang="ts">
2
+ import type { HTMLAttributes } from 'vue';
3
+ import { useDelegatedProps } from '@/composables/use-delegated-props';
4
+ import clsx from 'clsx';
5
+ import { NumberFieldDecrement, NumberFieldIncrement, NumberFieldInput, NumberFieldRoot, type NumberFieldRootEmits, type NumberFieldRootProps, useForwardPropsEmits } from 'radix-vue';
6
+ import CompactButton from '../button/compact-button.vue';
7
+
8
+ const props = withDefaults(
9
+ defineProps<NumberFieldRootProps & {
10
+ class?: HTMLAttributes['class'];
11
+ size?: 'xs' | 'sm' | 'md';
12
+ hasError?: boolean;
13
+ }>(),
14
+ {
15
+ size: 'md',
16
+ defaultValue: 0,
17
+ hasError: false,
18
+ },
19
+ );
20
+ const emits = defineEmits<NumberFieldRootEmits>();
21
+
22
+ const delegatedProps = useDelegatedProps(props, 'class');
23
+ const forwarded = useForwardPropsEmits(delegatedProps, emits);
24
+ </script>
25
+
26
+ <template>
27
+ <NumberFieldRoot
28
+ v-bind="forwarded"
29
+ :has-error="hasError"
30
+ :class="clsx('celeste-counter-input-wrapper', props.class)"
31
+ >
32
+ <NumberFieldDecrement as-child class="celeste-counter-input-decrement">
33
+ <CompactButton variant="ghost" icon="i-celeste-subtract-line" />
34
+ </NumberFieldDecrement>
35
+ <NumberFieldInput class="celeste-counter-input" />
36
+ <NumberFieldIncrement as-child class="celeste-counter-input-increment">
37
+ <CompactButton variant="ghost" icon="i-celeste-add-line" />
38
+ </NumberFieldIncrement>
39
+ </NumberFieldRoot>
40
+ </template>
41
+
42
+ <style lang="scss">
43
+ .celeste-counter-input-wrapper {
44
+ --celeste-counter-input-bg-color: var(--color-bg-white-0);
45
+ --celeste-counter-input-text-color: var(--color-text-strong-950);
46
+ --celeste-counter-input-drop-shadow: var(--shadow-regular-xs);
47
+ --celeste-counter-input-outline-color: transparent;
48
+ --celeste-counter-input-border-color: var(--color-stroke-soft-200);
49
+
50
+ display: flex;
51
+ align-items: center;
52
+ width: 100%;
53
+ height: var(--celeste-counter-input-height);
54
+ padding-inline: var(--celeste-counter-input-gap);
55
+ transition: all var(--animation-fast) ease-out;
56
+ border: 1px solid var(--celeste-counter-input-border-color);
57
+ border-radius: var(--celeste-counter-input-radius);
58
+ outline: 2px solid var(--celeste-counter-input-outline-color);
59
+ outline-offset: 2px;
60
+ background-color: var(--celeste-counter-input-bg-color);
61
+ box-shadow: var(--celeste-counter-input-drop-shadow);
62
+ color: var(--celeste-counter-input-text-color);
63
+ font: var(--paragraph-sm);
64
+ gap: var(--celeste-counter-input-gap);
65
+
66
+ &[size='xs'] {
67
+ --celeste-counter-input-gap: var(--spacing-4);
68
+ --celeste-counter-input-height: 30px;
69
+ --celeste-counter-input-radius: var(--radius-8);
70
+ --celeste-counter-input-padding: calc(var(--spacing-8) - var(--spacing-2));
71
+ }
72
+
73
+ &[size='sm'] {
74
+ --celeste-counter-input-gap: var(--spacing-6);
75
+ --celeste-counter-input-height: 34px;
76
+ --celeste-counter-input-radius: var(--radius-8);
77
+ --celeste-counter-input-padding: var(--spacing-8);
78
+ }
79
+
80
+ &[size='md'] {
81
+ --celeste-counter-input-gap: var(--spacing-8);
82
+ --celeste-counter-input-height: 38px;
83
+ --celeste-counter-input-radius: var(--radius-10);
84
+ --celeste-counter-input-padding: var(--spacing-8);
85
+ }
86
+
87
+ &[has-error='true'] {
88
+ --celeste-counter-input-border-color: var(--color-state-error-base);
89
+ }
90
+
91
+ & > .celeste-counter-input {
92
+ flex: 2;
93
+ height: 100%;
94
+ border: none;
95
+ outline: none;
96
+ background-color: transparent;
97
+ color: inherit;
98
+ text-align: center;
99
+ }
100
+
101
+ .celeste-counter-input-decrement:active,
102
+ .celeste-counter-input-increment:active {
103
+ background-color: var(--color-bg-weak-50);
104
+ color: var(--color-icon-strong-950);
105
+ }
106
+
107
+ &:has(.celeste-counter-input:focus) {
108
+ --celeste-counter-input-outline-color: var(--color-stroke-soft-200);
109
+ --celeste-counter-input-border-color: var(--color-stroke-strong-950);
110
+
111
+ &[has-error='true'] {
112
+ --celeste-counter-input-border-color: var(--color-state-error-base);
113
+ --celeste-counter-input-outline-color: var(--color-state-error-lighter);
114
+ }
115
+ }
116
+
117
+ &:has(.celeste-counter-input:disabled) {
118
+ --celeste-counter-input-bg-color: var(--color-bg-weak-50);
119
+ --celeste-counter-input-text-color: var(--color-text-disabled-300);
120
+ --celeste-counter-input-drop-shadow: none;
121
+ --celeste-counter-input-border-color: transparent;
122
+
123
+ pointer-events: none;
124
+ }
125
+
126
+ &:has(.celeste-counter-input:hover:not(:focus, :disabled)) {
127
+ --celeste-counter-input-border-color: transparent;
128
+ --celeste-counter-input-bg-color: var(--color-bg-weak-50);
129
+ }
130
+ }
131
+ </style>
@@ -0,0 +1,2 @@
1
+ export * from './counter-input.vue';
2
+ export { default as CounterInput } from './counter-input.vue';