@marwes-ui/core 1.5.0 → 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.
package/dist/index.d.ts CHANGED
@@ -3737,6 +3737,11 @@ declare const storybookButtonGeneralArgTypes: {
3737
3737
  readonly control: "select";
3738
3738
  readonly options: readonly ["primary", "secondary", "neutral", "text", "success", "danger"];
3739
3739
  };
3740
+ readonly type: {
3741
+ readonly control: "select";
3742
+ readonly options: readonly ["button", "submit", "reset"];
3743
+ readonly description: "Native form behavior; defaults to \"button\". Form actions (submit/reset) take precedence. Ignored for anchors.";
3744
+ };
3740
3745
  readonly iconLeft: {
3741
3746
  readonly control: "select";
3742
3747
  readonly options: ("tablet" | "info" | "search" | "repeat" | "bold" | "link" | "save" | "edit" | "upload" | "download" | "copy" | "delete" | "code" | "airplay" | "alertCircle" | "alertOctagon" | "alertTriangle" | "alignCenter" | "alignJustify" | "alignLeft" | "alignRight" | "arrowDown" | "arrowDownCircle" | "arrowDownLeft" | "arrowDownRight" | "arrowIn" | "arrowInCircle" | "arrowInSquare" | "arrowLeft" | "arrowLeftCircle" | "arrowOut" | "arrowOutCircle" | "arrowOutSquare" | "arrowRight" | "arrowRightCircle" | "arrowUp" | "arrowUpCircle" | "arrowUpLeft" | "arrowUpRight" | "atSign" | "barChart" | "barChart2" | "barChart3" | "barChart4" | "bell" | "bluetooth" | "bookmark" | "calendar" | "camera" | "cast" | "check" | "checkCircle" | "checkSquare" | "chevronDown" | "chevronLeft" | "chevronRight" | "chevronUp" | "chevronsDown" | "chevronsLeft" | "chevronsRight" | "chevronsUp" | "circle" | "clipboard" | "clock" | "command" | "compass" | "cornerDownLeft" | "cornerDownRight" | "cornerLeftDown" | "cornerLeftUp" | "cornerRightDown" | "cornerRightUp" | "cornerUpLeft" | "cornerUpRight" | "cpu" | "creditCard" | "database" | "disc" | "dollarSign" | "downloadCloud" | "edit2" | "edit3" | "expand" | "externalLink" | "eye" | "eyeOff" | "facebook" | "fastForward" | "file" | "fileMinus" | "fileMinus2" | "filePlus" | "filePlus2" | "fileText" | "fileX" | "fileX2" | "film" | "flag" | "folder" | "folderMinus" | "folderMinus2" | "folderPlus" | "folderPlus2" | "folderX" | "folderX2" | "grid" | "hardDrive" | "hash" | "headphones" | "heart" | "helpCircle" | "hexagon" | "home" | "home2" | "image" | "inbox" | "italic" | "layout" | "layout2" | "layout3" | "layout4" | "layout5" | "layout6" | "lineChart" | "lineChart2" | "list" | "loader" | "lock" | "mail" | "mapMarker1" | "mapMarker2" | "mapMarker3" | "maximize" | "maximize2" | "menu" | "messageCircle" | "messageSquare" | "mic" | "minimize" | "minimize3" | "minus" | "minusCircle" | "minusSquare" | "monitor" | "moon" | "moreHorizontal" | "moreVertical" | "move" | "music" | "octagon" | "paperclip" | "pause" | "pauseCircle" | "percent" | "phone" | "pieChart" | "pieChart2" | "pieChart3" | "pieChart4" | "pieChart5" | "play" | "playCircle" | "plus" | "plusCircle" | "plusSquare" | "power" | "printer" | "radio" | "refreshCcw" | "refreshCw" | "rewind" | "rotateLeft" | "rotateRight" | "rss" | "scissors" | "server" | "settings" | "share" | "shoppingBag" | "shoppingCart" | "shuffle" | "skipBack" | "skipForward" | "slash" | "sliders" | "smartphone" | "speaker" | "square" | "star" | "stopCircle" | "strikethrough" | "sun" | "table" | "table2" | "tag" | "thumbsDown" | "thumbsUp" | "trash" | "trendingDown" | "trendingUp" | "triangle" | "tv" | "twitter" | "type" | "underline" | "unlock" | "uploadCloud" | "user" | "userCheck" | "userCircle" | "userMinus" | "userPlus" | "userX" | "users" | "video" | "videoOff" | "volume" | "volume1" | "volume2" | "volumeX" | "watch" | "wifi" | "x" | "xCircle" | "xSquare" | "zoomIn" | "zoomOut" | undefined)[];
@@ -4106,6 +4111,7 @@ declare const storybookSliderArgTypes: {
4106
4111
  };
4107
4112
  };
