@inglorious/ui 7.1.2 → 7.1.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inglorious/ui",
3
- "version": "7.1.2",
3
+ "version": "7.1.4",
4
4
  "description": "A design system for Inglorious Web with render-function components and customizable themes",
5
5
  "author": "Matteo Antony Mistretta <antony.mistretta@gmail.com> (https://ingloriouscoderz.it)",
6
6
  "license": "MIT",
@@ -1,5 +1,6 @@
1
1
  import { html } from "@inglorious/web"
2
2
 
3
+ import { Icon } from "../../data-display/icon"
3
4
  import { createRender } from "../../stories/notifyStory.js"
4
5
  import { Fab } from "."
5
6
 
@@ -37,16 +38,50 @@ export default {
37
38
 
38
39
  export const Default = {}
39
40
  Default.args = {
40
- children: "+",
41
+ children: PlusIcon(),
41
42
  color: "primary",
42
43
  size: "md",
43
44
  isExtended: false,
44
45
  isDisabled: false,
45
46
  }
46
47
 
48
+ export const Small = {}
49
+ Small.args = {
50
+ ...Default.args,
51
+ children: PlusIcon(),
52
+ size: "sm",
53
+ }
54
+
55
+ export const Large = {}
56
+ Large.args = {
57
+ ...Default.args,
58
+ children: PlusIcon(),
59
+ size: "lg",
60
+ }
61
+
47
62
  export const Extended = {}
48
63
  Extended.args = {
49
64
  ...Default.args,
50
65
  isExtended: true,
51
- children: html`<span>+</span><span>Create</span>`,
66
+ children: html`${PlusIcon()}<span>Create</span>`,
67
+ }
68
+
69
+ export const ExtendedSmall = {}
70
+ ExtendedSmall.args = {
71
+ ...Default.args,
72
+ size: "sm",
73
+ isExtended: true,
74
+ children: html`${PlusIcon()}<span>Create</span>`,
75
+ }
76
+
77
+ export const ExtendedLarge = {}
78
+ ExtendedLarge.args = {
79
+ ...Default.args,
80
+ size: "lg",
81
+ isExtended: true,
82
+ children: html`${PlusIcon()}<span>Create</span>`,
83
+ }
84
+
85
+ function PlusIcon() {
86
+ return Icon.render({ children: "+", size: "lg" })
52
87
  }
@@ -1,76 +1,51 @@
1
1
  .iw-button.iw-fab {
2
2
  box-shadow: var(--iw-shadow-lg);
3
+ margin: var(--iw-space-2);
3
4
  border: 0;
4
- width: 3.5rem;
5
+ padding: 0;
6
+
7
+ display: inline-flex;
8
+ align-items: center;
9
+ justify-content: center;
10
+
11
+ font-size: var(--iw-font-size-sm);
12
+ font-weight: var(--iw-font-weight-medium);
13
+ line-height: var(--iw-line-height-normal);
14
+ text-transform: uppercase;
5
15
 
6
16
  &:hover:not(:disabled) {
7
17
  transform: translateY(-1px);
8
18
  box-shadow: var(--iw-shadow-xl);
9
19
  }
10
20
 
11
- .iw-fab-content {
12
- display: inline-flex;
13
- align-items: center;
14
- justify-content: center;
15
- font-size: 1.65em;
16
- line-height: 1;
17
- font-weight: var(--iw-font-weight-normal);
18
- transform: translateY(-0.04em);
19
- }
21
+ &.iw-button-shape-round {
22
+ width: var(--iw-space-12);
23
+ height: var(--iw-space-12);
20
24
 
21
- &.iw-button-sm {
22
- width: 2.75rem;
23
-
24
- .iw-fab-content {
25
- font-size: 1.55em;
25
+ &.iw-button-sm {
26
+ width: var(--iw-space-10);
27
+ height: var(--iw-space-10);
26
28
  }
27
- }
28
29
 
29
- &.iw-button-lg {
30
- width: 4.25rem;
31
-
32
- .iw-fab-content {
33
- font-size: 1.75em;
30
+ &.iw-button-lg {
31
+ width: var(--iw-space-14);
32
+ height: var(--iw-space-14);
34
33
  }
35
34
  }
36
35
 
37
36
  &.iw-fab-extended {
38
- width: auto;
39
- min-height: 2.5rem;
40
- padding: var(--iw-space-2) var(--iw-space-4);
37
+ height: var(--iw-space-10);
38
+ padding: 0 var(--iw-space-4);
41
39
  gap: var(--iw-space-2);
42
40
 
43
- .iw-fab-content {
44
- font-size: inherit;
45
- transform: none;
41
+ &.iw-button-sm {
42
+ height: var(--iw-space-8);
43
+ padding: 0 var(--iw-space-2);
46
44
  }
47
- }
48
-
49
- &.iw-fab-extended.iw-button-sm {
50
- min-height: 2rem;
51
- padding: var(--iw-space-1) var(--iw-space-3);
52
- }
53
45
 
54
- &.iw-fab-extended.iw-button-lg {
55
- min-height: 3rem;
56
- padding: var(--iw-space-3) var(--iw-space-5);
57
- }
58
-
59
- &.iw-fab-extended .iw-fab-content {
60
- transform: none;
61
- }
62
-
63
- &.iw-fab-extended .iw-button-icon {
64
- width: 1.1em;
65
- height: 1.1em;
66
- transform: translateY(-0.02em);
67
- }
68
-
69
- &.iw-fab-extended.iw-button-sm .iw-button-icon {
70
- transform: none;
71
- }
72
-
73
- &.iw-fab-extended.iw-button-lg .iw-button-icon {
74
- transform: translateY(-0.03em);
46
+ &.iw-button-lg {
47
+ height: var(--iw-space-12);
48
+ padding: 0 var(--iw-space-4);
49
+ }
75
50
  }
76
51
  }
@@ -3,8 +3,6 @@
3
3
  * @typedef {import('@inglorious/web').TemplateResult} TemplateResult
4
4
  */
5
5
 
6
- import { html } from "@inglorious/web"
7
-
8
6
  import { Button } from "../button/index.js"
9
7
 
10
8
  /**
@@ -27,9 +25,7 @@ export function render(props) {
27
25
  shape: isExtended ? "pill" : "round",
28
26
  className:
29
27
  `iw-fab ${isExtended ? "iw-fab-extended" : ""} ${className}`.trim(),
30
- children: isExtended
31
- ? children
32
- : html`<span class="iw-fab-content">${children}</span>`,
28
+ children,
33
29
  onClick,
34
30
  })
35
31
  }
@@ -2,7 +2,7 @@
2
2
  * @typedef {import('../../../types/data-display/before-after.js').BeforeAfterProps} BeforeAfterEntity
3
3
  */
4
4
 
5
- import { clamp } from "@inglorious/utils/math/numbers.js"
5
+ import { clamp } from "@inglorious/utils/math/number.js"
6
6
 
7
7
  import {
8
8
  DEFAULT_POSITION,
@@ -3,7 +3,7 @@
3
3
  * @typedef {import('@inglorious/web').TemplateResult} TemplateResult
4
4
  */
5
5
 
6
- import { clamp } from "@inglorious/utils/math/numbers.js"
6
+ import { clamp } from "@inglorious/utils/math/number.js"
7
7
  import { html } from "@inglorious/web"
8
8
  import { classMap } from "@inglorious/web/directives/class-map"
9
9
 
@@ -1,4 +1,4 @@
1
- import { clamp } from "@inglorious/utils/math/numbers.js"
1
+ import { clamp } from "@inglorious/utils/math/number.js"
2
2
 
3
3
  export const DEFAULT_AXIS = "x"
4
4
  export const VERTICAL_AXIS = "y"
@@ -2,16 +2,23 @@
2
2
  display: inline-flex;
3
3
  align-items: center;
4
4
  justify-content: center;
5
- width: 1em;
6
- height: 1em;
7
- line-height: 1;
8
5
  cursor: pointer;
9
6
 
10
7
  &.iw-icon-sm {
11
- font-size: 0.875rem;
8
+ width: var(--iw-space-3);
9
+ height: var(--iw-space-3);
10
+ font-size: var(--iw-font-size-sm);
11
+ }
12
+
13
+ &.iw-icon-md {
14
+ width: var(--iw-space-4);
15
+ height: var(--iw-space-4);
16
+ font-size: var(--iw-font-size-base);
12
17
  }
13
18
 
14
19
  &.iw-icon-lg {
15
- font-size: 1.5rem;
20
+ width: var(--iw-space-6);
21
+ height: var(--iw-space-6);
22
+ font-size: var(--iw-font-size-2xl);
16
23
  }
17
24
  }
@@ -29,7 +29,7 @@ export function render({
29
29
  return html`<span
30
30
  class=${classMap({
31
31
  "iw-icon": true,
32
- [`iw-icon-${size}`]: size !== "md",
32
+ [`iw-icon-${size}`]: true,
33
33
  "iw-icon-current": color === "current",
34
34
  ...extraClasses,
35
35
  })}
@@ -59,6 +59,7 @@
59
59
  --iw-space-8: 2rem;
60
60
  --iw-space-10: 2.5rem;
61
61
  --iw-space-12: 3rem;
62
+ --iw-space-14: 3.5rem;
62
63
  --iw-space-16: 4rem;
63
64
  --iw-space-20: 5rem;
64
65
  --iw-space-24: 6rem;