@prokodo/ui 0.1.7 → 0.1.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.
@@ -3,9 +3,9 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  import { create } from "../../helpers/bem.js";
5
5
  import styles from "./Avatar.module.scss.js";
6
- import { Image } from "../image/Image.js";
7
6
  import { Icon, getIconSize } from "../icon/Icon.js";
8
7
  import { Link } from "../link/Link.js";
8
+ import { Image } from "../image/Image.js";
9
9
  const bem = create(styles, "Avatar");
10
10
  function AvatarView({
11
11
  className,
@@ -254,7 +254,7 @@ html[data-theme=dark] .prokodo-Button {
254
254
  html[data-theme=dark] .prokodo-Button--has-variant-outlined {
255
255
  background: none;
256
256
  }
257
- .prokodo-Button--has-icon {
257
+ .prokodo-Button--has-image, .prokodo-Button--has-icon {
258
258
  align-items: center;
259
259
  }
260
260
  .prokodo-Button--icon-only {
@@ -277,8 +277,11 @@ html[data-theme=dark] .prokodo-Button--has-variant-outlined {
277
277
  flex-direction: row;
278
278
  align-items: center;
279
279
  }
280
+ .prokodo-Button__image {
281
+ margin-right: 0.5rem;
282
+ }
280
283
  .prokodo-Button__icon {
281
- margin-right: 5px;
284
+ margin-right: 0.5rem;
282
285
  }
283
286
  .prokodo-Button__icon--icon-only {
284
287
  margin-right: 0;
@@ -254,7 +254,7 @@ html[data-theme=dark] .prokodo-Button {
254
254
  html[data-theme=dark] .prokodo-Button--has-variant-outlined {
255
255
  background: none;
256
256
  }
257
- .prokodo-Button--has-icon {
257
+ .prokodo-Button--has-image, .prokodo-Button--has-icon {
258
258
  align-items: center;
259
259
  }
260
260
  .prokodo-Button--icon-only {
@@ -277,8 +277,11 @@ html[data-theme=dark] .prokodo-Button--has-variant-outlined {
277
277
  flex-direction: row;
278
278
  align-items: center;
279
279
  }
280
+ .prokodo-Button__image {
281
+ margin-right: 0.5rem;
282
+ }
280
283
  .prokodo-Button__icon {
281
- margin-right: 5px;
284
+ margin-right: 0.5rem;
282
285
  }
283
286
  .prokodo-Button__icon--icon-only {
284
287
  margin-right: 0;
@@ -15,10 +15,12 @@ const styles = {
15
15
  "prokodo-Button--has-text-warning": "prokodo-Button--has-text-warning",
16
16
  "prokodo-Button--has-text-error": "prokodo-Button--has-text-error",
17
17
  "prokodo-Button--has-variant-outlined": "prokodo-Button--has-variant-outlined",
18
+ "prokodo-Button--has-image": "prokodo-Button--has-image",
18
19
  "prokodo-Button--has-icon": "prokodo-Button--has-icon",
19
20
  "prokodo-Button--icon-only": "prokodo-Button--icon-only",
20
21
  "prokodo-Button--has-fullWidth": "prokodo-Button--has-fullWidth",
21
22
  "prokodo-Button__title": "prokodo-Button__title",
23
+ "prokodo-Button__image": "prokodo-Button__image",
22
24
  "prokodo-Button__icon": "prokodo-Button__icon",
23
25
  "prokodo-Button__icon--icon-only": "prokodo-Button__icon--icon-only",
24
26
  "prokodo-Button__link": "prokodo-Button__link",
@@ -4,6 +4,7 @@ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
4
4
  import { create } from "../../helpers/bem.js";
5
5
  import { isString } from "../../helpers/validations.js";
6
6
  import styles from "./Button.module.scss.js";
7
+ import { Image } from "../image/Image.js";
7
8
  import { Icon } from "../icon/Icon.js";
8
9
  const bem = create(styles, "Button");
9
10
  const ButtonView = /* @__PURE__ */ __name(({
@@ -15,6 +16,7 @@ const ButtonView = /* @__PURE__ */ __name(({
15
16
  contentClassName,
16
17
  disabled,
17
18
  redirect,
19
+ image,
18
20
  iconProps = {},
19
21
  isIconOnly,
20
22
  LinkComponent,
@@ -25,6 +27,15 @@ const ButtonView = /* @__PURE__ */ __name(({
25
27
  const iconMod = { "icon-only": isIconOnly };
26
28
  const { title } = rest;
27
29
  const inner = /* @__PURE__ */ jsxs(Fragment, { children: [
30
+ (image == null ? void 0 : image.src) !== void 0 && /* @__PURE__ */ jsx(
31
+ Image,
32
+ {
33
+ height: 20,
34
+ width: 20,
35
+ ...image,
36
+ className: bem("image", void 0, image == null ? void 0 : image.className)
37
+ }
38
+ ),
28
39
  iconName && /* @__PURE__ */ jsx(Icon, { className: bem("icon", iconMod), ...iconProps }),
29
40
  title
30
41
  ] });
@@ -36,6 +47,7 @@ const ButtonView = /* @__PURE__ */ __name(({
36
47
  void 0,
37
48
  {
38
49
  "has-fullWidth": Boolean(fullWidth),
50
+ "has-image": (image == null ? void 0 : image.src) !== void 0,
39
51
  "has-icon": !Boolean(isIconOnly) && isString(iconProps == null ? void 0 : iconProps.name),
40
52
  [`has-variant-${variant}`]: true,
41
53
  [`has-bg-${color}`]: variant === "contained",
@@ -1,13 +1,15 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
3
  import { jsx } from "react/jsx-runtime";
4
+ import { ENVIRONMENT } from "../../constants/environment.js";
4
5
  import { PROKODO_UI_VERSION } from "../../constants/project.js";
5
6
  import { create } from "../../helpers/bem.js";
6
7
  import { isString } from "../../helpers/validations.js";
7
8
  import styles from "./Icon.module.scss.js";
8
9
  const bem = create(styles, "Icon");
9
10
  const getIconSize = /* @__PURE__ */ __name((s) => ({ xs: 15, sm: 20, md: 30, lg: 40, xl: 50 })[s] ?? s ?? 16, "getIconSize");
10
- const iconUrl = /* @__PURE__ */ __name((n) => `https://cdn.jsdelivr.net/gh/prokodo-agency/ui@v${PROKODO_UI_VERSION}/assets/icons/${n.replace(/Icon$/, "").replace(/([a-z])([A-Z0-9])/g, "$1_$2").replace(/([0-9])([a-zA-Z])/g, "$1_$2").toLowerCase()}_icon.svg`, "iconUrl");
11
+ const baseUrl = ENVIRONMENT !== "development" ? `https://cdn.jsdelivr.net/gh/prokodo-agency/ui@v${PROKODO_UI_VERSION}/assets/icons` : "/assets/icons";
12
+ const iconUrl = /* @__PURE__ */ __name((n) => `${baseUrl}/${n.replace(/Icon$/, "").replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/([a-zA-Z])([0-9])/g, "$1_$2").toLowerCase()}_icon.svg`, "iconUrl");
11
13
  const Icon = /* @__PURE__ */ __name(({
12
14
  name,
13
15
  size,
@@ -162,6 +162,12 @@
162
162
  background-clip: text;
163
163
  -webkit-text-fill-color: transparent;
164
164
  }
165
+ html[data-theme=dark] .prokodo-Label__highlighted {
166
+ background-image: var(--gradient-text-primary);
167
+ -webkit-background-clip: text;
168
+ background-clip: text;
169
+ -webkit-text-fill-color: var(--color-grey-800);
170
+ }
165
171
  .prokodo-Label__highlighted--error {
166
172
  background-image: var(--gradient-text-error);
167
173
  }
@@ -170,5 +176,5 @@
170
176
  font-style: normal;
171
177
  }
172
178
  html[data-theme=dark] .prokodo-Label__text {
173
- color: var(--color-grey-700);
179
+ color: var(--color-grey-800);
174
180
  }
@@ -162,6 +162,12 @@
162
162
  background-clip: text;
163
163
  -webkit-text-fill-color: transparent;
164
164
  }
165
+ html[data-theme=dark] .prokodo-Label__highlighted {
166
+ background-image: var(--gradient-text-primary);
167
+ -webkit-background-clip: text;
168
+ background-clip: text;
169
+ -webkit-text-fill-color: var(--color-grey-800);
170
+ }
165
171
  .prokodo-Label__highlighted--error {
166
172
  background-image: var(--gradient-text-error);
167
173
  }
@@ -170,5 +176,5 @@
170
176
  font-style: normal;
171
177
  }
172
178
  html[data-theme=dark] .prokodo-Label__text {
173
- color: var(--color-grey-700);
179
+ color: var(--color-grey-800);
174
180
  }
@@ -0,0 +1,4 @@
1
+ const { MODE: ENVIRONMENT } = process.env;
2
+ export {
3
+ ENVIRONMENT
4
+ };
@@ -1,4 +1,4 @@
1
- const PROKODO_UI_VERSION = "0.1.7";
1
+ const PROKODO_UI_VERSION = "0.1.9";
2
2
  export {
3
3
  PROKODO_UI_VERSION
4
4
  };
package/dist/theme.css CHANGED
@@ -664,7 +664,7 @@ html[data-theme=dark] .prokodo-Button {
664
664
  html[data-theme=dark] .prokodo-Button--has-variant-outlined {
665
665
  background: none;
666
666
  }
667
- .prokodo-Button--has-icon {
667
+ .prokodo-Button--has-image, .prokodo-Button--has-icon {
668
668
  align-items: center;
669
669
  }
670
670
  .prokodo-Button--icon-only {
@@ -687,8 +687,11 @@ html[data-theme=dark] .prokodo-Button--has-variant-outlined {
687
687
  flex-direction: row;
688
688
  align-items: center;
689
689
  }
690
+ .prokodo-Button__image {
691
+ margin-right: 0.5rem;
692
+ }
690
693
  .prokodo-Button__icon {
691
- margin-right: 5px;
694
+ margin-right: 0.5rem;
692
695
  }
693
696
  .prokodo-Button__icon--icon-only {
694
697
  margin-right: 0;
@@ -2471,6 +2474,12 @@ html[data-theme=dark] .prokodo-Input__helperText {
2471
2474
  background-clip: text;
2472
2475
  -webkit-text-fill-color: transparent;
2473
2476
  }
2477
+ html[data-theme=dark] .prokodo-Label__highlighted {
2478
+ background-image: var(--gradient-text-primary);
2479
+ -webkit-background-clip: text;
2480
+ background-clip: text;
2481
+ -webkit-text-fill-color: var(--color-grey-800);
2482
+ }
2474
2483
  .prokodo-Label__highlighted--error {
2475
2484
  background-image: var(--gradient-text-error);
2476
2485
  }
@@ -2479,7 +2488,7 @@ html[data-theme=dark] .prokodo-Input__helperText {
2479
2488
  font-style: normal;
2480
2489
  }
2481
2490
  html[data-theme=dark] .prokodo-Label__text {
2482
- color: var(--color-grey-700);
2491
+ color: var(--color-grey-800);
2483
2492
  }
2484
2493
 
2485
2494
  .prokodo-Link {