@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.
@@ -1,6 +1,6 @@
1
1
  import React__default from 'react';
2
- import { u as CapsuleBlueprintParameter } from './CapsuleBlueprint-GfFJiLUb.cjs';
3
- export { ai as HelpButton } from './CapsuleBlueprint-GfFJiLUb.cjs';
2
+ import { v as CapsuleBlueprintParameter } from './CapsuleBlueprint-BmoD-pSK.cjs';
3
+ export { ak as HelpButton } from './CapsuleBlueprint-BmoD-pSK.cjs';
4
4
 
5
5
  interface MarkdownEditorProps {
6
6
  value?: string;
@@ -1,6 +1,6 @@
1
1
  import React__default from 'react';
2
- import { u as CapsuleBlueprintParameter } from './CapsuleBlueprint-GfFJiLUb.js';
3
- export { ai as HelpButton } from './CapsuleBlueprint-GfFJiLUb.js';
2
+ import { v as CapsuleBlueprintParameter } from './CapsuleBlueprint-BmoD-pSK.js';
3
+ export { ak as HelpButton } from './CapsuleBlueprint-BmoD-pSK.js';
4
4
 
5
5
  interface MarkdownEditorProps {
6
6
  value?: string;
package/dist/markdown.js CHANGED
@@ -136,6 +136,30 @@ var getGlassChromeClasses = (color, options = {}) => {
136
136
  return chrome.join(" ");
137
137
  };
138
138
 
139
+ // ../common/theme/surfaceTransparency.ts
140
+ function resolveSurfaceTransparency(variant, value) {
141
+ return value ?? (variant === "glass" || variant === "liquid-glass" || variant === "subtle" ? "high" : "none");
142
+ }
143
+ function getSurfaceTransparencyClasses(classes, variant, transparency) {
144
+ const level = resolveSurfaceTransparency(variant, transparency);
145
+ if (level === "high") return classes;
146
+ const tokens = classes.split(/\s+/).filter(Boolean);
147
+ const background = /^((?:(?:dark|hover):)*)bg-((?:[a-z]+-\d+)|white|black)(?:\/(\d+))?$/;
148
+ if (!tokens.some((token) => background.test(token) && token.includes("/"))) return classes;
149
+ const converted = tokens.map((token) => {
150
+ const match = token.match(background);
151
+ if (!match) return token;
152
+ const [, prefix, colour, alpha = "100"] = match;
153
+ return `${prefix}[--ui-surface-color:var(--color-${colour})] ${prefix}[--ui-surface-alpha:${Math.min(100, Number(alpha))}%]`;
154
+ });
155
+ return [
156
+ ...converted,
157
+ "ui-surface-fill",
158
+ `ui-surface-transparency-${level}`,
159
+ "[--ui-surface-base:var(--color-white)] dark:[--ui-surface-base:var(--color-neutral-900)]"
160
+ ].join(" ");
161
+ }
162
+
139
163
  // ../common/theme/Theme.ts
140
164
  var TRUE_COLORS = [
141
165
  "red",
@@ -9852,6 +9876,7 @@ var Panel = React10.forwardRef(function Panel2({
9852
9876
  actions,
9853
9877
  actionLayout = "auto",
9854
9878
  variant = "elevated",
9879
+ transparency,
9855
9880
  tone,
9856
9881
  padding = DEFAULT_SURFACE_PADDING,
9857
9882
  corner = DEFAULT_SURFACE_CORNER,
@@ -9992,7 +10017,7 @@ var Panel = React10.forwardRef(function Panel2({
9992
10017
  })();
9993
10018
  const vibrancyClass = getGlassVibrancyClass(vibrancy);
9994
10019
  const glassFillClass = getSurfaceGlassFillClass(resolvedTone, glassOpacity);
9995
- const variantClasses = (() => {
10020
+ const variantClasses = getSurfaceTransparencyClasses(classNames7((() => {
9996
10021
  switch (variant) {
9997
10022
  case "outlined":
9998
10023
  return classNames7(
@@ -10051,7 +10076,7 @@ var Panel = React10.forwardRef(function Panel2({
10051
10076
  effectiveBgClass
10052
10077
  );
10053
10078
  }
10054
- })();
10079
+ })(), isHoverable && hoverColorName && `hover:bg-${hoverColorName}-50 dark:hover:bg-${hoverColorName}-900/20`), variant, transparency);
10055
10080
  const overlayClasses = isOverlay ? "relative overflow-hidden text-white shadow-xl ring-0" : void 0;
10056
10081
  const headingClass = isOverlay ? "text-white" : variant === "liquid-glass" ? palette.liquidHeading : palette.heading;
10057
10082
  const subtitleClass = isOverlay ? "text-white/80" : surfaceText.description;
@@ -10238,7 +10263,6 @@ var Panel = React10.forwardRef(function Panel2({
10238
10263
  // because an outer ring is clipped by `overflow: hidden` — which
10239
10264
  // every Panel has.
10240
10265
  isClickable && !disabled && trigger.focusRing,
10241
- isHoverable && hoverColorName && `hover:bg-${hoverColorName}-50 dark:hover:bg-${hoverColorName}-900/20`,
10242
10266
  className
10243
10267
  ),
10244
10268
  style: resolvedStyle,
@@ -11481,7 +11505,9 @@ var Tabs = ({
11481
11505
  sizeConfig.gap,
11482
11506
  focusRing(color),
11483
11507
  focusOffset,
11484
- config.base,
11508
+ // Filled active tabs must not inherit inactive hover text/backgrounds:
11509
+ // a tone-coloured label on the same tone fill becomes unreadable.
11510
+ isActive && ["soft", "pill", "segmented"].includes(variant) ? config.base.split(" ").filter((token) => !token.startsWith("hover:") && !token.startsWith("dark:hover:")).join(" ") : config.base,
11485
11511
  isActive ? config.active : config.inactive,
11486
11512
  isDisabled && config.disabled,
11487
11513
  fullWidth && "flex-1 justify-center",