@rubenpazch/icon-button 1.0.0 → 2.0.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.
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  export type IconButtonVariant = "default" | "secondary" | "black" | "gradient-green" | "solid-green" | "blue" | "pink" | "warning";
3
3
  export type IconButtonSize = "small" | "medium";
4
+ export type IconButtonShape = "rounded" | "square";
4
5
  export type IconButtonFocusStyle = "filled" | "outline" | "underline";
5
6
  export type IconButtonFocusTrigger = "self" | "sibling" | "parent" | "grandparent";
6
7
  export type IconPosition = "start" | "end";
@@ -10,6 +11,7 @@ interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>
10
11
  icon: React.ReactNode;
11
12
  variant?: IconButtonVariant;
12
13
  size?: IconButtonSize;
14
+ shape?: IconButtonShape;
13
15
  filled?: boolean;
14
16
  quiet?: boolean;
15
17
  inverted?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../src/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,MAAM,MAAM,iBAAiB,GACzB,SAAS,GACT,WAAW,GACX,OAAO,GACP,gBAAgB,GAChB,aAAa,GACb,MAAM,GACN,MAAM,GACN,SAAS,CAAC;AACd,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,QAAQ,CAAC;AAChD,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,CAAC;AACtE,MAAM,MAAM,sBAAsB,GAC9B,MAAM,GACN,SAAS,GACT,QAAQ,GACR,aAAa,CAAC;AAClB,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,KAAK,CAAC;AAC3C,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,QAAQ,CAAC;AAC/D,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,QAAQ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SAAS,GACT,QAAQ,GACR,aAAa,CAAC;AAClB,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,KAAK,CAAC;AAC3C,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,QAAQ,CAAC;AAC/D,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAElE,UAAU,eAAgB,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IAC7E,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,oBAAoB,CAAC;IACtC,gBAAgB,CAAC,EAAE,sBAAsB,CAAC;IAC1C,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,QAAA,MAAM,UAAU,2FAiQf,CAAC;AAIF,eAAe,UAAU,CAAC"}
package/dist/index.cjs.js CHANGED
@@ -424,13 +424,15 @@ function requireJsxRuntime () {
424
424
 
425
425
  var jsxRuntimeExports = requireJsxRuntime();
426
426
 
427
- const IconButton = require$$0.forwardRef(({ icon, variant = "default", size = "medium", filled = false, quiet = false, inverted = false, linkStyle = false, focusStyleType = "filled", focusTriggerType = "self", iconPosition = "start", label, labelPosition = "end", tooltip, tooltipPosition = "top", className, disabled, children, type = "button", ...props }, ref) => {
427
+ const IconButton = require$$0.forwardRef(({ icon, variant = "default", size = "medium", shape = "rounded", filled = false, quiet = false, inverted = false, linkStyle = false, focusStyleType = "filled", focusTriggerType = "self", iconPosition = "start", label, labelPosition = "end", tooltip, tooltipPosition = "top", className, disabled, children, type = "button", ...props }, ref) => {
428
428
  const [showTooltip, setShowTooltip] = require$$0.useState(false);
429
429
  // Size classes for icon-only buttons
430
430
  const sizeClasses = {
431
431
  small: "p-2 w-8 h-8",
432
432
  medium: "p-2.5 w-10 h-10",
433
433
  };
434
+ // Shape classes for icon-only buttons
435
+ const shapeClasses = shape === "square" ? "rounded-lg" : "rounded-full";
434
436
  // Icon size based on button size
435
437
  const iconSizeClasses = {
436
438
  small: "w-4 h-4",
@@ -521,7 +523,7 @@ const IconButton = require$$0.forwardRef(({ icon, variant = "default", size = "m
521
523
  const allClasses = `
522
524
  ${sizeClasses[size]}
523
525
  ${colorClasses}
524
- rounded-full
526
+ ${shapeClasses}
525
527
  ${disabledClasses}
526
528
  ${focusClasses}
527
529
  ${linkStyleClasses}
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import React from 'react';
2
2
 
3
3
  type IconButtonVariant = "default" | "secondary" | "black" | "gradient-green" | "solid-green" | "blue" | "pink" | "warning";
4
4
  type IconButtonSize = "small" | "medium";
5
+ type IconButtonShape = "rounded" | "square";
5
6
  type IconButtonFocusStyle = "filled" | "outline" | "underline";
6
7
  type IconButtonFocusTrigger = "self" | "sibling" | "parent" | "grandparent";
7
8
  type IconPosition = "start" | "end";
@@ -11,6 +12,7 @@ interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>
11
12
  icon: React.ReactNode;
12
13
  variant?: IconButtonVariant;
13
14
  size?: IconButtonSize;
15
+ shape?: IconButtonShape;
14
16
  filled?: boolean;
15
17
  quiet?: boolean;
16
18
  inverted?: boolean;
package/dist/index.esm.js CHANGED
@@ -422,13 +422,15 @@ function requireJsxRuntime () {
422
422
 
423
423
  var jsxRuntimeExports = requireJsxRuntime();
424
424
 
425
- const IconButton = require$$0.forwardRef(({ icon, variant = "default", size = "medium", filled = false, quiet = false, inverted = false, linkStyle = false, focusStyleType = "filled", focusTriggerType = "self", iconPosition = "start", label, labelPosition = "end", tooltip, tooltipPosition = "top", className, disabled, children, type = "button", ...props }, ref) => {
425
+ const IconButton = require$$0.forwardRef(({ icon, variant = "default", size = "medium", shape = "rounded", filled = false, quiet = false, inverted = false, linkStyle = false, focusStyleType = "filled", focusTriggerType = "self", iconPosition = "start", label, labelPosition = "end", tooltip, tooltipPosition = "top", className, disabled, children, type = "button", ...props }, ref) => {
426
426
  const [showTooltip, setShowTooltip] = useState(false);
427
427
  // Size classes for icon-only buttons
428
428
  const sizeClasses = {
429
429
  small: "p-2 w-8 h-8",
430
430
  medium: "p-2.5 w-10 h-10",
431
431
  };
432
+ // Shape classes for icon-only buttons
433
+ const shapeClasses = shape === "square" ? "rounded-lg" : "rounded-full";
432
434
  // Icon size based on button size
433
435
  const iconSizeClasses = {
434
436
  small: "w-4 h-4",
@@ -519,7 +521,7 @@ const IconButton = require$$0.forwardRef(({ icon, variant = "default", size = "m
519
521
  const allClasses = `
520
522
  ${sizeClasses[size]}
521
523
  ${colorClasses}
522
- rounded-full
524
+ ${shapeClasses}
523
525
  ${disabledClasses}
524
526
  ${focusClasses}
525
527
  ${linkStyleClasses}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rubenpazch/icon-button",
3
- "version": "1.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "IconButton component",
5
5
  "private": false,
6
6
  "main": "dist/index.cjs.js",
@@ -29,7 +29,7 @@
29
29
  "react-dom": "^19.0.0"
30
30
  },
31
31
  "devDependencies": {
32
- "@rubenpazch/typescript-config": "2.0.0"
32
+ "@rubenpazch/typescript-config": "3.0.0"
33
33
  },
34
34
  "publishConfig": {
35
35
  "access": "public"