@byyuurin/ui 0.0.3 → 0.0.4

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 (81) hide show
  1. package/README.md +4 -2
  2. package/dist/nuxt.mjs +1 -1
  3. package/dist/resolver.mjs +1 -1
  4. package/dist/runtime/components/App.vue +5 -1
  5. package/dist/runtime/components/Button.vue +0 -1
  6. package/dist/runtime/components/Checkbox.vue +2 -5
  7. package/dist/runtime/components/Input.vue +5 -1
  8. package/dist/runtime/components/ModalProvider.vue +1 -1
  9. package/dist/runtime/components/RadioGroup.vue +1 -7
  10. package/dist/runtime/components/ScrollArea.vue +72 -0
  11. package/dist/runtime/components/Switch.vue +0 -1
  12. package/dist/runtime/components/Tabs.vue +5 -5
  13. package/dist/runtime/components/Textarea.vue +173 -0
  14. package/dist/runtime/components/Toast.vue +1 -1
  15. package/dist/runtime/components/index.d.ts +2 -0
  16. package/dist/runtime/components/index.mjs +2 -0
  17. package/dist/runtime/composables/defineInjection.d.ts +11 -0
  18. package/dist/runtime/composables/defineInjection.mjs +9 -0
  19. package/dist/runtime/composables/index.d.ts +1 -0
  20. package/dist/runtime/composables/index.mjs +1 -0
  21. package/dist/runtime/composables/useModal.d.ts +1 -1
  22. package/dist/runtime/composables/useModal.mjs +3 -2
  23. package/dist/runtime/composables/useTheme.d.ts +3 -1
  24. package/dist/runtime/composables/useTheme.mjs +14 -6
  25. package/dist/runtime/theme/button.d.ts +0 -8
  26. package/dist/runtime/theme/button.mjs +1 -9
  27. package/dist/runtime/theme/checkbox.d.ts +0 -12
  28. package/dist/runtime/theme/checkbox.mjs +4 -9
  29. package/dist/runtime/theme/index.d.ts +2 -0
  30. package/dist/runtime/theme/index.mjs +2 -0
  31. package/dist/runtime/theme/radioGroup.d.ts +0 -24
  32. package/dist/runtime/theme/radioGroup.mjs +8 -20
  33. package/dist/runtime/theme/scrollArea.d.ts +51 -0
  34. package/dist/runtime/theme/scrollArea.mjs +30 -0
  35. package/dist/runtime/theme/switch.d.ts +0 -12
  36. package/dist/runtime/theme/switch.mjs +2 -8
  37. package/dist/runtime/theme/tabs.d.ts +32 -11
  38. package/dist/runtime/theme/tabs.mjs +19 -12
  39. package/dist/runtime/theme/textarea.d.ts +90 -0
  40. package/dist/runtime/theme/textarea.mjs +100 -0
  41. package/dist/runtime/theme/toast.mjs +1 -1
  42. package/dist/runtime/types/components.d.ts +2 -0
  43. package/dist/runtime/utils/index.d.ts +0 -11
  44. package/dist/runtime/utils/index.mjs +0 -11
  45. package/dist/shared/{ui.CPXA9QoM.mjs → ui.Cmq14xN9.mjs} +2 -0
  46. package/dist/unocss-preset.d.mts +15 -7
  47. package/dist/unocss-preset.d.ts +15 -7
  48. package/dist/unocss-preset.mjs +90 -386
  49. package/package.json +6 -5
  50. package/dist/index.cjs +0 -38
  51. package/dist/runtime/components/index.cjs +0 -132
  52. package/dist/runtime/composables/index.cjs +0 -33
  53. package/dist/runtime/composables/useComponentIcons.cjs +0 -30
  54. package/dist/runtime/composables/useModal.cjs +0 -55
  55. package/dist/runtime/composables/useTheme.cjs +0 -30
  56. package/dist/runtime/composables/useToast.cjs +0 -51
  57. package/dist/runtime/theme/accordion.cjs +0 -27
  58. package/dist/runtime/theme/app.cjs +0 -15
  59. package/dist/runtime/theme/button.cjs +0 -127
  60. package/dist/runtime/theme/card.cjs +0 -17
  61. package/dist/runtime/theme/checkbox.cjs +0 -56
  62. package/dist/runtime/theme/drawer.cjs +0 -73
  63. package/dist/runtime/theme/index.cjs +0 -125
  64. package/dist/runtime/theme/input.cjs +0 -115
  65. package/dist/runtime/theme/link.cjs +0 -23
  66. package/dist/runtime/theme/modal.cjs +0 -55
  67. package/dist/runtime/theme/popover.cjs +0 -13
  68. package/dist/runtime/theme/radioGroup.cjs +0 -73
  69. package/dist/runtime/theme/select.cjs +0 -128
  70. package/dist/runtime/theme/switch.cjs +0 -73
  71. package/dist/runtime/theme/tabs.cjs +0 -105
  72. package/dist/runtime/theme/toast.cjs +0 -33
  73. package/dist/runtime/theme/toaster.cjs +0 -72
  74. package/dist/runtime/theme/tooltip.cjs +0 -14
  75. package/dist/runtime/types/components.cjs +0 -1
  76. package/dist/runtime/types/index.cjs +0 -27
  77. package/dist/runtime/types/utils.cjs +0 -1
  78. package/dist/runtime/utils/extend-theme.cjs +0 -24
  79. package/dist/runtime/utils/index.cjs +0 -119
  80. package/dist/runtime/utils/link.cjs +0 -10
  81. package/dist/runtime/utils/styler.cjs +0 -18
