@phillips/seldon 1.56.0 → 1.57.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.
@@ -1,5 +1,6 @@
1
1
  export declare enum ButtonVariants {
2
2
  primary = "primary",
3
3
  secondary = "secondary",
4
- ghost = "ghost"
4
+ ghost = "ghost",
5
+ tertiary = "tertiary"
5
6
  }
@@ -1,4 +1,4 @@
1
- var e = /* @__PURE__ */ ((r) => (r.primary = "primary", r.secondary = "secondary", r.ghost = "ghost", r))(e || {});
1
+ var e = /* @__PURE__ */ ((r) => (r.primary = "primary", r.secondary = "secondary", r.ghost = "ghost", r.tertiary = "tertiary", r))(e || {});
2
2
  export {
3
3
  e as ButtonVariants
4
4
  };
@@ -1,3 +1,4 @@
1
+ import { ButtonVariants } from '../Button/types';
1
2
  export interface IconButtonProps extends Omit<React.HTMLAttributes<HTMLButtonElement>, 'children'> {
2
3
  /**
3
4
  * Button contents
@@ -7,6 +8,14 @@ export interface IconButtonProps extends Omit<React.HTMLAttributes<HTMLButtonEle
7
8
  * How large should the button be?
8
9
  */
9
10
  size?: 'sm' | 'md' | 'lg';
11
+ /**
12
+ * Mainly used for styling
13
+ */
14
+ variant?: ButtonVariants;
15
+ /**
16
+ * Should the button be disabled?
17
+ */
18
+ isDisabled?: boolean;
10
19
  }
11
- declare const IconButton: ({ children, size, className, ...props }: IconButtonProps) => import("react/jsx-runtime").JSX.Element;
20
+ declare const IconButton: ({ children, size, variant, isDisabled, className, ...props }: IconButtonProps) => import("react/jsx-runtime").JSX.Element;
12
21
  export default IconButton;
@@ -1,21 +1,29 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import c from "../../node_modules/classnames/index.js";
3
- import e from "../Button/Button.js";
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ import f from "../../node_modules/classnames/index.js";
3
+ import p from "../Button/Button.js";
4
4
  import { getCommonProps as i } from "../../utils/index.js";
