@tectra-ng/themes 0.1.2 → 0.1.3

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/README.md CHANGED
@@ -9,7 +9,7 @@ Gives the primitive tokens a meaning. A preset = semantic tokens for light + dar
9
9
  | `styles/<name>/` | a style = component token overrides + semantic overrides + optional CSS on top of the default look: `tectra` — the default; `soft` — pill buttons, tags and segments, filled borderless fields, tonal secondary buttons, large card and overlay radii, glow focus; `edge` — sharp corners, strong borders, solid selection; `paper` — filled fields with an underline, elevation shadows, focus halos |
10
10
  | `semantic/contrast.ts` | `primaryBaseStep(scale)` — light primary is step 600, or 700 when white text on 600 is under 4.5:1 |
11
11
  | `define-preset.ts` | `definePreset(base, overrides)` — deep merge: override one token without copying the rest |
12
- | `components/*.tokens.ts` | design tokens of each component (`button`, `badge`, `toggleButton`) — every size, padding, colour per severity and variant; emitted as `--tx-<component>-…`, overridable per preset or per instance with `[dt]` |
12
+ | `components/*.tokens.ts` | design tokens of every component (`button`, `select`, `table`, `datePicker`, …) — every size, padding, colour per severity and variant; emitted as `--tx-<component>-…`, overridable per preset or per instance with `[dt]` |
13
13
  | `preset-to-css.ts` | `presetToCss(preset)` → `:root { --tx-… }` + `:root[data-tx-theme="dark"] { … }` |
14
14
 
15
15
  Semantic groups (each becomes `--tx-<group>-<key>`): `primary`, `secondary`, `success`, `info`, `warn`, `danger`, `help`, `contrast`, `surface`, `text`, `field`, `highlight`, `list`, `mask`, `focus-ring`, `shadow`. Shared: `radius`, `space`, `font`, `motion`.
@@ -2053,6 +2053,386 @@ const virtualScrollerTokens = {
2053
2053
  iconSize: "24.5px"
2054
2054
  }
2055
2055
  };
