@wikicasa-dev/components 2.1.4-alpha.8 → 2.1.4-alpha.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -43,7 +43,6 @@ import { default as SwiperSlide } from './components/carousel/SwiperSlide';
43
43
  import { default as BaseBreadcrumb } from './UIKit/BaseBreadcrumb';
44
44
  import { default as NavigationBar } from './UIKit/Navigation/NavigationBar';
45
45
  import { default as NavigationBarItem } from './UIKit/Navigation/NavigationBarItem';
46
- import { buttonPlugin } from './plugins/buttonPlugin';
47
46
  export * from './UIKit/types';
48
47
  export type { ChartOptions, ChartData } from 'chart.js';
49
- export { NavigationBar, NavigationBarItem, DoughnutChart, LineChart, BaseAccordion, BaseAccordionBtn, BaseAccordionContent, BaseAccordionItem, SelectItem, BaseAlert, BaseAutocomplete, BaseBadge, BaseButton, AccessibleSelect, BaseComplexToggle, BaseDropDown, BaseFloatingLabel, BaseCard, BaseIcon, BaseInput, BasePagination, BasePaper, BasePin, BaseSelect, BaseSlider, BaseTab, BaseTextarea, BaseToggle, BaseTooltip, BaseUploadFile, CheckboxBtn, CheckboxGroup, RadioButton, RadioGroup, SwiperCarousel, SwiperSlide, IntersectionObservable, IntersectionObserver, BaseModal, BaseSnackbar, BaseTabView, BaseShimmerLoader, ShimmerMultiLine, StaticSpinner, BaseBreadcrumb, buttonPlugin };
48
+ export { NavigationBar, NavigationBarItem, DoughnutChart, LineChart, BaseAccordion, BaseAccordionBtn, BaseAccordionContent, BaseAccordionItem, SelectItem, BaseAlert, BaseAutocomplete, BaseBadge, BaseButton, AccessibleSelect, BaseComplexToggle, BaseDropDown, BaseFloatingLabel, BaseCard, BaseIcon, BaseInput, BasePagination, BasePaper, BasePin, BaseSelect, BaseSlider, BaseTab, BaseTextarea, BaseToggle, BaseTooltip, BaseUploadFile, CheckboxBtn, CheckboxGroup, RadioButton, RadioGroup, SwiperCarousel, SwiperSlide, IntersectionObservable, IntersectionObserver, BaseModal, BaseSnackbar, BaseTabView, BaseShimmerLoader, ShimmerMultiLine, StaticSpinner, BaseBreadcrumb, };
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import './assets/packages/components/lib/UIKit/Navigation/NavigationBar.css';import './assets/packages/components/lib/UIKit/BaseBreadcrumb.css';import './assets/packages/components/lib/UIKit/ShimmerLoader/BaseShimmerLoader.css';import './assets/packages/components/lib/UIKit/BaseModal.css';import './assets/packages/components/lib/UIKit/BaseSelect.css';import './assets/packages/components/lib/UIKit/BasePin.css';import './assets/packages/components/lib/UIKit/BaseInput.css';import './assets/packages/components/lib/UIKit/BaseFloatingLabel.css';import './assets/packages/components/lib/UIKit/BaseBadge.css';import './assets/packages/components/lib/UIKit/BaseAlert.css';import './assets/packages/components/src/tailwind.css';/* empty css */
2
2
  import { default as i } from "./packages/components/lib/UIKit/Accordion/BaseAccordion.vue.js";
3
3
  import { default as n } from "./packages/components/lib/UIKit/Accordion/BaseAccordionBtn.vue.js";
4
- import { default as b } from "./packages/components/lib/UIKit/Accordion/BaseAccordionContent.vue.js";
4
+ import { default as S } from "./packages/components/lib/UIKit/Accordion/BaseAccordionContent.vue.js";
5
5
  import { default as g } from "./packages/components/lib/UIKit/Accordion/BaseAccordionItem.vue.js";
6
6
  import { default as h } from "./packages/components/lib/UIKit/BaseSelect/SelectItem.vue.js";
7
7
  import { default as I } from "./packages/components/lib/UIKit/Checkbox/CheckboxBtn.vue.js";
