@w5-ui/wc 0.7.0 → 0.8.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.js CHANGED
@@ -6612,7 +6612,7 @@ function SkipLink($$anchor, $$props) {
6612
6612
  }
6613
6613
  reset(a);
6614
6614
  template_effect(() => {
6615
- set_class(a, 1, `absolute left-0 top-0 z-[100] -translate-y-full rounded-br-md bg-brand-05 px-3 py-2 text-13 font-semibold text-white no-underline focus:translate-y-0 focus:outline-2 focus:-outline-offset-4 focus:outline-white
6615
+ set_class(a, 1, `absolute left-0 top-0 z-[100] -translate-y-full rounded-br-md bg-primary-fill px-3 py-2 text-13 font-semibold text-primary-fill-fg no-underline focus:translate-y-0 focus:outline-2 focus:-outline-offset-4 focus:outline-white
6616
6616
  ${className() ?? ""}`);
6617
6617
  set_attribute(a, "href", href());
6618
6618
  });
@@ -7276,7 +7276,7 @@ function Badge($$anchor, $$props) {
7276
7276
  // Status-warning is yellow in both motifs; near-black text stays
7277
7277
  // legible against it. `text-neutral-10` resolves to `#0a0a0b`.
7278
7278
  warn: "bg-status-warning text-neutral-10",
7279
- info: "bg-brand-05 text-white",
7279
+ info: "bg-primary-fill text-primary-fill-fg",
7280
7280
  success: "bg-status-success text-white",
7281
7281
  neutral: "bg-status-neutral text-white"
7282
7282
  };
@@ -8757,7 +8757,7 @@ var root$2N = /* @__PURE__ */ from_html(`<button><!> <!></button>`);
8757
8757
  function Button($$anchor, $$props) {
8758
8758
  let variant = prop($$props, "variant", 3, "ghost"), iconOnly = prop($$props, "iconOnly", 3, false), loading = prop($$props, "loading", 3, false), title = prop($$props, "title", 3, void 0), type = prop($$props, "type", 3, "button"), disabled = prop($$props, "disabled", 3, false), className = prop($$props, "class", 3, ""), style = prop($$props, "style", 3, ""), ariaLabel = prop($$props, "aria-label", 3, void 0), ariaHasPopup = prop($$props, "aria-haspopup", 3, void 0), ariaExpanded = prop($$props, "aria-expanded", 3, void 0), ariaControls = prop($$props, "aria-controls", 3, void 0);
8759
8759
  const VARIANT = {
8760
- primary: "bg-brand-05 text-white hover:bg-brand-06 border-transparent",
8760
+ primary: "bg-primary-fill text-primary-fill-fg hover:bg-primary-fill-hover active:bg-primary-fill-press border-transparent",
8761
8761
  ghost: "bg-transparent text-text-2 border-border-2 hover:bg-row-hover hover:text-text-1",
8762
8762
  danger: "bg-transparent text-status-danger border-status-danger/30"
8763
8763
  };
@@ -11783,6 +11783,18 @@ function Pill($$anchor, $$props) {
11783
11783
  });
11784
11784
  append($$anchor, span);
11785
11785
  }
11786
+ function along(pointer, size, viewport, margin) {
11787
+ const far = viewport - margin;
11788
+ if (pointer + size <= far) return Math.max(margin, pointer);
11789
+ if (pointer - size >= margin) return pointer - size;
11790
+ return Math.max(margin, Math.min(pointer, far - size));
11791
+ }
11792
+ function computeMenuPosition(input) {
11793
+ return {
11794
+ left: along(input.x, input.menuWidth, input.viewportWidth, input.margin),
11795
+ top: along(input.y, input.menuHeight, input.viewportHeight, input.margin)
11796
+ };
11797
+ }
11786
11798
  var root$2r = /* @__PURE__ */ from_html(`<li role="separator" class="my-1 h-px bg-row-active"></li>`);
11787
11799
  var root_1$1N = /* @__PURE__ */ from_html(` <!> `, 1);
11788
11800
  var root_2$1u = /* @__PURE__ */ from_html(`<li role="menuitem" class="flex cursor-pointer items-center whitespace-nowrap rounded-[5px] px-3 py-1.5 text-13 text-text-2 outline-none hover:bg-row-active hover:text-text-1 data-[active=true]:bg-row-active data-[active=true]:text-text-1 data-[danger=true]:text-status-danger data-[danger=true]:hover:bg-status-danger/10 data-[warning=true]:text-status-warning data-[warning=true]:hover:bg-status-warning/10 data-[success=true]:text-status-success data-[success=true]:hover:bg-status-success/10 aria-disabled:cursor-not-allowed aria-disabled:opacity-40"><!></li>`);
@@ -11809,10 +11821,25 @@ function ContextMenu($$anchor, $$props) {
11809
11821
  },
11810
11822
  []
11811
11823
  ));