2056
+ const timelineTokens = {
2057
+ event: { minHeight: "63px" },
2058
+ horizontal: { eventContentPadding: "12.25px 0" },
2059
+ vertical: { eventContentPadding: "0 12.25px" },
2060
+ eventMarker: {
2061
+ size: "14px",
2062
+ borderRadius: "50%",
2063
+ borderWidth: "2px",
2064
+ background: tokenRef("surface-card"),
2065
+ borderColor: tokenRef("surface-border"),
2066
+ contentBorderRadius: "50%",
2067
+ contentSize: "6px",
2068
+ contentBackground: tokenRef("primary-base"),
2069
+ contentInsetShadow: "0px 0.5px 0px 0px rgba(0, 0, 0, 0.06), 0px 1px 1px 0px rgba(0, 0, 0, 0.12)"
2070
+ },
2071
+ eventConnector: {
2072
+ color: tokenRef("surface-border"),
2073
+ size: "2px"
2074
+ }
2075
+ };
2076
+ const statTilesTokens = {
2077
+ root: {
2078
+ gap: "14px",
2079
+ minWidth: "168px",
2080
+ floorWidth: "210px"
2081
+ },
2082
+ compact: { gap: "7px" }
2083
+ };
2084
+ const statTileTokens = {
2085
+ root: {
2086
+ background: tokenRef("surface-card"),
2087
+ borderColor: tokenRef("surface-border"),
2088
+ borderWidth: "1px",
2089
+ borderRadius: tokenRef("radius-lg"),
2090
+ paddingX: "17.5px",
2091
+ paddingY: "14px",
2092
+ gap: "10.5px",
2093
+ headGap: "14px",
2094
+ mainGap: "3.5px",
2095
+ transitionDuration: tokenRef("motion-duration")
2096
+ },
2097
+ compact: {
2098
+ paddingX: "12.25px",
2099
+ paddingY: "8.75px",
2100
+ gap: "7px",
2101
+ iconSize: "28px",
2102
+ valueFontSize: "17.5px"
2103
+ },
2104
+ icon: {
2105
+ size: "38.5px",
2106
+ fontSize: "15.75px",
2107
+ borderRadius: tokenRef("radius-md"),
2108
+ backgroundMix: "12%"
2109
+ },
2110
+ label: {
2111
+ color: tokenRef("text-muted"),
2112
+ fontSize: "11.375px",
2113
+ fontWeight: tokenRef("font-weight-medium")
2114
+ },
2115
+ value: {
2116
+ color: tokenRef("text-primary"),
2117
+ fontSize: "24.5px",
2118
+ fontWeight: tokenRef("font-weight-semibold"),
2119
+ lineHeight: "1",
2120
+ letterSpacing: "-0.03em",
2121
+ textFontSize: "17.5px",
2122
+ textLineHeight: "24.5px",
2123
+ fitMinFontSize: "14px",
2124
+ fitFontSize: "8cqi",
2125
+ fitMaxFontSize: "24.5px"
2126
+ },
2127
+ unit: {
2128
+ color: tokenRef("text-muted"),
2129
+ fontSize: "12.25px",
2130
+ lineHeight: "17.5px",
2131
+ fontWeight: tokenRef("font-weight-medium"),
2132
+ gap: "3.5px"
2133
+ },
2134
+ meta: {
2135
+ color: tokenRef("text-muted"),
2136
+ fontSize: "10.5px",
2137
+ lineHeight: "14px"
2138
+ },
2139
+ bar: {
2140
+ height: "3.5px",
2141
+ marginTop: "3.5px",
2142
+ borderRadius: tokenRef("radius-full"),
2143
+ background: tokenRef("surface-ground"),
2144
+ transitionDuration: "0.5s"
2145
+ },
2146
+ highlighted: {
2147
+ backgroundMix: "8%",
2148
+ borderMix: "30%"
2149
+ },
2150
+ link: {
2151
+ hoverBorderColor: tokenRef("primary-base"),
2152
+ focusRingWidth: "2px",
2153
+ focusRingColor: tokenRef("primary-base")
2154
+ },
2155
+ tone: {
2156
+ neutral: tokenRef("text-muted"),
2157
+ primary: tokenRef("primary-base"),
2158
+ success: lightDark(tokenRef("green-600"), tokenRef("green-400")),
2159
+ info: lightDark(tokenRef("sky-600"), tokenRef("sky-400")),
2160
+ warn: lightDark(tokenRef("amber-600"), tokenRef("amber-400")),
2161
+ danger: lightDark(tokenRef("red-600"), tokenRef("red-400"))
2162
+ }
2163
+ };
2164
+ const sparklineTokens = {
2165
+ root: {
2166
+ height: "31.5px",
2167
+ strokeWidth: "1.75",
2168
+ areaOpacity: "0.1"
2169
+ },
2170
+ tone: {
2171
+ primary: tokenRef("primary-base"),
2172
+ info: lightDark(tokenRef("sky-600"), tokenRef("sky-400")),
2173
+ success: lightDark(tokenRef("green-600"), tokenRef("green-400")),
2174
+ warn: lightDark(tokenRef("amber-600"), tokenRef("amber-400")),
2175
+ danger: lightDark(tokenRef("red-600"), tokenRef("red-400"))
2176
+ }
2177
+ };
2178
+ const countdownTokens = { root: {
2179
+ color: "inherit",
2180
+ fontWeight: "inherit",
2181
+ endingColor: lightDark(tokenRef("red-600"), tokenRef("red-400")),
2182
+ expiredColor: "inherit",
2183
+ transitionDuration: tokenRef("motion-duration")
2184
+ } };
2185
+ const analogClockTokens = {
2186
+ root: {
2187
+ size: "210px",
2188
+ background: tokenRef("surface-card"),
2189
+ borderColor: tokenRef("surface-border"),
2190
+ shadow: "0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)",
2191
+ transitionDuration: "700ms",
2192
+ transitionEasing: "cubic-bezier(0.34, 1.56, 0.64, 1)"
2193
+ },
2194
+ tick: {
2195
+ width: "3.5px",
2196
+ height: "4%",
2197
+ offset: "-1125%",
2198
+ color: tokenRef("surface-border"),
2199
+ majorHeight: "7%",
2200
+ majorOffset: "-600%",
2201
+ majorColor: tokenRef("text-muted")
2202
+ },
2203
+ hourHand: {
2204
+ width: "5.25px",
2205
+ length: "27%",
2206
+ color: tokenRef("text-primary")
2207
+ },
2208
+ minuteHand: {
2209
+ width: "3.5px",
2210
+ length: "40%",
2211
+ color: tokenRef("primary-base")
2212
+ },
2213
+ secondHand: {
2214
+ width: "1.75px",
2215
+ length: "42%",
2216
+ color: lightDark(tokenRef("red-600"), tokenRef("red-400"))
2217
+ },
2218
+ pin: {
2219
+ size: "14px",
2220
+ color: tokenRef("primary-base"),
2221
+ ringWidth: "4px",
2222
+ ringColor: tokenRef("surface-card")
2223
+ }
2224
+ };
2225
+ const focusRing = {
2226
+ width: "2px",
2227
+ style: "solid",
2228
+ color: tokenRef("focus-ring-color"),
2229
+ offset: "2px",
2230
+ shadow: "none"
2231
+ };
2232
+ const datePickerTokens = {
2233
+ root: { transitionDuration: tokenRef("motion-duration") },
2234
+ panel: {
2235
+ background: tokenRef("surface-overlay"),
2236
+ borderColor: tokenRef("surface-overlay-border"),
2237
+ color: tokenRef("text-primary"),
2238
+ borderRadius: tokenRef("radius-lg"),
2239
+ shadow: tokenRef("shadow-overlay"),
2240
+ padding: "10.5px"
2241
+ },
2242
+ header: {
2243
+ background: tokenRef("surface-overlay"),
2244
+ borderColor: tokenRef("surface-overlay-border"),
2245
+ color: tokenRef("text-primary"),
2246
+ padding: "0 0 7px 0"
2247
+ },
2248
+ title: {
2249
+ gap: "7px",
2250
+ fontWeight: tokenRef("font-weight-medium"),
2251
+ fontSize: tokenRef("font-size-md")
2252
+ },
2253
+ dropdown: {
2254
+ width: "31.5px",
2255
+ sm: { width: "24.5px" },
2256
+ lg: { width: "36.75px" },
2257
+ background: lightDark(tokenRef("surface-100"), tokenRef("surface-800")),
2258
+ hoverBackground: lightDark(tokenRef("surface-200"), tokenRef("surface-700")),
2259
+ activeBackground: lightDark(tokenRef("surface-300"), tokenRef("surface-600")),
2260
+ borderColor: tokenRef("form-field-border-color"),
2261
+ hoverBorderColor: tokenRef("form-field-border-color"),
2262
+ activeBorderColor: tokenRef("form-field-border-color"),
2263
+ color: lightDark(tokenRef("surface-600"), tokenRef("surface-300")),
2264
+ hoverColor: lightDark(tokenRef("surface-700"), tokenRef("surface-200")),
2265
+ activeColor: lightDark(tokenRef("surface-800"), tokenRef("surface-100")),
2266
+ borderRadius: tokenRef("form-field-border-radius"),
2267
+ focusRing
2268
+ },
2269
+ inputIcon: { color: tokenRef("form-field-icon-color") },
2270
+ selectMonth: {
2271
+ hoverBackground: tokenRef("surface-hover"),
2272
+ color: tokenRef("text-primary"),
2273
+ hoverColor: tokenRef("text-hover"),
2274
+ padding: "3.5px 7px",
2275
+ borderRadius: tokenRef("radius-lg"),
2276
+ fontWeight: tokenRef("font-weight-medium"),
2277
+ fontSize: tokenRef("font-size-md")
2278
+ },
2279
+ selectYear: {
2280
+ hoverBackground: tokenRef("surface-hover"),
2281
+ color: tokenRef("text-primary"),
2282
+ hoverColor: tokenRef("text-hover"),
2283
+ padding: "3.5px 7px",
2284
+ borderRadius: tokenRef("radius-lg"),
2285
+ fontWeight: tokenRef("font-weight-medium"),
2286
+ fontSize: tokenRef("font-size-md")
2287
+ },
2288
+ group: {
2289
+ borderColor: tokenRef("surface-overlay-border"),
2290
+ gap: "10.5px"
2291
+ },
2292
+ dayView: { margin: "7px 0 0 0" },
2293
+ weekDay: {
2294
+ padding: "3.5px",
2295
+ fontWeight: tokenRef("font-weight-medium"),
2296
+ fontSize: tokenRef("font-size-md"),
2297
+ color: tokenRef("text-primary")
2298
+ },
2299
+ weekNumber: {
2300
+ color: tokenRef("text-muted"),
2301
+ fontSize: tokenRef("font-size-sm")
2302
+ },
2303
+ date: {
2304
+ fontWeight: tokenRef("font-weight-regular"),
2305
+ fontSize: tokenRef("font-size-md"),
2306
+ hoverBackground: tokenRef("surface-hover"),
2307
+ selectedBackground: tokenRef("primary-base"),
2308
+ rangeSelectedBackground: tokenRef("highlight-background"),
2309
+ color: tokenRef("text-primary"),
2310
+ hoverColor: tokenRef("text-hover"),
2311
+ selectedColor: tokenRef("primary-contrast"),
2312
+ rangeSelectedColor: tokenRef("highlight-color"),
2313
+ disabledOpacity: "0.6",
2314
+ width: "24.5px",
2315
+ height: "24.5px",
2316
+ borderRadius: "50%",
2317
+ padding: "3.5px",
2318
+ focusRing
2319
+ },
2320
+ monthView: { margin: "7px 0 0 0" },
2321
+ month: {
2322
+ padding: "3.5px",
2323
+ borderRadius: tokenRef("radius-lg")
2324
+ },
2325
+ yearView: { margin: "7px 0 0 0" },
2326
+ year: {
2327
+ padding: "3.5px",
2328
+ borderRadius: tokenRef("radius-lg")
2329
+ },
2330
+ buttonbar: {
2331
+ padding: "7px 0 0 0",
2332
+ borderColor: tokenRef("surface-overlay-border")
2333
+ },
2334
+ timePicker: {
2335
+ padding: "7px 0 0 0",
2336
+ borderColor: tokenRef("surface-overlay-border"),
2337
+ gap: "7px",
2338
+ buttonGap: "1.75px",
2339
+ color: tokenRef("text-primary"),
2340
+ fontWeight: tokenRef("font-weight-regular"),
2341
+ fontSize: tokenRef("font-size-md")
2342
+ },
2343
+ today: {
2344
+ background: lightDark(tokenRef("surface-200"), tokenRef("surface-700")),
2345
+ color: lightDark(tokenRef("surface-900"), tokenRef("surface-0"))
2346
+ },
2347
+ touch: {
2348
+ maskBackground: tokenRef("mask-background"),
2349
+ width: "min(92vw, 360px)"
2350
+ }
2351
+ };
2352
+ const monthCalendarTokens = {
2353
+ root: {
2354
+ background: tokenRef("surface-card"),
2355
+ borderColor: tokenRef("surface-border"),
2356
+ borderRadius: tokenRef("radius-lg"),
2357
+ transitionDuration: tokenRef("motion-duration")
2358
+ },
2359
+ head: { background: tokenRef("surface-ground") },
2360
+ weekday: {
2361
+ padding: "7px",
2362
+ widePaddingX: "10.5px",
2363
+ color: tokenRef("text-muted"),
2364
+ fontSize: "10.5px",
2365
+ fontWeight: tokenRef("font-weight-semibold"),
2366
+ weekendColor: tokenRef("text-muted")
2367
+ },
2368
+ week: {
2369
+ height: "49px",
2370
+ headHeight: "31.5px",
2371
+ laneHeight: "21px",
2372
+ moreHeight: "21px"
2373
+ },
2374
+ cell: {
2375
+ borderColor: tokenRef("surface-border"),
2376
+ weekendBackground: `color-mix(in srgb, ${tokenRef("surface-ground")} 70%, transparent)`,
2377
+ selectedBackground: `color-mix(in srgb, ${tokenRef("primary-base")} 9%, transparent)`
2378
+ },
2379
+ day: {
2380
+ padding: "3.5px",
2381
+ widePaddingX: "5.25px",
2382
+ color: tokenRef("text-primary"),
2383
+ hoverBackground: `color-mix(in srgb, ${tokenRef("primary-base")} 5%, transparent)`,
2384
+ gap: "3.5px",
2385
+ focusRingWidth: "2px",
2386
+ focusRingColor: tokenRef("primary-base")
2387
+ },
2388
+ number: {
2389
+ size: "24.5px",
2390
+ fontSize: "11.375px",
2391
+ fontWeight: tokenRef("font-weight-medium"),
2392
+ selectedColor: tokenRef("primary-base"),
2393
+ selectedFontWeight: tokenRef("font-weight-semibold"),
2394
+ todayBackground: tokenRef("primary-base"),
2395
+ todayColor: tokenRef("primary-contrast"),
2396
+ outsideColor: tokenRef("text-muted")
2397
+ },
2398
+ dot: {
2399
+ size: "5.25px",
2400
+ gap: "3.5px",
2401
+ bottom: "5.25px"
2402
+ },
2403
+ event: {
2404
+ height: "17.5px",
2405
+ paddingX: "7px",
2406
+ gap: "5.25px",
2407
+ inset: "3.5px",
2408
+ borderRadius: "5.25px",
2409
+ fontSize: "10.5px",
2410
+ fontWeight: tokenRef("font-weight-medium"),
2411
+ backgroundMix: "14%",
2412
+ hoverBackgroundMix: "24%",
2413
+ textMix: "65%",
2414
+ textBase: tokenRef("text-primary"),
2415
+ avatarSize: "14px"
2416
+ },
2417
+ more: {
2418
+ margin: "3.5px",
2419
+ padding: "1.75px 5.25px",
2420
+ borderRadius: "5.25px",
2421
+ color: tokenRef("text-muted"),
2422
+ hoverColor: tokenRef("primary-base"),
2423
+ hoverBackground: `color-mix(in srgb, ${tokenRef("primary-base")} 10%, transparent)`,
2424
+ fontSize: "10.5px",
2425
+ fontWeight: tokenRef("font-weight-semibold")
2426
+ },
2427
+ tone: {
2428
+ primary: tokenRef("primary-base"),
2429
+ info: lightDark(tokenRef("sky-600"), tokenRef("sky-400")),
2430
+ success: lightDark(tokenRef("green-600"), tokenRef("green-400")),
2431
+ warn: lightDark(tokenRef("amber-600"), tokenRef("amber-400")),
2432
+ danger: lightDark(tokenRef("red-600"), tokenRef("red-400")),
2433
+ neutral: tokenRef("text-muted")
2434
+ }
2435
+ };
2056
2436
  const iconTokens = { root: {
2057
2437
  size: "1em",
2058
2438
  strokeWidth: "1.75"
@@ -2176,7 +2556,15 @@ const COMPONENT_TOKENS = {
2176
2556
  table: tableTokens,
2177
2557
  treeTable: treeTableTokens,
2178
2558
  dataView: dataViewTokens,
2179
- virtualScroller: virtualScrollerTokens
2559
+ virtualScroller: virtualScrollerTokens,
2560
+ timeline: timelineTokens,
2561
+ statTiles: statTilesTokens,
2562
+ statTile: statTileTokens,
2563
+ sparkline: sparklineTokens,
2564
+ datePicker: datePickerTokens,
2565
+ monthCalendar: monthCalendarTokens,
2566
+ countdown: countdownTokens,
2567
+ analogClock: analogClockTokens
2180
2568
  };
2181
2569
  function edgeLight({ accent, surface }) {
2182
2570
  const base = primaryBaseStep(accent);
@@ -3715,6 +4103,6 @@ function presetToCss(preset) {
3715
4103
  ...preset.css ? [preset.css] : []
3716
4104
  ].join("\n");
3717
4105
  }
3718
- export { COMPONENT_TOKENS, Edge, Paper, Soft, TECTRA_STYLES, Tectra, amountTokens, avatarTokens, badgeTokens, buttonTokens, cardTokens, cascadeSelectTokens, checkboxTokens, chipTokens, chipsInputTokens, colorPickerTokens, confirmTokens, contrastWithWhite, countryTokens, createDarkSemantic, createLightSemantic, createTectraPreset, dataViewTokens, deepMerge, definePreset, dialogTokens, dividerTokens, emailSuggestionTokens, fade, fieldMessageTokens, fieldTokens, fieldsetTokens, floatLabelTokens, formFieldTokens, highlightTextTokens, iconLinkTokens, iconTokens, iftaLabelTokens, inputGroupTokens, inputNumberTokens, inputOtpTokens, knobTokens, labelTokens, lightDark, linkTokens, listboxTokens, mentionTokens, menuTokens, messageTokens, mix, noirScale, overlayBadgeTokens, paginatorTokens, panelTokens, passwordTokens, pillTokens, popoverTokens, presetToCss, primaryBaseStep, progressBarTokens, progressSpinnerTokens, radioButtonTokens, ratingTokens, relativeLuminance, rippleTokens, selectTokens, skeletonTokens, sliderTokens, speedDialTokens, splitButtonTokens, statusIconTokens, tableTokens, tagTokens, textareaTokens, toCssVariables, toStyleObject, toastTokens, toggleButtonTokens, toggleSwitchTokens, tokenRef, tooltipTokens, treeTableTokens, treeTokens, virtualScrollerTokens };
4106
+ export { COMPONENT_TOKENS, Edge, Paper, Soft, TECTRA_STYLES, Tectra, amountTokens, analogClockTokens, avatarTokens, badgeTokens, buttonTokens, cardTokens, cascadeSelectTokens, checkboxTokens, chipTokens, chipsInputTokens, colorPickerTokens, confirmTokens, contrastWithWhite, countdownTokens, countryTokens, createDarkSemantic, createLightSemantic, createTectraPreset, dataViewTokens, datePickerTokens, deepMerge, definePreset, dialogTokens, dividerTokens, emailSuggestionTokens, fade, fieldMessageTokens, fieldTokens, fieldsetTokens, floatLabelTokens, formFieldTokens, highlightTextTokens, iconLinkTokens, iconTokens, iftaLabelTokens, inputGroupTokens, inputNumberTokens, inputOtpTokens, knobTokens, labelTokens, lightDark, linkTokens, listboxTokens, mentionTokens, menuTokens, messageTokens, mix, monthCalendarTokens, noirScale, overlayBadgeTokens, paginatorTokens, panelTokens, passwordTokens, pillTokens, popoverTokens, presetToCss, primaryBaseStep, progressBarTokens, progressSpinnerTokens, radioButtonTokens, ratingTokens, relativeLuminance, rippleTokens, selectTokens, skeletonTokens, sliderTokens, sparklineTokens, speedDialTokens, splitButtonTokens, statTileTokens, statTilesTokens, statusIconTokens, tableTokens, tagTokens, textareaTokens, timelineTokens, toCssVariables, toStyleObject, toastTokens, toggleButtonTokens, toggleSwitchTokens, tokenRef, tooltipTokens, treeTableTokens, treeTokens, virtualScrollerTokens };
3719
4107
 
3720
4108
  //# sourceMappingURL=tectra-ng-themes.mjs.map