@adamjanicki/ui 1.4.9 → 1.5.1

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.
@@ -36,6 +36,11 @@ type ButtonProps = DefaultButtonProps & {
36
36
  * @default "rounded"
37
37
  */
38
38
  corners?: CornerType;
39
+ /**
40
+ * [Optional] Size of the button, if wishing to make smaller
41
+ * @default "regular"
42
+ */
43
+ size?: "regular" | "small";
39
44
  };
40
45
  export declare const UnstyledButton: React.ForwardRefExoticComponent<Omit<DefaultButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
41
46
  export declare const IconButton: React.ForwardRefExoticComponent<Omit<IconButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
@@ -37,7 +37,7 @@ export var IconButton = forwardRef(function (_a, ref) {
37
37
  return (_jsx(UnstyledButton, __assign({}, props, { className: classNames("ajui-icon-button", className), ref: ref, children: icon })));
38
38
  });
39
39
  var Button = forwardRef(function (_a, ref) {
40
- var _b = _a.variant, variant = _b === void 0 ? "primary" : _b, _c = _a.corners, corners = _c === void 0 ? "rounded" : _c, className = _a.className, rest = __rest(_a, ["variant", "corners", "className"]);
41
- return (_jsx(UnstyledButton, __assign({}, rest, { className: classNames("ajui-button-default ajui-button--".concat(variant, " corners--").concat(corners), className), ref: ref })));
40
+ var _b = _a.variant, variant = _b === void 0 ? "primary" : _b, _c = _a.corners, corners = _c === void 0 ? "rounded" : _c, className = _a.className, _d = _a.size, size = _d === void 0 ? "regular" : _d, rest = __rest(_a, ["variant", "corners", "className", "size"]);
41
+ return (_jsx(UnstyledButton, __assign({}, rest, { className: classNames("ajui-button--".concat(variant, " ajui-button-size--").concat(size, " corners--").concat(corners), className), ref: ref })));
42
42
  });
43
43
  export default Button;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adamjanicki/ui",
3
- "version": "1.4.9",
3
+ "version": "1.5.1",
4
4
  "description": "Basic UI components and hooks for React in TypeScript",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
package/style.css CHANGED
@@ -107,11 +107,11 @@ a:focus:not(:focus-visible) {
107
107
  outline: none;
108
108
  }
109
109
 
110
- a:not([disabled]):focus-visible,
111
- button:not([disabled]):focus-visible {
112
- outline: 3px solid var(--ajui-link-color);
113
- outline-offset: 0;
110
+ a,
111
+ button {
112
+ outline-color: var(--ajui-link-color);
114
113
  }
114
+
115
115
  .ajui-input-default:not([disabled]):focus-within,
116
116
  .ajui-select-container:not([disabled]):focus-within {
117
117
  outline: 3px solid var(--ajui-focus-ring-color);
@@ -204,10 +204,16 @@ a {
204
204
  font-weight: 500;
205
205
  }
206
206
 
207
- .ajui-button-default {
207
+ .ajui-button-size--regular {
208
208
  padding: 0.5rem 1rem;
209
209
  }
210
210
 
211
+ .ajui-button-size--small {
212
+ padding: 4px 6px;
213
+ font-size: 12px;
214
+ font-weight: 700;
215
+ }
216
+
211
217
  .ajui-icon-button {
212
218
  display: flex;
213
219
  justify-content: center;
@@ -243,14 +249,14 @@ a {
243
249
  }
244
250
 
245
251
  @media (hover: hover) {
246
- .ajui-button--primary:not([disabled]):is(:hover, :focus-visible),
247
- .ajui-icon-button:not([disabled]):is(:hover, :focus-visible),
248
- .ajui-link-default:is(:hover, :focus-visible) {
252
+ .ajui-button--primary:not([disabled]):hover,
253
+ .ajui-icon-button:not([disabled]):hover,
254
+ .ajui-link-default:hover {
249
255
  opacity: var(--ajui-default-opacity-dim);
250
256
  }
251
257
 
252
- .ajui-button--transparent:not([disabled]):is(:hover, :focus-visible),
253
- .ajui-button--secondary:not([disabled]):is(:hover, :focus-visible) {
258
+ .ajui-button--transparent:not([disabled]):hover,
259
+ .ajui-button--secondary:not([disabled]):hover {
254
260
  box-shadow: inset 0 0 0 1px var(--ajui-button-secondary-border-hover);
255
261
  }
256
262
  }