@datum-cloud/activity-ui 0.7.1-dev.1fa076d → 0.7.1-dev.39d494f

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.esm.js CHANGED
@@ -4700,7 +4700,13 @@ const createParseClassName = config => {
4700
4700
  continue;
4701
4701
  }
4702
4702
  }
4703
- if (currentCharacter === '[') bracketDepth++;else if (currentCharacter === ']') bracketDepth--;else if (currentCharacter === '(') parenDepth++;else if (currentCharacter === ')') parenDepth--;
4703
+ if (currentCharacter === '[') bracketDepth++;else if (currentCharacter === ']') bracketDepth--;else if (currentCharacter === '(') parenDepth++;else if (currentCharacter === ')') parenDepth--;else if (currentCharacter === '\\') index++;else if (currentCharacter === '"' || currentCharacter === "'") {
4704
+ // Quoted delimiters do not affect nesting or separate modifiers.
4705
+ while (++index < len) {
4706
+ const quotedCharacter = className[index];
4707
+ if (quotedCharacter === '\\') index++;else if (quotedCharacter === currentCharacter) break;
4708
+ }
4709
+ }
4704
4710
  }
4705
4711
  const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.slice(modifierStart);
4706
4712
  // Inline important modifier check
@@ -4718,7 +4724,13 @@ const createParseClassName = config => {
4718
4724
  baseClassName = baseClassNameWithImportantModifier.slice(1);
4719
4725
  hasImportantModifier = true;
4720
4726
  }
4721
- const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : undefined;
4727
+ // `maybePostfixModifierPosition` is relative to `baseClassName`, so it must be shifted by
4728
+ // however much the important modifier shortened the name. A leading `!` is removed from
4729
+ // the front, which moves every following index down by one; the position was measured
4730
+ // against `baseClassNameWithImportantModifier`, so without this correction `!text-lg/7`
4731
+ // reports 8 instead of 7 and consumers slice `"text-lg/"`, matching no class group.
4732
+ const importantModifierOffset = hasImportantModifier && baseClassNameWithImportantModifier.startsWith(IMPORTANT_MODIFIER) ? IMPORTANT_MODIFIER.length : 0;
4733
+ const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart - importantModifierOffset : undefined;
4722
4734
  return createResultObject(modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition);
4723
4735
  };
