@gradient-ui/core 0.4.0 → 0.5.0-rc.0

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 (172) hide show
  1. package/README.md +58 -2
  2. package/dist/GLoading.vue_vue_type_style_index_0_lang-Bv3dWEq8.cjs +1 -0
  3. package/dist/GLoading.vue_vue_type_style_index_0_lang-CBB_GocW.js +466 -0
  4. package/dist/GSwitch.vue_vue_type_script_setup_true_lang-BS6bb1XY.cjs +1 -0
  5. package/dist/GSwitch.vue_vue_type_script_setup_true_lang-UTBNFP5X.js +7015 -0
  6. package/dist/{default-585QCoXx.js → camelToKebabCase-6qY6WHvl.js} +987 -1194
  7. package/dist/camelToKebabCase-BQDotaQm.cjs +316 -0
  8. package/dist/components.cjs +1 -1
  9. package/dist/components.mjs +56 -53
  10. package/dist/default-BhuY-A3o.cjs +4 -0
  11. package/dist/default-OTmCd0Aq.js +131 -0
  12. package/dist/directives.cjs +1 -1
  13. package/dist/directives.mjs +6 -5
  14. package/dist/index.cjs +1 -1
  15. package/dist/index.mjs +183 -113
  16. package/dist/mask-BbofdFd4.cjs +1 -0
  17. package/dist/mask-CZX-I_iy.js +936 -0
  18. package/dist/material-Ca7ZZAiO.cjs +194 -0
  19. package/dist/material-okvXHenb.js +1162 -0
  20. package/dist/materialSurface-BBrP9ltj.js +591 -0
  21. package/dist/materialSurface-CK8LN_dU.cjs +1 -0
  22. package/dist/services.cjs +1 -1
  23. package/dist/services.mjs +1 -1
  24. package/dist/style.css +1 -1
  25. package/dist/surface-8z3gR7vF.cjs +1 -0
  26. package/dist/surface-BKu4KfkY.js +288 -0
  27. package/dist/theme.cjs +1 -1
  28. package/dist/theme.mjs +55 -9
  29. package/dist/types/components/index.d.ts +3 -1
  30. package/dist/types/components/ui/BaseOverlay/BaseOverlay.vue.d.ts +1 -1
  31. package/dist/types/components/ui/GAlert/GAlert.vue.d.ts +675 -9
  32. package/dist/types/components/ui/GAlert/types.d.ts +352 -4
  33. package/dist/types/components/ui/GAside/GAside.vue.d.ts +7 -5
  34. package/dist/types/components/ui/GAside/types.d.ts +17 -6
  35. package/dist/types/components/ui/GBadge/GBadge.vue.d.ts +679 -13
  36. package/dist/types/components/ui/GBadge/types.d.ts +350 -3
  37. package/dist/types/components/ui/GButton/GButton.vue.d.ts +295 -25
  38. package/dist/types/components/ui/GButton/types.d.ts +194 -49
  39. package/dist/types/components/ui/GCheckControl/GCheckControl.vue.d.ts +24 -24
  40. package/dist/types/components/ui/GCheckControl/GCheckGroup.vue.d.ts +24 -24
  41. package/dist/types/components/ui/GCheckbox/GCheckbox.vue.d.ts +24 -24
  42. package/dist/types/components/ui/GChip/GChip.vue.d.ts +295 -25
  43. package/dist/types/components/ui/GChip/types.d.ts +188 -43
  44. package/dist/types/components/ui/GDrawer/GDrawer.vue.d.ts +1 -1
  45. package/dist/types/components/ui/GExpansion/GExpansion.vue.d.ts +47 -13
  46. package/dist/types/components/ui/GExpansion/types.d.ts +284 -22
  47. package/dist/types/components/ui/GFAB/GFAB.vue.d.ts +220 -7
  48. package/dist/types/components/ui/GFAB/types.d.ts +122 -3
  49. package/dist/types/components/ui/GFieldBase/GFieldBase.vue.d.ts +15 -15
  50. package/dist/types/components/ui/GFieldBase/props.d.ts +10 -10
  51. package/dist/types/components/ui/GForm/GForm.vue.d.ts +156 -0
  52. package/dist/types/components/ui/GForm/index.d.ts +2 -0
  53. package/dist/types/components/ui/GForm/types.d.ts +107 -0
  54. package/dist/types/components/ui/GGradient/GGradient.vue.d.ts +165 -66
  55. package/dist/types/components/ui/GGradient/GGradientBorderLayer.vue.d.ts +11 -0
  56. package/dist/types/components/ui/GGradient/index.d.ts +1 -0
  57. package/dist/types/components/ui/GGradient/types.d.ts +10 -1
  58. package/dist/types/components/ui/GGradientMaterial/GGradientMaterial.vue.d.ts +257 -0
  59. package/dist/types/components/ui/GGradientMaterial/index.d.ts +2 -0
  60. package/dist/types/components/ui/GGradientMaterial/types.d.ts +140 -0
  61. package/dist/types/components/ui/GInput/GInput.vue.d.ts +15 -15
  62. package/dist/types/components/ui/GLoading/GLoading.vue.d.ts +5 -5
  63. package/dist/types/components/ui/GLoading/types.d.ts +3 -2
  64. package/dist/types/components/ui/GMenu/GSubmenu.vue.d.ts +14 -14
  65. package/dist/types/components/ui/GMenuItem/GMenuItem.vue.d.ts +11 -11
  66. package/dist/types/components/ui/GMenuItem/types.d.ts +4 -4
  67. package/dist/types/components/ui/GModal/GModal.vue.d.ts +1 -1
  68. package/dist/types/components/ui/GNavList/GNavList.vue.d.ts +7 -5
  69. package/dist/types/components/ui/GNavList/types.d.ts +17 -6
  70. package/dist/types/components/ui/GNavbar/GNavbar.vue.d.ts +4 -4
  71. package/dist/types/components/ui/GNavbar/types.d.ts +6 -6
  72. package/dist/types/components/ui/GProgress/GProgress.vue.d.ts +41 -20
  73. package/dist/types/components/ui/GProgress/types.d.ts +23 -10
  74. package/dist/types/components/ui/GQuickActions/GQuickActions.vue.d.ts +1 -1
  75. package/dist/types/components/ui/GSelectItem.vue.d.ts +5 -3
  76. package/dist/types/components/ui/GSnackbar/GSnackbar.vue.d.ts +681 -15
  77. package/dist/types/components/ui/GSnackbar/types.d.ts +350 -3
  78. package/dist/types/components/ui/GSquircle/GSquircle.vue.d.ts +2 -2
  79. package/dist/types/components/ui/GSquircle/types.d.ts +8 -2
  80. package/dist/types/components/ui/GSwitch/GSwitch.vue.d.ts +24 -24
  81. package/dist/types/components/ui/GTable/GTable.vue.d.ts +51 -3
  82. package/dist/types/components/ui/GTable/types.d.ts +351 -3
  83. package/dist/types/components/ui/GTabs/GTabs.vue.d.ts +4 -4
  84. package/dist/types/components/ui/GTabs/types.d.ts +6 -6
  85. package/dist/types/components/ui/GTextarea/GTextarea.vue.d.ts +15 -15
  86. package/dist/types/components/ui/GToggleButton/GToggleButton.vue.d.ts +490 -16
  87. package/dist/types/components/ui/GToggleButton/types.d.ts +284 -32
  88. package/dist/types/directives/index.d.ts +2 -0
  89. package/dist/types/directives/ripple.d.ts +1 -1
  90. package/dist/types/directives/specular.d.ts +34 -0
  91. package/dist/types/theme/color.d.ts +11 -0
  92. package/dist/types/theme/colorSeeds.d.ts +21 -20
  93. package/dist/types/theme/colorSystem.d.ts +12 -0
  94. package/dist/types/theme/cssTokens.d.ts +7 -0
  95. package/dist/types/theme/default.d.ts +26 -80
  96. package/dist/types/theme/gradient/animation/css.d.ts +12 -0
  97. package/dist/types/theme/gradient/animation/index.d.ts +1 -0
  98. package/dist/types/theme/gradient/colorMath.d.ts +3 -0
  99. package/dist/types/theme/gradient/constants.d.ts +3 -0
  100. package/dist/types/theme/gradient/core.d.ts +1 -0
  101. package/dist/types/theme/gradient/effects/index.d.ts +1 -0
  102. package/dist/types/theme/gradient/effects/morph.d.ts +5 -0
  103. package/dist/types/theme/gradient/effects/shadow.d.ts +3 -0
  104. package/dist/types/theme/gradient/formatters/canvas.d.ts +2 -0
  105. package/dist/types/theme/gradient/formatters/css.d.ts +3 -0
  106. package/dist/types/theme/gradient/formatters/index.d.ts +1 -0
  107. package/dist/types/theme/gradient/formatters/svg.d.ts +5 -0
  108. package/dist/types/theme/gradient/index.d.ts +1 -0
  109. package/dist/types/theme/gradient/material.d.ts +1 -0
  110. package/dist/types/theme/gradient/model.d.ts +5 -0
  111. package/dist/types/theme/gradient/presets.d.ts +158 -0
  112. package/dist/types/theme/gradient/recipes.d.ts +14 -0
  113. package/dist/types/theme/gradient/tokens.d.ts +72 -0
  114. package/dist/types/theme/gradient/types.d.ts +117 -0
  115. package/dist/types/theme/gradient/utils.d.ts +10 -0
  116. package/dist/types/theme/gradient.d.ts +1 -0
  117. package/dist/types/theme/index.d.ts +12 -1
  118. package/dist/types/theme/palette.d.ts +13 -0
  119. package/dist/types/theme/scheme.d.ts +2 -0
  120. package/dist/types/theme/types.d.ts +11 -0
  121. package/dist/types/use/actionSurface.d.ts +1742 -20
  122. package/dist/types/use/check/booleanControl.d.ts +9 -9
  123. package/dist/types/use/check/optionGroup.d.ts +9 -7
  124. package/dist/types/use/check/types.d.ts +26 -26
  125. package/dist/types/use/color.d.ts +2 -2
  126. package/dist/types/use/colorResolver.d.ts +15 -5
  127. package/dist/types/use/form/context.d.ts +8 -0
  128. package/dist/types/use/form/control.d.ts +4 -0
  129. package/dist/types/use/form/props.d.ts +4 -4
  130. package/dist/types/use/form/textFieldControl.d.ts +1 -1
  131. package/dist/types/use/glass.d.ts +24 -0
  132. package/dist/types/use/gradient.d.ts +1759 -43
  133. package/dist/types/use/gradientGlow.d.ts +4 -4
  134. package/dist/types/use/gradientMaterial.d.ts +21 -0
  135. package/dist/types/use/gradientRuntime.d.ts +11 -0
  136. package/dist/types/use/gradientRuntimeRegistry.d.ts +8 -0
  137. package/dist/types/use/gradientSurface.d.ts +31 -4
  138. package/dist/types/use/index.d.ts +8 -0
  139. package/dist/types/use/input/props.d.ts +11 -11
  140. package/dist/types/use/material.d.ts +112 -0
  141. package/dist/types/use/materialSurface.d.ts +376 -0
  142. package/dist/types/use/surface.d.ts +67 -19
  143. package/dist/types/use/surfaceColor.d.ts +1 -1
  144. package/dist/types/use/textarea/props.d.ts +11 -11
  145. package/dist/types/use/variant.d.ts +1 -1
  146. package/dist/use.cjs +1 -1
  147. package/dist/use.mjs +42 -22
  148. package/dist/useSnackbar-BHQshEZ8.cjs +1 -0
  149. package/dist/useSnackbar-DeNHZH8v.js +908 -0
  150. package/package.json +11 -4
  151. package/dist/GLoading.vue_vue_type_style_index_0_lang-CPzo3WD3.js +0 -680
  152. package/dist/GLoading.vue_vue_type_style_index_0_lang-cokm-HBh.cjs +0 -1
  153. package/dist/GSwitch.vue_vue_type_script_setup_true_lang-BmbKqNgm.js +0 -6421
  154. package/dist/GSwitch.vue_vue_type_script_setup_true_lang-By_7hZOW.cjs +0 -4
  155. package/dist/camelToKebabCase-BAESShJ1.cjs +0 -1
  156. package/dist/camelToKebabCase-KgkZ7-1F.js +0 -28
  157. package/dist/default-BcPApP1Q.cjs +0 -318
  158. package/dist/mask-Bu8cjwwH.js +0 -817
  159. package/dist/mask-D1vJj5Hl.cjs +0 -1
  160. package/dist/propsFactory-DyyboUaC.cjs +0 -1
  161. package/dist/propsFactory-UhcvubZJ.js +0 -13
  162. package/dist/tagName-CYG1CUfd.js +0 -103
  163. package/dist/tagName-CbsvFHGg.cjs +0 -1
  164. package/dist/types/theme/changeTone.d.ts +0 -1
  165. package/dist/types/theme/colorPallete.d.ts +0 -2
  166. package/dist/types/theme/generateColors.d.ts +0 -1
  167. package/dist/types/theme/generateGradient.d.ts +0 -9
  168. package/dist/types/theme/getComplementaryColor.d.ts +0 -1
  169. package/dist/types/utils/color.d.ts +0 -3
  170. package/dist/types/utils/colors/normaliseColor.d.ts +0 -5
  171. package/dist/useSnackbar-2iJU4bdd.js +0 -769
  172. package/dist/useSnackbar-3QuH25xm.cjs +0 -1
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@gradient-ui/core",
3
- "version": "0.4.0",
3
+ "version": "0.5.0-rc.0",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vite --config docs/vite.config.ts",
7
7
  "dev:docs": "vite --config docs/vite.config.ts",