8
8
  import { default as v } from "./packages/components/lib/UIKit/Checkbox/CheckboxGroup.vue.js";
9
9
  import { default as L } from "./packages/components/lib/UIKit/Tab/BaseTab.vue.js";
10
- import { default as k } from "./packages/components/lib/UIKit/Tab/BaseTabView.vue.js";
10
+ import { default as D } from "./packages/components/lib/UIKit/Tab/BaseTabView.vue.js";
11
11
  import { default as F } from "./packages/components/lib/UIKit/Radio/RadioButton.vue.js";
12
12
  import { default as M } from "./packages/components/lib/UIKit/Radio/RadioGroup.vue.js";
13
13
  import { default as O } from "./packages/components/lib/UIKit/AccessibleSelect.vue.js";
@@ -34,7 +34,7 @@ import { default as le } from "./packages/components/lib/UIKit/BaseSelect.vue.js
34
34
  import { default as ue } from "./packages/components/lib/UIKit/BaseSlider.vue.js";
35
35
  import { default as ie } from "./UIKit/BaseTextarea.js";
36
36
  import { default as ne } from "./packages/components/lib/UIKit/BaseToggle.vue.js";
37
- import { default as be } from "./UIKit/BaseTooltip.js";
37
+ import { default as Se } from "./UIKit/BaseTooltip.js";
38
38
  import { default as ge } from "./packages/components/lib/UIKit/BaseUploadFile.vue.js";
39
39
  import { default as he } from "./packages/components/lib/UIKit/BaseModal.vue.js";
40
40
  /* empty css */
@@ -42,7 +42,7 @@ import { default as Ie } from "./UIKit/BaseSnackbar.js";
42
42
  import { default as ve } from "./UIKit/StaticSpinner.js";
43
43
  import { default as Le } from "./packages/components/lib/UIKit/ShimmerLoader/BaseShimmerLoader.vue.js";
44
44
  /* empty css */
45
- import { default as ke } from "./packages/components/lib/UIKit/ShimmerLoader/ShimmerMultiLine.vue.js";
45
+ import { default as De } from "./packages/components/lib/UIKit/ShimmerLoader/ShimmerMultiLine.vue.js";
46
46
  import { default as Fe } from "./packages/components/lib/chart/DoughnutChart.vue.js";
47
47
  import { default as Me } from "./packages/components/lib/chart/LineChart.vue.js";
48
48
  import { default as Oe } from "./packages/components/lib/components/IntersectionObserver/IntersectionObservable.vue.js";
@@ -54,12 +54,11 @@ import { default as Ee } from "./packages/components/lib/UIKit/BaseBreadcrumb.vu
54
54
  import { default as Je } from "./packages/components/lib/UIKit/Navigation/NavigationBar.vue.js";
55
55
  /* empty css */
56
56
  import { default as Qe } from "./packages/components/lib/UIKit/Navigation/NavigationBarItem.vue.js";