4724
4736
  if (prefix) {
@@ -4951,8 +4963,11 @@ const arbitraryValueRegex = /^\[(?:(\w[\w-]*):)?(.+)\]$/i;
4951
4963
  const arbitraryVariableRegex = /^\((?:(\w[\w-]*):)?(.+)\)$/i;
4952
4964
  const fractionRegex = /^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/;
4953
4965
  const tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/;
4954
- const lengthUnitRegex = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/;
4955
- const colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/;
4966
+ // Includes Tailwind's `--spacing()` because Tailwind resolves it to `calc(var(--spacing) * n)` before detecting the value's type. Only a value starting with it counts: Tailwind treats an expression like `-1*--spacing(4)` outside of `calc()` as a color.
4967
+ const lengthUnitRegex = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|Q|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^--spacing\(.+\)|^0$/;
4968
+ // Case-insensitive because CSS function names are, and includes Tailwind's `--alpha()` because it resolves to a color.
4969
+ const colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark|contrast-color|device-cmyk|--alpha)\(.+\)$/i;
4970
+ const maskPositionRegex = /^(?:_*[+-]?(?:\d|\.\d)|[\w-]+\(|_*(?:inherit|initial|revert(?:-layer)?|unset)_*$)/i;
4956
4971
  // Shadow always begins with x and y offset separated by underscore optionally prepended by inset
4957
4972
  const shadowRegex = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
4958
4973
  const imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;
@@ -4967,6 +4982,9 @@ const isLengthOnly = value =>
4967
4982
  // For example, `hsl(0 0% 0%)` would be classified as a length without this check.
4968
4983
  // I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.
4969
4984
  lengthUnitRegex.test(value) && !colorFunctionRegex.test(value);
4985
+ const isMaskPosition = value =>
4986
+ // Mask stops default to positions for variables and non-color CSS functions, including angles, so color functions need to be excluded explicitly.
4987
+ maskPositionRegex.test(value) && !colorFunctionRegex.test(value);
4970
4988
  const isNever = () => false;
4971
4989
  const isShadow = value => shadowRegex.test(value);
4972
4990
  const isImage = value => imageRegex.test(value);
@@ -4975,6 +4993,7 @@ const isNamedContainerQuery = value => value.startsWith('@container') && (value[
4975
4993
  const isArbitrarySize = value => getIsArbitraryValue(value, isLabelSize, isNever);
4976
4994
  const isArbitraryValue = value => arbitraryValueRegex.test(value);
4977
4995
  const isArbitraryLength = value => getIsArbitraryValue(value, isLabelLength, isLengthOnly);
4996
+ const isArbitraryMaskPosition = value => getIsArbitraryValue(value, isLabelMaskPosition, isMaskPosition);
4978
4997
  const isArbitraryNumber = value => getIsArbitraryValue(value, isLabelNumber, isNumber);
4979
4998
  const isArbitraryWeight = value => getIsArbitraryValue(value, isLabelWeight, isAny);
4980
4999
  const isArbitraryFamilyName = value => getIsArbitraryValue(value, isLabelFamilyName, isNever);
@@ -4983,6 +5002,7 @@ const isArbitraryImage = value => getIsArbitraryValue(value, isLabelImage, isIma
4983
5002
  const isArbitraryShadow = value => getIsArbitraryValue(value, isLabelShadow, isShadow);
4984
5003
  const isArbitraryVariable = value => arbitraryVariableRegex.test(value);
4985
5004
  const isArbitraryVariableLength = value => getIsArbitraryVariable(value, isLabelLength);
5005
+ const isArbitraryVariableMaskPosition = value => getIsArbitraryVariable(value, isLabelMaskPosition, true);
4986
5006
  const isArbitraryVariableFamilyName = value => getIsArbitraryVariable(value, isLabelFamilyName);
4987
5007
  const isArbitraryVariablePosition = value => getIsArbitraryVariable(value, isLabelPosition);
4988
5008
  const isArbitraryVariableSize = value => getIsArbitraryVariable(value, isLabelSize);
@@ -5015,6 +5035,7 @@ const isLabelPosition = label => label === 'position' || label === 'percentage';
5015
5035
  const isLabelImage = label => label === 'image' || label === 'url';
5016
5036
  const isLabelSize = label => label === 'length' || label === 'size' || label === 'bg-size';
5017
5037
  const isLabelLength = label => label === 'length';
5038
+ const isLabelMaskPosition = label => label !== 'color';
5018
5039
  const isLabelNumber = label => label === 'number';
5019
5040
  const isLabelFamilyName = label => label === 'family-name';
5020
5041
  const isLabelWeight = label => label === 'number' || label === 'weight';
@@ -5095,7 +5116,7 @@ const getDefaultConfig = () => {
5095
5116
  const scaleBorderWidth = () => ['', isNumber, isArbitraryVariableLength, isArbitraryLength];
5096
5117
  const scaleLineStyle = () => ['solid', 'dashed', 'dotted', 'double'];
5097
5118
  const scaleBlendMode = () => ['normal', 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity'];
5098
- const scaleMaskImagePosition = () => [isNumber, isPercent, isArbitraryVariablePosition, isArbitraryPosition];
5119
+ const scaleMaskImagePosition = () => [isNumber, isPercent, isArbitraryVariableMaskPosition, isArbitraryMaskPosition];
5099
5120
  const scaleBlur = () => [
5100
5121
  // Deprecated since Tailwind CSS v4.0.0
5101
5122
  '', 'none', themeBlur, isArbitraryVariable, isArbitraryValue];
@@ -5206,7 +5227,12 @@ const getDefaultConfig = () => {
5206
5227
  * Screen Reader Only
5207
5228
  * @see https://tailwindcss.com/docs/display#screen-reader-only
5208
5229
  */
5209
- sr: ['sr-only', 'not-sr-only'],
5230
+ sr: ['sr-only'],
5231
+ /**
5232
+ * Not Screen Reader Only
5233
+ * @see https://tailwindcss.com/docs/display#screen-reader-only
5234
+ */
5235
+ 'not-sr': ['not-sr-only'],
5210
5236
  /**
5211
5237
  * Floats
5212
5238
  * @see https://tailwindcss.com/docs/float
@@ -5417,7 +5443,7 @@ const getDefaultConfig = () => {
5417
5443
  * @see https://tailwindcss.com/docs/flex
5418
5444
  */
5419
5445
  flex: [{
5420
- flex: [isNumber, isFraction, 'auto', 'initial', 'none', isArbitraryValue]
5446
+ flex: [isNumber, isFraction, 'auto', 'initial', 'none', isArbitraryVariable, isArbitraryValue]
5421
5447
  }],
5422
5448
  /**
5423
5449
  * Flex Grow
@@ -5973,7 +5999,7 @@ const getDefaultConfig = () => {
5973
5999
  * @see https://tailwindcss.com/docs/line-clamp
5974
6000
  */
5975
6001
  'line-clamp': [{
5976
- 'line-clamp': [isNumber, 'none', isArbitraryVariable, isArbitraryNumber]
6002
+ 'line-clamp': [isNumber, 'none', isArbitraryVariable, isArbitraryValue]
5977
6003
  }],
5978
6004
  /**
5979
6005
  * Line Height
@@ -6043,7 +6069,7 @@ const getDefaultConfig = () => {
6043
6069
  * @see https://tailwindcss.com/docs/text-decoration-thickness
6044
6070
  */
6045
6071
  'text-decoration-thickness': [{
6046
- decoration: [isNumber, 'from-font', 'auto', isArbitraryVariable, isArbitraryLength]
6072
+ decoration: [isNumber, 'from-font', 'auto', isArbitraryVariableLength, isArbitraryVariablePosition, isArbitraryLength]
6047
6073
  }],
6048
6074
  /**
6049
6075
  * Text Decoration Color
@@ -6818,7 +6844,7 @@ const getDefaultConfig = () => {
6818
6844
  'mask-radial-to': scaleColor()
6819
6845
  }],
6820
6846
  'mask-image-radial-shape': [{
6821
- 'mask-radial': ['circle', 'ellipse']
6847
+ mask: ['circle', 'ellipse']
6822
6848
  }],
6823
6849
  'mask-image-radial-size': [{
6824
6850
  'mask-radial': [{
@@ -7666,6 +7692,9 @@ const getDefaultConfig = () => {
7666
7692
  'inset-y': ['inset-bs', 'inset-be', 'top', 'bottom'],
7667
7693
  flex: ['basis', 'grow', 'shrink'],
7668
7694
  gap: ['gap-x', 'gap-y'],
7695
+ 'place-content': ['align-content', 'justify-content'],
7696
+ 'place-items': ['align-items', 'justify-items'],
7697
+ 'place-self': ['align-self', 'justify-self'],
7669
7698
  p: ['px', 'py', 'ps', 'pe', 'pbs', 'pbe', 'pt', 'pr', 'pb', 'pl'],
7670
7699
  px: ['ps', 'pe', 'pr', 'pl'],
7671
7700
  py: ['pbs', 'pbe', 'pt', 'pb'],
@@ -7673,7 +7702,6 @@ const getDefaultConfig = () => {
7673
7702
  mx: ['ms', 'me', 'mr', 'ml'],
7674
7703
  my: ['mbs', 'mbe', 'mt', 'mb'],
7675
7704
  size: ['w', 'h'],
7676
- 'font-size': ['leading'],
7677
7705
  'fvn-normal': ['fvn-ordinal', 'fvn-slashed-zero', 'fvn-figure', 'fvn-spacing', 'fvn-fraction'],
7678
7706
  'fvn-ordinal': ['fvn-normal'],
7679
7707
  'fvn-slashed-zero': ['fvn-normal'],
@@ -7681,6 +7709,11 @@ const getDefaultConfig = () => {
7681
7709
  'fvn-spacing': ['fvn-normal'],
7682
7710
  'fvn-fraction': ['fvn-normal'],
7683
7711
  'line-clamp': ['display', 'overflow'],
7712
+ // Tailwind emits these utilities after `sr-only`, so keeping an earlier `relative` or `p-4` undoes the hide. Removing them is safe because `not-sr-only` resets the same properties when the element is revealed.
7713
+ // Border width and min/max sizes stay independent because `not-sr-only` doesn't reset them, so they still apply once the element is revealed. While hidden they don't undo the hide: the element is absolutely positioned and clipped away.
7714
+ // `not-sr-only` only conflicts with `sr-only`: Tailwind emits these utilities after it too, so an earlier `relative` or `p-4` is meant to apply once the element is visible.
7715
+ sr: ['not-sr', 'position', 'size', 'w', 'h', 'p', 'px', 'py', 'ps', 'pe', 'pbs', 'pbe', 'pt', 'pr', 'pb', 'pl', 'm', 'mx', 'my', 'ms', 'me', 'mbs', 'mbe', 'mt', 'mr', 'mb', 'ml', 'overflow', 'overflow-x', 'overflow-y', 'whitespace'],
7716
+ 'not-sr': ['sr'],
7684
7717
  rounded: ['rounded-s', 'rounded-e', 'rounded-t', 'rounded-r', 'rounded-b', 'rounded-l', 'rounded-ss', 'rounded-se', 'rounded-ee', 'rounded-es', 'rounded-tl', 'rounded-tr', 'rounded-br', 'rounded-bl'],
7685
7718
  'rounded-s': ['rounded-ss', 'rounded-es'],
7686
7719
  'rounded-e': ['rounded-se', 'rounded-ee'],
@@ -7695,6 +7728,14 @@ const getDefaultConfig = () => {
7695
7728
  'border-color': ['border-color-x', 'border-color-y', 'border-color-s', 'border-color-e', 'border-color-bs', 'border-color-be', 'border-color-t', 'border-color-r', 'border-color-b', 'border-color-l'],
7696
7729
  'border-color-x': ['border-color-s', 'border-color-e', 'border-color-r', 'border-color-l'],
7697
7730
  'border-color-y': ['border-color-bs', 'border-color-be', 'border-color-t', 'border-color-b'],
7731
+ 'mask-image-x-from-pos': ['mask-image-r-from-pos', 'mask-image-l-from-pos'],
7732
+ 'mask-image-x-to-pos': ['mask-image-r-to-pos', 'mask-image-l-to-pos'],
7733
+ 'mask-image-x-from-color': ['mask-image-r-from-color', 'mask-image-l-from-color'],
7734
+ 'mask-image-x-to-color': ['mask-image-r-to-color', 'mask-image-l-to-color'],
7735
+ 'mask-image-y-from-pos': ['mask-image-t-from-pos', 'mask-image-b-from-pos'],
7736
+ 'mask-image-y-to-pos': ['mask-image-t-to-pos', 'mask-image-b-to-pos'],
7737
+ 'mask-image-y-from-color': ['mask-image-t-from-color', 'mask-image-b-from-color'],
7738
+ 'mask-image-y-to-color': ['mask-image-t-to-color', 'mask-image-b-to-color'],
7698
7739
  translate: ['translate-x', 'translate-y', 'translate-none'],
7699
7740
  'translate-none': ['translate', 'translate-x', 'translate-y', 'translate-z'],
7700
7741
  'scroll-m': ['scroll-mx', 'scroll-my', 'scroll-ms', 'scroll-me', 'scroll-mbs', 'scroll-mbe', 'scroll-mt', 'scroll-mr', 'scroll-mb', 'scroll-ml'],
@@ -7709,6 +7750,7 @@ const getDefaultConfig = () => {
7709
7750
  'touch-pz': ['touch']
7710
7751
  },
7711
7752
  conflictingClassGroupModifiers: {
7753
+ // Only a font size with a line-height modifier like `text-lg/7` sets `line-height` directly. Without a modifier, font sizes don't conflict with `leading-*`: arbitrary ones only set `font-size`, and the theme ones set `line-height: var(--tw-leading, …)`, so an earlier `leading-*` keeps applying in Tailwind's CSS.
7712
7754
  'font-size': ['leading']
7713
7755
  },
7714
7756
  postfixLookupClassGroups: ['container-type'],