8
8
  "build:docs": "vite build --config docs/vite.config.ts",
9
- "build:lib": "vite build --config vite.lib.config.ts && vue-tsc -p tsconfig.lib.json",
9
+ "build:gradient-engine": "npm run build -w @gradient-ui/gradient-engine",
10
+ "build:lib": "npm run build:gradient-engine && vite build --config vite.lib.config.ts && vue-tsc -p tsconfig.lib.json",
10
11
  "build": "npm run build:lib && npm run build:docs",
11
12
  "preview:docs": "vite preview --config docs/vite.config.ts",
12
13
  "prettier": "prettier --check . --ignore-unknown",
@@ -16,12 +17,17 @@
16
17
  "eslint:fix": "eslint --fix .",
17
18
  "lint:css": "stylelint src docs/src",
18
19
  "lint:css:fix": "npm run lint:css -- --fix",
19
- "type-check": "vue-tsc -b && npm run type-check:docs",
20
+ "type-check": "npm run build:gradient-engine && vue-tsc -b && npm run type-check:docs",
21
+ "type-check:gradient-engine": "npm run type-check -w @gradient-ui/gradient-engine",
20
22
  "type-check:lib": "vue-tsc -p tsconfig.lib.json",
21
23
  "type-check:docs": "vue-tsc -p docs/tsconfig.json",
