@tectra-ng/themes 0.4.0 → 0.4.2

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,4 +1,4 @@
1
- import { ACCENT_PALETTES, SEVERITY_PALETTES, SURFACE_PALETTES, layers, motion, radius, shadows, spacing, typography } from "@tectra-ng/tokens";
1
+ import { ACCENT_PALETTES, PRIMARY_ORDER, SEVERITY_PALETTES, SURFACE_PALETTES, layers, motion, radius, shadows, spacing, typography } from "@tectra-ng/tokens";
2
2
  function channel(hex, offset) {
3
3
  const value = parseInt(hex.slice(offset, offset + 2), 16) / 255;
4
4
  return value <= .03928 ? value / 12.92 : ((value + .055) / 1.055) ** 2.4;
@@ -752,6 +752,7 @@ const messageTokens = {
752
752
  fontSize: "14px",
753
753
  tint: "15%"
754
754
  },
755
+ actions: { gap: "8px" },
755
756
  closeButton: {
756
757
  size: "26px",
757
758
  borderRadius: /* @__PURE__ */ tokenRef("radius-md"),
@@ -1085,6 +1086,39 @@ const ratingTokens = {
1085
1086
  gap: "4px"
1086
1087
  }
1087
1088
  };
1089
+ const colorSwatchesTokens = {
1090
+ root: {
1091
+ gap: "6px",
1092
+ size: "22px",
1093
+ borderRadius: /* @__PURE__ */ tokenRef("radius-full"),
1094
+ ringColor: /* @__PURE__ */ fade(/* @__PURE__ */ tokenRef("text-primary"), "88%"),
1095
+ hoverScale: "1.12",
1096
+ selectedRingColor: /* @__PURE__ */ tokenRef("primary-base"),
1097
+ selectedRingWidth: "2px",
1098
+ selectedRingOffset: "2px",
1099
+ checkColor: /* @__PURE__ */ tokenRef("surface-0"),
1100
+ checkShadow: /* @__PURE__ */ joinCss("0 0 1.5px ", /* @__PURE__ */ fade(/* @__PURE__ */ tokenRef("surface-950"), "30%")),
1101
+ checkSize: "12px",
1102
+ checkStrokeWidth: "2.5",
1103
+ focusRingColor: /* @__PURE__ */ tokenRef("focus-ring-color"),
1104
+ focusRingWidth: "2px",
1105
+ focusRingOffset: "2px",
1106
+ invalidRingColor: /* @__PURE__ */ tokenRef("form-field-invalid-border-color"),
1107
+ disabledOpacity: "0.5",
1108
+ transitionDuration: /* @__PURE__ */ tokenRef("motion-duration"),
1109
+ transitionEasing: /* @__PURE__ */ tokenRef("motion-easing")
1110
+ },
1111
+ sm: {
1112
+ size: "18px",
1113
+ gap: "4px",
1114
+ checkSize: "10px"
1115
+ },
1116
+ lg: {
1117
+ size: "28px",
1118
+ gap: "8px",
1119
+ checkSize: "15px"
1120
+ }
1121
+ };
1088
1122
  const knobTokens = { root: {
1089
1123
  valueColor: /* @__PURE__ */ tokenRef("primary-base"),
1090
1124
  rangeColor: /* @__PURE__ */ lightDark(/* @__PURE__ */ tokenRef("surface-200"), /* @__PURE__ */ tokenRef("surface-700")),
@@ -1555,8 +1589,10 @@ const tooltipTokens = {
1555
1589
  lineHeight: "1.5"
1556
1590
  },
1557
1591
  arrow: {
1558
- size: "5px",
1559
- inset: "10px"
1592
+ size: "3.5px",
1593
+ inset: "10px",
1594
+ background: "initial",
1595
+ shadow: "drop-shadow(0 1.5px 1.5px rgba(12, 16, 21, 0.1))"
1560
1596
  }
1561
1597
  };
1562
1598
  const popoverTokens = {
@@ -1595,7 +1631,11 @@ const popoverTokens = {
1595
1631
  },
1596
1632
  arrow: {
1597
1633
  size: "14px",
1598
- inset: "15.75px"
1634
+ inset: "15.75px",
1635
+ background: "initial",
1636
+ borderColor: "initial",
1637
+ borderWidth: "initial",
1638
+ shadow: "none"
1599
1639
  },
1600
1640
  focusRing: {
1601
1641
  width: "2px",
@@ -1830,6 +1870,14 @@ const menuTokens = {
1830
1870
  fontWeight: /* @__PURE__ */ tokenRef("font-weight-medium"),
1831
1871
  itemBorderWidth: "1px"
1832
1872
  },
1873
+ arrow: {
1874
+ size: "14px",
1875
+ inset: "15.75px",
1876
+ background: "initial",
1877
+ borderColor: "initial",
1878
+ borderWidth: "1px",
1879
+ shadow: "none"
1880
+ },
1833
1881
  context: {
1834
1882
  background: /* @__PURE__ */ joinCss("color-mix(in srgb, ", /* @__PURE__ */ tokenRef("surface-card"), " 92%, transparent)"),
1835
1883
  borderColor: /* @__PURE__ */ tokenRef("surface-border"),
@@ -1954,7 +2002,7 @@ const tableTokens = {
1954
2002
  color: /* @__PURE__ */ tokenRef("text-primary"),
1955
2003
  stripedBackground: /* @__PURE__ */ lightDark(/* @__PURE__ */ tokenRef("surface-50"), /* @__PURE__ */ tokenRef("surface-950")),
1956
2004
  selectedBackground: /* @__PURE__ */ tokenRef("highlight-background"),
1957
- selectedColor: /* @__PURE__ */ tokenRef("highlight-color"),
2005
+ selectedColor: /* @__PURE__ */ tokenRef("text-primary"),
1958
2006
  menuBackground: /* @__PURE__ */ mix(/* @__PURE__ */ tokenRef("primary-base"), "8%", /* @__PURE__ */ tokenRef("surface-card")),
1959
2007
  focusRing: {
1960
2008
  width: "2px",
@@ -3481,6 +3529,12 @@ const breadcrumbTokens = {
3481
3529
  item: {
3482
3530
  color: /* @__PURE__ */ tokenRef("text-muted"),
3483
3531
  hoverColor: /* @__PURE__ */ tokenRef("text-primary"),
3532
+ textColor: /* @__PURE__ */ tokenRef("text-muted"),
3533
+ linkDecoration: "underline",
3534
+ linkDecorationColor: /* @__PURE__ */ lightDark(/* @__PURE__ */ tokenRef("surface-300"), /* @__PURE__ */ tokenRef("surface-600")),
3535
+ linkHoverDecorationColor: "currentColor",
3536
+ linkDecorationThickness: "1px",
3537
+ linkUnderlineOffset: "3px",
3484
3538
  borderRadius: /* @__PURE__ */ tokenRef("radius-lg"),
3485
3539
  gap: "7px",
3486
3540
  fontSize: /* @__PURE__ */ tokenRef("font-size-md"),
@@ -3805,9 +3859,10 @@ const filtersPanelTokens = {
3805
3859
  shadow: "0 16px 40px -12px rgb(0 0 0 / 0.22), 0 4px 12px -4px rgb(0 0 0 / 0.1)",
3806
3860
  headPadding: "5.25px 8.75px 7px",
3807
3861
  headGap: "10.5px",
3808
- titleFontSize: "9.625px",
3862
+ titleFontSize: /* @__PURE__ */ tokenRef("font-size-xs"),
3809
3863
  titleFontWeight: /* @__PURE__ */ tokenRef("font-weight-semibold"),
3810
- titleLetterSpacing: "0.05em",
3864
+ titleLetterSpacing: "normal",
3865
+ titleTextTransform: "none",
3811
3866
  mutedColor: /* @__PURE__ */ tokenRef("text-muted"),
3812
3867
  rowGap: "1px",
3813
3868
  rowHeight: "28px",
@@ -4160,9 +4215,9 @@ const wizardTokens = {
4160
4215
  progress: {
4161
4216
  gap: "7px",
4162
4217
  labelColor: /* @__PURE__ */ tokenRef("text-muted"),
4163
- labelFontSize: "10.5px",
4218
+ labelFontSize: /* @__PURE__ */ tokenRef("font-size-xs"),
4164
4219
  labelFontWeight: /* @__PURE__ */ tokenRef("font-weight-medium"),
4165
- labelLetterSpacing: "0.08em",
4220
+ labelLetterSpacing: "normal",
4166
4221
  segmentGap: "5.25px",
4167
4222
  segmentHeight: "5.25px",
4168
4223
  segmentBackground: /* @__PURE__ */ tokenRef("surface-border"),
@@ -4314,9 +4369,10 @@ const commandPaletteTokens = {
4314
4369
  results: {
4315
4370
  padding: "7px",
4316
4371
  groupPadding: "10.5px 10.5px 5.25px",
4317
- groupFontSize: "9.625px",
4372
+ groupFontSize: /* @__PURE__ */ tokenRef("font-size-xs"),
4318
4373
  groupFontWeight: /* @__PURE__ */ tokenRef("font-weight-semibold"),
4319
- groupLetterSpacing: "0.05em",
4374
+ groupLetterSpacing: "normal",
4375
+ groupTextTransform: "none",
4320
4376
  groupColor: /* @__PURE__ */ tokenRef("text-muted"),
4321
4377
  statusGap: "7px",
4322
4378
  statusPadding: "28px 14px",
@@ -4501,6 +4557,14 @@ const switchThemeTokens = {
4501
4557
  hiddenScale: "0.5"
4502
4558
  }
4503
4559
  };
4560
+ const themeConfiguratorTokens = { root: {
4561
+ width: "17.5rem",
4562
+ gap: "16px",
4563
+ sectionGap: "8px",
4564
+ labelColor: /* @__PURE__ */ tokenRef("text-muted"),
4565
+ labelFontSize: /* @__PURE__ */ tokenRef("font-size-sm"),
4566
+ labelFontWeight: /* @__PURE__ */ tokenRef("font-weight-semibold")
4567
+ } };
4504
4568
  const switchLanguageTokens = {
4505
4569
  root: {
4506
4570
  height: "37px",
@@ -5378,6 +5442,7 @@ const COMPONENT_TOKENS = {
5378
5442
  chipsInput: chipsInputTokens,
5379
5443
  country: countryTokens,
5380
5444
  colorPicker: colorPickerTokens,
5445
+ colorSwatches: colorSwatchesTokens,
5381
5446
  mention: mentionTokens,
5382
5447
  tree: treeTokens,
5383
5448
  cascadeSelect: cascadeSelectTokens,
@@ -5470,6 +5535,7 @@ const COMPONENT_TOKENS = {
5470
5535
  actionsMenu: actionsMenuTokens,
5471
5536
  actionTile: actionTileTokens,
5472
5537
  switchTheme: switchThemeTokens,
5538
+ themeConfigurator: themeConfiguratorTokens,
5473
5539
  switchLanguage: switchLanguageTokens,
5474
5540
  topbarPreferences: topbarPreferencesTokens,
5475
5541
  publicHeader: publicHeaderTokens,
@@ -5744,7 +5810,9 @@ const edgeControlsTokens = {
5744
5810
  background: /* @__PURE__ */ tokenRef("primary-base"),
5745
5811
  shadow: "none"
5746
5812
  }
5747
- }
5813
+ },
5814
+ filtersPanel: { button: { borderRadius: /* @__PURE__ */ tokenRef("radius-xs") } },
5815
+ commandPalette: { trigger: { borderRadius: /* @__PURE__ */ tokenRef("radius-xs") } }
5748
5816
  };
5749
5817
  /* @__NO_SIDE_EFFECTS__ */
5750
5818
  function solid$1(severity) {
@@ -5902,6 +5970,7 @@ const edgeStyle = {
5902
5970
  },
5903
5971
  table: {
5904
5972
  root: { borderColor: /* @__PURE__ */ lightDark(/* @__PURE__ */ tokenRef("surface-300"), /* @__PURE__ */ tokenRef("surface-600")) },
5973
+ row: { selectedColor: /* @__PURE__ */ tokenRef("highlight-color") },
5905
5974
  headerCell: { fontWeight: /* @__PURE__ */ tokenRef("font-weight-bold") },
5906
5975
  footerCell: { fontWeight: /* @__PURE__ */ tokenRef("font-weight-bold") }
5907
5976
  },
@@ -5978,7 +6047,10 @@ const softFormsTokens = {
5978
6047
  padding: "8px 12px",
5979
6048
  borderRadius: /* @__PURE__ */ tokenRef("radius-lg")
5980
6049
  },
5981
- chip: { borderRadius: /* @__PURE__ */ tokenRef("radius-full") },
6050
+ chip: {
6051
+ borderRadius: /* @__PURE__ */ tokenRef("radius-full"),
6052
+ background: /* @__PURE__ */ lightDark(/* @__PURE__ */ fade(/* @__PURE__ */ tokenRef("surface-950"), "90%"), /* @__PURE__ */ fade(/* @__PURE__ */ tokenRef("surface-0"), "88%"))
6053
+ },
5982
6054
  checkbox: {
5983
6055
  borderRadius: "6px",
5984
6056
  borderColor: softLine
@@ -6068,7 +6140,9 @@ const softStyle = {
6068
6140
  toggleSwitch: { root: /* @__PURE__ */ mergeTokens({ background: softFillHover }, glowRing) },
6069
6141
  rating: { root: glowRing },
6070
6142
  knob: { root: glowRing },
6071
- slider: { handle: glowRing }
6143
+ slider: { handle: glowRing },
6144
+ filtersPanel: { button: { borderRadius: "22px" } },
6145
+ commandPalette: { trigger: { borderRadius: /* @__PURE__ */ tokenRef("radius-xl") } }
6072
6146
  }, {
6073
6147
  card: { root: {
6074
6148
  borderRadius: "22px",
@@ -6090,7 +6164,8 @@ const softStyle = {
6090
6164
  chip: { root: { background: softFill } },
6091
6165
  message: { root: {
6092
6166
  borderRadius: "16px",
6093
- borderWidth: "0"
6167
+ borderColor: "transparent",
6168
+ borderTint: "28%"
6094
6169
  } },
6095
6170
  avatar: { root: { squareBorderRadius: /* @__PURE__ */ tokenRef("radius-xl") } },
6096
6171
  skeleton: { root: { borderRadius: /* @__PURE__ */ tokenRef("radius-lg") } }
@@ -6441,7 +6516,8 @@ const paperControlsTokens = {
6441
6516
  shadow: "0px 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12)",
6442
6517
  hoverRing: /* @__PURE__ */ joinCss("0 0 1px 10px ", /* @__PURE__ */ fade(/* @__PURE__ */ tokenRef("primary-base"), "92%"))
6443
6518
  }, noFocusRing)
6444
- }
6519
+ },
6520
+ filtersPanel: { button: { borderRadius: /* @__PURE__ */ tokenRef("radius-sm") } }
6445
6521
  };
6446
6522
  /* @__NO_SIDE_EFFECTS__ */
6447
6523
  function solid(severity) {
@@ -7013,13 +7089,44 @@ function createTectraPreset({ style = tectraStyle, primary = "blue", surface = "
7013
7089
  light: /* @__PURE__ */ deepMerge(createLightSemantic(palettes), definition.light?.(palettes)),
7014
7090
  dark: /* @__PURE__ */ deepMerge(createDarkSemantic(palettes), definition.dark?.(palettes)),
7015
7091
  components: definition.components ?? {},
7016
- css: definition.css
7092
+ css: definition.css,
7093
+ source: {
7094
+ style: definition,
7095
+ primary,
7096
+ surface
7097
+ }
7017
7098
  };
7018
7099
  }
7019
7100
  const Tectra = /* @__PURE__ */ createTectraPreset();
7020
7101
  const Soft = /* @__PURE__ */ createTectraPreset({ style: softStyle });
7021
7102
  const Edge = /* @__PURE__ */ createTectraPreset({ style: edgeStyle });
7022
7103
  const Paper = /* @__PURE__ */ createTectraPreset({ style: paperStyle });
7104
+ /* @__NO_SIDE_EFFECTS__ */
7105
+ function title(value) {
7106
+ return value.charAt(0).toUpperCase() + value.slice(1);
7107
+ }
7108
+ /* @__NO_SIDE_EFFECTS__ */
7109
+ function tectraPrimaryChoices() {
7110
+ return PRIMARY_ORDER.map((value) => ({
7111
+ value,
7112
+ label: /* @__PURE__ */ title(value),
7113
+ color: value === "noir" ? /* @__PURE__ */ tokenRef("text-primary") : ACCENT_PALETTES[value][500]
7114
+ }));
7115
+ }
7116
+ /* @__NO_SIDE_EFFECTS__ */
7117
+ function tectraSurfaceChoices() {
7118
+ return Object.keys(SURFACE_PALETTES).map((value) => ({
7119
+ value,
7120
+ label: /* @__PURE__ */ title(value),
7121
+ color: SURFACE_PALETTES[value][500]
7122
+ }));
7123
+ }
7124
+ function isTectraPrimary(value) {
7125
+ return typeof value === "string" && PRIMARY_ORDER.includes(value);
7126
+ }
7127
+ function isTectraSurface(value) {
7128
+ return typeof value === "string" && Object.hasOwn(SURFACE_PALETTES, value);
7129
+ }
7023
7130
  function kebab(key) {
7024
7131
  return key.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
7025
7132
  }
@@ -7070,6 +7177,6 @@ function presetToCss(preset) {
7070
7177
  const components = /* @__PURE__ */ deepMerge(COMPONENT_TOKENS, preset.components);
7071
7178
  return themeCss(preset, Object.entries(components).flatMap(([name, tokens]) => componentVariables(name, tokens)));
7072
7179
  }
7073
- export { COMPONENT_TOKENS, Edge, Paper, Soft, TECTRA_STYLES, Tectra, accordionTokens, actionTileTokens, actionsMenuTokens, amountTokens, analogClockTokens, appFooterTokens, appLayoutTokens, avatarTokens, badgeTokens, breadcrumbTokens, buttonTokens, cardTokens, carouselTokens, cascadeSelectTokens, chartTokens, checkboxTokens, chipTokens, chipsInputTokens, codeDiffTokens, codeEditorTokens, codeHighlightTokens, codeSyntaxTokens, colorPickerTokens, commandPaletteTokens, componentTokensCss, componentVariables, confettiTokens, confirmTokens, consoleLayoutTokens, contrastWithWhite, cookieNoticeTokens, countdownTokens, countryTokens, createDarkSemantic, createLightSemantic, createTectraPreset, dataViewTokens, datePickerTokens, deepMerge, definePreset, dialogTokens, dividerTokens, edgeStyle, editorContentTokens, editorTokens, emailSuggestionTokens, emptyStateTokens, extendTokens, fade, fieldMessageTokens, fieldTokens, fieldsetTokens, fileUploadTokens, filtersPanelTokens, floatLabelTokens, formFieldTokens, galleriaTokens, highlightTextTokens, hoverEffectTokens, iconLinkTokens, iconTokens, iftaLabelTokens, imageTokens, inputGroupTokens, inputNumberTokens, inputOtpTokens, joinCss, kanbanTokens, knobTokens, labelTokens, lightDark, linkTokens, listInputTokens, listboxTokens, mascotTokens, mentionTokens, menuTokens, menubarTokens, mergeTokens, messageTokens, mix, monthCalendarTokens, networkStatusTokens, noirScale, overlayBadgeTokens, pageHeaderTokens, paginatorTokens, panelMenuTokens, panelTokens, paperStyle, passwordTokens, pillTokens, pinnedTabsTokens, popoverTokens, presetBaseCss, presetToCss, primaryBaseStep, progressBarTokens, progressSpinnerTokens, publicHeaderTokens, qrCodeTokens, radioButtonTokens, ratingTokens, relativeLuminance, rippleTokens, scrollPanelTokens, selectTokens, skeletonTokens, sliderTokens, softStyle, sparklineTokens, speedDialTokens, splitButtonTokens, splitterTokens, statTileTokens, statTilesTokens, statusIconTokens, stepperTokens, stepsTokens, switchLanguageTokens, switchThemeTokens, tableTokens, tabsTokens, tagTokens, tectraStyle, textareaTokens, timelineTokens, toCssVariables, toStyleObject, toastTokens, toggleButtonTokens, toggleSwitchTokens, tokenRef, toolbarTokens, tooltipTokens, topbarPreferencesTokens, treeTableTokens, treeTokens, truncateTextTokens, virtualScrollerTokens, wizardTokens };
7180
+ export { COMPONENT_TOKENS, Edge, Paper, Soft, TECTRA_STYLES, Tectra, accordionTokens, actionTileTokens, actionsMenuTokens, amountTokens, analogClockTokens, appFooterTokens, appLayoutTokens, avatarTokens, badgeTokens, breadcrumbTokens, buttonTokens, cardTokens, carouselTokens, cascadeSelectTokens, chartTokens, checkboxTokens, chipTokens, chipsInputTokens, codeDiffTokens, codeEditorTokens, codeHighlightTokens, codeSyntaxTokens, colorPickerTokens, colorSwatchesTokens, commandPaletteTokens, componentTokensCss, componentVariables, confettiTokens, confirmTokens, consoleLayoutTokens, contrastWithWhite, cookieNoticeTokens, countdownTokens, countryTokens, createDarkSemantic, createLightSemantic, createTectraPreset, dataViewTokens, datePickerTokens, deepMerge, definePreset, dialogTokens, dividerTokens, edgeStyle, editorContentTokens, editorTokens, emailSuggestionTokens, emptyStateTokens, extendTokens, fade, fieldMessageTokens, fieldTokens, fieldsetTokens, fileUploadTokens, filtersPanelTokens, floatLabelTokens, formFieldTokens, galleriaTokens, highlightTextTokens, hoverEffectTokens, iconLinkTokens, iconTokens, iftaLabelTokens, imageTokens, inputGroupTokens, inputNumberTokens, inputOtpTokens, isTectraPrimary, isTectraSurface, joinCss, kanbanTokens, knobTokens, labelTokens, lightDark, linkTokens, listInputTokens, listboxTokens, mascotTokens, mentionTokens, menuTokens, menubarTokens, mergeTokens, messageTokens, mix, monthCalendarTokens, networkStatusTokens, noirScale, overlayBadgeTokens, pageHeaderTokens, paginatorTokens, panelMenuTokens, panelTokens, paperStyle, passwordTokens, pillTokens, pinnedTabsTokens, popoverTokens, presetBaseCss, presetToCss, primaryBaseStep, progressBarTokens, progressSpinnerTokens, publicHeaderTokens, qrCodeTokens, radioButtonTokens, ratingTokens, relativeLuminance, rippleTokens, scrollPanelTokens, selectTokens, skeletonTokens, sliderTokens, softStyle, sparklineTokens, speedDialTokens, splitButtonTokens, splitterTokens, statTileTokens, statTilesTokens, statusIconTokens, stepperTokens, stepsTokens, switchLanguageTokens, switchThemeTokens, tableTokens, tabsTokens, tagTokens, tectraPrimaryChoices, tectraStyle, tectraSurfaceChoices, textareaTokens, themeConfiguratorTokens, timelineTokens, toCssVariables, toStyleObject, toastTokens, toggleButtonTokens, toggleSwitchTokens, tokenRef, toolbarTokens, tooltipTokens, topbarPreferencesTokens, treeTableTokens, treeTokens, truncateTextTokens, virtualScrollerTokens, wizardTokens };
7074
7181
 
7075
7182
  //# sourceMappingURL=tectra-ng-themes.mjs.map