57
- import { buttonPlugin as Xe } from "./plugins/buttonPlugin.js";
58
57
  export {
59
58
  O as AccessibleSelect,
60
59
  i as BaseAccordion,
61
60
  n as BaseAccordionBtn,
62
- b as BaseAccordionContent,
61
+ S as BaseAccordionContent,
63
62
  g as BaseAccordionItem,
64
63
  U as BaseAlert,
65
64
  j as BaseAutocomplete,
@@ -81,10 +80,10 @@ export {
81
80
  ue as BaseSlider,
82
81
  Ie as BaseSnackbar,
83
82
  L as BaseTab,
84
- k as BaseTabView,
83
+ D as BaseTabView,
85
84
  ie as BaseTextarea,
86
85
  ne as BaseToggle,
87
- be as BaseTooltip,
86
+ Se as BaseTooltip,
88
87
  ge as BaseUploadFile,
89
88
  I as CheckboxBtn,
90
89
  v as CheckboxGroup,
@@ -97,9 +96,8 @@ export {
97
96
  F as RadioButton,
98
97
  M as RadioGroup,
99
98
  h as SelectItem,
100
- ke as ShimmerMultiLine,
99
+ De as ShimmerMultiLine,
101
100
  ve as StaticSpinner,
102
101
  je as SwiperCarousel,
103
- ye as SwiperSlide,
104
- Xe as buttonPlugin
102
+ ye as SwiperSlide
105
103
  };
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "2.1.4-alpha.8",
3
+ "version": "2.1.4-alpha.9",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
8
8
  "files": [
9
- "dist"
9
+ "dist",
10
+ "plugins"
10
11
  ],
11
12
  "sideEffects": [
12
13
  "**/*.css"
@@ -28,6 +29,9 @@
28
29
  "./chart/*": {
29
30
  "import": "./dist/chart/*.js",
30
31
  "types": "./dist/chart/*.d.ts"
32
+ },
33
+ "./buttonPlugin": {
34
+ "import": "./plugins/buttonPlugin.ts"
31
35
  }
32
36
  },
33
37
  "repository": {
@@ -0,0 +1,290 @@
1
+ import plugin from "tailwindcss/plugin";
2
+
3
+ const colors = {
4
+ //New colors
5
+ primary: { value: "#F20282", hover: "#E30C79", outlineHover: "#FFF8FB" },
6
+ secondary: { value: "#2b5dff", hover: "#244FD9" },
7
+ lightgray: { value: "#C1C8D5", hover: "" },
8
+ ghost: { value: "#FAFBFF", hover: "" },
9
+
10
+ //Old colors
11
+ darkPrimary: { value: "#2A3761", hover: "" },
12
+ lavender: { value: "#E9EFFE", hover: "" },
13
+ cultured: { value: "#F4F7FF", hover: "" },
14
+ carbon: { value: "#3C474D", hover: "" },
15
+ gray: { value: "#6D7687", hover: "" },
16
+ black: { value: "#222222", hover: "" },
17
+ warning: { value: "#FFD167", hover: "" },
18
+ white: { value: "#FFF", hover: "" },
19
+ danger: { value: "#FA4F64", hover: "" },
20
+ } as const;
21
+
22
+ export const buttonPlugin = plugin(({ addComponents, theme }) => {
23
+ addComponents({
24
+ ".btn": {
25
+ "--btn-px": "25px",
26
+ "--btn-py": "11px",
27
+ "--btn-bg-color": "transparent",
28
+ "--btn-text-color": colors.black.value,
29
+ "--btn-border-color": "unset",
30
+ "--btn-border-width": "0",
31
+ "--btn-border-radius": "24px",
32
+ "--btn-border-style": "solid",
33
+ "--btn-height": "40px",
34
+ "--btn-width": "auto",
35
+ "--btn-font-size": theme("fontSize.16"),
36
+ "--btn-transition":
37
+ "color, background-color cubic-bezier(0.4, 0, 0.2, 1) 150ms",
38
+ "--btn-font-weight": `${theme("fontWeight.semibold")}`,
39
+ display: "inline-flex",
40
+ "align-items": "center",
41
+ "justify-content": "center",
42
+ "font-size": "var(--btn-font-size)",
43
+ "font-weight": "var(--btn-font-weight)",
44
+ "white-space": "nowrap",
45
+ border:
46
+ "var(--btn-border-width) var(--btn-border-color) var(--btn-border-style)",
47
+ "border-radius": "var(--btn-border-radius)",
48
+ cursor: "pointer",
49
+ height: "var(--btn-height)",
50
+ width: "var(--btn-width)",
51
+ "background-color": "var(--btn-bg-color)",
52
+ color: "var(--btn-text-color)",
53
+ padding: "var(--btn-py) var(--btn-px)",
54
+ transition: "var(--btn-transition)",
55
+ "line-height": "1",
56
+ "-webkit-tap-highlight-color": "transparent",
57
+ "&.btn-lg": {
58
+ "--btn-height": "48px",
59
+ "--btn-px": "24px",
60
+ "--btn-py": "12px",
61
+ },
62
+ "&.btn-sm": {
63
+ "--btn-px": "24px",
64
+ "--btn-py": "8px",
65
+ "--btn-height": "40px",
66
+ },
67
+ "&.btn-rounded": {
68
+ "--btn-px": "0",
69
+ "--btn-py": "0",
70
+ },
71
+ "&.btn-outline": {
72
+ "--btn-border-width": "1px",
73
+ "--btn-bg-color": colors.white.value,
74
+ },
75
+ "&.btn-primary": {
76
+ ...createBtn(
77
+ {
78
+ bgColor: colors.primary.value,
79
+ textColor: colors.white.value,
80
+ hoverBgColor: colors.primary.hover,
81
+ hoverDisabledBgColor: colors.primary.value,
82
+ },
83
+ {
84
+ mainColor: colors.white.hover,
85
+ textColor: colors.primary.value,
86
+ hoverBgColor: colors.primary.outlineHover,
87
+ },
88
+ ),
89
+ "text-transform": "uppercase",
90
+ },
91
+ "&.btn-secondary": createBtn(
92
+ {
93
+ bgColor: colors.secondary.value,
94
+ textColor: colors.white.value,
95
+ hoverBgColor: colors.secondary.hover,
96
+ hoverDisabledBgColor: colors.secondary.value,
97
+ },
98
+ {
99
+ mainColor: colors.secondary.value,
100
+ textColor: colors.secondary.value,
101
+ },
102
+ ),
103
+ "&.btn-ternary": {
104
+ ...createBtn({
105
+ bgColor: colors.white.value,
106
+ textColor: colors.secondary.value,
107
+ hoverBgColor: colors.white.value,
108
+ hoverDisabledBgColor: colors.secondary.value,
109
+ hoverTextColor: colors.secondary.hover,
110
+ }),
111
+ "--btn-border-color": colors.lightgray.value,
112
+ "--btn-border-width": "1px",
113
+ "--btn-border-radius": "24px",
114
+ },
115
+ "&.btn-quaternary": {
116
+ "--btn-px": "0",
117
+ "--btn-py": "0",
118
+ "--btn-text-color": colors.secondary.value,
119
+ "--btn-height": "auto",
120
+ "&:hover": {
121
+ "text-decoration": "underline",
122
+ "--btn-text-color": colors.secondary.hover,
123
+ },
124
+ "&:disabled": {
125
+ "--btn-bg-color": "transparent",
126
+ "--btn-text-color": colors.lightgray.value,
127
+ },
128
+ },
129
+ "&.btn-single-selection": {
130
+ "--btn-px": "16px",
131
+ "--btn-py": "8px",
132
+ "--btn-border-radius": theme("borderRadius.2xs"),
133
+ "--btn-border-color": colors.lightgray.value,
134
+ "--btn-border-width": "1px",
135
+ "--btn-font-weight": theme("fontWeight.regular"),
136
+ "&:hover": {
137
+ "--btn-border-color": colors.secondary.value,
138
+ },
139
+ "&:active,&.active,&[data-active='true']": {
140
+ "--btn-bg-color": colors.ghost.value,
141
+ "--btn-text-color": colors.secondary.value,
142
+ "--btn-border-color": colors.secondary.value,
143
+ },
144
+ },
145
+ },
146
+ //OLD style. Kept for retro-compatibility
147
+ ".btn-light": createBtn({
148
+ textColor: colors.primary.value,
149
+ bgColor: colors.white.value,
150
+ hoverTextColor: colors.primary.value,
151
+ hoverBgColor: "#FAFAFA",
152
+ hoverDisabledBgColor: colors.white.value,
153
+ }),
154
+ ".btn-warning": createBtn({
155
+ bgColor: colors.warning.value,
156
+ textColor: "#2A3761",
157
+ hoverBgColor: "#F2C761",
158
+ hoverDisabledBgColor: colors.warning.value,
159
+ }),
160
+ ".btn-danger": createBtn(
161
+ {
162
+ bgColor: colors.danger.value,
163
+ textColor: colors.white.value,
164
+ hoverBgColor: "#E0485A",
165
+ hoverDisabledBgColor: colors.danger.value,
166
+ },
167
+ {
168
+ mainColor: colors.danger.value,
169
+ textColor: colors.danger.value,
170
+ },
171
+ ),
172
+ ".btn-multi-selection": {
173
+ "--btn-py": "10px",
174
+ "--btn-height": "40px",
175
+ "font-weight": theme("fontWeight.regular"),
176
+ "--btn-border-radius": theme("borderRadius.xs"),
177
+ "--btn-border-color": "#EAEFFD",
178
+ "--btn-border-width": "1px",
179
+ "white-space": "normal",
180
+ ...createBtn({
181
+ textColor: colors.black.value,
182
+ bgColor: "#F5F7FA",
183
+ hoverBgColor: colors.lavender.value,
184
+ hoverDisabledBgColor: colors.white.value,
185
+ hoverBorderColor: "#385CF6",
186
+ }),
187
+ },
188
+
189
+ ".btn-facile": {
190
+ "--btn-facile-color": "#FF6600",
191
+ "--btn-facile-hover-color": "#b34700",
192
+ ...createBtn({
193
+ bgColor: "var(--btn-facile-color)",
194
+ textColor: colors.white.value,
195
+ hoverBgColor: "var(--btn-facile-hover-color)",
196
+ hoverTextColor: colors.white.value,
197
+ hoverDisabledBgColor: "var(--btn-facile-color)",
198
+ }),
199
+ },
200
+ ".btn-show-more": {
201
+ "--btn-border-radius": "0",
202
+ "--btn-border-color": colors.white.value,
203
+ ...createBtn({
204
+ textColor: "#2B5DFF",
205
+ bgColor: colors.white.value,
206
+ hoverTextColor: "#3646B3",
207
+ hoverBgColor: colors.white.value,
208
+ hoverDisabledBgColor: colors.white.value,
209
+ }),
210
+ },
211
+ ".btn-transparent": {
212
+ "--border-color": "transparent",
213
+ "--btn-px": "0",
214
+ "--btn-py": "0",
215
+ "&:hover": {
216
+ "--btn-bg-color": "transparent",
217
+ "--border-color": "transparent",
218
+ },
219
+ },
220
+ });
221
+ });
222
+
223
+ type BtnAttributes = {
224
+ bgColor: string;
225
+ textColor: string;
226
+ hoverBgColor: string;
227
+ hoverTextColor?: string;
228
+ /* The border color will be applied to desktop mode */
229
+ hoverBorderColor?: string;
230
+ activeBorderColor?: string;
231
+ activeBgColor?: string;
232
+ activeTextColor?: string;
233
+ hoverDisabledBgColor: string;
234
+ };
235
+ type BtnOutlineVariantAttributes = {
236
+ /* If present, it will be used to set the color to borders, text and background */
237
+ mainColor?: string;
238
+ borderColor?: string;
239
+ textColor?: string;
240
+ /* The hover bg color will be activated only from tablet mode on */
241
+ hoverBgColor?: string;
242
+ hoverDisabledBgColor?: string;
243
+ /* The hover text color will be activated only from tablet mode on */
244
+ hoverTextColor?: string;
245
+ activeBgColor?: string;
246
+ activeTextColor?: string;
247
+ };
248
+
249
+ const createBtn = (
250
+ btnProps: BtnAttributes,
251
+ btnOutlineProps?: BtnOutlineVariantAttributes,
252
+ ): any => ({
253
+ "--btn-bg-color": btnProps.bgColor,
254
+ "--btn-text-color": btnProps.textColor,
255
+ "&:disabled": {
256
+ cursor: "not-allowed",
257
+ },
258
+ "&:hover:not(:disabled)": {
259
+ "--btn-text-color": btnProps.hoverTextColor,
260
+ "--btn-bg-color": btnProps.hoverBgColor,
261
+ },
262
+ ...(btnOutlineProps
263
+ ? {
264
+ "&.btn-outline": createOutlineVariant(btnOutlineProps),
265
+ }
266
+ : {}),
267
+ });
268
+
269
+ const createOutlineVariant = (props: BtnOutlineVariantAttributes): any => ({
270
+ "--btn-border-color": props.mainColor ?? props.borderColor,
271
+ "--btn-text-color": props.textColor,
272
+ "--btn-bg-color": "#fff",
273
+ //By default, the active section is the same of the hover section in desktop mode
274
+ "&:active": {
275
+ "--btn-bg-color":
276
+ (props.mainColor ?? props.activeBgColor ?? props.hoverBgColor) +
277
+ " !important",
278
+ //By default, on active the text is white
279
+ ...(props.activeTextColor || props.hoverTextColor
280
+ ? {
281
+ "--btn-text-color": props.activeTextColor ?? props.hoverTextColor,
282
+ }
283
+ : {}),
284
+ },
285
+ "&:hover": {
286
+ //By default, the text color is white
287
+ ...(props.hoverBgColor ? { "--btn-bg-color": props.hoverBgColor } : {}),
288
+ "--btn-text-color": props.hoverTextColor ?? props.textColor,
289
+ },
290
+ });
@@ -1,6 +0,0 @@
1
- function e(t) {
2
- return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
3
- }
4
- export {
5
- e as getDefaultExportFromCjs
6
- };
@@ -1,4 +0,0 @@
1
- var e = {};
2
- export {
3
- e as __exports
4
- };
@@ -1,4 +0,0 @@
1
- var e = {};
2
- export {
3
- e as __exports
4
- };
@@ -1,7 +0,0 @@
1
- import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
2
- import { __require as o } from "../node_modules/.pnpm/tailwindcss@3.4.15_ts-node@10.9.2_@types_node@24.0.1_typescript@5.8.3_/node_modules/tailwindcss/plugin.js";
3
- var t = o();
4
- const p = /* @__PURE__ */ r(t);
5
- export {
6
- p as default
7
- };
@@ -1,25 +0,0 @@
1
- import { __exports as r } from "../../../../../../../_virtual/create-plugin.js";
2
- import { __require as _ } from "../util/createPlugin.js";
3
- var u;
4
- function o() {
5
- return u ? r : (u = 1, function(t) {
6
- Object.defineProperty(t, "__esModule", {
7
- value: !0
8
- }), Object.defineProperty(t, "default", {
9
- enumerable: !0,
10
- get: function() {
11
- return a;
12
- }
13
- });
14
- const n = /* @__PURE__ */ i(_());
15
- function i(e) {
16
- return e && e.__esModule ? e : {
17
- default: e
18
- };
19
- }
20
- const a = n.default;
21
- }(r), r);
22
- }
23
- export {
24
- o as __require
25
- };
@@ -1,34 +0,0 @@
1
- import { __exports as u } from "../../../../../../../_virtual/createPlugin.js";
2
- var c;
3
- function f() {
4
- return c ? u : (c = 1, function(i) {
5
- Object.defineProperty(i, "__esModule", {
6
- value: !0
7
- }), Object.defineProperty(i, "default", {
8
- enumerable: !0,
9
- get: function() {
10
- return _;
11
- }
12
- });
13
- function o(e, n) {
14
- return {
15
- handler: e,
16
- config: n
17
- };
18
- }
19
- o.withOptions = function(e, n = () => ({})) {
20
- const r = function(t) {
21
- return {
22
- __options: t,
23
- handler: e(t),
24
- config: n(t)
25
- };
26
- };
27
- return r.__isOptionsFunction = !0, r.__pluginFunction = e, r.__configFunction = n, r;
28
- };
29
- const _ = o;
30
- }(u), u);
31
- }
32
- export {
33
- f as __require
34
- };
@@ -1,11 +0,0 @@
1
- import { __require as i } from "./lib/public/create-plugin.js";
2
- var r, u;
3
- function a() {
4
- if (u) return r;
5
- u = 1;
6
- let e = i();
7
- return r = (e.__esModule ? e : { default: e }).default, r;
8
- }
9
- export {
10
- a as __require
11
- };
@@ -1,4 +0,0 @@
1
- export declare const buttonPlugin: {
2
- handler: import('tailwindcss/types/config').PluginCreator;
3
- config?: Partial<import('tailwindcss/types/config').Config>;
4
- };
@@ -1,232 +0,0 @@
1
- import n from "../_virtual/plugin.js";
2
- const o = {
3
- //New colors
4
- primary: { value: "#F20282", hover: "#E30C79", outlineHover: "#FFF8FB" },
5
- secondary: { value: "#2b5dff", hover: "#244FD9" },
6
- lightgray: { value: "#C1C8D5" },
7
- ghost: { value: "#FAFBFF" },
8
- lavender: { value: "#E9EFFE" },
9
- black: { value: "#222222" },
10
- warning: { value: "#FFD167" },
11
- white: { value: "#FFF", hover: "" },
12
- danger: { value: "#FA4F64" }
13
- }, b = n(({ addComponents: r, theme: t }) => {
14
- r({
15
- ".btn": {
16
- "--btn-px": "25px",
17
- "--btn-py": "11px",
18
- "--btn-bg-color": "transparent",
19
- "--btn-text-color": o.black.value,
20
- "--btn-border-color": "unset",
21
- "--btn-border-width": "0",
22
- "--btn-border-radius": "24px",
23
- "--btn-border-style": "solid",
24
- "--btn-height": "40px",
25
- "--btn-width": "auto",
26
- "--btn-font-size": t("fontSize.16"),
27
- "--btn-transition": "color, background-color cubic-bezier(0.4, 0, 0.2, 1) 150ms",
28
- "--btn-font-weight": `${t("fontWeight.semibold")}`,
29
- display: "inline-flex",
30
- "align-items": "center",
31
- "justify-content": "center",
32
- "font-size": "var(--btn-font-size)",
33
- "font-weight": "var(--btn-font-weight)",
34
- "white-space": "nowrap",
35
- border: "var(--btn-border-width) var(--btn-border-color) var(--btn-border-style)",
36
- "border-radius": "var(--btn-border-radius)",
37
- cursor: "pointer",
38
- height: "var(--btn-height)",
39
- width: "var(--btn-width)",
40
- "background-color": "var(--btn-bg-color)",
41
- color: "var(--btn-text-color)",
42
- padding: "var(--btn-py) var(--btn-px)",
43
- transition: "var(--btn-transition)",
44
- "line-height": "1",
45
- "-webkit-tap-highlight-color": "transparent",
46
- "&.btn-lg": {
47
- "--btn-height": "48px",
48
- "--btn-px": "24px",
49
- "--btn-py": "12px"
50
- },
51
- "&.btn-sm": {
52
- "--btn-px": "24px",
53
- "--btn-py": "8px",
54
- "--btn-height": "40px"
55
- },
56
- "&.btn-rounded": {
57
- "--btn-px": "0",
58
- "--btn-py": "0"
59
- },
60
- "&.btn-outline": {
61
- "--btn-border-width": "1px",
62
- "--btn-bg-color": o.white.value
63
- },
64
- "&.btn-primary": {
65
- ...e(
66
- {
67
- bgColor: o.primary.value,
68
- textColor: o.white.value,
69
- hoverBgColor: o.primary.hover
70
- },
71
- {
72
- mainColor: o.white.hover,
73
- textColor: o.primary.value,
74
- hoverBgColor: o.primary.outlineHover
75
- }
76
- ),
77
- "text-transform": "uppercase"
78
- },
79
- "&.btn-secondary": e(
80
- {
81
- bgColor: o.secondary.value,
82
- textColor: o.white.value,
83
- hoverBgColor: o.secondary.hover
84
- },
85
- {
86
- mainColor: o.secondary.value,
87
- textColor: o.secondary.value
88
- }
89
- ),
90
- "&.btn-ternary": {
91
- ...e({
92
- bgColor: o.white.value,
93
- textColor: o.secondary.value,
94
- hoverBgColor: o.white.value,
95
- hoverTextColor: o.secondary.hover
96
- }),
97
- "--btn-border-color": o.lightgray.value,
98
- "--btn-border-width": "1px",
99
- "--btn-border-radius": "24px"
100
- },
101
- "&.btn-quaternary": {
102
- "--btn-px": "0",
103
- "--btn-py": "0",
104
- "--btn-text-color": o.secondary.value,
105
- "--btn-height": "auto",
106
- "&:hover": {
107
- "text-decoration": "underline",
108
- "--btn-text-color": o.secondary.hover
109
- },
110
- "&:disabled": {
111
- "--btn-bg-color": "transparent",
112
- "--btn-text-color": o.lightgray.value
113
- }
114
- },
115
- "&.btn-single-selection": {
116
- "--btn-px": "16px",
117
- "--btn-py": "8px",
118
- "--btn-border-radius": t("borderRadius.2xs"),
119
- "--btn-border-color": o.lightgray.value,
120
- "--btn-border-width": "1px",
121
- "--btn-font-weight": t("fontWeight.regular"),
122
- "&:hover": {
123
- "--btn-border-color": o.secondary.value
124
- },
125
- "&:active,&.active,&[data-active='true']": {
126
- "--btn-bg-color": o.ghost.value,
127
- "--btn-text-color": o.secondary.value,
128
- "--btn-border-color": o.secondary.value
129
- }
130
- }
131
- },
132
- //OLD style. Kept for retro-compatibility
133
- ".btn-light": e({
134
- textColor: o.primary.value,
135
- bgColor: o.white.value,
136
- hoverTextColor: o.primary.value,
137
- hoverBgColor: "#FAFAFA"
138
- }),
139
- ".btn-warning": e({
140
- bgColor: o.warning.value,
141
- textColor: "#2A3761",
142
- hoverBgColor: "#F2C761"
143
- }),
144
- ".btn-danger": e(
145
- {
146
- bgColor: o.danger.value,
147
- textColor: o.white.value,
148
- hoverBgColor: "#E0485A"
149
- },
150
- {
151
- mainColor: o.danger.value,
152
- textColor: o.danger.value
153
- }
154
- ),
155
- ".btn-multi-selection": {
156
- "--btn-py": "10px",
157
- "--btn-height": "40px",
158
- "font-weight": t("fontWeight.regular"),
159
- "--btn-border-radius": t("borderRadius.xs"),
160
- "--btn-border-color": "#EAEFFD",
161
- "--btn-border-width": "1px",
162
- "white-space": "normal",
163
- ...e({
164
- textColor: o.black.value,
165
- bgColor: "#F5F7FA",
166
- hoverBgColor: o.lavender.value
167
- })
168
- },
169
- ".btn-facile": {
170
- "--btn-facile-color": "#FF6600",
171
- "--btn-facile-hover-color": "#b34700",
172
- ...e({
173
- bgColor: "var(--btn-facile-color)",
174
- textColor: o.white.value,
175
- hoverBgColor: "var(--btn-facile-hover-color)",
176
- hoverTextColor: o.white.value
177
- })
178
- },
179
- ".btn-show-more": {
180
- "--btn-border-radius": "0",
181
- "--btn-border-color": o.white.value,
182
- ...e({
183
- textColor: "#2B5DFF",
184
- bgColor: o.white.value,
185
- hoverTextColor: "#3646B3",
186
- hoverBgColor: o.white.value
187
- })
188
- },
189
- ".btn-transparent": {
190
- "--border-color": "transparent",
191
- "--btn-px": "0",
192
- "--btn-py": "0",
193
- "&:hover": {
194
- "--btn-bg-color": "transparent",
195
- "--border-color": "transparent"
196
- }
197
- }
198
- });
199
- }), e = (r, t) => ({
200
- "--btn-bg-color": r.bgColor,
201
- "--btn-text-color": r.textColor,
202
- "&:disabled": {
203
- cursor: "not-allowed"
204
- },
205
- "&:hover:not(:disabled)": {
206
- "--btn-text-color": r.hoverTextColor,
207
- "--btn-bg-color": r.hoverBgColor
208
- },
209
- ...t ? {
210
- "&.btn-outline": l(t)
211
- } : {}
212
- }), l = (r) => ({
213
- "--btn-border-color": r.mainColor ?? r.borderColor,
214
- "--btn-text-color": r.textColor,
215
- "--btn-bg-color": "#fff",
216
- //By default, the active section is the same of the hover section in desktop mode
217
- "&:active": {
218
- "--btn-bg-color": (r.mainColor ?? r.activeBgColor ?? r.hoverBgColor) + " !important",
219
- //By default, on active the text is white
220
- ...r.activeTextColor || r.hoverTextColor ? {
221
- "--btn-text-color": r.activeTextColor ?? r.hoverTextColor
222
- } : {}
223
- },
224
- "&:hover": {
225
- //By default, the text color is white
226
- ...r.hoverBgColor ? { "--btn-bg-color": r.hoverBgColor } : {},
227
- "--btn-text-color": r.hoverTextColor ?? r.textColor
228
- }
229
- });
230
- export {
231
- b as buttonPlugin
232
- };