@@ -1,105 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _uiKit = require("@byyuurin/ui-kit");
8
- module.exports = (0, _uiKit.ct)({
9
- slots: {
10
- root: "flex items-center gap-2",
11
- list: "relative flex p-1 group",
12
- indicator: "absolute transition-all duration-200",
13
- trigger: ["group relative inline-flex items-center shrink-0 min-w-0 font-medium rounded-ui-tabs transition-colors", "focus:outline-hidden", "disabled:cursor-not-allowed disabled:opacity-50"],
14
- content: "w-full focus:outline-none",
15
- leadingIcon: "shrink-0",
16
- label: "truncate"
17
- },
18
- variants: {
19
- variant: {
20
- solid: {
21
- list: "bg-ui-cb/5 rounded-ui-tabs",
22
- trigger: ["data-[state=active]:color-ui-c1 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ui-fill/80", "data-[state=inactive]:color-ui-cb/80 hover:data-[state=inactive]:not-disabled:color-ui-cb"],
23
- indicator: "bg-ui-fill/90 rounded-ui-tabs shadow-xs"
24
- },
25
- soft: {
26
- list: "bg-ui-c1 rounded-ui-tabs",
27
- trigger: ["data-[state=active]:color-ui-fill focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ui-fill", "data-[state=inactive]:color-ui-cb/80 hover:data-[state=inactive]:not-disabled:color-ui-cb"],
28
- indicator: "bg-ui-fill/10 rounded-ui-tabs shadow-xs"
29
- },
30
- link: {
31
- list: "border-ui-cb/10",
32
- indicator: "bg-ui-fill rounded-full",
33
- trigger: ["data-[state=active]:color-ui-base focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ui-base", "data-[state=inactive]:color-ui-cb/80 hover:data-[state=inactive]:not-disabled:color-ui-cb"]
34
- }
35
- },
36
- orientation: {
37
- horizontal: {
38
- root: "flex-col",
39
- list: "w-full",
40
- indicator: "left-0 w-[var(--reka-tabs-indicator-size)] translate-x-[var(--reka-tabs-indicator-position)]",
41
- trigger: "justify-center"
42
- },
43
- vertical: {
44
- list: "flex-col",
45
- indicator: "top-0 h-[var(--reka-tabs-indicator-size)] translate-y-[var(--reka-tabs-indicator-position)]",
46
- trigger: "flex-1 w-full"
47
- }
48
- },
49
- size: {
50
- xs: {
51
- trigger: "px-2 py-1 text-xs gap-1",
52
- leadingIcon: "size-4"
53
- },
54
- sm: {
55
- trigger: "px-2.5 py-1.5 text-xs gap-1.5",
56
- leadingIcon: "size-4"
57
- },
58
- md: {
59
- trigger: "px-3 py-1.5 text-sm gap-1.5",
60
- leadingIcon: "size-5"
61
- },
62
- lg: {
63
- trigger: "px-3 py-2 text-sm gap-2",
64
- leadingIcon: "size-5"
65
- },
66
- xl: {
67
- trigger: "px-3 py-2 text-base gap-2",
68
- leadingIcon: "size-6"
69
- }
70
- },
71
- full: {
72
- true: {
73
- trigger: "w-full flex-1"
74
- }
75
- }
76
- },
77
- compoundVariants: [{
78
- orientation: "horizontal",
79
- variant: ["solid", "soft"],
80
- class: {
81
- indicator: "inset-y-1"
82
- }
83
- }, {
84
- orientation: "horizontal",
85
- variant: "link",
86
- class: {
87
- list: "border-b -mb-px",
88
- indicator: "-bottom-px h-px"
89
- }
90
- }, {
91
- orientation: "vertical",
92
- variant: ["solid", "soft"],
93
- class: {
94
- indicator: "inset-x-1",
95
- list: "items-center rounded-[calc(var(--ui-radius-tabs)*0.66)]"
96
- }
97
- }, {
98
- orientation: "vertical",
99
- variant: "link",
100
- class: {
101
- list: "border-s -ms-px",
102
- indicator: "-start-px w-px"
103
- }
104
- }]
105
- });
@@ -1,33 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _uiKit = require("@byyuurin/ui-kit");
8
- module.exports = (0, _uiKit.ct)({
9
- slots: {
10
- root: "relative group overflow-hidden bg-ui-c1 shadow-lg rounded-ui-box ring ring-ui-c2 p-4 flex gap-2.5 focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ui-c2",
11
- wrapper: "w-0 flex-1 flex flex-col gap-1",
12
- title: "text-base font-medium color-ui-cb",
13
- description: "text-sm color-ui-cb/80",
14
- icon: "shrink-0 size-6 color-ui-cb",
15
- avatar: "shrink-0",
16
- avatarSize: "2xl",
17
- actions: "flex flex-wrap gap-1.5 shrink-0",
18
- progress: "absolute inset-x-0 bottom-0 h-1 z-[-1] color-ui-base/80 bg-current",
19
- close: "p-0.5"
20
- },
21
- variants: {
22
- multiline: {
23
- true: {
24
- root: "items-start",
25
- actions: "items-start mt-1"
26
- },
27
- false: {
28
- root: "items-center",
29
- actions: "items-center"
30
- }
31
- }
32
- }
33
- });
@@ -1,72 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _uiKit = require("@byyuurin/ui-kit");
8
- module.exports = (0, _uiKit.ct)({
9
- slots: {
10
- viewport: ["fixed flex flex-col w-[calc(100%-2rem)] sm:w-96 z-[100] focus:outline-none", "data-[expanded=true]:h-[var(--height)]"],
11
- base: ["pointer-events-auto absolute inset-x-0 z-[var(--index)] [transform:var(--transform)] transition-all duration-200 ease-out", "[&[data-expanded=false][data-front=false]]:h-[var(--front-height)]", "[&[data-expanded=false][data-front=false]>*]:invisible", "data-[state=closed]:animate-[toast-closed_200ms_ease-in-out]", "[&[data-state=closed][data-expanded=false][data-front=false]]:animate-[toast-collapsed-closed_200ms_ease-in-out]", "data-[swipe=move]:transition-none"]
12
- },
13
- variants: {
14
- position: {
15
- "top-left": {
16
- viewport: "left-4"
17
- },
18
- "top-center": {
19
- viewport: "left-1/2 -translate-x-1/2"
20
- },
21
- "top-right": {
22
- viewport: "right-4"
23
- },
24
- "bottom-left": {
25
- viewport: "left-4"
26
- },
27
- "bottom-center": {
28
- viewport: "left-1/2 -translate-x-1/2"
29
- },
30
- "bottom-right": {
31
- viewport: "right-4"
32
- }
33
- },
34
- swipeDirection: {
35
- up: {
36
- base: "data-[swipe=end]:animate-[toast-slide-up_200ms_ease-out]"
37
- },
38
- right: {
39
- base: "data-[swipe=end]:animate-[toast-slide-right_200ms_ease-out]"
40
- },
41
- down: {
42
- base: "data-[swipe=end]:animate-[toast-slide-down_200ms_ease-out]"
43
- },
44
- left: {
45
- base: "data-[swipe=end]:animate-[toast-slide-left_200ms_ease-out]"
46
- }
47
- }
48
- },
49
- compoundVariants: [{
50
- position: ["top-left", "top-center", "top-right"],
51
- class: {
52
- viewport: "top-4",
53
- base: "top-0 data-[state=open]:animate-[slide-in-from-top_200ms_ease-in-out]"
54
- }
55
- }, {
56
- position: ["bottom-left", "bottom-center", "bottom-right"],
57
- class: {
58
- viewport: "bottom-4",
59
- base: "bottom-0 data-[state=open]:animate-[slide-in-from-bottom_200ms_ease-in-out]"
60
- }
61
- }, {
62
- swipeDirection: ["left", "right"],
63
- class: {
64
- base: ["data-[swipe=move]:translate-x-[var(--reka-toast-swipe-move-x)]", "data-[swipe=end]:translate-x-[var(--reka-toast-swipe-end-x)]", "data-[swipe=cancel]:translate-x-0"]
65
- }
66
- }, {
67
- swipeDirection: ["up", "down"],
68
- class: {
69
- base: ["data-[swipe=move]:translate-y-[var(--reka-toast-swipe-move-y)]", "data-[swipe=end]:translate-y-[var(--reka-toast-swipe-end-y)]", "data-[swipe=cancel]:translate-y-0"]
70
- }
71
- }]
72
- });
@@ -1,14 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _uiKit = require("@byyuurin/ui-kit");
8
- module.exports = (0, _uiKit.ct)({
9
- slots: {
10
- content: "flex items-center gap-1 bg-ui-c1 color-ui-base shadow-sm rounded-ui-base ring ring-ui-base/10 h-6 px-2 py-1 text-xs select-none data-[state=delayed-open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]",
11
- arrow: "fill-ui-c1 stroke-ui-cb/10",
12
- text: "truncate"
13
- }
14
- });
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,27 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _components = require("./components.cjs");
7
- Object.keys(_components).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _components[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function () {
13
- return _components[key];
14
- }
15
- });
16
- });
17
- var _utils = require("./utils.cjs");
18
- Object.keys(_utils).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (key in exports && exports[key] === _utils[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function () {
24
- return _utils[key];
25
- }
26
- });
27
- });
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,24 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.extendTheme = void 0;
7
- var _defu = require("defu");
8
- const extendTheme = exports.extendTheme = (0, _defu.createDefu)((obj, key, value) => {
9
- if (key === "global") {
10
- obj[key] = {
11
- ...obj[key],
12
- ...value
13
- };
14
- return true;
15
- }
16
- if (typeof obj[key] === "string" && typeof value === "string") {
17
- if (value.trim()) obj[key] += ` ${value}`;
18
- return true;
19
- }
20
- if (Array.isArray(obj[key]) && typeof value === "string") {
21
- obj[key].push(value);
22
- return true;
23
- }
24
- });
@@ -1,119 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _exportNames = {
7
- createInjection: true,
8
- pick: true,
9
- omit: true,
10
- get: true,
11
- set: true,
12
- looseToNumber: true,
13
- compare: true
14
- };
15
- exports.compare = compare;
16
- exports.createInjection = createInjection;
17
- exports.get = get;
18
- exports.looseToNumber = looseToNumber;
19
- exports.omit = omit;
20
- exports.pick = pick;
21
- exports.set = set;
22
- var _ohash = require("ohash");
23
- var _vue = require("vue");
24
- var _extendTheme = require("./extend-theme.cjs");
25
- Object.keys(_extendTheme).forEach(function (key) {
26
- if (key === "default" || key === "__esModule") return;
27
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
28
- if (key in exports && exports[key] === _extendTheme[key]) return;
29
- Object.defineProperty(exports, key, {
30
- enumerable: true,
31
- get: function () {
32
- return _extendTheme[key];
33
- }
34
- });
35
- });
36
- var _link = require("./link.cjs");
37
- Object.keys(_link).forEach(function (key) {
38
- if (key === "default" || key === "__esModule") return;
39
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
40
- if (key in exports && exports[key] === _link[key]) return;
41
- Object.defineProperty(exports, key, {
42
- enumerable: true,
43
- get: function () {
44
- return _link[key];
45
- }
46
- });
47
- });
48
- var _styler = require("./styler.cjs");
49
- Object.keys(_styler).forEach(function (key) {
50
- if (key === "default" || key === "__esModule") return;
51
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
52
- if (key in exports && exports[key] === _styler[key]) return;
53
- Object.defineProperty(exports, key, {
54
- enumerable: true,
55
- get: function () {
56
- return _styler[key];
57
- }
58
- });
59
- });
60
- function createInjection(name, defaultValue) {
61
- const injectionKey = Symbol(name);
62
- const provide = value => (0, _vue.provide)(injectionKey, value);
63
- const inject = () => (0, _vue.inject)(injectionKey, defaultValue);
64
- return {
65
- injectionKey,
66
- provide,
67
- inject
68
- };
69
- }
70
- function pick(data, keys) {
71
- const result = {};
72
- for (const key of keys) result[key] = data[key];
73
- return result;
74
- }
75
- function omit(data, keys) {
76
- const result = {
77
- ...data
78
- };
79
- for (const key of keys) delete result[key];
80
- return result;
81
- }
82
- function get(object, path, defaultValue) {
83
- if (typeof path === "string") {
84
- path = path.split(".").map(key => {
85
- const numKey = Number(key);
86
- return Number.isNaN(numKey) ? key : numKey;
87
- });
88
- }
89
- let result = object;
90
- for (const key of path) {
91
- if (result === void 0 || result === null) return defaultValue;
92
- result = result[key];
93
- }
94
- return result === void 0 ? defaultValue : result;
95
- }
96
- function set(object, path, value) {
97
- if (typeof path === "string") {
98
- path = path.split(".").map(key => {
99
- const numKey = Number(key);
100
- return Number.isNaN(numKey) ? key : numKey;
101
- });
102
- }
103
- path.reduce((acc, key, i) => {
104
- if (acc[key] === void 0) acc[key] = {};
105
- if (i === path.length - 1) acc[key] = value;
106
- return acc[key];
107
- }, object);
108
- }
109
- function looseToNumber(value) {
110
- const n = Number.parseFloat(value);
111
- return Number.isNaN(n) ? value : n;
112
- }
113
- function compare(value, currentValue, comparator) {
114
- if (value === void 0 || currentValue === void 0) return false;
115
- if (typeof value === "string") return value === currentValue;
116
- if (typeof comparator === "function") return comparator(value, currentValue);
117
- if (typeof comparator === "string") return get(value, comparator) === get(currentValue, comparator);
118
- return (0, _ohash.isEqual)(value, currentValue);
119
- }
@@ -1,10 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.pickLinkProps = pickLinkProps;
7
- var _core = require("@vueuse/core");
8
- function pickLinkProps(props) {
9
- return (0, _core.reactivePick)(props, "ui", "active", "ariaLabel", "as", "disabled", "href", "rel", "noRel", "type", "target", "title", "onClick");
10
- }
@@ -1,18 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.prepareStyler = prepareStyler;
7
- var _uiKit = require("@byyuurin/ui-kit");
8
- function prepareStyler(rules = []) {
9
- const createVariants = (0, _uiKit.cv)(rules);
10
- function createStyler(theme) {
11
- const ui = createVariants(theme);
12
- const styler = props => ui(props);
13
- return styler;
14
- }
15
- return {
16
- createStyler
17
- };
18
- }