4108
4113
  declare const storybookDocsDescription: {
4114
+ readonly primaryButton: "PrimaryButton controls visual emphasis and defaults to type=\"button\". Set type=\"submit\" for a form, or use SubmitButton for a fixed submit purpose.";
4109
4115
  readonly linkButton: "LinkButton locks navigation semantics, renders as an anchor, and keeps the canonical text treatment. Use Button for intentional visual deviations.";
4110
4116
  readonly destructiveButton: "DestructiveButton locks destructive semantics, uses the canonical danger treatment, and requires confirmation by default. Use Button for intentional exceptions.";
4111
4117
  readonly submitButton: "SubmitButton locks form-submit semantics, always renders as a button, and keeps the canonical primary treatment.";
@@ -5156,6 +5162,8 @@ type AccessibleButtonName = {
5156
5162
  type ButtonOptions = {
5157
5163
  as?: "button" | "a";
5158
5164
  href?: string;
5165
+ /** Native form behavior. Defaults to "button"; submit/reset actions take precedence. Ignored for anchors. */
5166
+ type?: "button" | "submit" | "reset";
5159
5167
  size?: ButtonSize;
5160
5168
  variant?: ButtonVariant;
5161
5169
  disabled?: boolean;
package/dist/index.js CHANGED
@@ -5505,7 +5505,7 @@ function resolveButtonA11y(opts, resolvedLoading) {
5505
5505
  if (opts.ariaExpanded !== void 0) common.ariaExpanded = opts.ariaExpanded;
5506
5506
  if (opts.ariaControls) common.ariaControls = opts.ariaControls;
5507
5507
  if (tag === "button") {
5508
- const nativeButtonType = opts.action === "submit" ? "submit" : opts.action === "reset" ? "reset" : "button";
5508
+ const nativeButtonType = opts.action === "submit" ? "submit" : opts.action === "reset" ? "reset" : opts.type ?? "button";
5509
5509
  const a11y2 = { ...common, type: nativeButtonType };
5510
5510
  if (isDisabled) a11y2.disabled = true;
5511
5511
  return { tag, a11y: a11y2, blockClick: false };
@@ -5528,7 +5528,7 @@ function createButtonRecipe(opts) {
5528
5528
  const { tag, a11y, blockClick } = resolveButtonA11y(opts, resolvedLoading);
5529
5529
  const size = opts.size ?? "md";
5530
5530
  const variant = opts.variant ?? "primary";
5531
- const action = opts.action ?? (tag === "button" ? "button" : "navigate");
5531
+ const action = opts.action ?? (tag === "button" ? a11y.type ?? "button" : "navigate");
5532
5532
  const hasAffordance = resolvedLoading.isLoading || Boolean(opts.iconLeft || opts.iconRight);
5533
5533
  return {
5534
5534
  tag,
@@ -12462,7 +12462,12 @@ var storybookButtonIconArgTypes = {
12462
12462
  };
12463
12463
  var storybookButtonGeneralArgTypes = {
12464
12464
  ...storybookButtonIconArgTypes,
12465
- variant: storybookButtonVariantArgType
12465
+ variant: storybookButtonVariantArgType,
12466
+ type: {
12467
+ control: "select",
12468
+ options: ["button", "submit", "reset"],
12469
+ description: 'Native form behavior; defaults to "button". Form actions (submit/reset) take precedence. Ignored for anchors.'
12470
+ }
12466
12471
  };
12467
12472
  var storybookIconButtonArgTypes = {
12468
12473
  icon: {
@@ -12681,6 +12686,7 @@ var storybookSliderArgTypes = {
12681
12686
  ariaValueText: { control: "text" }
12682
12687
  };
12683
12688
  var storybookDocsDescription = {
12689
+ primaryButton: 'PrimaryButton controls visual emphasis and defaults to type="button". Set type="submit" for a form, or use SubmitButton for a fixed submit purpose.',
12684
12690
  linkButton: "LinkButton locks navigation semantics, renders as an anchor, and keeps the canonical text treatment. Use Button for intentional visual deviations.",
12685
12691
  destructiveButton: "DestructiveButton locks destructive semantics, uses the canonical danger treatment, and requires confirmation by default. Use Button for intentional exceptions.",
12686
12692
  submitButton: "SubmitButton locks form-submit semantics, always renders as a button, and keeps the canonical primary treatment.",