24
+ "release:gradient-engine:check": "npm run type-check:gradient-engine && npm run build:gradient-engine",
25
+ "release:gradient-engine:pack": "npm run release:gradient-engine:check && npm pack -w @gradient-ui/gradient-engine",
26
+ "release:gradient-engine:publish": "npm run release:gradient-engine:check && npm publish -w @gradient-ui/gradient-engine --access public",
22
27
  "prepack": "npm run build:lib"
23
28
  },
24
29
  "dependencies": {
30
+ "@gradient-ui/gradient-engine": "^0.5.0",
25
31
  "@floating-ui/vue": "^1.1.10",
26
32
  "@mdi/js": "^7.4.47",
27
33
  "gib-validate": "^1.1.0"
@@ -165,6 +171,7 @@
165
171
  "vue": "^3.5.0"
166
172
  },
167
173
  "workspaces": [
168
- "docs"
174
+ "docs",
175
+ "packages/*"
169
176
  ]
170
177
  }
@@ -1,680 +0,0 @@
1
- import { computed as a, toValue as p, ref as D, onMounted as F, onBeforeUnmount as H, defineComponent as O, useAttrs as ae, TransitionGroup as se, Transition as ie, openBlock as y, createBlock as I, resolveDynamicComponent as le, mergeProps as ce, unref as w, withCtx as U, renderSlot as A, createElementBlock as h, normalizeStyle as V, normalizeClass as k, createTextVNode as W, toDisplayString as j, createCommentVNode as E, createElementVNode as f, Fragment as ue, renderList as de, createVNode as ge } from "vue";
2
- import { p as g } from "./propsFactory-UhcvubZJ.js";
3
- import "@mdi/js";
4
- import { M as ve, c as fe } from "./camelToKebabCase-KgkZ7-1F.js";
5
- const pe = (e, t) => {
6
- const n = e.__vccOpts || e;
7
- for (const [o, i] of t)
8
- n[o] = i;
9
- return n;
10
- }, me = g({
11
- disabled: Boolean
12
- });
13
- function ye(e, t) {
14
- return a(() => e.disabled ? `${t}_disabled` : "");
15
- }
16
- const K = g({
17
- rounded: Boolean
18
- });
19
- function _e(e, t) {
20
- return a(() => e.rounded ? `${t}_rounded` : "");
21
- }
22
- const be = g({
23
- size: {
24
- type: String,
25
- default: "m"
26
- }
27
- });
28
- function tt(e, t) {
29
- return a(() => `${t}_${e.size}`);
30
- }
31
- const S = ke();
32
- function Se(e) {
33
- var t;
34
- return e ? ((t = S[e]) == null ? void 0 : t.color) ?? e : S.primary.color;
35
- }
36
- function Ce(e) {
37
- var t;
38
- return e ? ((t = S[e]) == null ? void 0 : t.onColor) ?? S.primary.onColor : S.primary.onColor;
39
- }
40
- function he(e) {
41
- var t;
42
- return e ? ((t = S[e]) == null ? void 0 : t.gradient) ?? `var(--g-gradient-${e})` : S.primary.gradient;
43
- }
44
- function $e(e) {
45
- return a(() => he(p(e)));
46
- }
47
- function ke() {
48
- const e = {
49
- primary: {
50
- color: "var(--g-token-color-primary)",
51
- onColor: "var(--g-token-color-on-primary)",
52
- gradient: "var(--g-gradient-main)"
53
- },
54
- main: {
55
- color: "var(--g-token-color-primary)",
56
- onColor: "var(--g-token-color-on-primary)",
57
- gradient: "var(--g-gradient-main)"
58
- },
59
- error: {
60
- color: "var(--g-token-color-error)",
61
- onColor: "var(--g-token-color-on-error)",
62
- gradient: "var(--g-gradient-error)"
63
- },
64
- warning: {
65
- color: "var(--g-token-color-warning)",
66
- onColor: "var(--g-token-color-on-warning)",
67
- gradient: "var(--g-gradient-warning)"
68
- },
69
- success: {
70
- color: "var(--g-token-color-success)",
71
- onColor: "var(--g-token-color-on-success)",
72
- gradient: "var(--g-gradient-success)"
73
- },
74
- surface: {
75
- color: "var(--g-token-color-surface)",
76
- onColor: "var(--g-token-color-on-surface)",
77
- gradient: "var(--g-gradient-source-40)"
78
- },
79
- "on-surface": {
80
- color: "var(--g-token-color-on-surface)",
81
- onColor: "var(--g-token-color-surface)",
82
- gradient: "var(--g-gradient-source-40)"
83
- },
84
- source: {
85
- color: "rgb(var(--g-color-source-40))",
86
- onColor: "rgb(var(--g-color-on-source-40))",
87
- gradient: "var(--g-gradient-source-40)"
88
- }
89
- };
90
- return z(e, "source"), Object.keys(ve).forEach((t) => {
91
- z(e, t);
92
- }), e;
93
- }
94
- function z(e, t) {
95
- const n = fe(t);
96
- for (let o = 10; o <= 100; o += 10) {
97
- const i = {
98
- color: `rgb(var(--g-color-${n}-${o}))`,
99
- onColor: `rgb(var(--g-color-on-${n}-${o}))`,
100
- gradient: `var(--g-gradient-${n}-${o})`
101
- };
102
- e[`${t}${o}`] = i, e[`${n}${o}`] = i, e[`${n}-${o}`] = i;
103
- }
104
- e[t] = e[`${t}40`], e[n] = e[`${n}40`];
105
- }
106
- const J = g({
107
- color: {
108
- type: String,
109
- default: "primary"
110
- }
111
- });
112
- function we(e) {
113
- return {
114
- colorStyles: a(() => {
115
- const n = p(e.color);
116
- return {
117
- "--g-color": Se(n),
118
- "--g-on-color": Ce(n),
119
- "--g-surface-color": "var(--g-token-color-surface)",
120
- "--g-on-surface-color": "var(--g-token-color-on-surface)"
121
- };
122
- })
123
- };
124
- }
125
- function Q(e) {
126
- const t = a(() => {
127
- const c = p(e.activeState);
128
- return p(e.active) && c !== void 0 ? c : p(e.state);
129
- }), n = a(() => {
130
- const c = t.value;
131
- if (c)
132
- return c;
133
- const s = p(e.activeColor);
134
- return p(e.active) && s !== void 0 ? s : p(e.color);
135
- }), { colorStyles: o } = we({ color: n }), i = $e(n), l = a(
136
- () => ({
137
- ...o.value,
138
- "--g-gradient-current": i.value
139
- })
140
- );
141
- return {
142
- resolvedColor: n,
143
- resolvedState: t,
144
- resolvedGradient: i,
145
- colorStyles: o,
146
- surfaceColorStyles: o,
147
- gradientStyles: l
148
- };
149
- }
150
- const xe = {
151
- fade: "g-fade-transition",
152
- scale: "g-scale-transition",
153
- "scale-only": "g-scale-only-transition",
154
- "slide-x": "g-slide-x-transition",
155
- "slide-x-reverse": "g-slide-x-reverse-transition",
156
- "slide-y": "g-slide-y-transition",
157
- "slide-y-reverse": "g-slide-y-reverse-transition",
158
- dialog: "g-dialog-transition",
159
- overlay: "g-overlay-transition",
160
- expand: "g-expand-transition"
161
- }, X = g(
162
- {
163
- transition: {
164
- type: [Boolean, String, Object],
165
- default: void 0
166
- }
167
- },
168
- "transition"
169
- ), Le = g(
170
- {
171
- ...X(),
172
- name: String,
173
- appear: Boolean,
174
- disabled: Boolean,
175
- group: Boolean,
176
- tag: String,
177
- mode: String,
178
- origin: String,
179
- duration: [Number, String],
180
- enterDuration: [Number, String],
181
- leaveDuration: [Number, String],
182
- easing: String,
183
- enterEasing: String,
184
- leaveEasing: String,
185
- distance: [Number, String],
186
- scale: [Number, String],
187
- opacity: {
188
- type: Boolean,
189
- default: void 0
190
- },
191
- leaveAbsolute: Boolean,
192
- hideOnLeave: Boolean,
193
- css: {
194
- type: Boolean,
195
- default: !0
196
- }
197
- },
198
- "transition"
199
- );
200
- function Te(e) {
201
- return e ? xe[e] ?? e : "";
202
- }
203
- function Be(e) {
204
- if (!(e === void 0 || e === ""))
205
- return typeof e == "number" ? `${e}px` : e;
206
- }
207
- function R(e) {
208
- if (!(e === void 0 || e === ""))
209
- return typeof e == "number" ? `${e}ms` : e;
210
- }
211
- function G(e, t) {
212
- if (e === void 0 || e === "") return t;
213
- if (typeof e == "number") return e;
214
- const n = e.trim();
215
- if (n.endsWith("ms"))
216
- return Number.parseFloat(n);
217
- if (n.endsWith("s"))
218
- return Number.parseFloat(n) * 1e3;
219
- const o = Number.parseFloat(n);
220
- return Number.isNaN(o) ? t : o;
221
- }
222
- function De(e, t) {
223
- return e === !1 ? {
224
- ...t,
225
- disabled: !0
226
- } : e === !0 || e === void 0 ? t : typeof e == "string" ? {
227
- ...t,
228
- name: e
229
- } : {
230
- ...t,
231
- ...e
232
- };
233
- }
234
- function Ee() {
235
- const e = D(!1);
236
- let t = null;
237
- const n = () => {
238
- e.value = (t == null ? void 0 : t.matches) ?? !1;
239
- };
240
- return F(() => {
241
- typeof window > "u" || !window.matchMedia || (t = window.matchMedia("(prefers-reduced-motion: reduce)"), n(), t.addEventListener("change", n));
242
- }), H(() => {
243
- t == null || t.removeEventListener("change", n);
244
- }), e;
245
- }
246
- const Me = 80, Ne = /* @__PURE__ */ O({
247
- inheritAttrs: !1,
248
- __name: "GTransition",
249
- props: Le({
250
- name: "fade",
251
- css: !0
252
- }),
253
- emits: ["before-enter", "after-enter", "before-leave", "leave", "after-leave", "enter-cancelled", "leave-cancelled"],
254
- setup(e, { emit: t }) {
255
- const n = e, o = t, i = ae(), l = Ee(), c = a(
256
- () => n.group ? se : ie
257
- ), s = a(
258
- () => De(n.transition, M.value)
259
- ), _ = a(
260
- () => b.value ? "" : Te(s.value.name)
261
- ), b = a(
262
- () => n.disabled || l.value || s.value.disabled
263
- ), $ = a(
264
- () => n.group || s.value.mode === "default" ? void 0 : s.value.mode
265
- ), C = a(
266
- () => !b.value && s.value.css !== !1
267
- ), u = a(() => {
268
- if (!x.value || b.value) return;
269
- const r = s.value;
270
- return {
271
- enter: G(
272
- r.enterDuration ?? r.duration,
273
- 220
274
- ),
275
- leave: G(
276
- r.leaveDuration ?? r.duration,
277
- 180
278
- ) + Me
279
- };
280
- }), x = a(
281
- () => s.value.name === "overlay" || _.value === "g-overlay-transition"
282
- ), M = a(() => ({
283
- name: n.name,
284
- appear: n.appear,
285
- mode: n.mode,
286
- origin: n.origin,
287
- duration: n.duration,
288
- enterDuration: n.enterDuration,
289
- leaveDuration: n.leaveDuration,
290
- easing: n.easing,
291
- enterEasing: n.enterEasing,
292
- leaveEasing: n.leaveEasing,
293
- distance: n.distance,
294
- scale: n.scale,
295
- opacity: n.opacity,
296
- leaveAbsolute: n.leaveAbsolute,
297
- hideOnLeave: n.hideOnLeave,
298
- css: n.css
299
- })), N = a(() => {
300
- const r = s.value;
301
- return {
302
- "--g-transition-enter-duration": R(
303
- r.enterDuration ?? r.duration
304
- ),
305
- "--g-transition-leave-duration": R(
306
- r.leaveDuration ?? r.duration
307
- ),
308
- "--g-transition-enter-easing": r.enterEasing ?? r.easing,
309
- "--g-transition-leave-easing": r.leaveEasing ?? r.easing,
310
- "--g-transition-origin": r.origin,
311
- "--g-transition-distance": Be(r.distance),
312
- "--g-transition-scale": r.scale === void 0 ? void 0 : String(r.scale),
313
- "--g-transition-opacity-from": r.opacity === !1 ? "1" : void 0
314
- };
315
- });
316
- function L(r) {
317
- if (r instanceof HTMLElement)
318
- for (const [d, B] of Object.entries(N.value))
319
- B !== void 0 && r.style.setProperty(d, B);
320
- }
321
- function P(r) {
322
- const { offsetTop: d, offsetLeft: B, offsetWidth: ne, offsetHeight: oe } = r;
323
- r._gTransitionInitialStyles = {
324
- position: r.style.position,
325
- top: r.style.top,
326
- left: r.style.left,
327
- width: r.style.width,
328
- height: r.style.height,
329
- display: r.style.display
330
- }, r.style.position = "absolute", r.style.top = `${d}px`, r.style.left = `${B}px`, r.style.width = `${ne}px`, r.style.height = `${oe}px`;
331
- }
332
- function v(r) {
333
- const d = r._gTransitionInitialStyles;
334
- d && (r.style.position = d.position, r.style.top = d.top, r.style.left = d.left, r.style.width = d.width, r.style.height = d.height, r.style.display = d.display, delete r._gTransitionInitialStyles);
335
- }
336
- function m(r) {
337
- L(r), o("before-enter", r);
338
- }
339
- function T(r) {
340
- o("after-enter", r);
341
- }
342
- function Z(r) {
343
- L(r), o("before-leave", r);
344
- }
345
- function q(r) {
346
- if (!(r instanceof HTMLElement)) {
347
- o("leave", r);
348
- return;
349
- }
350
- s.value.leaveAbsolute && P(r), s.value.hideOnLeave && r.style.setProperty("display", "none", "important"), o("leave", r);
351
- }
352
- function ee(r) {
353
- r instanceof HTMLElement && v(r), o("after-leave", r);
354
- }
355
- function te(r) {
356
- o("enter-cancelled", r);
357
- }
358
- function re(r) {
359
- r instanceof HTMLElement && v(r), o("leave-cancelled", r);
360
- }
361
- return (r, d) => (y(), I(le(c.value), ce(w(i), {
362
- name: _.value,
363
- css: C.value,
364
- appear: s.value.appear,
365
- duration: u.value,
366
- mode: $.value,
367
- tag: n.group ? n.tag : void 0,
368
- onBeforeEnter: m,
369
- onAfterEnter: T,
370
- onBeforeLeave: Z,
371
- onLeave: q,
372
- onAfterLeave: ee,
373
- onEnterCancelled: te,
374
- onLeaveCancelled: re
375
- }), {
376
- default: U(() => [
377
- A(r.$slots, "default")
378
- ]),
379
- _: 3
380
- }, 16, ["name", "css", "appear", "duration", "mode", "tag"]));
381
- }
382
- }), Pe = (e) => a(() => {
383
- const t = p(e);
384
- return t === "" || t === null || t === void 0 ? "" : typeof t == "number" ? `${t}px` : /^\d+(\.\d+)?$/.test(t) ? `${t}px` : t;
385
- }), Ve = g({
386
- variant: {
387
- type: String,
388
- default: "filled"
389
- }
390
- });
391
- function Oe(e, t) {
392
- return a(() => `${t}_${e.variant}`);
393
- }
394
- const Y = g({
395
- state: String
396
- });
397
- function Ae(e, t) {
398
- return a(() => e.state ? `${t}_${e.state}` : "");
399
- }
400
- const rt = g({
401
- ...Ve(),
402
- ...J(),
403
- ...me(),
404
- ...K(),
405
- ...Y()
406
- });
407
- function nt(e, t) {
408
- const n = Oe(e, t), o = ye(e, t), i = _e(e, t), l = Ae(e, t), { colorStyles: c } = Q(e), s = a(
409
- () => [
410
- n.value,
411
- o.value,
412
- i.value,
413
- l.value
414
- ].filter(Boolean)
415
- );
416
- return {
417
- variantClass: n,
418
- disabledClass: o,
419
- roundedClass: i,
420
- stateClass: l,
421
- surfaceStyles: c,
422
- surfaceClasses: s
423
- };
424
- }
425
- function ze(e) {
426
- return {
427
- surfaceUnderlayClasses: a(() => [
428
- `${e}__surface-underlay`
429
- ])
430
- };
431
- }
432
- function Re(e) {
433
- return {
434
- surfaceOverlayClasses: a(() => [
435
- `${e}__surface-overlay`
436
- ])
437
- };
438
- }
439
- function Ge(e) {
440
- return {
441
- surfaceContentClasses: a(() => [
442
- `${e}__surface-content`
443
- ])
444
- };
445
- }
446
- function Fe(e) {
447
- return {
448
- ...ze(e),
449
- ...Re(e),
450
- ...Ge(e)
451
- };
452
- }
453
- const He = g({
454
- ...J(),
455
- ...K(),
456
- ...be(),
457
- ...Y(),
458
- modelValue: {
459
- type: Number,
460
- default: 0
461
- },
462
- indeterminate: Boolean,
463
- noLabel: Boolean,
464
- label: String,
465
- labelAlign: {
466
- type: String,
467
- default: "center"
468
- },
469
- view: {
470
- type: String,
471
- default: "default"
472
- },
473
- segments: {
474
- type: Number,
475
- default: 12
476
- }
477
- }), Ie = {
478
- key: 0,
479
- class: "g-progress__label"
480
- }, Ue = ["aria-valuenow", "aria-valuetext"], We = /* @__PURE__ */ O({
481
- __name: "GProgress",
482
- props: He({ color: "primary" }),
483
- setup(e) {
484
- const t = e, { gradientStyles: n } = Q(t), o = D(0), i = D(null);
485
- let l;
486
- const c = a(
487
- () => Math.min(100, Math.max(0, t.modelValue))
488
- ), s = Pe(o), _ = a(
489
- () => Math.max(2, Math.round(t.segments))
490
- ), b = a(
491
- () => Array.from({ length: _.value - 1 }, (v, m) => m)
492
- ), $ = a(() => `${c.value}%`), C = a(
493
- () => t.label ?? `${Math.round(c.value)}%`
494
- ), u = (v) => ({
495
- "--g-progress-segment-position": `${(v + 1) / _.value * 100}%`
496
- }), x = a(() => ({
497
- ...n.value,
498
- "--g-progress-value": $.value,
499
- "--g-progress-track-width": s.value
500
- })), M = () => {
501
- l = new ResizeObserver((v) => {
502
- for (const m of v)
503
- o.value = m.contentRect.width;
504
- }), i.value && l.observe(i.value);
505
- };
506
- F(() => {
507
- M();
508
- }), H(() => {
509
- l == null || l.disconnect();
510
- });
511
- const {
512
- surfaceOverlayClasses: N,
513
- surfaceUnderlayClasses: L,
514
- surfaceContentClasses: P
515
- } = Fe("g-progress");
516
- return (v, m) => (y(), h("div", {
517
- class: k(["g-progress", {
518
- "g-progress_rounded": t.rounded,
519
- "g-progress_indeterminate": t.indeterminate,
520
- "g-progress_no-label": t.noLabel,
521
- [`g-progress_${t.size}`]: !0,
522
- [`g-progress_label-${t.labelAlign}`]: !0,
523
- [`g-progress_view-${t.view}`]: !0
524
- }]),
525
- style: V(x.value)
526
- }, [
527
- t.noLabel ? E("", !0) : (y(), h("div", Ie, [
528
- A(v.$slots, "default", {}, () => [
529
- W(j(C.value), 1)
530
- ], !0)
531
- ])),
532
- f("div", {
533
- ref_key: "parentRef",
534
- ref: i,
535
- class: "g-progress__track",
536
- role: "progressbar",
537
- "aria-valuemin": 0,
538
- "aria-valuemax": 100,
539
- "aria-valuenow": t.indeterminate ? void 0 : c.value,
540
- "aria-valuetext": t.indeterminate ? void 0 : C.value
541
- }, [
542
- f("span", {
543
- class: k(w(L))
544
- }, null, 2),
545
- f("span", {
546
- class: k(w(N))
547
- }, null, 2),
548
- f("div", {
549
- class: k(["g-progress__surface-content", w(P)])
550
- }, [...m[0] || (m[0] = [
551
- f("div", { class: "g-progress__bar" }, [
552
- f("div", { class: "g-progress__active" }, [
553
- f("div", { class: "g-progress__overlay" })
554
- ])
555
- ], -1)
556
- ])], 2),
557
- t.view === "segmented" ? (y(!0), h(ue, { key: 0 }, de(b.value, (T) => (y(), h("span", {
558
- key: T,
559
- class: "g-progress__segment-divider",
560
- style: V(u(T))
561
- }, null, 4))), 128)) : E("", !0)
562
- ], 8, Ue)
563
- ], 6));
564
- }
565
- }), je = /* @__PURE__ */ pe(We, [["__scopeId", "data-v-0140ebe7"]]), Ke = g({
566
- ...X(),
567
- text: String,
568
- noText: Boolean,
569
- show: Boolean,
570
- color: String,
571
- dark: Boolean,
572
- opacity: [Number, String],
573
- blur: [Number, String],
574
- progressView: String,
575
- onClose: Function
576
- }), Je = { class: "g-loading__body" }, Qe = {
577
- key: 0,
578
- class: "g-loading__text"
579
- }, Xe = { class: "g-loading__progress" }, ot = /* @__PURE__ */ O({
580
- __name: "GLoading",
581
- props: Ke({
582
- text: "Loading...",
583
- noText: !1,
584
- show: !1,
585
- color: "primary",
586
- dark: !1,
587
- opacity: void 0,
588
- blur: void 0,
589
- progressView: "glow",
590
- transition: () => ({ name: "fade", duration: 220 }),
591
- onClose: void 0
592
- }),
593
- emits: ["close"],
594
- setup(e, { expose: t, emit: n }) {
595
- const o = e, i = n, l = D(!1), c = a(() => o.show || l.value), s = a(() => ({
596
- "--g-loading-overlay-opacity": o.opacity !== void 0 ? String(o.opacity) : void 0,
597
- "--g-loading-overlay-blur": o.blur !== void 0 ? _(o.blur) : void 0
598
- }));
599
- function _(u) {
600
- return typeof u == "number" ? `${u}px` : u;
601
- }
602
- function b() {
603
- l.value = !0;
604
- }
605
- function $() {
606
- l.value = !1;
607
- }
608
- function C() {
609
- var u;
610
- (u = o.onClose) == null || u.call(o), i("close");
611
- }
612
- return t({
613
- hide: $,
614
- show: b,
615
- isVisible: c
616
- }), (u, x) => (y(), I(w(Ne), {
617
- transition: o.transition,
618
- name: "scale",
619
- onAfterLeave: C
620
- }, {
621
- default: U(() => [
622
- c.value ? (y(), h("div", {
623
- key: 0,
624
- class: k(["g-loading", { "g-loading_dark": o.dark }]),
625
- style: V(s.value),
626
- "aria-live": "polite",
627
- "aria-busy": "true"
628
- }, [
629
- f("div", Je, [
630
- o.noText ? E("", !0) : (y(), h("div", Qe, [
631
- A(u.$slots, "default", {}, () => [
632
- W(j(o.text), 1)
633
- ])
634
- ])),
635
- f("div", Xe, [
636
- ge(je, {
637
- "no-label": "",
638
- indeterminate: "",
639
- "model-value": 100,
640
- color: o.color,
641
- view: o.progressView,
642
- size: "s"
643
- }, null, 8, ["color", "view"])
644
- ])
645
- ])
646
- ], 6)) : E("", !0)
647
- ]),
648
- _: 3
649
- }, 8, ["transition"]));
650
- }
651
- });
652
- export {
653
- je as G,
654
- ot as _,
655
- Ne as a,
656
- Se as b,
657
- pe as c,
658
- Y as d,
659
- me as e,
660
- Ae as f,
661
- Pe as g,
662
- K as h,
663
- Ve as i,
664
- _e as j,
665
- $e as k,
666
- be as l,
667
- X as m,
668
- rt as n,
669
- nt as o,
670
- Fe as p,
671
- tt as q,
672
- he as r,
673
- Q as s,
674
- J as t,
675
- ye as u,
676
- Ee as v,
677
- De as w,
678
- Le as x,
679
- Oe as y
680
- };