@ably/ui 14.9.0-dev.b9c2a3b → 15.0.1-dev.80b42cd

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/core/Button.js ADDED
@@ -0,0 +1 @@
1
+ import React from"react";import Icon from"./Icon";import clsx from"clsx";const buttonClasses={priority:{lg:"ui-button-priority-lg",md:"ui-button-priority",sm:"ui-button-priority-sm",xs:"ui-button-priority-xs"},primary:{lg:"ui-button-primary-lg",md:"ui-button-primary",sm:"ui-button-primary-sm",xs:"ui-button-primary-xs"},secondary:{lg:"ui-button-secondary-lg",md:"ui-button-secondary",sm:"ui-button-secondary-sm",xs:"ui-button-secondary-xs"}};export const iconModifierClasses={lg:{left:"ui-button-lg-left-icon",right:"ui-button-lg-right-icon"},md:{left:"ui-button-left-icon",right:"ui-button-right-icon"},sm:{left:"ui-button-sm-left-icon",right:"ui-button-sm-right-icon"},xs:{left:"",right:""}};const Button=({variant="primary",size,leftIcon,rightIcon,children,className,...rest})=>{return /*#__PURE__*/React.createElement("button",{className:clsx(buttonClasses[variant][size??"md"],{[iconModifierClasses[size??"md"].left]:leftIcon},{[iconModifierClasses[size??"md"].right]:rightIcon},className),...rest},leftIcon?/*#__PURE__*/React.createElement(Icon,{name:leftIcon}):null,children,rightIcon?/*#__PURE__*/React.createElement(Icon,{name:rightIcon}):null)};export default Button;
@@ -1,95 +1,125 @@
1
1
  @layer components {
2
- .ui-btn {
3
- @apply text-white bg-cool-black text-btn2 font-sans font-bold inline-block rounded p-btn;
4
- @apply hover:text-white hover:bg-active-orange;
5
- @apply active:text-white active:bg-red-orange;
6
- @apply focus:text-white focus:bg-cool-black focus:outline-gui-focus;
7
- @apply disabled:text-mid-grey disabled:bg-gui-unavailable disabled:cursor-not-allowed;
8
- @apply transition-colors;
9
- @apply inline-flex items-center justify-center;
2
+ .ui-button-base {
3
+ @apply inline-flex rounded justify-center items-center gap-12 text-neutral-000 transition-colors focus:outline-4 focus:outline-gui-blue-focus disabled:cursor-not-allowed;
10
4
  }
11
5
 
12
- .ui-btn-alt {
13
- transition: background-position 0.2s;
14
- background: linear-gradient(
15
- 61.2deg,
16
- var(--color-active-orange) 5%,
17
- #fe5215 19%,
18
- #fc4a13 27%,
19
- #f73c10 33%,
20
- #f1280a 39%,
21
- #e90f04 44%,
22
- var(--color-red-orange) 50%
23
- );
24
- background-size: 200% 100%;
25
- background-position: 0% 0%;
6
+ .ui-button-lg-base {
7
+ @apply ui-button-base ui-gui-button1 h-[56px] px-[28px] py-[17px] gap-12 [&>svg]:!w-24 [&>svg]:!h-24;
8
+ }
9
+
10
+ .ui-button-md-base {
11
+ @apply ui-button-base ui-gui-button2 h-[48px] px-24 py-[13.5px] gap-[10px] [&>svg]:!w-24 [&>svg]:!h-24;
12
+ }
13
+
14
+ .ui-button-sm-base {
15
+ @apply ui-button-base ui-gui-button3 h-[40px] px-20 py-[10px] gap-8 [&>svg]:!w-20 [&>svg]:!h-20;
16
+ }
17
+
18
+ .ui-button-xs-base {
19
+ @apply ui-button-base ui-gui-button4 h-[36px] px-12 py-[9px] gap-6 [&>svg]:!w-16 [&>svg]:!h-16;
20
+ }
21
+
22
+ .ui-button-disabled-base {
23
+ @apply disabled:bg-gui-unavailable disabled:text-gui-unavailable-dark disabled:hover:bg-gui-unavailable;
24
+ }
25
+
26
+ .ui-button-disabled-base-dark {
27
+ @apply disabled:bg-gui-unavailable-dark disabled:text-gui-unavailable disabled:hover:bg-gui-unavailable-dark;
28
+ }
29
+
30
+ .ui-button-priority-base {
31
+ @apply bg-gradient-active-orange hover:bg-gradient-to-r hover:from-orange-800 hover:to-orange-800 active:bg-gradient-to-r active:from-orange-800 active:to-orange-800 disabled:bg-none ui-button-disabled-base;
32
+ }
33
+
34
+ .ui-theme-dark .ui-button-priority-base {
35
+ @apply bg-gradient-active-orange hover:bg-gradient-to-r hover:from-orange-800 hover:to-orange-800 active:bg-gradient-to-r active:from-orange-800 active:to-orange-800 disabled:bg-none ui-button-disabled-base-dark;
36
+ }
37
+
38
+ .ui-button-primary-base {
39
+ @apply bg-neutral-1300 text-neutral-000 hover:bg-neutral-1200 active:bg-neutral-1100 ui-button-disabled-base;
40
+ }
41
+
42
+ .ui-theme-dark .ui-button-primary-base {
43
+ @apply bg-neutral-000 text-neutral-1300 hover:bg-neutral-100 active:bg-neutral-200 ui-button-disabled-base-dark;
44
+ }
45
+
46
+ .ui-button-secondary-base {
47
+ @apply text-neutral-1300 border border-neutral-600 hover:border-neutral-700 active:border-neutral-400 active:text-neutral-1000 disabled:border-gui-unavailable disabled:text-gui-unavailable;
48
+ }
49
+
50
+ .ui-theme-dark .ui-button-secondary-base {
51
+ @apply text-neutral-000 border-neutral-700 hover:border-neutral-600 active:border-neutral-800 active:text-neutral-300 disabled:border-gui-unavailable-dark disabled:text-gui-unavailable-dark;
52
+ }
53
+
54
+ .ui-button-priority-lg {
55
+ @apply ui-button-lg-base ui-button-priority-base;
56
+ }
57
+
58
+ .ui-button-priority {
59
+ @apply ui-button-md-base ui-button-priority-base;
60
+ }
26
61
 
27
- @apply text-white text-btn2 font-sans font-bold inline-block rounded p-btn;
28
- @apply focus:outline-gui-focus;
29
- @apply inline-flex items-center justify-center;
62
+ .ui-button-priority-sm {
63
+ @apply ui-button-sm-base ui-button-priority-base;
30
64
  }
31
65
 
32
- .ui-btn-alt:hover,
33
- .ui-btn-alt:focus {
34
- background-position: 100% 0%;
66
+ .ui-button-priority-xs {
67
+ @apply ui-button-xs-base ui-button-priority-base;
35
68
  }
36
69
 
37
- .ui-btn-alt:disabled {
38
- background: linear-gradient(var(--gradient-transparent));
39
- @apply bg-gui-unavailable text-mid-grey cursor-not-allowed;
70
+ .ui-button-primary-lg {
71
+ @apply ui-button-lg-base ui-button-primary-base;
40
72
  }
41
73
 
42
- .ui-btn-invert {
43
- @apply text-cool-black bg-white text-btn2 font-sans font-bold inline-block rounded p-btn;
44
- @apply hover:text-white hover:bg-active-orange;
45
- @apply active:text-white active:bg-red-orange;
46
- @apply focus:text-white focus:bg-cool-black focus:outline-gui-focus;
47
- @apply disabled:text-mid-grey disabled:bg-gui-unavailable disabled:cursor-not-allowed;
48
- @apply transition-colors;
49
- @apply inline-flex items-center justify-center;
74
+ .ui-button-primary {
75
+ @apply ui-button-md-base ui-button-primary-base;
50
76
  }
51
77
 
52
- .ui-btn-secondary {
53
- @apply text-cool-black bg-white text-btn2 font-sans font-bold inline-block border-btn border-cool-black rounded p-btn;
54
- @apply hover:text-cool-black hover:border-active-orange hover:bg-white;
55
- @apply active:border-red-orange active:bg-white;
56
- @apply focus:border-cool-black focus:bg-white focus:outline-gui-focus;
57
- @apply disabled:text-gui-unavailable disabled:border-gui-unavailable disabled:bg-white disabled:cursor-not-allowed;
58
- @apply transition-colors;
59
- @apply inline-flex items-center justify-center;
78
+ .ui-button-primary-sm {
79
+ @apply ui-button-sm-base ui-button-primary-base;
60
80
  }
61
81
 
62
- .ui-btn-secondary-invert {
63
- @apply text-white bg-cool-black text-btn2 font-sans font-bold inline-block border-btn border-mid-grey rounded p-btn;
64
- @apply hover:text-white hover:border-active-orange;
65
- @apply active:border-red-orange;
66
- @apply focus:outline-gui-focus;
67
- @apply disabled:text-gui-unavailable disabled:border-gui-unavailable disabled:cursor-not-allowed;
68
- @apply transition-colors;
69
- @apply inline-flex items-center justify-center;
82
+ .ui-button-primary-xs {
83
+ @apply ui-button-xs-base ui-button-primary-base;
70
84
  }
71
85
 
72
- .ui-btn-icon {
73
- @apply w-24 h-24 mr-16;
86
+ .ui-button-secondary-lg {
87
+ @apply ui-button-lg-base ui-button-secondary-base;
74
88
  }
75
89
 
76
- .ui-btn-icon-small {
77
- @apply w-20 h-20 mr-12;
90
+ .ui-button-secondary {
91
+ @apply ui-button-md-base ui-button-secondary-base;
78
92
  }
79
93
 
80
- .ui-btn-icon-xsmall {
81
- @apply w-16 h-16 mr-8;
94
+ .ui-button-secondary-sm {
95
+ @apply ui-button-sm-base ui-button-secondary-base;
82
96
  }
83
- .ui-btn.ui-btn-disabled,
84
- .ui-btn-invert.ui-btn-disabled {
85
- @apply text-mid-grey bg-gui-unavailable cursor-not-allowed pointer-events-none select-none;
97
+
98
+ .ui-button-secondary-xs {
99
+ @apply ui-button-xs-base ui-button-secondary-base;
100
+ }
101
+
102
+ .ui-button-lg-left-icon {
103
+ @apply pl-24;
104
+ }
105
+
106
+ .ui-button-left-icon {
107
+ @apply pl-20;
108
+ }
109
+
110
+ .ui-button-sm-left-icon {
111
+ @apply pl-[18px];
112
+ }
113
+
114
+ .ui-button-lg-right-icon {
115
+ @apply pr-24;
86
116
  }
87
117
 
88
- .ui-btn-secondary.ui-btn-disabled {
89
- @apply text-gui-unavailable border-gui-unavailable bg-white cursor-not-allowed pointer-events-none select-none;
118
+ .ui-button-right-icon {
119
+ @apply pr-20;
90
120
  }
91
121
 
92
- .ui-btn-secondary-invert.ui-btn-disabled {
93
- @apply text-gui-unavailable border-gui-unavailable cursor-not-allowed pointer-events-none select-none;
122
+ .ui-button-sm-right-icon {
123
+ @apply pr-[18px];
94
124
  }
95
125
  }
@@ -0,0 +1,33 @@
1
+ @layer components {
2
+ .ui-gui-menu1 {
3
+ @apply font-sans text-neutral-1000 text-p1 font-medium leading-snug;
4
+ }
5
+
6
+ .ui-gui-menu2 {
7
+ @apply font-sans text-neutral-1000 text-p2 font-medium leading-snug;
8
+ }
9
+
10
+ .ui-gui-menu3 {
11
+ @apply font-sans text-neutral-1000 text-p3 font-medium leading-snug;
12
+ }
13
+
14
+ .ui-gui-menu4 {
15
+ @apply font-sans text-neutral-1000 text-p4 font-medium leading-snug;
16
+ }
17
+
18
+ .ui-gui-button1 {
19
+ @apply font-sans text-p1 font-bold leading-snug;
20
+ }
21
+
22
+ .ui-gui-button2 {
23
+ @apply font-sans text-p2 font-bold leading-snug;
24
+ }
25
+
26
+ .ui-gui-button3 {
27
+ @apply font-sans text-p3 font-bold leading-snug;
28
+ }
29
+
30
+ .ui-gui-button4 {
31
+ @apply font-sans text-p4 font-bold leading-snug;
32
+ }
33
+ }
@@ -0,0 +1,95 @@
1
+ @layer components {
2
+ .ui-btn {
3
+ @apply text-white bg-cool-black text-btn2 font-sans font-bold inline-block rounded p-btn;
4
+ @apply hover:text-white hover:bg-active-orange;
5
+ @apply active:text-white active:bg-red-orange;
6
+ @apply focus:text-white focus:bg-cool-black focus:outline-gui-focus;
7
+ @apply disabled:text-mid-grey disabled:bg-gui-unavailable disabled:cursor-not-allowed;
8
+ @apply transition-colors;
9
+ @apply inline-flex items-center justify-center;
10
+ }
11
+
12
+ .ui-btn-alt {
13
+ transition: background-position 0.2s;
14
+ background: linear-gradient(
15
+ 61.2deg,
16
+ var(--color-active-orange) 5%,
17
+ #fe5215 19%,
18
+ #fc4a13 27%,
19
+ #f73c10 33%,
20
+ #f1280a 39%,
21
+ #e90f04 44%,
22
+ var(--color-red-orange) 50%
23
+ );
24
+ background-size: 200% 100%;
25
+ background-position: 0% 0%;
26
+
27
+ @apply text-white text-btn2 font-sans font-bold inline-block rounded p-btn;
28
+ @apply focus:outline-gui-focus;
29
+ @apply inline-flex items-center justify-center;
30
+ }
31
+
32
+ .ui-btn-alt:hover,
33
+ .ui-btn-alt:focus {
34
+ background-position: 100% 0%;
35
+ }
36
+
37
+ .ui-btn-alt:disabled {
38
+ background: linear-gradient(var(--gradient-transparent));
39
+ @apply bg-gui-unavailable text-mid-grey cursor-not-allowed;
40
+ }
41
+
42
+ .ui-btn-invert {
43
+ @apply text-cool-black bg-white text-btn2 font-sans font-bold inline-block rounded p-btn;
44
+ @apply hover:text-white hover:bg-active-orange;
45
+ @apply active:text-white active:bg-red-orange;
46
+ @apply focus:text-white focus:bg-cool-black focus:outline-gui-focus;
47
+ @apply disabled:text-mid-grey disabled:bg-gui-unavailable disabled:cursor-not-allowed;
48
+ @apply transition-colors;
49
+ @apply inline-flex items-center justify-center;
50
+ }
51
+
52
+ .ui-btn-secondary {
53
+ @apply text-cool-black bg-white text-btn2 font-sans font-bold inline-block border-btn border-cool-black rounded p-btn;
54
+ @apply hover:text-cool-black hover:border-active-orange hover:bg-white;
55
+ @apply active:border-red-orange active:bg-white;
56
+ @apply focus:border-cool-black focus:bg-white focus:outline-gui-focus;
57
+ @apply disabled:text-gui-unavailable disabled:border-gui-unavailable disabled:bg-white disabled:cursor-not-allowed;
58
+ @apply transition-colors;
59
+ @apply inline-flex items-center justify-center;
60
+ }
61
+
62
+ .ui-btn-secondary-invert {
63
+ @apply text-white bg-cool-black text-btn2 font-sans font-bold inline-block border-btn border-mid-grey rounded p-btn;
64
+ @apply hover:text-white hover:border-active-orange;
65
+ @apply active:border-red-orange;
66
+ @apply focus:outline-gui-focus;
67
+ @apply disabled:text-gui-unavailable disabled:border-gui-unavailable disabled:cursor-not-allowed;
68
+ @apply transition-colors;
69
+ @apply inline-flex items-center justify-center;
70
+ }
71
+
72
+ .ui-btn-icon {
73
+ @apply w-24 h-24 mr-16;
74
+ }
75
+
76
+ .ui-btn-icon-small {
77
+ @apply w-20 h-20 mr-12;
78
+ }
79
+
80
+ .ui-btn-icon-xsmall {
81
+ @apply w-16 h-16 mr-8;
82
+ }
83
+ .ui-btn.ui-btn-disabled,
84
+ .ui-btn-invert.ui-btn-disabled {
85
+ @apply text-mid-grey bg-gui-unavailable cursor-not-allowed pointer-events-none select-none;
86
+ }
87
+
88
+ .ui-btn-secondary.ui-btn-disabled {
89
+ @apply text-gui-unavailable border-gui-unavailable bg-white cursor-not-allowed pointer-events-none select-none;
90
+ }
91
+
92
+ .ui-btn-secondary-invert.ui-btn-disabled {
93
+ @apply text-gui-unavailable border-gui-unavailable cursor-not-allowed pointer-events-none select-none;
94
+ }
95
+ }
@@ -86,6 +86,7 @@
86
86
  --color-gui-blue-active-dark: #0080ff;
87
87
  --color-gui-blue-focus: #80b9f2;
88
88
  --color-gui-unavailable: #a8a8a8;
89
+ --color-gui-unavailable-dark: #575757;
89
90
  --color-gui-success-green: #11cb24;
90
91
  --color-gui-error-red: #fb0c0c;
91
92
  --color-gui-focus: #80b9f2;
@@ -165,20 +165,4 @@
165
165
  .ui-figcaption {
166
166
  @apply font-mono text-p3 text-neutral-800;
167
167
  }
168
-
169
- .ui-menu-label-1 {
170
- @apply font-sans text-neutral-1000 text-p1 font-medium leading-snug;
171
- }
172
-
173
- .ui-menu-label-2 {
174
- @apply font-sans text-neutral-1000 text-p2 font-medium leading-snug;
175
- }
176
-
177
- .ui-menu-label-3 {
178
- @apply font-sans text-neutral-1000 text-p3 font-medium leading-snug;
179
- }
180
-
181
- .ui-menu-label-4 {
182
- @apply font-sans text-neutral-1000 text-p4 font-medium leading-snug;
183
- }
184
168
  }
@@ -1,9 +1,11 @@
1
1
  @import "./styles/buttons.css";
2
+ @import "./styles/legacy-buttons.css";
2
3
  @import "./styles/dropdowns.css";
3
4
  @import "./styles/forms.css";
4
5
  @import "./styles/layout.css";
5
6
  @import "./styles/shadows.css";
6
7
  @import "./styles/text.css";
8
+ @import "./styles/gui.css";
7
9
 
8
10
  @layer components {
9
11
  /* Basis for icon component */
package/index.d.ts CHANGED
@@ -168,6 +168,42 @@ export default Accordion;
168
168
  //# sourceMappingURL=Accordion.d.ts.map
169
169
  }
170
170
 
171
+ declare module '@ably/ui/core/Button' {
172
+ import React, { PropsWithChildren } from "react";
173
+ import { IconName } from "@ably/ui/core/Icon/types";
174
+ export type ButtonType = "priority" | "primary" | "secondary";
175
+ type ButtonSize = "lg" | "md" | "sm" | "xs";
176
+ type ButtonProps = {
177
+ /**
178
+ * The type of button: priority, primary, or secondary.
179
+ */
180
+ variant?: ButtonType;
181
+ /**
182
+ * The button size: lg, sm, or xs. Leave empty for md.
183
+ */
184
+ size?: ButtonSize;
185
+ /**
186
+ * An icon to render on the left side of the button label.
187
+ */
188
+ leftIcon?: IconName;
189
+ /**
190
+ * An icon to render on the right side of the button label.
191
+ */
192
+ rightIcon?: IconName;
193
+ /**
194
+ * Optional classes to add to the button element.
195
+ */
196
+ className?: string;
197
+ } & React.ButtonHTMLAttributes<HTMLButtonElement>;
198
+ export const iconModifierClasses: Record<ButtonSize, {
199
+ left: string;
200
+ right: string;
201
+ }>;
202
+ const Button: React.FC<PropsWithChildren<ButtonProps>>;
203
+ export default Button;
204
+ //# sourceMappingURL=Button.d.ts.map
205
+ }
206
+
171
207
  declare module '@ably/ui/core/Code' {
172
208
  type CodeProps = {
173
209
  language: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ably/ui",
3
- "version": "14.9.0-dev.b9c2a3b",
3
+ "version": "15.0.1-dev.80b42cd",
4
4
  "description": "Home of the Ably design system library ([design.ably.com](https://design.ably.com)). It provides a showcase, development/test environment and a publishing pipeline for different distributables.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -128,6 +128,7 @@ module.exports = {
128
128
  "gui-blue-focus": "var(--color-gui-blue-focus)",
129
129
  "gui-blue-visited": "var(--color-gui-blue-focus)",
130
130
  "gui-unavailable": "var(--color-gui-unavailable)",
131
+ "gui-unavailable-dark": "var(--color-gui-unavailable-dark)",
131
132
  "gui-success-green": "var(--color-gui-success-green)",
132
133
  "gui-error-red": "var(--color-gui-error-red)",
133
134
  "gui-focus": "var(--color-gui-focus)",
@@ -1 +0,0 @@
1
- ["bg-blue-400","bg-blue-100","bg-neutral-1300","bg-neutral-300","bg-neutral-200","bg-neutral-100","bg-neutral-000","bg-neutral-600","bg-orange-900","bg-orange-600","border-blue-400","border-neutral-200","border-neutral-600","border-neutral-500","border-orange-600","from-neutral-400","group-hover:bg-neutral-100","text-blue-600","text-blue-200","text-neutral-1300","text-neutral-300","text-neutral-000","text-neutral-1100","text-neutral-1000","text-neutral-800","text-neutral-700","text-neutral-600","text-neutral-500","text-orange-200","text-orange-600"]