@hunter-industries/hunter-components 0.0.82 → 0.0.84

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.
@@ -2188,7 +2188,8 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
2188
2188
  fill: {},
2189
2189
  stroke: {},
2190
2190
  strokeWidth: {},
2191
- flipIcon: {}
2191
+ flipIcon: {},
2192
+ aspectSquare: { type: Boolean }
2192
2193
  },
2193
2194
  setup(__props, { expose: __expose }) {
2194
2195
  const props = __props;
@@ -2215,6 +2216,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
2215
2216
  if (flipIcon.value) {
2216
2217
  classes.push(`hcl-flip-icon ${flipIcon.value}`);
2217
2218
  }
2219
+ console.log("SQ", props.aspectSquare);
2218
2220
  return classes;
2219
2221
  });
2220
2222
  __expose({
@@ -2222,7 +2224,11 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
2222
2224
  });
2223
2225
  return (_ctx, _cache) => {
2224
2226
  return icon.value ? (openBlock(), createBlock(resolveDynamicComponent(icon.value), mergeProps({ key: 0 }, iconProps.value, {
2225
- class: ["hcl-icon", [iconClasses.value, iconSizeClass.value, {}]],
2227
+ class: ["hcl-icon", [
2228
+ iconClasses.value,
2229
+ iconSizeClass.value,
2230
+ { "hcl-aspect-square": _ctx.aspectSquare === true }
2231
+ ]],
2226
2232
  style: { width: _ctx.width, height: _ctx.height },
2227
2233
  ref_key: "hunterIcon",
2228
2234
  ref: hunterIcon
@@ -2237,7 +2243,7 @@ const _export_sfc = (sfc, props) => {
2237
2243
  }
2238
2244
  return target;
2239
2245
  };
2240
- const Icon = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-b1857077"]]);
2246
+ const Icon = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-4bbd4c4d"]]);
2241
2247
  const unitRegex = /(ch|em|rem|ex|px|cm|mm|in|pt|pc|vh|vw|vmin|vmax|svh|lvh|dvh|svw|lvw|dvw|%)$/i;
2242
2248
  const keywordOrFuncRegex = /^(auto|min-content|max-content|fit-content\(.+\)|calc\(.+\)|clamp\(.+\)|min\(.+\)|max\(.+\)|var\(--[^)]+\))$/i;
2243
2249
  const convertValueToCssSizeProperty = (value) => {
@@ -2342,7 +2348,9 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
2342
2348
  height: {},
2343
2349
  type: {},
2344
2350
  useSlot: { type: Boolean },
2345
- flipIcon: {}
2351
+ flipIcon: {},
2352
+ iconButtonShape: {},
2353
+ hasShadow: { type: Boolean }
2346
2354
  },
2347
2355
  setup(__props, { expose: __expose }) {
2348
2356
  const props = __props;
@@ -2380,12 +2388,34 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
2380
2388
  const buttonHeight = computed(
2381
2389
  () => convertValueToCssSizeProperty(props.height)
2382
2390
  );
2391
+ const isIconButton = computed(() => {
2392
+ var _a;
2393
+ return (_a = props.variant) == null ? void 0 : _a.includes("icon");
2394
+ });
2395
+ const buttonVariant = computed(() => {
2396
+ const v = props.variant;
2397
+ if (isIconButton.value === true && v) {
2398
+ return v.split("-")[1] || "icon_default";
2399
+ }
2400
+ return v || "primary";
2401
+ });
2383
2402
  const buttonClasses = computed(() => {
2384
- const defaultClass = `hunter-button_${props.variant ? props.variant : "primary"}`;
2403
+ console.log("TEST", isIconButton.value, buttonVariant.value);
2404
+ const defaultClass = buttonVariant.value && `hunter-button_${buttonVariant.value}`;
2405
+ console.log("DEF", defaultClass);
2385
2406
  const statusClass = props.useStatusStyles === true && status.value !== "idle" && !props.disabled ? `hunter-button_${status.value}` : void 0;
2386
2407
  const flipClass = props.icon && iconPosition.value === "left" ? "hunter-button_flip-icon-position" : void 0;
2387
2408
  const ellipsisClass = props.animatePendingEllipsis === true && status.value === "pending" ? "hunter-button_animate-ellipsis" : void 0;
2388
- return [defaultClass, statusClass, flipClass, ellipsisClass].filter(Boolean);
2409
+ const iconSizeClass = isIconButton.value === true ? `hcl-icon-size_${props.iconSize || "default"}` : void 0;
2410
+ const classes = [
2411
+ defaultClass,
2412
+ statusClass,
2413
+ flipClass,
2414
+ ellipsisClass,
2415
+ iconSizeClass
2416
+ ].filter(Boolean);
2417
+ console.log("CL", classes);
2418
+ return classes;
2389
2419
  });
2390
2420
  const buttonEl = ref(null);
2391
2421
  const buttonSpan = ref(null);
@@ -2399,7 +2429,16 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
2399
2429
  return openBlock(), createElementBlock("button", {
2400
2430
  ref_key: "buttonEl",
2401
2431
  ref: buttonEl,
2402
- class: normalizeClass(["hunter-component hunter-button", [_ctx.className, ...buttonClasses.value, { disabled: _ctx.disabled }]]),
2432
+ class: normalizeClass(["hunter-component hunter-button", [
2433
+ _ctx.className,
2434
+ ...buttonClasses.value,
2435
+ {
2436
+ disabled: _ctx.disabled,
2437
+ "hunter-button_icon_circle": _ctx.iconButtonShape === "circle",
2438
+ "with-shadow": _ctx.hasShadow,
2439
+ "hunter-button_icon": isIconButton.value
2440
+ }
2441
+ ]]),
2403
2442
  style: normalizeStyle({
2404
2443
  width: buttonWidth.value,
2405
2444
  height: buttonHeight.value,
@@ -2411,25 +2450,22 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
2411
2450
  onMouseover: _cache[0] || (_cache[0] = ($event) => isHovered.value = true),
2412
2451
  onMouseleave: _cache[1] || (_cache[1] = ($event) => isHovered.value = false)
2413
2452
  }, [
2414
- _ctx.variant !== "icon" && !_ctx.useSlot ? (openBlock(), createElementBlock("span", {
2453
+ !isIconButton.value && !_ctx.useSlot ? (openBlock(), createElementBlock("span", {
2415
2454
  key: 0,
2416
2455
  class: "hunter-button__label",
2417
2456
  ref_key: "buttonSpan",
2418
2457
  ref: buttonSpan
2419
2458
  }, toDisplayString(displayText.value), 513)) : createCommentVNode("", true),
2420
- _ctx.variant !== "icon" && _ctx.useSlot === true ? renderSlot(_ctx.$slots, "default", { key: 1 }, void 0, true) : createCommentVNode("", true),
2459
+ !isIconButton.value && _ctx.useSlot === true ? renderSlot(_ctx.$slots, "default", { key: 1 }) : createCommentVNode("", true),
2421
2460
  _ctx.icon ? (openBlock(), createBlock(Icon, {
2422
2461
  key: 2,
2423
2462
  ref_key: "buttonIcon",
2424
2463
  ref: buttonIcon,
2425
2464
  name: _ctx.icon,
2426
2465
  size: _ctx.iconSize || "default",
2427
- class: normalizeClass([
2428
- {
2429
- "hunter-button_icon": _ctx.variant === "icon"
2430
- },
2466
+ class: normalizeClass(["hunter-button__icon", [
2431
2467
  isHovered.value === true && _ctx.iconHoverClass ? [_ctx.iconHoverClass].flat().join(" ") : ""
2432
- ]),
2468
+ ]]),
2433
2469
  flipIcon: _ctx.flipIcon,
2434
2470
  className: unref(iconClass),
2435
2471
  width: _ctx.iconWidth,
@@ -2442,7 +2478,6 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
2442
2478
  };
2443
2479
  }
2444
2480
  });
2445
- const Button = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-d65b8412"]]);
2446
2481
  const _hoisted_1$b = ["id"];
2447
2482
  const _hoisted_2$9 = { key: 0 };
2448
2483
  const _sfc_main$j = /* @__PURE__ */ defineComponent({
@@ -2558,7 +2593,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
2558
2593
  var _a;
2559
2594
  return openBlock(), createElementBlock("div", {
2560
2595
  class: normalizeClass(["hunter-component hc__card", {
2561
- "horizontal": _ctx.variant === "horizontal",
2596
+ horizontal: _ctx.variant === "horizontal",
2562
2597
  "selected-card": isActive.value === true
2563
2598
  }]),
2564
2599
  id: cardId.value
@@ -2589,19 +2624,18 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
2589
2624
  createElementVNode("div", _hoisted_7, toDisplayString(_ctx.description), 1)
2590
2625
  ]),
2591
2626
  !_ctx.hideToggleButton ? (openBlock(), createElementBlock("div", _hoisted_8, [
2592
- withDirectives(createVNode(unref(Button), {
2593
- variant: "icon",
2627
+ withDirectives(createVNode(unref(_sfc_main$k), {
2628
+ variant: "icon-primary",
2629
+ "icon-button-shape": "circle",
2594
2630
  icon: "add",
2595
- class: "hc__card__buttons__button_add",
2596
2631
  onClick: handleSetActive
2597
2632
  }, null, 512), [
2598
2633
  [vShow, !isActive.value]
2599
2634
  ]),
2600
- withDirectives(createVNode(unref(Button), {
2601
- variant: "icon",
2635
+ withDirectives(createVNode(unref(_sfc_main$k), {
2636
+ variant: "icon-primary",
2637
+ "icon-button-shape": "circle",
2602
2638
  icon: "delete",
2603
- class: "hc__card__buttons__button_delete",
2604
- iconClass: "delete-button-icon",
2605
2639
  onClick: handleSetActive
2606
2640
  }, null, 512), [
2607
2641
  [vShow, isActive.value]
@@ -3014,13 +3048,15 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
3014
3048
  height: {},
3015
3049
  type: {},
3016
3050
  useSlot: { type: Boolean },
3017
- flipIcon: {}
3051
+ flipIcon: {},
3052
+ iconButtonShape: {},
3053
+ hasShadow: { type: Boolean }
3018
3054
  },
3019
3055
  setup(__props) {
3020
3056
  const props = __props;
3021
3057
  const { collapsed } = toRefs(props);
3022
3058
  return (_ctx, _cache) => {
3023
- return openBlock(), createBlock(Button, mergeProps(props, {
3059
+ return openBlock(), createBlock(_sfc_main$k, mergeProps(props, {
3024
3060
  class: ["hunter-button_dropdown", {
3025
3061
  disabled: _ctx.disabled
3026
3062
  }],
@@ -3195,7 +3231,9 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
3195
3231
  height: {},
3196
3232
  type: {},
3197
3233
  useSlot: { type: Boolean },
3198
- flipIcon: {}
3234
+ flipIcon: {},
3235
+ iconButtonShape: {},
3236
+ hasShadow: { type: Boolean }
3199
3237
  },
3200
3238
  setup(__props) {
3201
3239
  const props = __props;
@@ -3587,14 +3625,14 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
3587
3625
  ])
3588
3626
  ]),
3589
3627
  createElementVNode("div", _hoisted_6, [
3590
- createVNode(Button, mergeProps(unref(cancelButtonProps), {
3628
+ createVNode(_sfc_main$k, mergeProps(unref(cancelButtonProps), {
3591
3629
  variant: "tertiary",
3592
3630
  className: "form-button",
3593
3631
  text: _ctx.cancelButtonText,
3594
3632
  disabled: status.value === "pending" || status.value === "success",
3595
3633
  onClick: handleCancelFormClick
3596
3634
  }), null, 16, ["text", "disabled"]),
3597
- createVNode(Button, mergeProps({
3635
+ createVNode(_sfc_main$k, mergeProps({
3598
3636
  class: ["form-button form-button_submit", {
3599
3637
  "form-button_pointer-events-none": status.value === "success" && unref(successSubmitButtonDisabled) === true
3600
3638
  }]
@@ -3745,7 +3783,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
3745
3783
  variant: _ctx.variant === "light" ? "light" : "dark",
3746
3784
  onClick: _cache[0] || (_cache[0] = ($event) => emit("button-click", informationEl.value))
3747
3785
  }, null, 8, ["text", "type", "variant"])) : createCommentVNode("", true),
3748
- _ctx.buttonType === "close" ? (openBlock(), createBlock(Button, {
3786
+ _ctx.buttonType === "close" ? (openBlock(), createBlock(_sfc_main$k, {
3749
3787
  key: 1,
3750
3788
  variant: "icon",
3751
3789
  onClick: _cache[1] || (_cache[1] = ($event) => emit("close", informationEl.value)),
@@ -3912,7 +3950,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3912
3950
  class: "hunter-search-input-dropdown",
3913
3951
  onSelectOption: _cache[3] || (_cache[3] = (value) => handleSelectedOption(value))
3914
3952
  }, null, 8, ["options", "option-key", "collapsed", "filter-value"]),
3915
- !_ctx.hideSearchButton ? (openBlock(), createBlock(Button, {
3953
+ !_ctx.hideSearchButton ? (openBlock(), createBlock(_sfc_main$k, {
3916
3954
  key: 0,
3917
3955
  ref_key: "searchButtonEl",
3918
3956
  ref: searchButtonEl,
@@ -3925,7 +3963,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3925
3963
  }, null, 8, ["icon-fill"])) : createCommentVNode("", true)
3926
3964
  ], 4),
3927
3965
  !_ctx.hideClearButton ? (openBlock(), createElementBlock("div", _hoisted_5, [
3928
- createVNode(Button, {
3966
+ createVNode(_sfc_main$k, {
3929
3967
  class: "underline clear-button",
3930
3968
  variant: "link",
3931
3969
  text: "Clear",
@@ -3938,7 +3976,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3938
3976
  });
3939
3977
  const SearchInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-603385ac"]]);
3940
3978
  export {
3941
- Button as HunterButton,
3979
+ _sfc_main$k as HunterButton,
3942
3980
  ButtonIcon as HunterButtonIcon,
3943
3981
  _sfc_main$i as HunterButtonToast,
3944
3982
  _sfc_main$h as HunterCard,