@cjlapao/ui-kit 0.2.16 → 0.2.18

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/markdown.cjs CHANGED
@@ -171,6 +171,30 @@ var getGlassChromeClasses = (color, options = {}) => {
171
171
  return chrome.join(" ");
172
172
  };
173
173
 
174
+ // ../common/theme/surfaceTransparency.ts
175
+ function resolveSurfaceTransparency(variant, value) {
176
+ return value ?? (variant === "glass" || variant === "liquid-glass" || variant === "subtle" ? "high" : "none");
177
+ }
178
+ function getSurfaceTransparencyClasses(classes, variant, transparency) {
179
+ const level = resolveSurfaceTransparency(variant, transparency);
180
+ if (level === "high") return classes;
181
+ const tokens = classes.split(/\s+/).filter(Boolean);
182
+ const background = /^((?:(?:dark|hover):)*)bg-((?:[a-z]+-\d+)|white|black)(?:\/(\d+))?$/;
183
+ if (!tokens.some((token) => background.test(token) && token.includes("/"))) return classes;
184
+ const converted = tokens.map((token) => {
185
+ const match = token.match(background);
186
+ if (!match) return token;
187
+ const [, prefix, colour, alpha = "100"] = match;
188
+ return `${prefix}[--ui-surface-color:var(--color-${colour})] ${prefix}[--ui-surface-alpha:${Math.min(100, Number(alpha))}%]`;
189
+ });
190
+ return [
191
+ ...converted,
192
+ "ui-surface-fill",
193
+ `ui-surface-transparency-${level}`,
194
+ "[--ui-surface-base:var(--color-white)] dark:[--ui-surface-base:var(--color-neutral-900)]"
195
+ ].join(" ");
196
+ }
197
+
174
198
  // ../common/theme/Theme.ts
175
199
  var TRUE_COLORS = [
176
200
  "red",
@@ -9874,6 +9898,7 @@ var Panel = import_react155.default.forwardRef(function Panel2({
9874
9898
  actions,
9875
9899
  actionLayout = "auto",
9876
9900
  variant = "elevated",
9901
+ transparency,
9877
9902
  tone,
9878
9903
  padding = DEFAULT_SURFACE_PADDING,
9879
9904
  corner = DEFAULT_SURFACE_CORNER,
@@ -10014,7 +10039,7 @@ var Panel = import_react155.default.forwardRef(function Panel2({
10014
10039
  })();
10015
10040
  const vibrancyClass = getGlassVibrancyClass(vibrancy);
10016
10041
  const glassFillClass = getSurfaceGlassFillClass(resolvedTone, glassOpacity);
10017
- const variantClasses = (() => {
10042
+ const variantClasses = getSurfaceTransparencyClasses((0, import_classnames7.default)((() => {
10018
10043
  switch (variant) {
10019
10044
  case "outlined":
10020
10045
  return (0, import_classnames7.default)(
@@ -10073,7 +10098,7 @@ var Panel = import_react155.default.forwardRef(function Panel2({
10073
10098
  effectiveBgClass
10074
10099
  );
10075
10100
  }
10076
- })();
10101
+ })(), isHoverable && hoverColorName && `hover:bg-${hoverColorName}-50 dark:hover:bg-${hoverColorName}-900/20`), variant, transparency);
10077
10102
  const overlayClasses = isOverlay ? "relative overflow-hidden text-white shadow-xl ring-0" : void 0;
10078
10103
  const headingClass = isOverlay ? "text-white" : variant === "liquid-glass" ? palette.liquidHeading : palette.heading;
10079
10104
  const subtitleClass = isOverlay ? "text-white/80" : surfaceText.description;
@@ -10260,7 +10285,6 @@ var Panel = import_react155.default.forwardRef(function Panel2({
10260
10285
  // because an outer ring is clipped by `overflow: hidden` — which
10261
10286
  // every Panel has.
10262
10287
  isClickable && !disabled && trigger.focusRing,
10263
- isHoverable && hoverColorName && `hover:bg-${hoverColorName}-50 dark:hover:bg-${hoverColorName}-900/20`,
10264
10288
  className
10265
10289
  ),
10266
10290
  style: resolvedStyle,
@@ -11492,7 +11516,9 @@ var Tabs = ({
11492
11516
  sizeConfig.gap,
11493
11517
  focusRing(color),
11494
11518
  focusOffset,
11495
- config.base,
11519
+ // Filled active tabs must not inherit inactive hover text/backgrounds:
11520
+ // a tone-coloured label on the same tone fill becomes unreadable.
11521
+ isActive && ["soft", "pill", "segmented"].includes(variant) ? config.base.split(" ").filter((token) => !token.startsWith("hover:") && !token.startsWith("dark:hover:")).join(" ") : config.base,
11496
11522
  isActive ? config.active : config.inactive,
11497
11523
  isDisabled && config.disabled,
11498
11524
  fullWidth && "flex-1 justify-center",