11812
- const menuW = 168;
11813
- let menuH = /* @__PURE__ */ user_derived(() => items().length * 30 + 8);
11814
- let cx = /* @__PURE__ */ user_derived(() => Math.min(x(), (typeof window !== "undefined" ? window.innerWidth : 1200) - menuW - 8));
11815
- let cy = /* @__PURE__ */ user_derived(() => Math.min(y(), (typeof window !== "undefined" ? window.innerHeight : 800) - get(menuH) - 8));
11824
+ const MENU_MARGIN = 8;
11825
+ let cx = /* @__PURE__ */ state(0);
11826
+ let cy = /* @__PURE__ */ state(0);
11827
+ user_effect(() => {
11828
+ void items();
11829
+ if (!open() || get(menuEl) === void 0) return;
11830
+ const { width, height } = get(menuEl).getBoundingClientRect();
11831
+ const placed = computeMenuPosition({
11832
+ x: x(),
11833
+ y: y(),
11834
+ menuWidth: width,
11835
+ menuHeight: height,
11836
+ viewportWidth: window.innerWidth,
11837
+ viewportHeight: window.innerHeight,
11838
+ margin: MENU_MARGIN
11839
+ });
11840
+ set(cx, placed.left, true);
11841
+ set(cy, placed.top, true);
11842
+ });
11816
11843
  function activate(id) {
11817
11844
  $$props.onaction?.(id);
11818
11845
  $$props.onclose?.();
@@ -13239,7 +13266,7 @@ function DatePicker($$anchor, $$props) {
13239
13266
  if (outside) cls += " text-text-4";
13240
13267
  else cls += " text-text-2";
13241
13268
  if (isToday && !isSelected) cls += " ring-1 ring-inset ring-brand-05";
13242
- if (isSelected) cls += " bg-brand-05 text-white hover:bg-brand-06";
13269
+ if (isSelected) cls += " bg-primary-fill text-primary-fill-fg hover:bg-primary-fill-hover";
13243
13270
  return cls;
13244
13271
  }
13245
13272
  var div = root_5$e();
@@ -13527,7 +13554,7 @@ function DateRangePicker($$anchor, $$props) {
13527
13554
  if (outside) cls += " text-text-4";
13528
13555
  else cls += " text-text-2";
13529
13556
  if (isTodayDay && !start && !end) cls += " ring-1 ring-inset ring-brand-05";
13530
- if (start || end) cls += " bg-brand-05 text-white hover:bg-brand-06";
13557
+ if (start || end) cls += " bg-primary-fill text-primary-fill-fg hover:bg-primary-fill-hover";
13531
13558
  else if (inRange) cls += " bg-brand-05/20 text-text-1";
13532
13559
  return cls;
13533
13560
  }
@@ -22433,7 +22460,7 @@ function NotifDot_wc($$anchor, $$props) {
22433
22460
  return pop($$exports);
22434
22461
  }
22435
22462
  customElements.define("uni-notif-dot", create_custom_element(NotifDot_wc, { class: {} }, ["default"], [], { mode: "open" }));
22436
- var root$1n = /* @__PURE__ */ from_html(`<span class="inline-flex h-5 min-w-[20px] items-center justify-center rounded-full bg-brand-05 px-1.5 text-11 font-bold text-white tabular-nums"> </span>`);
22463
+ var root$1n = /* @__PURE__ */ from_html(`<span class="inline-flex h-5 min-w-[20px] items-center justify-center rounded-full bg-primary-fill px-1.5 text-11 font-bold text-primary-fill-fg tabular-nums"> </span>`);
22437
22464
  var root_1$$ = /* @__PURE__ */ from_html(`<button type="button" class="cursor-pointer rounded border-0 bg-transparent px-1.5 py-0.5 text-11 text-brand-05 hover:text-status-info focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-brand-05">Mark all read</button>`);
22438
22465
  var root_2$R = /* @__PURE__ */ from_html(`<button type="button" role="tab" class="cursor-pointer rounded border border-border-2 bg-transparent px-2.5 py-0.5 text-11 text-text-3 hover:bg-row-hover hover:text-text-1 data-[active=true]:border-brand-05 data-[active=true]:bg-brand-05/[0.10] data-[active=true]:text-brand-05 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-brand-05"> </button>`);
22439
22466
  var root_3$v = /* @__PURE__ */ from_html(`<div class="p-6 text-center text-13 text-text-4">No notifications</div>`);
@@ -23203,7 +23230,7 @@ function Pagination($$anchor, $$props) {
23203
23230
  let totalPages = /* @__PURE__ */ user_derived(() => Math.max(1, Math.ceil(total() / pageSize())));
23204
23231
  let pages = /* @__PURE__ */ user_derived(() => getPageNumbers(page(), get(totalPages)));
23205
23232
  const BTN_BASE = "inline-flex h-[30px] min-w-[30px] cursor-pointer items-center justify-center rounded-md border border-transparent bg-transparent px-1.5 text-13 font-medium leading-none text-text-3 transition-[background-color,color,border-color] duration-100 hover:bg-row-hover hover:text-text-1 hover:border-border-2 disabled:cursor-not-allowed disabled:opacity-35 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-brand-05";
23206
- const BTN_ACTIVE = "bg-brand-05 text-white border-brand-05 hover:bg-brand-06 hover:border-brand-06";
23233
+ const BTN_ACTIVE = "bg-primary-fill text-primary-fill-fg border-primary-fill hover:bg-primary-fill-hover hover:border-primary-fill-hover";
23207
23234
  var fragment = comment();
23208
23235
  var node = first_child(fragment);
23209
23236
  {
@@ -27483,7 +27510,7 @@ function SelectionToolbar_wc($$anchor, $$props) {
27483
27510
  }
27484
27511
  customElements.define("uni-selection-toolbar", create_custom_element(SelectionToolbar_wc, { count: {}, actions: {}, ariaLabel: {} }, ["default"], [], { mode: "open" }));
27485
27512
  var root$W = /* @__PURE__ */ from_html(`<span> </span>`);
27486
- var root_1$C = /* @__PURE__ */ from_html(`<span class="ml-auto rounded-full bg-brand-05 px-1.5 py-px text-[10px] font-semibold text-white"> <span class="sr-only"> </span></span>`);
27513
+ var root_1$C = /* @__PURE__ */ from_html(`<span class="ml-auto rounded-full bg-primary-fill px-1.5 py-px text-[10px] font-semibold text-primary-fill-fg"> <span class="sr-only"> </span></span>`);
27487
27514
  var root_2$v = /* @__PURE__ */ from_html(`<li><button type="button"><span class="sb-ico shrink-0 text-text-3 [&amp;_svg]:h-4 [&amp;_svg]:w-4"><!></span> <!> <!></button></li>`);
27488
27515
  var root_3$i = /* @__PURE__ */ from_html(`<h2 class="m-0 px-4 pb-1.5 pt-3.5 text-[10px] font-semibold uppercase leading-[1.4] tracking-[0.06em] text-text-4"> </h2> <ul class="m-0 flex list-none flex-col gap-px px-2"></ul>`, 1);
27489
27516
  var root_4$7 = /* @__PURE__ */ from_html(`<nav class="overflow-auto border-r border-border-1 bg-bg-page py-2" aria-label="Primary"></nav>`);
@@ -28803,7 +28830,7 @@ function SplitButton($$anchor, $$props) {
28803
28830
  onMount(() => document.addEventListener("mousedown", handleOutside));
28804
28831
  onDestroy(() => document.removeEventListener("mousedown", handleOutside));
28805
28832
  const VARIANT = {
28806
- primary: "bg-brand-05 text-white hover:bg-brand-06 border-brand-05",
28833
+ primary: "bg-primary-fill text-primary-fill-fg hover:bg-primary-fill-hover active:bg-primary-fill-press border-primary-fill",
28807
28834
  ghost: "bg-transparent text-text-2 border-border-2 hover:bg-row-hover hover:text-text-1",
28808
28835
  danger: "bg-transparent text-status-danger border-status-danger/30"
28809
28836
  };
@@ -30093,7 +30120,7 @@ function Stepper($$anchor, $$props) {
30093
30120
  let className = prop($$props, "class", 3, "");
30094
30121
  let activeIdx = /* @__PURE__ */ user_derived(() => $$props.steps.findIndex((s) => s.id === $$props.active));
30095
30122
  const NUM = {
30096
- active: "border-brand-05 bg-brand-05 text-white",
30123
+ active: "border-primary-fill bg-primary-fill text-primary-fill-fg",
30097
30124
  done: "border-brand-05 bg-brand-05/[0.18] text-status-info",
30098
30125
  upcoming: "border-bg-3 bg-bg-1 text-text-4"
30099
30126
  };