5
- import { ButtonVariants as p } from "../Button/types.js";
6
- const x = ({ children: m, size: r = "md", className: s, ...o }) => {
7
- const { className: t, ...a } = i(o, "IconButton");
8
- return /* @__PURE__ */ n(
9
- e,
5
+ import { ButtonVariants as l } from "../Button/types.js";
6
+ const C = ({
7
+ children: s,
8
+ size: r = "md",
9
+ variant: m = l.primary,
10
+ isDisabled: a = !1,
11
+ className: n,
12
+ ...t
13
+ }) => {
14
+ const { className: o, ...e } = i(t, "IconButton");
15
+ return /* @__PURE__ */ c(
16
+ p,
10
17
  {
11
- ...a,
12
- variant: p.primary,
13
- className: c(t, `${t}--${r}`, s),
14
- ...o,
15
- children: m
18
+ ...e,
19
+ variant: m,
20
+ className: f(o, `${o}--${r}`, `${o}--${m}`, n),
21
+ isDisabled: a,
22
+ ...t,
23
+ children: s
16
24
  }
17
25
  );
18
26
  };
19
27
  export {
20
- x as default
28
+ C as default
21
29
  };
@@ -52,6 +52,9 @@ $post-sale-magenta: $post-sale-pink;
52
52
  $header-color: $pure-black;
53
53
  $text-color: $soft-black;
54
54
 
55
+ // Interactive Colors
56
+ $button-hover: #75716f;
57
+
55
58
  ////////////////////////
56
59
  /// FONTS:
57
60
  ///////////////////////
@@ -5,52 +5,123 @@
5
5
 
6
6
  align-items: center;
7
7
  background-color: $pure-black;
8
- border: 0;
9
- border-radius: 3em;
10
- color: white;
8
+ border: 1px solid transparent;
9
+ border-radius: 100px;
10
+ color: $pure-white;
11
11
  cursor: pointer;
12
12
  display: inline-flex;
13
+ font-weight: 600;
14
+ gap: $margin-xsm;
13
15
  justify-content: center;
14
- min-width: 3rem;
15
- padding: 0.5em $spacing-md;
16
+ padding: 0 $padding-md;
17
+ position: relative;
16
18
  transition:
17
19
  color 0.25s,
18
- background-color 0.25s,
19
- font-weight 0.25s;
20
+ background-color 0.25s;
21
+
22
+ svg {
23
+ fill: $pure-white;
24
+
25
+ path {
26
+ fill: $pure-white;
27
+ transition: 0.25s;
28
+ }
29
+ }
30
+
31
+ &:hover {
32
+ background-color: $button-hover;
33
+
34
+ svg {
35
+ fill: $pure-white;
36
+ }
37
+ }
20
38
 
21
- &:hover,
22
39
  &:focus-visible {
23
- background-color: $primary-black;
40
+ outline: 0.5px solid $pure-white;
41
+ outline-offset: -4.5px;
24
42
 
25
43
  svg {
26
44
  fill: $pure-white;
27
45
  }
28
46
  }
29
47
 
30
- svg {
31
- fill: $pure-white;
32
- margin-inline-end: 0.5rem;
33
- transition: fill 0.25s;
34
- width: 1em;
48
+ &--sm {
49
+ font-size: 0.75rem;
50
+ height: 44px;
51
+
52
+ svg {
53
+ height: 1rem;
54
+ width: 1rem;
55
+ }
56
+ }
57
+
58
+ &--md,
59
+ &--lg {
60
+ font-size: 1rem;
61
+ height: 48px;
62
+
63
+ svg {
64
+ height: 1.25rem;
65
+ width: 1.25rem;
66
+ }
35
67
  }
36
68
 
37
69
  &--secondary,
38
70
  &--ghost {
39
- background-color: transparent;
40
- border: 1px solid;
41
- color: $text-color;
71
+ background-color: $pure-white;
72
+ border: 1px solid $pure-black;
73
+ color: $pure-black;
74
+ mix-blend-mode: difference;
75
+ position: relative;
76
+ transition: border 0.3s ease-out;
77
+
78
+ &::before {
79
+ border-radius: 100px;
80
+ box-sizing: border-box;
81
+ content: '';
82
+ display: inline-block;
83
+ height: 0;
84
+ left: 50%;
85
+ position: absolute;
86
+ top: 50%;
87
+ transition: all 0.25s ease;
88
+ width: 0;
89
+ z-index: -2;
90
+ }
42
91
 
43
- &:hover,
44
- &:focus-visible {
92
+ &:hover {
93
+ background-color: transparent;
94
+ border: 1px solid transparent;
45
95
  color: $pure-white;
46
96
 
47
97
  svg {
48
98
  fill: $pure-white;
99
+
100
+ path {
101
+ fill: $pure-white;
102
+ }
103
+ }
104
+
105
+ &::before {
106
+ background: $button-hover;
107
+ height: 100%;
108
+ left: 0;
109
+ top: 0;
110
+ width: 100%;
49
111
  }
50
112
  }
51
113
 
114
+ &:focus-visible {
115
+ background-color: $pure-white;
116
+ outline-color: $soft-black;
117
+ }
118
+
52
119
  svg {
53
- fill: $text-color;
120
+ fill: $pure-black;
121
+
122
+ path {
123
+ fill: $pure-black;
124
+ }
54
125
  }
55
126
  }
56
127
 
@@ -58,35 +129,69 @@
58
129
  border-color: transparent;
59
130
  }
60
131
 
61
- &.#{$px}-button--icon-last svg {
62
- margin-inline-end: unset;
63
- margin-inline-start: 0.5rem;
64
- }
132
+ &--tertiary {
133
+ background-color: transparent;
134
+ border: 0;
135
+ color: $pure-black;
136
+ height: 28px;
137
+ padding: 0;
65
138
 
66
- &--sm {
67
- font-size: 0.75rem;
68
- }
139
+ svg {
140
+ fill: $pure-black;
69
141
 
70
- &--md {
71
- font-size: 1rem;
72
- }
142
+ path {
143
+ fill: $pure-black;
144
+ }
145
+ }
73
146
 
74
- &--lg {
75
- font-size: 1.05rem;
76
- padding: 0.75em 1.75em;
147
+ &:hover {
148
+ background-color: transparent;
149
+ color: $button-hover;
150
+
151
+ svg {
152
+ fill: $button-hover;
153
+
154
+ path {
155
+ fill: $button-hover;
156
+ }
157
+ }
158
+ }
159
+
160
+ &:focus-visible {
161
+ background-color: $pure-white;
162
+ border-radius: 0;
163
+ outline-color: $soft-black;
164
+ outline-offset: 4.5px;
165
+ padding: 0 4px;
166
+ }
77
167
  }
78
168
 
79
169
  &:disabled {
80
170
  background-color: $white;
81
- border: 1px solid $medium-gray;
82
- color: $medium-gray;
171
+ border: 1px solid $light-gray;
172
+ color: $light-gray;
83
173
  cursor: default;
84
174
 
175
+ &:hover {
176
+ &::before {
177
+ all: unset;
178
+ }
179
+ }
180
+
85
181
  svg {
86
- fill: $medium-gray;
182
+ fill: $light-gray;
183
+
184
+ path {
185
+ fill: $light-gray;
186
+ }
87
187
  }
88
188
  }
89
189
 
190
+ &--ghost:disabled,
191
+ &--tertiary:disabled {
192
+ border-color: transparent;
193
+ }
194
+
90
195
  * {
91
196
  margin: 0;
92
197
  }
@@ -1,49 +1,103 @@
1
1
  @use '../../allPartials' as *;
2
2
 
3
3
  .#{$px}-icon-button {
4
- background-color: unset;
5
- border: unset;
6
- color: $text-color;
7
- min-width: unset;
8
- padding: unset;
4
+ padding: 0;
9
5
 
10
6
  & > svg {
11
- fill: $pure-black;
12
- height: 100%;
13
- margin-inline-end: unset;
14
- width: 100%;
7
+ position: absolute;
15
8
  }
16
9
 
17
- &:hover {
18
- background-color: unset;
19
- opacity: 0.75;
10
+ &:focus {
11
+ &:focus {
12
+ outline: 0.5px solid $soft-black;
13
+ outline-offset: -4.5px;
14
+
15
+ svg {
16
+ fill: $pure-white;
17
+ }
18
+ }
19
+ }
20
+
21
+ &--primary,
22
+ &--ghost {
23
+ background: $pure-white;
24
+ color: $pure-black;
25
+ height: 44px;
26
+ width: 44px;
20
27
 
21
28
  & > svg {
22
29
  fill: $pure-black;
30
+ height: 100%;
31
+ height: 1.5rem;
32
+ margin-inline-end: unset;
33
+ position: absolute;
34
+ width: 100%;
35
+ width: 1.5rem;
36
+
37
+ path {
38
+ fill: $pure-black;
39
+ }
40
+ }
41
+
42
+ &:hover {
43
+ svg {
44
+ fill: $pure-white;
45
+
46
+ path {
47
+ fill: $pure-white;
48
+ }
49
+ }
23
50
  }
24
51
  }
25
52
 
26
- &:focus {
27
- background-color: unset;
28
- fill: $pure-black;
53
+ &--ghost {
54
+ border-color: transparent;
55
+
56
+ svg {
57
+ fill: $keyline-gray;
58
+
59
+ path {
60
+ fill: $keyline-gray;
61
+ }
62
+ }
63
+ }
64
+
65
+ &--secondary,
66
+ &--tertiary {
67
+ height: 28px;
68
+ width: 28px;
29
69
 
30
70
  & > svg {
31
71
  fill: $pure-black;
72
+ height: 100%;
73
+ height: 1rem;
74
+ margin-inline-end: unset;
75
+ position: absolute;
76
+ width: 100%;
77
+ width: 1rem;
78
+
79
+ path {
80
+ fill: $pure-black;
81
+ }
32
82
  }
33
83
  }
34
84
 
35
- &--sm {
36
- height: 1rem;
37
- width: 1rem;
85
+ &--tertiary {
86
+ &:focus {
87
+ border-radius: 100px;
88
+ }
38
89
  }
39
90
 
40
- &--md {
41
- height: 1.5rem;
42
- width: 1.5rem;
43
- }
91
+ &:disabled {
92
+ background-color: $white;
93
+ border: 1px solid $light-gray;
44
94
 
45
- &--lg {
46
- height: 2rem;
47
- width: 2rem;
95
+ svg {
96
+ fill: $light-gray;
97
+
98
+ path {
99
+ fill: $light-gray;
100
+ }
101
+ }
48
102
  }
49
103
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.56.0",
3
+ "version": "1.57.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"