@tenphi/tasty 0.0.0-snapshot.c8bdaeb → 0.0.0-snapshot.c8c7b2a
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 +309 -159
- package/dist/_virtual/_rolldown/runtime.js +1 -2
- package/dist/chunks/cacheKey.d.ts +1 -0
- package/dist/chunks/cacheKey.js +17 -10
- package/dist/chunks/cacheKey.js.map +1 -1
- package/dist/chunks/definitions.d.ts +1 -1
- package/dist/chunks/definitions.js +3 -5
- package/dist/chunks/definitions.js.map +1 -1
- package/dist/chunks/index.d.ts +1 -0
- package/dist/chunks/renderChunk.d.ts +1 -0
- package/dist/chunks/renderChunk.js +32 -34
- package/dist/chunks/renderChunk.js.map +1 -1
- package/dist/compute-styles.d.ts +31 -0
- package/dist/compute-styles.js +322 -0
- package/dist/compute-styles.js.map +1 -0
- package/dist/config.d.ts +157 -30
- package/dist/config.js +233 -45
- package/dist/config.js.map +1 -1
- package/dist/core/index.d.ts +12 -11
- package/dist/core/index.js +12 -11
- package/dist/counter-style/index.js +51 -0
- package/dist/counter-style/index.js.map +1 -0
- package/dist/debug.d.ts +26 -141
- package/dist/debug.js +359 -639
- package/dist/debug.js.map +1 -1
- package/dist/font-face/index.js +63 -0
- package/dist/font-face/index.js.map +1 -0
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/useCounterStyle.d.ts +36 -0
- package/dist/hooks/useCounterStyle.js +65 -0
- package/dist/hooks/useCounterStyle.js.map +1 -0
- package/dist/hooks/useFontFace.d.ts +45 -0
- package/dist/hooks/useFontFace.js +66 -0
- package/dist/hooks/useFontFace.js.map +1 -0
- package/dist/hooks/useGlobalStyles.d.ts +21 -2
- package/dist/hooks/useGlobalStyles.js +60 -28
- package/dist/hooks/useGlobalStyles.js.map +1 -1
- package/dist/hooks/useKeyframes.d.ts +4 -2
- package/dist/hooks/useKeyframes.js +44 -43
- package/dist/hooks/useKeyframes.js.map +1 -1
- package/dist/hooks/useProperty.d.ts +4 -2
- package/dist/hooks/useProperty.js +36 -31
- package/dist/hooks/useProperty.js.map +1 -1
- package/dist/hooks/useRawCSS.d.ts +13 -44
- package/dist/hooks/useRawCSS.js +91 -16
- package/dist/hooks/useRawCSS.js.map +1 -1
- package/dist/hooks/useStyles.d.ts +3 -3
- package/dist/hooks/useStyles.js +8 -146
- package/dist/hooks/useStyles.js.map +1 -1
- package/dist/index.d.ts +15 -12
- package/dist/index.js +15 -12
- package/dist/injector/index.d.ts +36 -11
- package/dist/injector/index.js +43 -12
- package/dist/injector/index.js.map +1 -1
- package/dist/injector/injector.d.ts +62 -3
- package/dist/injector/injector.js +293 -46
- package/dist/injector/injector.js.map +1 -1
- package/dist/injector/sheet-manager.d.ts +22 -17
- package/dist/injector/sheet-manager.js +64 -79
- package/dist/injector/sheet-manager.js.map +1 -1
- package/dist/injector/types.d.ts +121 -21
- package/dist/keyframes/index.js +1 -1
- package/dist/parser/classify.js +6 -6
- package/dist/parser/classify.js.map +1 -1
- package/dist/parser/const.js +30 -3
- package/dist/parser/const.js.map +1 -1
- package/dist/parser/lru.js +1 -1
- package/dist/parser/lru.js.map +1 -1
- package/dist/parser/parser.js +2 -3
- package/dist/parser/parser.js.map +1 -1
- package/dist/parser/tokenizer.js +1 -1
- package/dist/parser/tokenizer.js.map +1 -1
- package/dist/parser/types.js +1 -1
- package/dist/parser/types.js.map +1 -1
- package/dist/pipeline/conditions.js +1 -1
- package/dist/pipeline/conditions.js.map +1 -1
- package/dist/pipeline/exclusive.js +58 -4
- package/dist/pipeline/exclusive.js.map +1 -1
- package/dist/pipeline/index.d.ts +3 -1
- package/dist/pipeline/index.js +82 -34
- package/dist/pipeline/index.js.map +1 -1
- package/dist/pipeline/materialize.js +436 -123
- package/dist/pipeline/materialize.js.map +1 -1
- package/dist/pipeline/parseStateKey.d.ts +1 -1
- package/dist/pipeline/parseStateKey.js +21 -13
- package/dist/pipeline/parseStateKey.js.map +1 -1
- package/dist/pipeline/simplify.js +181 -7
- package/dist/pipeline/simplify.js.map +1 -1
- package/dist/pipeline/warnings.js +1 -1
- package/dist/plugins/index.d.ts +2 -0
- package/dist/plugins/okhsl-plugin.js +3 -277
- package/dist/plugins/okhsl-plugin.js.map +1 -1
- package/dist/plugins/types.d.ts +20 -2
- package/dist/properties/index.js +83 -19
- package/dist/properties/index.js.map +1 -1
- package/dist/properties/property-type-resolver.d.ts +24 -0
- package/dist/properties/property-type-resolver.js +90 -0
- package/dist/properties/property-type-resolver.js.map +1 -0
- package/dist/rsc-cache.js +79 -0
- package/dist/rsc-cache.js.map +1 -0
- package/dist/ssr/astro-client.d.ts +1 -0
- package/dist/ssr/astro-client.js +19 -0
- package/dist/ssr/astro-client.js.map +1 -0
- package/dist/ssr/astro-middleware.d.ts +15 -0
- package/dist/ssr/astro-middleware.js +19 -0
- package/dist/ssr/astro-middleware.js.map +1 -0
- package/dist/ssr/astro.d.ts +108 -0
- package/dist/ssr/astro.js +149 -0
- package/dist/ssr/astro.js.map +1 -0
- package/dist/ssr/async-storage.d.ts +17 -0
- package/dist/ssr/async-storage.js +44 -0
- package/dist/ssr/async-storage.js.map +1 -0
- package/dist/ssr/collect-auto-properties.js +58 -0
- package/dist/ssr/collect-auto-properties.js.map +1 -0
- package/dist/ssr/collector.d.ts +98 -0
- package/dist/ssr/collector.js +235 -0
- package/dist/ssr/collector.js.map +1 -0
- package/dist/ssr/context.js +16 -0
- package/dist/ssr/context.js.map +1 -0
- package/dist/ssr/format-global-rules.js +22 -0
- package/dist/ssr/format-global-rules.js.map +1 -0
- package/dist/ssr/format-keyframes.js +69 -0
- package/dist/ssr/format-keyframes.js.map +1 -0
- package/dist/ssr/format-property.js +49 -0
- package/dist/ssr/format-property.js.map +1 -0
- package/dist/ssr/format-rules.js +73 -0
- package/dist/ssr/format-rules.js.map +1 -0
- package/dist/ssr/hydrate.d.ts +29 -0
- package/dist/ssr/hydrate.js +45 -0
- package/dist/ssr/hydrate.js.map +1 -0
- package/dist/ssr/index.d.ts +4 -0
- package/dist/ssr/index.js +10 -0
- package/dist/ssr/index.js.map +1 -0
- package/dist/ssr/next.d.ts +46 -0
- package/dist/ssr/next.js +75 -0
- package/dist/ssr/next.js.map +1 -0
- package/dist/ssr/ssr-collector-ref.js +29 -0
- package/dist/ssr/ssr-collector-ref.js.map +1 -0
- package/dist/states/index.js +13 -259
- package/dist/states/index.js.map +1 -1
- package/dist/static/index.js +1 -2
- package/dist/static/inject.d.ts +5 -0
- package/dist/static/inject.js +17 -0
- package/dist/static/inject.js.map +1 -0
- package/dist/static/tastyStatic.js +1 -2
- package/dist/static/tastyStatic.js.map +1 -1
- package/dist/static/types.js +1 -1
- package/dist/styles/border.d.ts +1 -1
- package/dist/styles/border.js +30 -24
- package/dist/styles/border.js.map +1 -1
- package/dist/styles/color.d.ts +1 -1
- package/dist/styles/color.js +11 -8
- package/dist/styles/color.js.map +1 -1
- package/dist/styles/const.js +17 -0
- package/dist/styles/const.js.map +1 -0
- package/dist/styles/createStyle.js +28 -26
- package/dist/styles/createStyle.js.map +1 -1
- package/dist/styles/dimension.js +15 -3
- package/dist/styles/dimension.js.map +1 -1
- package/dist/styles/directional.js +133 -0
- package/dist/styles/directional.js.map +1 -0
- package/dist/styles/display.d.ts +3 -10
- package/dist/styles/display.js +45 -39
- package/dist/styles/display.js.map +1 -1
- package/dist/styles/fade.d.ts +1 -1
- package/dist/styles/fade.js +9 -5
- package/dist/styles/fade.js.map +1 -1
- package/dist/styles/fill.d.ts +2 -2
- package/dist/styles/fill.js +9 -9
- package/dist/styles/fill.js.map +1 -1
- package/dist/styles/flow.js +1 -1
- package/dist/styles/gap.d.ts +1 -1
- package/dist/styles/gap.js +4 -3
- package/dist/styles/gap.js.map +1 -1
- package/dist/styles/height.d.ts +1 -1
- package/dist/styles/height.js +1 -2
- package/dist/styles/height.js.map +1 -1
- package/dist/styles/index.d.ts +0 -1
- package/dist/styles/index.js +3 -4
- package/dist/styles/index.js.map +1 -1
- package/dist/styles/inset.d.ts +1 -29
- package/dist/styles/inset.js +19 -135
- package/dist/styles/inset.js.map +1 -1
- package/dist/styles/list.d.ts +5 -5
- package/dist/styles/list.js +4 -2
- package/dist/styles/list.js.map +1 -1
- package/dist/styles/margin.d.ts +1 -1
- package/dist/styles/margin.js +17 -89
- package/dist/styles/margin.js.map +1 -1
- package/dist/styles/outline.d.ts +1 -1
- package/dist/styles/outline.js +6 -16
- package/dist/styles/outline.js.map +1 -1
- package/dist/styles/padding.d.ts +1 -1
- package/dist/styles/padding.js +17 -89
- package/dist/styles/padding.js.map +1 -1
- package/dist/styles/placement.d.ts +37 -0
- package/dist/styles/placement.js +74 -0
- package/dist/styles/placement.js.map +1 -0
- package/dist/styles/predefined.d.ts +4 -6
- package/dist/styles/predefined.js +9 -13
- package/dist/styles/predefined.js.map +1 -1
- package/dist/styles/preset.d.ts +6 -1
- package/dist/styles/preset.js +54 -53
- package/dist/styles/preset.js.map +1 -1
- package/dist/styles/radius.d.ts +1 -3
- package/dist/styles/radius.js +38 -6
- package/dist/styles/radius.js.map +1 -1
- package/dist/styles/scrollMargin.d.ts +24 -0
- package/dist/styles/scrollMargin.js +32 -0
- package/dist/styles/scrollMargin.js.map +1 -0
- package/dist/styles/scrollbar.d.ts +9 -5
- package/dist/styles/scrollbar.js +31 -92
- package/dist/styles/scrollbar.js.map +1 -1
- package/dist/styles/shadow.d.ts +1 -1
- package/dist/styles/shadow.js +4 -3
- package/dist/styles/shadow.js.map +1 -1
- package/dist/styles/shared.js +17 -0
- package/dist/styles/shared.js.map +1 -0
- package/dist/styles/transition.d.ts +1 -1
- package/dist/styles/transition.js +6 -5
- package/dist/styles/transition.js.map +1 -1
- package/dist/styles/types.d.ts +94 -28
- package/dist/styles/width.d.ts +1 -1
- package/dist/styles/width.js +1 -2
- package/dist/styles/width.js.map +1 -1
- package/dist/tasty.d.ts +46 -894
- package/dist/tasty.js +101 -59
- package/dist/tasty.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/utils/cache-wrapper.js +4 -9
- package/dist/utils/cache-wrapper.js.map +1 -1
- package/dist/utils/case-converter.js +1 -1
- package/dist/utils/color-math.d.ts +46 -0
- package/dist/utils/color-math.js +749 -0
- package/dist/utils/color-math.js.map +1 -0
- package/dist/utils/color-space.d.ts +5 -0
- package/dist/utils/color-space.js +228 -0
- package/dist/utils/color-space.js.map +1 -0
- package/dist/utils/colors.js +3 -2
- package/dist/utils/colors.js.map +1 -1
- package/dist/utils/deps-equal.js +15 -0
- package/dist/utils/deps-equal.js.map +1 -0
- package/dist/utils/dotize.js +1 -1
- package/dist/utils/dotize.js.map +1 -1
- package/dist/utils/filter-base-props.d.ts +1 -1
- package/dist/utils/filter-base-props.js +1 -1
- package/dist/utils/filter-base-props.js.map +1 -1
- package/dist/utils/get-display-name.js +1 -1
- package/dist/utils/has-keys.js +13 -0
- package/dist/utils/has-keys.js.map +1 -0
- package/dist/utils/hash.js +14 -0
- package/dist/utils/hash.js.map +1 -0
- package/dist/utils/is-dev-env.js +1 -1
- package/dist/utils/is-dev-env.js.map +1 -1
- package/dist/utils/is-valid-element-type.js +1 -1
- package/dist/utils/merge-styles.js +1 -2
- package/dist/utils/merge-styles.js.map +1 -1
- package/dist/utils/mod-attrs.d.ts +0 -2
- package/dist/utils/mod-attrs.js +3 -4
- package/dist/utils/mod-attrs.js.map +1 -1
- package/dist/utils/process-tokens.d.ts +3 -17
- package/dist/utils/process-tokens.js +19 -107
- package/dist/utils/process-tokens.js.map +1 -1
- package/dist/utils/resolve-recipes.js +1 -2
- package/dist/utils/resolve-recipes.js.map +1 -1
- package/dist/utils/selector-transform.js +32 -0
- package/dist/utils/selector-transform.js.map +1 -0
- package/dist/utils/string.js +1 -1
- package/dist/utils/styles.d.ts +3 -82
- package/dist/utils/styles.js +29 -399
- package/dist/utils/styles.js.map +1 -1
- package/dist/utils/typography.d.ts +35 -13
- package/dist/utils/typography.js +16 -18
- package/dist/utils/typography.js.map +1 -1
- package/dist/utils/warnings.js +1 -1
- package/dist/zero/babel.d.ts +57 -84
- package/dist/zero/babel.js +217 -37
- package/dist/zero/babel.js.map +1 -1
- package/dist/zero/css-writer.js +1 -2
- package/dist/zero/css-writer.js.map +1 -1
- package/dist/zero/extractor.js +119 -3
- package/dist/zero/extractor.js.map +1 -1
- package/dist/zero/index.js +1 -2
- package/dist/zero/next.d.ts +56 -30
- package/dist/zero/next.js +105 -40
- package/dist/zero/next.js.map +1 -1
- package/docs/README.md +31 -0
- package/docs/adoption.md +298 -0
- package/docs/comparison.md +419 -0
- package/docs/configuration.md +394 -0
- package/docs/debug.md +320 -0
- package/docs/design-system.md +436 -0
- package/docs/dsl.md +688 -0
- package/docs/getting-started.md +217 -0
- package/docs/injector.md +544 -0
- package/docs/methodology.md +616 -0
- package/docs/pipeline.md +519 -0
- package/docs/react-api.md +557 -0
- package/docs/ssr.md +442 -0
- package/docs/styles.md +596 -0
- package/docs/tasty-static.md +532 -0
- package/package.json +68 -36
- package/dist/styles/align.d.ts +0 -15
- package/dist/styles/align.js +0 -14
- package/dist/styles/align.js.map +0 -1
- package/dist/styles/justify.d.ts +0 -15
- package/dist/styles/justify.js +0 -14
- package/dist/styles/justify.js.map +0 -1
- package/dist/styles/styledScrollbar.d.ts +0 -47
- package/dist/styles/styledScrollbar.js +0 -38
- package/dist/styles/styledScrollbar.js.map +0 -1
- package/dist/tokens/typography.d.ts +0 -19
- package/dist/tokens/typography.js +0 -237
- package/dist/tokens/typography.js.map +0 -1
- package/dist/utils/hsl-to-rgb.js +0 -38
- package/dist/utils/hsl-to-rgb.js.map +0 -1
- package/dist/utils/okhsl-to-rgb.js +0 -296
- package/dist/utils/okhsl-to-rgb.js.map +0 -1
package/dist/styles/scrollbar.js
CHANGED
|
@@ -1,112 +1,51 @@
|
|
|
1
|
+
import { CSS_WIDE_KEYWORDS } from "../parser/const.js";
|
|
1
2
|
import { makeEmptyDetails } from "../parser/types.js";
|
|
2
3
|
import { parseStyle } from "../utils/styles.js";
|
|
3
|
-
|
|
4
|
+
import { warn } from "../utils/warnings.js";
|
|
4
5
|
//#region src/styles/scrollbar.ts
|
|
5
6
|
/**
|
|
6
|
-
*
|
|
7
|
+
* Standard CSS scrollbar styling via `scrollbar-width`, `scrollbar-color`,
|
|
8
|
+
* and `scrollbar-gutter`.
|
|
9
|
+
*
|
|
10
|
+
* Width values: `thin` (default), `auto`, `none`
|
|
11
|
+
* Modifiers: `stable`, `both-edges`, `always`
|
|
7
12
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
13
|
+
* Note: `auto` is classified as a VALUE_KEYWORD by the parser, so it lands
|
|
14
|
+
* in `values` rather than `mods`. Both locations are checked for robustness.
|
|
10
15
|
*/
|
|
11
16
|
function scrollbarStyle({ scrollbar, overflow }) {
|
|
12
|
-
if (!scrollbar
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (v && typeof v === "object") return v;
|
|
19
|
-
return {};
|
|
20
|
-
}
|
|
17
|
+
if (!scrollbar) return null;
|
|
18
|
+
if (typeof scrollbar === "string" && CSS_WIDE_KEYWORDS.has(scrollbar)) return {
|
|
19
|
+
"scrollbar-width": scrollbar,
|
|
20
|
+
"scrollbar-color": scrollbar
|
|
21
|
+
};
|
|
22
|
+
const { mods, colors, values } = parseStyle(String(scrollbar === true ? "thin" : scrollbar)).groups[0] ?? makeEmptyDetails();
|
|
21
23
|
const defaultThumbColor = "var(--scrollbar-thumb-color)";
|
|
22
24
|
const defaultTrackColor = "var(--scrollbar-track-color, transparent)";
|
|
23
|
-
style
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
const style = {};
|
|
26
|
+
if (mods.includes("none")) {
|
|
27
|
+
const ignored = [
|
|
28
|
+
...mods.filter((m) => m !== "none"),
|
|
29
|
+
...values,
|
|
30
|
+
...colors
|
|
31
|
+
];
|
|
32
|
+
if (ignored.length) warn(`scrollbar="none" hides the scrollbar; other tokens are ignored: ${ignored.join(", ")}`);
|
|
27
33
|
style["scrollbar-width"] = "none";
|
|
28
|
-
delete style["scrollbar-color"];
|
|
29
|
-
style["&::-webkit-scrollbar"] = {
|
|
30
|
-
width: "0px",
|
|
31
|
-
height: "0px",
|
|
32
|
-
display: "none"
|
|
33
|
-
};
|
|
34
34
|
return style;
|
|
35
|
-
} else if (mods.includes("auto")) style["scrollbar-width"] = "auto";
|
|
36
|
-
if (mods.includes("stable") || mods.includes("both-edges")) style["scrollbar-gutter"] = mods.includes("both-edges") ? "stable both-edges" : "stable";
|
|
37
|
-
if (sizeValue) style["&::-webkit-scrollbar"] = {
|
|
38
|
-
...getNested("&::-webkit-scrollbar"),
|
|
39
|
-
width: sizeValue,
|
|
40
|
-
height: sizeValue
|
|
41
|
-
};
|
|
42
|
-
const thumbColor = colors && colors[0] ? colors[0] : defaultThumbColor;
|
|
43
|
-
const trackColor = colors && colors[1] ? colors[1] : defaultTrackColor;
|
|
44
|
-
const cornerColor = colors && colors[2] ? colors[2] : trackColor;
|
|
45
|
-
if (colors && colors.length) {
|
|
46
|
-
style["scrollbar-color"] = `${thumbColor} ${trackColor}`;
|
|
47
|
-
const webkitScrollbar = getNested("&::-webkit-scrollbar");
|
|
48
|
-
webkitScrollbar["background"] = trackColor;
|
|
49
|
-
style["&::-webkit-scrollbar"] = webkitScrollbar;
|
|
50
|
-
style["&::-webkit-scrollbar-track"] = {
|
|
51
|
-
...getNested("&::-webkit-scrollbar-track"),
|
|
52
|
-
background: trackColor
|
|
53
|
-
};
|
|
54
|
-
style["&::-webkit-scrollbar-thumb"] = {
|
|
55
|
-
...getNested("&::-webkit-scrollbar-thumb"),
|
|
56
|
-
background: thumbColor
|
|
57
|
-
};
|
|
58
|
-
style["&::-webkit-scrollbar-corner"] = {
|
|
59
|
-
...getNested("&::-webkit-scrollbar-corner"),
|
|
60
|
-
background: cornerColor
|
|
61
|
-
};
|
|
62
35
|
}
|
|
36
|
+
if (mods.includes("auto") || values.includes("auto")) style["scrollbar-width"] = "auto";
|
|
37
|
+
else style["scrollbar-width"] = "thin";
|
|
38
|
+
style["scrollbar-color"] = `${colors?.[0] || defaultThumbColor} ${colors?.[1] || defaultTrackColor}`;
|
|
39
|
+
if (mods.includes("stable") || mods.includes("both-edges")) style["scrollbar-gutter"] = mods.includes("both-edges") ? "stable both-edges" : "stable";
|
|
63
40
|
if (mods.includes("always")) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
alwaysScrollbar["display"] = "block";
|
|
68
|
-
style["&::-webkit-scrollbar"] = alwaysScrollbar;
|
|
69
|
-
}
|
|
70
|
-
if (mods.includes("styled")) {
|
|
71
|
-
const baseTransition = [
|
|
72
|
-
"background var(--transition)",
|
|
73
|
-
"border-radius var(--transition)",
|
|
74
|
-
"box-shadow var(--transition)",
|
|
75
|
-
"width var(--transition)",
|
|
76
|
-
"height var(--transition)",
|
|
77
|
-
"border var(--transition)"
|
|
78
|
-
].join(", ");
|
|
79
|
-
style["scrollbar-width"] = style["scrollbar-width"] || "thin";
|
|
80
|
-
style["scrollbar-color"] = style["scrollbar-color"] || `${defaultThumbColor} ${defaultTrackColor}`;
|
|
81
|
-
style["&::-webkit-scrollbar"] = {
|
|
82
|
-
width: sizeValue,
|
|
83
|
-
height: sizeValue,
|
|
84
|
-
transition: baseTransition,
|
|
85
|
-
background: defaultTrackColor,
|
|
86
|
-
...getNested("&::-webkit-scrollbar")
|
|
87
|
-
};
|
|
88
|
-
style["&::-webkit-scrollbar-thumb"] = {
|
|
89
|
-
"border-radius": "8px",
|
|
90
|
-
"min-height": "24px",
|
|
91
|
-
transition: baseTransition,
|
|
92
|
-
background: defaultThumbColor,
|
|
93
|
-
...getNested("&::-webkit-scrollbar-thumb")
|
|
94
|
-
};
|
|
95
|
-
style["&::-webkit-scrollbar-track"] = {
|
|
96
|
-
background: defaultTrackColor,
|
|
97
|
-
transition: baseTransition,
|
|
98
|
-
...getNested("&::-webkit-scrollbar-track")
|
|
99
|
-
};
|
|
100
|
-
style["&::-webkit-scrollbar-corner"] = {
|
|
101
|
-
background: defaultTrackColor,
|
|
102
|
-
transition: baseTransition,
|
|
103
|
-
...getNested("&::-webkit-scrollbar-corner")
|
|
104
|
-
};
|
|
41
|
+
const effectiveOverflow = overflow || "scroll";
|
|
42
|
+
style["overflow"] = effectiveOverflow;
|
|
43
|
+
if (!style["scrollbar-gutter"] && (effectiveOverflow === "scroll" || effectiveOverflow === "auto")) style["scrollbar-gutter"] = "stable";
|
|
105
44
|
}
|
|
106
45
|
return style;
|
|
107
46
|
}
|
|
108
47
|
scrollbarStyle.__lookupStyles = ["scrollbar", "overflow"];
|
|
109
|
-
|
|
110
48
|
//#endregion
|
|
111
49
|
export { scrollbarStyle };
|
|
50
|
+
|
|
112
51
|
//# sourceMappingURL=scrollbar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scrollbar.js","names":[],"sources":["../../src/styles/scrollbar.ts"],"sourcesContent":["import { makeEmptyDetails } from '../parser/types';\nimport { parseStyle } from '../utils/styles';\n\ninterface ScrollbarStyleProps {\n scrollbar?: string | boolean
|
|
1
|
+
{"version":3,"file":"scrollbar.js","names":[],"sources":["../../src/styles/scrollbar.ts"],"sourcesContent":["import { CSS_WIDE_KEYWORDS } from '../parser/const';\nimport { makeEmptyDetails } from '../parser/types';\nimport { parseStyle } from '../utils/styles';\nimport { warn } from '../utils/warnings';\n\ninterface ScrollbarStyleProps {\n scrollbar?: string | boolean;\n overflow?: string;\n}\n\n/**\n * Standard CSS scrollbar styling via `scrollbar-width`, `scrollbar-color`,\n * and `scrollbar-gutter`.\n *\n * Width values: `thin` (default), `auto`, `none`\n * Modifiers: `stable`, `both-edges`, `always`\n *\n * Note: `auto` is classified as a VALUE_KEYWORD by the parser, so it lands\n * in `values` rather than `mods`. Both locations are checked for robustness.\n */\nexport function scrollbarStyle({\n scrollbar,\n overflow,\n}: ScrollbarStyleProps): Record<string, string> | null {\n if (!scrollbar) return null;\n\n if (typeof scrollbar === 'string' && CSS_WIDE_KEYWORDS.has(scrollbar)) {\n return {\n 'scrollbar-width': scrollbar,\n 'scrollbar-color': scrollbar,\n };\n }\n\n // `true` is treated as `thin` (empty string is falsy, caught by the guard above)\n const value = scrollbar === true ? 'thin' : scrollbar;\n const processed = parseStyle(String(value));\n const { mods, colors, values } = processed.groups[0] ?? makeEmptyDetails();\n\n const defaultThumbColor = 'var(--scrollbar-thumb-color)';\n const defaultTrackColor = 'var(--scrollbar-track-color, transparent)';\n\n const style: Record<string, string> = {};\n\n if (mods.includes('none')) {\n const ignored = [...mods.filter((m) => m !== 'none'), ...values, ...colors];\n\n if (ignored.length) {\n warn(\n `scrollbar=\"none\" hides the scrollbar; other tokens are ignored: ${ignored.join(', ')}`,\n );\n }\n\n style['scrollbar-width'] = 'none';\n\n return style;\n }\n\n // `thin` is the default — accepted as a value for readability but always\n // the fallback when neither `auto` nor `none` is specified.\n // `auto` is a VALUE_KEYWORD in the parser, so it may land in `values`.\n if (mods.includes('auto') || values.includes('auto')) {\n style['scrollbar-width'] = 'auto';\n } else {\n style['scrollbar-width'] = 'thin';\n }\n\n const thumbColor = colors?.[0] || defaultThumbColor;\n const trackColor = colors?.[1] || defaultTrackColor;\n style['scrollbar-color'] = `${thumbColor} ${trackColor}`;\n\n if (mods.includes('stable') || mods.includes('both-edges')) {\n style['scrollbar-gutter'] = mods.includes('both-edges')\n ? 'stable both-edges'\n : 'stable';\n }\n\n if (mods.includes('always')) {\n const effectiveOverflow = overflow || 'scroll';\n style['overflow'] = effectiveOverflow;\n\n // scrollbar-gutter only applies with scroll/auto overflow\n if (\n !style['scrollbar-gutter'] &&\n (effectiveOverflow === 'scroll' || effectiveOverflow === 'auto')\n ) {\n style['scrollbar-gutter'] = 'stable';\n }\n }\n\n return style;\n}\n\nscrollbarStyle.__lookupStyles = ['scrollbar', 'overflow'];\n"],"mappings":";;;;;;;;;;;;;;;AAoBA,SAAgB,eAAe,EAC7B,WACA,YACqD;AACrD,KAAI,CAAC,UAAW,QAAO;AAEvB,KAAI,OAAO,cAAc,YAAY,kBAAkB,IAAI,UAAU,CACnE,QAAO;EACL,mBAAmB;EACnB,mBAAmB;EACpB;CAMH,MAAM,EAAE,MAAM,QAAQ,WADJ,WAAW,OADf,cAAc,OAAO,SAAS,UACF,CAAC,CACA,OAAO,MAAM,kBAAkB;CAE1E,MAAM,oBAAoB;CAC1B,MAAM,oBAAoB;CAE1B,MAAM,QAAgC,EAAE;AAExC,KAAI,KAAK,SAAS,OAAO,EAAE;EACzB,MAAM,UAAU;GAAC,GAAG,KAAK,QAAQ,MAAM,MAAM,OAAO;GAAE,GAAG;GAAQ,GAAG;GAAO;AAE3E,MAAI,QAAQ,OACV,MACE,mEAAmE,QAAQ,KAAK,KAAK,GACtF;AAGH,QAAM,qBAAqB;AAE3B,SAAO;;AAMT,KAAI,KAAK,SAAS,OAAO,IAAI,OAAO,SAAS,OAAO,CAClD,OAAM,qBAAqB;KAE3B,OAAM,qBAAqB;AAK7B,OAAM,qBAAqB,GAFR,SAAS,MAAM,kBAEO,GADtB,SAAS,MAAM;AAGlC,KAAI,KAAK,SAAS,SAAS,IAAI,KAAK,SAAS,aAAa,CACxD,OAAM,sBAAsB,KAAK,SAAS,aAAa,GACnD,sBACA;AAGN,KAAI,KAAK,SAAS,SAAS,EAAE;EAC3B,MAAM,oBAAoB,YAAY;AACtC,QAAM,cAAc;AAGpB,MACE,CAAC,MAAM,wBACN,sBAAsB,YAAY,sBAAsB,QAEzD,OAAM,sBAAsB;;AAIhC,QAAO;;AAGT,eAAe,iBAAiB,CAAC,aAAa,WAAW"}
|
package/dist/styles/shadow.d.ts
CHANGED
package/dist/styles/shadow.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { CSS_WIDE_KEYWORDS } from "../parser/const.js";
|
|
1
2
|
import { makeEmptyDetails } from "../parser/types.js";
|
|
2
3
|
import { parseStyle } from "../utils/styles.js";
|
|
3
|
-
|
|
4
4
|
//#region src/styles/shadow.ts
|
|
5
5
|
function toBoxShadow(shadow) {
|
|
6
6
|
const { values, mods, colors } = parseStyle(shadow).groups[0] ?? makeEmptyDetails();
|
|
@@ -13,12 +13,13 @@ function toBoxShadow(shadow) {
|
|
|
13
13
|
].join(" ");
|
|
14
14
|
}
|
|
15
15
|
function shadowStyle({ shadow }) {
|
|
16
|
-
if (!shadow) return;
|
|
16
|
+
if (!shadow) return null;
|
|
17
17
|
if (shadow === true) shadow = "var(--shadow)";
|
|
18
|
+
if (CSS_WIDE_KEYWORDS.has(shadow)) return { "box-shadow": shadow };
|
|
18
19
|
return { "box-shadow": shadow.split(",").map(toBoxShadow).join(",") };
|
|
19
20
|
}
|
|
20
21
|
shadowStyle.__lookupStyles = ["shadow"];
|
|
21
|
-
|
|
22
22
|
//#endregion
|
|
23
23
|
export { shadowStyle };
|
|
24
|
+
|
|
24
25
|
//# sourceMappingURL=shadow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shadow.js","names":[],"sources":["../../src/styles/shadow.ts"],"sourcesContent":["import { makeEmptyDetails } from '../parser/types';\nimport { parseStyle } from '../utils/styles';\n\nfunction toBoxShadow(shadow: string): string {\n const processed = parseStyle(shadow);\n const { values, mods, colors } = processed.groups[0] ?? makeEmptyDetails();\n const mod = mods[0] || '';\n const shadowColor = (colors && colors[0]) ?? '';\n\n return [mod, ...values, shadowColor].join(' ');\n}\n\nexport function shadowStyle({ shadow }: { shadow?: string | boolean }) {\n if (!shadow) return;\n\n if (shadow === true) shadow = 'var(--shadow)';\n\n return {\n 'box-shadow': shadow.split(',').map(toBoxShadow).join(','),\n };\n}\n\nshadowStyle.__lookupStyles = ['shadow'];\n"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"shadow.js","names":[],"sources":["../../src/styles/shadow.ts"],"sourcesContent":["import { CSS_WIDE_KEYWORDS } from '../parser/const';\nimport { makeEmptyDetails } from '../parser/types';\nimport { parseStyle } from '../utils/styles';\n\nfunction toBoxShadow(shadow: string): string {\n const processed = parseStyle(shadow);\n const { values, mods, colors } = processed.groups[0] ?? makeEmptyDetails();\n const mod = mods[0] || '';\n const shadowColor = (colors && colors[0]) ?? '';\n\n return [mod, ...values, shadowColor].join(' ');\n}\n\nexport function shadowStyle({ shadow }: { shadow?: string | boolean }) {\n if (!shadow) return null;\n\n if (shadow === true) shadow = 'var(--shadow)';\n\n if (CSS_WIDE_KEYWORDS.has(shadow)) {\n return { 'box-shadow': shadow };\n }\n\n return {\n 'box-shadow': shadow.split(',').map(toBoxShadow).join(','),\n };\n}\n\nshadowStyle.__lookupStyles = ['shadow'];\n"],"mappings":";;;;AAIA,SAAS,YAAY,QAAwB;CAE3C,MAAM,EAAE,QAAQ,MAAM,WADJ,WAAW,OAAO,CACO,OAAO,MAAM,kBAAkB;CAC1E,MAAM,MAAM,KAAK,MAAM;CACvB,MAAM,eAAe,UAAU,OAAO,OAAO;AAE7C,QAAO;EAAC;EAAK,GAAG;EAAQ;EAAY,CAAC,KAAK,IAAI;;AAGhD,SAAgB,YAAY,EAAE,UAAyC;AACrE,KAAI,CAAC,OAAQ,QAAO;AAEpB,KAAI,WAAW,KAAM,UAAS;AAE9B,KAAI,kBAAkB,IAAI,OAAO,CAC/B,QAAO,EAAE,cAAc,QAAQ;AAGjC,QAAO,EACL,cAAc,OAAO,MAAM,IAAI,CAAC,IAAI,YAAY,CAAC,KAAK,IAAI,EAC3D;;AAGH,YAAY,iBAAiB,CAAC,SAAS"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CSS_WIDE_KEYWORDS } from "../parser/const.js";
|
|
2
|
+
//#region src/styles/shared.ts
|
|
3
|
+
/**
|
|
4
|
+
* If the group contains exactly one value that is a CSS-wide keyword
|
|
5
|
+
* and no colors, return the keyword. Otherwise null.
|
|
6
|
+
*
|
|
7
|
+
* Direction mods (top/right/bottom/left) may coexist with the keyword
|
|
8
|
+
* for directional application like `padding="inherit top"`.
|
|
9
|
+
*/
|
|
10
|
+
function extractCSSWideKeyword(group) {
|
|
11
|
+
if (group.values.length !== 1 || group.colors.length > 0) return null;
|
|
12
|
+
return CSS_WIDE_KEYWORDS.has(group.values[0]) ? group.values[0] : null;
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { extractCSSWideKeyword };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","names":[],"sources":["../../src/styles/shared.ts"],"sourcesContent":["import { CSS_WIDE_KEYWORDS } from '../parser/const';\nimport type { StyleDetails } from '../parser/types';\n\n/**\n * If the group contains exactly one value that is a CSS-wide keyword\n * and no colors, return the keyword. Otherwise null.\n *\n * Direction mods (top/right/bottom/left) may coexist with the keyword\n * for directional application like `padding=\"inherit top\"`.\n */\nexport function extractCSSWideKeyword(group: StyleDetails): string | null {\n if (group.values.length !== 1 || group.colors.length > 0) return null;\n return CSS_WIDE_KEYWORDS.has(group.values[0]) ? group.values[0] : null;\n}\n"],"mappings":";;;;;;;;;AAUA,SAAgB,sBAAsB,OAAoC;AACxE,KAAI,MAAM,OAAO,WAAW,KAAK,MAAM,OAAO,SAAS,EAAG,QAAO;AACjE,QAAO,kBAAkB,IAAI,MAAM,OAAO,GAAG,GAAG,MAAM,OAAO,KAAK"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { CSS_WIDE_KEYWORDS } from "../parser/const.js";
|
|
1
2
|
import { parseStyle } from "../utils/styles.js";
|
|
2
|
-
|
|
3
3
|
//#region src/styles/transition.ts
|
|
4
4
|
const SECOND_FILL_COLOR_PROPERTY = "--tasty-second-fill-color";
|
|
5
5
|
const MAP = {
|
|
@@ -99,17 +99,18 @@ function isEasing(token) {
|
|
|
99
99
|
return EASING_KEYWORDS.has(token) || token.startsWith("cubic-bezier(") || token.startsWith("steps(") || token.startsWith("linear(");
|
|
100
100
|
}
|
|
101
101
|
function getTiming(name) {
|
|
102
|
-
return `var(
|
|
102
|
+
return `var(${name.startsWith("--") ? `${name}-transition` : `--${name}-transition`}, var(--transition))`;
|
|
103
103
|
}
|
|
104
104
|
function transitionStyle({ transition }) {
|
|
105
|
-
if (!transition) return;
|
|
105
|
+
if (!transition) return null;
|
|
106
|
+
if (CSS_WIDE_KEYWORDS.has(transition)) return { transition };
|
|
106
107
|
const processed = parseStyle(transition);
|
|
107
108
|
const tokens = [];
|
|
108
109
|
processed.groups.forEach((g, idx) => {
|
|
109
110
|
tokens.push(...g.all);
|
|
110
111
|
if (idx < processed.groups.length - 1) tokens.push(",");
|
|
111
112
|
});
|
|
112
|
-
if (tokens.length === 0) return;
|
|
113
|
+
if (tokens.length === 0) return null;
|
|
113
114
|
let tempTransition = [];
|
|
114
115
|
const transitions = [];
|
|
115
116
|
tokens.forEach((token) => {
|
|
@@ -152,7 +153,7 @@ function transitionStyle({ transition }) {
|
|
|
152
153
|
}).join(", ") };
|
|
153
154
|
}
|
|
154
155
|
transitionStyle.__lookupStyles = ["transition"];
|
|
155
|
-
|
|
156
156
|
//#endregion
|
|
157
157
|
export { transitionStyle };
|
|
158
|
+
|
|
158
159
|
//# sourceMappingURL=transition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transition.js","names":[],"sources":["../../src/styles/transition.ts"],"sourcesContent":["import { parseStyle } from '../utils/styles';\n\nconst SECOND_FILL_COLOR_PROPERTY = '--tasty-second-fill-color';\n\nconst MAP: Record<string, string[]> = {\n fade: ['mask', 'mask-composite'],\n translate: ['transform', 'translate'],\n rotate: ['transform', 'rotate'],\n scale: ['transform', 'scale'],\n fill: ['background-color', 'background-image', SECOND_FILL_COLOR_PROPERTY],\n image: [\n 'background-image',\n 'background-position',\n 'background-size',\n 'background-repeat',\n 'background-attachment',\n 'background-origin',\n 'background-clip',\n SECOND_FILL_COLOR_PROPERTY,\n ],\n background: [\n 'background-color',\n 'background-image',\n 'background-position',\n 'background-size',\n 'background-repeat',\n 'background-attachment',\n 'background-origin',\n 'background-clip',\n SECOND_FILL_COLOR_PROPERTY,\n ],\n border: [\n 'border',\n 'border-top',\n 'border-right',\n 'border-bottom',\n 'border-left',\n ],\n filter: ['filter', 'backdrop-filter'],\n radius: ['border-radius'],\n shadow: ['box-shadow'],\n outline: ['outline', 'outline-offset'],\n preset: [\n 'font-size',\n 'line-height',\n 'letter-spacing',\n 'font-weight',\n 'font-style',\n ],\n text: ['font-weight', 'text-decoration-color'],\n color: ['color'],\n opacity: ['opacity'],\n theme: [\n 'color',\n 'background-color',\n 'background-image',\n 'box-shadow',\n 'border',\n 'border-radius',\n 'outline',\n 'opacity',\n SECOND_FILL_COLOR_PROPERTY,\n ],\n width: ['max-width', 'min-width', 'width'],\n height: ['max-height', 'min-height', 'height'],\n gap: ['gap', 'margin'],\n zIndex: ['z-index'],\n inset: ['inset', 'top', 'right', 'bottom', 'left'],\n};\n\nexport const DEFAULT_TIMING = 'var(--transition)';\nconst DEFAULT_EASING = 'linear';\n\nconst EASING_KEYWORDS = new Set([\n 'ease',\n 'ease-in',\n 'ease-out',\n 'ease-in-out',\n 'linear',\n 'step-start',\n 'step-end',\n]);\n\nfunction isEasing(token: string): boolean {\n return (\n EASING_KEYWORDS.has(token) ||\n token.startsWith('cubic-bezier(') ||\n token.startsWith('steps(') ||\n token.startsWith('linear(')\n );\n}\n\nfunction getTiming(name: string): string {\n return `var(
|
|
1
|
+
{"version":3,"file":"transition.js","names":[],"sources":["../../src/styles/transition.ts"],"sourcesContent":["import { CSS_WIDE_KEYWORDS } from '../parser/const';\nimport { parseStyle } from '../utils/styles';\n\nconst SECOND_FILL_COLOR_PROPERTY = '--tasty-second-fill-color';\n\nconst MAP: Record<string, string[]> = {\n fade: ['mask', 'mask-composite'],\n translate: ['transform', 'translate'],\n rotate: ['transform', 'rotate'],\n scale: ['transform', 'scale'],\n fill: ['background-color', 'background-image', SECOND_FILL_COLOR_PROPERTY],\n image: [\n 'background-image',\n 'background-position',\n 'background-size',\n 'background-repeat',\n 'background-attachment',\n 'background-origin',\n 'background-clip',\n SECOND_FILL_COLOR_PROPERTY,\n ],\n background: [\n 'background-color',\n 'background-image',\n 'background-position',\n 'background-size',\n 'background-repeat',\n 'background-attachment',\n 'background-origin',\n 'background-clip',\n SECOND_FILL_COLOR_PROPERTY,\n ],\n border: [\n 'border',\n 'border-top',\n 'border-right',\n 'border-bottom',\n 'border-left',\n ],\n filter: ['filter', 'backdrop-filter'],\n radius: ['border-radius'],\n shadow: ['box-shadow'],\n outline: ['outline', 'outline-offset'],\n preset: [\n 'font-size',\n 'line-height',\n 'letter-spacing',\n 'font-weight',\n 'font-style',\n ],\n text: ['font-weight', 'text-decoration-color'],\n color: ['color'],\n opacity: ['opacity'],\n theme: [\n 'color',\n 'background-color',\n 'background-image',\n 'box-shadow',\n 'border',\n 'border-radius',\n 'outline',\n 'opacity',\n SECOND_FILL_COLOR_PROPERTY,\n ],\n width: ['max-width', 'min-width', 'width'],\n height: ['max-height', 'min-height', 'height'],\n gap: ['gap', 'margin'],\n zIndex: ['z-index'],\n inset: ['inset', 'top', 'right', 'bottom', 'left'],\n};\n\nexport const DEFAULT_TIMING = 'var(--transition)';\nconst DEFAULT_EASING = 'linear';\n\nconst EASING_KEYWORDS = new Set([\n 'ease',\n 'ease-in',\n 'ease-out',\n 'ease-in-out',\n 'linear',\n 'step-start',\n 'step-end',\n]);\n\nfunction isEasing(token: string): boolean {\n return (\n EASING_KEYWORDS.has(token) ||\n token.startsWith('cubic-bezier(') ||\n token.startsWith('steps(') ||\n token.startsWith('linear(')\n );\n}\n\nfunction getTiming(name: string): string {\n const varName = name.startsWith('--')\n ? `${name}-transition`\n : `--${name}-transition`;\n return `var(${varName}, var(--transition))`;\n}\n\ntype TransitionEntry = [\n name: string,\n easing: string | undefined,\n timing: string | undefined,\n delay: string | undefined,\n];\n\nexport function transitionStyle({ transition }: { transition?: string }) {\n if (!transition) return null;\n\n if (CSS_WIDE_KEYWORDS.has(transition)) {\n return { transition };\n }\n\n const processed = parseStyle(transition);\n const tokens: string[] = [];\n processed.groups.forEach((g, idx) => {\n tokens.push(...g.all);\n if (idx < processed.groups.length - 1) tokens.push(',');\n });\n\n if (tokens.length === 0) return null;\n\n let tempTransition: string[] = [];\n const transitions: string[][] = [];\n\n tokens.forEach((token) => {\n if (token === ',') {\n if (tempTransition.length) {\n transitions.push(tempTransition);\n tempTransition = [];\n }\n } else {\n tempTransition.push(token);\n }\n });\n\n if (tempTransition.length) {\n transitions.push(tempTransition);\n }\n\n const map: Record<string, TransitionEntry> = {};\n\n transitions.forEach((transition) => {\n const name = transition[0];\n\n let timing: string | undefined;\n let easing: string | undefined;\n let delay: string | undefined;\n\n if (transition[1] && isEasing(transition[1])) {\n easing = transition[1];\n delay = transition[2];\n } else {\n timing = transition[1];\n easing = transition[2];\n delay = transition[3];\n }\n\n const styles = MAP[name] || [name];\n\n styles.forEach((style) => {\n map[style] = [name, easing, timing, delay];\n });\n });\n\n const result = Object.entries(map)\n .map(([style, [name, easing, timing, delay]]) => {\n let value = `${style} ${timing || getTiming(name)}`;\n if (easing || delay) {\n value += ` ${easing || DEFAULT_EASING}`;\n }\n if (delay) {\n value += ` ${delay}`;\n }\n return value;\n })\n .join(', ');\n\n return { transition: result };\n}\n\ntransitionStyle.__lookupStyles = ['transition'];\n"],"mappings":";;;AAGA,MAAM,6BAA6B;AAEnC,MAAM,MAAgC;CACpC,MAAM,CAAC,QAAQ,iBAAiB;CAChC,WAAW,CAAC,aAAa,YAAY;CACrC,QAAQ,CAAC,aAAa,SAAS;CAC/B,OAAO,CAAC,aAAa,QAAQ;CAC7B,MAAM;EAAC;EAAoB;EAAoB;EAA2B;CAC1E,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,YAAY;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,QAAQ;EACN;EACA;EACA;EACA;EACA;EACD;CACD,QAAQ,CAAC,UAAU,kBAAkB;CACrC,QAAQ,CAAC,gBAAgB;CACzB,QAAQ,CAAC,aAAa;CACtB,SAAS,CAAC,WAAW,iBAAiB;CACtC,QAAQ;EACN;EACA;EACA;EACA;EACA;EACD;CACD,MAAM,CAAC,eAAe,wBAAwB;CAC9C,OAAO,CAAC,QAAQ;CAChB,SAAS,CAAC,UAAU;CACpB,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EAAC;EAAa;EAAa;EAAQ;CAC1C,QAAQ;EAAC;EAAc;EAAc;EAAS;CAC9C,KAAK,CAAC,OAAO,SAAS;CACtB,QAAQ,CAAC,UAAU;CACnB,OAAO;EAAC;EAAS;EAAO;EAAS;EAAU;EAAO;CACnD;AAGD,MAAM,iBAAiB;AAEvB,MAAM,kBAAkB,IAAI,IAAI;CAC9B;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAEF,SAAS,SAAS,OAAwB;AACxC,QACE,gBAAgB,IAAI,MAAM,IAC1B,MAAM,WAAW,gBAAgB,IACjC,MAAM,WAAW,SAAS,IAC1B,MAAM,WAAW,UAAU;;AAI/B,SAAS,UAAU,MAAsB;AAIvC,QAAO,OAHS,KAAK,WAAW,KAAK,GACjC,GAAG,KAAK,eACR,KAAK,KAAK,aACQ;;AAUxB,SAAgB,gBAAgB,EAAE,cAAuC;AACvE,KAAI,CAAC,WAAY,QAAO;AAExB,KAAI,kBAAkB,IAAI,WAAW,CACnC,QAAO,EAAE,YAAY;CAGvB,MAAM,YAAY,WAAW,WAAW;CACxC,MAAM,SAAmB,EAAE;AAC3B,WAAU,OAAO,SAAS,GAAG,QAAQ;AACnC,SAAO,KAAK,GAAG,EAAE,IAAI;AACrB,MAAI,MAAM,UAAU,OAAO,SAAS,EAAG,QAAO,KAAK,IAAI;GACvD;AAEF,KAAI,OAAO,WAAW,EAAG,QAAO;CAEhC,IAAI,iBAA2B,EAAE;CACjC,MAAM,cAA0B,EAAE;AAElC,QAAO,SAAS,UAAU;AACxB,MAAI,UAAU;OACR,eAAe,QAAQ;AACzB,gBAAY,KAAK,eAAe;AAChC,qBAAiB,EAAE;;QAGrB,gBAAe,KAAK,MAAM;GAE5B;AAEF,KAAI,eAAe,OACjB,aAAY,KAAK,eAAe;CAGlC,MAAM,MAAuC,EAAE;AAE/C,aAAY,SAAS,eAAe;EAClC,MAAM,OAAO,WAAW;EAExB,IAAI;EACJ,IAAI;EACJ,IAAI;AAEJ,MAAI,WAAW,MAAM,SAAS,WAAW,GAAG,EAAE;AAC5C,YAAS,WAAW;AACpB,WAAQ,WAAW;SACd;AACL,YAAS,WAAW;AACpB,YAAS,WAAW;AACpB,WAAQ,WAAW;;AAKrB,GAFe,IAAI,SAAS,CAAC,KAAK,EAE3B,SAAS,UAAU;AACxB,OAAI,SAAS;IAAC;IAAM;IAAQ;IAAQ;IAAM;IAC1C;GACF;AAeF,QAAO,EAAE,YAbM,OAAO,QAAQ,IAAI,CAC/B,KAAK,CAAC,OAAO,CAAC,MAAM,QAAQ,QAAQ,YAAY;EAC/C,IAAI,QAAQ,GAAG,MAAM,GAAG,UAAU,UAAU,KAAK;AACjD,MAAI,UAAU,MACZ,UAAS,IAAI,UAAU;AAEzB,MAAI,MACF,UAAS,IAAI;AAEf,SAAO;GACP,CACD,KAAK,KAAK,EAEgB;;AAG/B,gBAAgB,iBAAiB,CAAC,aAAa"}
|
package/dist/styles/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { KeyframesSteps, PropertyDefinition } from "../injector/types.js";
|
|
1
|
+
import { CounterStyleDescriptors, FontFaceInput, KeyframesSteps, PropertyDefinition } from "../injector/types.js";
|
|
2
2
|
import { CSSProperties } from "../utils/css-types.js";
|
|
3
3
|
import { StyleValue, StyleValueStateMap } from "../utils/styles.js";
|
|
4
4
|
|
|
@@ -40,8 +40,9 @@ type PresetNameKey = Extract<keyof TastyPresetNames, string>;
|
|
|
40
40
|
type PresetName = [PresetNameKey] extends [never] ? string : PresetNameKey;
|
|
41
41
|
type Digit = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
|
|
42
42
|
type OpaquePercentage = '' | `.${Digit}` | `.${Digit}${Digit}` | '.100';
|
|
43
|
+
type ColorValue = `#${NamedColor}${OpaquePercentage}` | `rgb(${string})` | `hsl(${string})` | `okhsl(${string})` | `oklch(${string})` | (string & {});
|
|
43
44
|
type NoType = false | null | undefined;
|
|
44
|
-
interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font' | 'outline' | 'type' | 'gap' | 'padding' | 'margin' | 'width' | 'height' | 'border' | 'transition' | 'placeContent' | 'placeItems'> {
|
|
45
|
+
interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font' | 'outline' | 'type' | 'gap' | 'padding' | 'margin' | 'width' | 'height' | 'border' | 'transition' | 'placeContent' | 'placeItems' | 'scrollMargin' | 'scrollMarginTop' | 'scrollMarginRight' | 'scrollMarginBottom' | 'scrollMarginLeft' | 'scrollMarginBlock' | 'scrollMarginInline'> {
|
|
45
46
|
/**
|
|
46
47
|
* @deprecated Use `flow` style instead.
|
|
47
48
|
*/
|
|
@@ -57,13 +58,20 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
|
|
|
57
58
|
/**
|
|
58
59
|
* Set the background color of the element. Shortcut for `background-color` with enhanced support for Tasty color tokens and syntaxes.
|
|
59
60
|
*
|
|
61
|
+
* Supports double-color syntax: the second color is applied as a foreground overlay via a CSS custom property.
|
|
62
|
+
*
|
|
60
63
|
* Examples:
|
|
61
64
|
* - `fill="#purple.10"` // purple background with 10% opacity
|
|
62
65
|
* - `fill="#danger"` // danger theme color
|
|
63
66
|
* - `fill="rgb(255 128 0)"` // custom RGB color
|
|
67
|
+
* - `fill="rgb(255 128 0 / 0.5)"` // RGB with opacity
|
|
68
|
+
* - `fill="hsl(200 100% 50%)"` // HSL color
|
|
69
|
+
* - `fill="okhsl(200 100% 50%)"` // perceptually uniform OKHSL color
|
|
70
|
+
* - `fill="oklch(0.7 0.15 200)"` // OKLCH color
|
|
71
|
+
* - `fill="#primary #secondary"` // double color (second as foreground overlay)
|
|
64
72
|
* - `fill={true}` // default fill color
|
|
65
73
|
*/
|
|
66
|
-
fill?:
|
|
74
|
+
fill?: ColorValue | boolean;
|
|
67
75
|
/**
|
|
68
76
|
* @deprecated Use `fill` instead.
|
|
69
77
|
*/
|
|
@@ -92,19 +100,26 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
|
|
|
92
100
|
* - `svgFill="#purple.10"` // purple fill with 10% opacity
|
|
93
101
|
* - `svgFill="#danger"` // danger theme color
|
|
94
102
|
* - `svgFill="rgb(255 128 0)"` // custom RGB color
|
|
103
|
+
* - `svgFill="hsl(200 100% 50%)"` // HSL color
|
|
104
|
+
* - `svgFill="okhsl(200 100% 50%)"` // OKHSL color
|
|
105
|
+
* - `svgFill="oklch(0.7 0.15 200)"` // OKLCH color
|
|
95
106
|
* - `svgFill="currentColor"` // inherit from parent color
|
|
96
107
|
*/
|
|
97
|
-
svgFill?:
|
|
108
|
+
svgFill?: ColorValue;
|
|
98
109
|
/**
|
|
99
110
|
* Set the text (current) color of the element. Shortcut for `color` with enhanced support for Tasty color tokens and syntaxes.
|
|
100
111
|
*
|
|
101
112
|
* Examples:
|
|
102
113
|
* - `color="#purple"` // purple text color
|
|
103
114
|
* - `color="#danger.6"` // danger color with 60% opacity
|
|
115
|
+
* - `color="rgb(255 128 0)"` // custom RGB color
|
|
116
|
+
* - `color="hsl(200 100% 50%)"` // HSL color
|
|
117
|
+
* - `color="okhsl(200 100% 50%)"` // OKHSL color
|
|
118
|
+
* - `color="oklch(0.7 0.15 200)"` // OKLCH color
|
|
104
119
|
* - `color="red"` // CSS color name
|
|
105
120
|
* - `color={true}` // currentColor
|
|
106
121
|
*/
|
|
107
|
-
color?:
|
|
122
|
+
color?: ColorValue | boolean;
|
|
108
123
|
/**
|
|
109
124
|
* The fade style applies gradient-based fading masks to the edges of an element. Replaces complex CSS mask gradients with a simple, declarative API.
|
|
110
125
|
*
|
|
@@ -128,25 +143,22 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
|
|
|
128
143
|
*/
|
|
129
144
|
fade?: 'top' | 'right' | 'bottom' | 'left' | string;
|
|
130
145
|
/**
|
|
131
|
-
*
|
|
132
|
-
* Whether the element has styled scrollbar.
|
|
133
|
-
*/
|
|
134
|
-
styledScrollbar?: boolean;
|
|
135
|
-
/**
|
|
136
|
-
* The scrollbar style provides a powerful and flexible way to control the appearance and behavior of scrollbars across browsers. It supports custom sizing, color, visibility, and advanced modifiers for modern UI needs.
|
|
146
|
+
* Scrollbar styling using standard CSS properties (`scrollbar-width`, `scrollbar-color`, `scrollbar-gutter`).
|
|
137
147
|
*
|
|
138
|
-
* Syntax: `[
|
|
148
|
+
* Syntax: `[width] [modifiers...] [thumb-color] [track-color]`
|
|
139
149
|
*
|
|
140
|
-
*
|
|
150
|
+
* Width values: `thin` (default), `auto`, `none`
|
|
151
|
+
* Modifiers: `stable`, `both-edges`, `always`
|
|
141
152
|
*
|
|
142
153
|
* Examples:
|
|
143
|
-
* - `scrollbar={true}` // thin scrollbar, default
|
|
144
|
-
* - `scrollbar="thin
|
|
145
|
-
* - `scrollbar="
|
|
154
|
+
* - `scrollbar={true}` // thin scrollbar, default colors
|
|
155
|
+
* - `scrollbar="thin #purple.40 #dark.04"`
|
|
156
|
+
* - `scrollbar="auto #red #blue"`
|
|
146
157
|
* - `scrollbar="none"`
|
|
147
|
-
* - `scrollbar="always
|
|
158
|
+
* - `scrollbar="always #primary.50 #white.02"`
|
|
159
|
+
* - `scrollbar="thin stable #red #blue"`
|
|
148
160
|
*/
|
|
149
|
-
scrollbar?: string | boolean
|
|
161
|
+
scrollbar?: string | boolean;
|
|
150
162
|
/**
|
|
151
163
|
* Set font weight for bold texts.
|
|
152
164
|
*/
|
|
@@ -265,7 +277,7 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
|
|
|
265
277
|
*
|
|
266
278
|
* Syntax: `[value] [modifiers]` | `[shape]` | `true`
|
|
267
279
|
*
|
|
268
|
-
* Shapes: `round` (fully rounded), `ellipse` (50%), `leaf`, `backleaf` (asymmetric)
|
|
280
|
+
* Shapes: `round` (fully rounded), `ellipse` (50%), `leaf`, `backleaf` (asymmetric), `inherit` (inherit from parent)
|
|
269
281
|
* Directional modifiers: `top`, `right`, `bottom`, `left`
|
|
270
282
|
*
|
|
271
283
|
* Examples:
|
|
@@ -274,8 +286,10 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
|
|
|
274
286
|
* - `radius="round"` // fully rounded (9999rem)
|
|
275
287
|
* - `radius="leaf"` // asymmetric leaf shape
|
|
276
288
|
* - `radius="1r top"` // round only top corners
|
|
289
|
+
* - `radius="inherit"` // inherit border-radius from parent
|
|
290
|
+
* - `radius="inherit right"` // inherit only right corners (uses longhand properties)
|
|
277
291
|
*/
|
|
278
|
-
radius?: 'round' | 'ellipse' | 'leaf' | 'backleaf' | string | true;
|
|
292
|
+
radius?: 'round' | 'ellipse' | 'leaf' | 'backleaf' | 'inherit' | string | true;
|
|
279
293
|
/**
|
|
280
294
|
* The flow style is a unified shorthand for controlling layout direction and wrapping in both flex and grid containers. Replaces `flexDirection` and `gridAutoFlow`.
|
|
281
295
|
*
|
|
@@ -354,11 +368,13 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
|
|
|
354
368
|
/**
|
|
355
369
|
* The preset style sets base text settings according to named presets. Affects `font-size`, `line-height`, `letter-spacing`, `font-weight`, and `text-transform`.
|
|
356
370
|
*
|
|
371
|
+
* Syntax: `name`, `name / modifier`, or `modifier` (shorthand, name defaults to `inherit`).
|
|
357
372
|
* Preset names are project-specific. Augment `TastyPresetNames` to register them for autocomplete.
|
|
358
373
|
*
|
|
359
374
|
* Examples:
|
|
360
375
|
* - `preset="h1"` // heading 1 typography
|
|
361
|
-
* - `preset="h2 strong"` // bold heading 2
|
|
376
|
+
* - `preset="h2 / strong"` // bold heading 2
|
|
377
|
+
* - `preset="bold"` // inherit with bold (shorthand)
|
|
362
378
|
* - `preset="t3"` // text size 3
|
|
363
379
|
*/
|
|
364
380
|
preset?: PresetName | (string & {});
|
|
@@ -381,12 +397,12 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
|
|
|
381
397
|
*/
|
|
382
398
|
justify?: CSSProperties['justifyItems'] | CSSProperties['justifyContent'];
|
|
383
399
|
/**
|
|
384
|
-
* Shorthand for
|
|
400
|
+
* Shorthand for all placement properties. Sets all 4 longhands: align-items, justify-items, align-content, justify-content.
|
|
385
401
|
*
|
|
386
402
|
* Examples:
|
|
387
|
-
* - `place="center"` //
|
|
388
|
-
* - `place="start end"` //
|
|
389
|
-
* - `place="stretch"` //
|
|
403
|
+
* - `place="center"` // all 4 longhands: center
|
|
404
|
+
* - `place="start end"` // align-*: start; justify-*: end
|
|
405
|
+
* - `place="stretch"` // all 4 longhands: stretch
|
|
390
406
|
*/
|
|
391
407
|
place?: CSSProperties['placeItems'] | CSSProperties['placeContent'] | string;
|
|
392
408
|
/**
|
|
@@ -405,6 +421,21 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
|
|
|
405
421
|
* - `placeItems="start end"` // start on block axis, end on inline axis
|
|
406
422
|
*/
|
|
407
423
|
placeItems?: CSSProperties['placeItems'];
|
|
424
|
+
/**
|
|
425
|
+
* Shorthand for scroll-margin on all sides. Supports custom units and directional modifiers.
|
|
426
|
+
*
|
|
427
|
+
* Examples:
|
|
428
|
+
* - `scrollMargin="2x"` // scroll-margin on all sides: 2x
|
|
429
|
+
* - `scrollMargin="2x top"` // only top scroll-margin: 2x
|
|
430
|
+
* - `scrollMargin={true}` // default scroll-margin on all sides
|
|
431
|
+
*/
|
|
432
|
+
scrollMargin?: CSSProperties['scrollMargin'] | string | boolean;
|
|
433
|
+
scrollMarginTop?: string | number | boolean;
|
|
434
|
+
scrollMarginRight?: string | number | boolean;
|
|
435
|
+
scrollMarginBottom?: string | number | boolean;
|
|
436
|
+
scrollMarginLeft?: string | number | boolean;
|
|
437
|
+
scrollMarginBlock?: string | number | boolean;
|
|
438
|
+
scrollMarginInline?: string | number | boolean;
|
|
408
439
|
/**
|
|
409
440
|
* Shorthand for `top`, `right`, `bottom`, and `left` offsets. Supports custom units, directional modifiers, and positioning.
|
|
410
441
|
*
|
|
@@ -438,6 +469,24 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
|
|
|
438
469
|
* - `'@properties': { '#theme': { initialValue: 'purple' } }` // syntax: '<color>' is auto-set
|
|
439
470
|
*/
|
|
440
471
|
'@properties'?: Record<string, PropertyDefinition>;
|
|
472
|
+
/**
|
|
473
|
+
* Local @font-face definitions for this component.
|
|
474
|
+
* Keys are font-family names, values are descriptors or arrays of descriptors
|
|
475
|
+
* (for multiple weights/styles of the same family).
|
|
476
|
+
*
|
|
477
|
+
* Examples:
|
|
478
|
+
* - `'@fontFace': { Icons: { src: 'url("/fonts/icons.woff2") format("woff2")', fontDisplay: 'block' } }`
|
|
479
|
+
* - `'@fontFace': { 'Brand Sans': [{ src: '...', fontWeight: 400 }, { src: '...', fontWeight: 700 }] }`
|
|
480
|
+
*/
|
|
481
|
+
'@fontFace'?: Record<string, FontFaceInput>;
|
|
482
|
+
/**
|
|
483
|
+
* Local @counter-style definitions for this component.
|
|
484
|
+
* Keys are counter-style names, values are descriptor objects.
|
|
485
|
+
*
|
|
486
|
+
* Examples:
|
|
487
|
+
* - `'@counterStyle': { thumbs: { system: 'cyclic', symbols: '"👍"', suffix: '" "' } }`
|
|
488
|
+
*/
|
|
489
|
+
'@counterStyle'?: Record<string, CounterStyleDescriptors>;
|
|
441
490
|
/**
|
|
442
491
|
* Apply one or more predefined style recipes by name.
|
|
443
492
|
* Recipes are defined globally via `configure({ recipes: { ... } })`.
|
|
@@ -458,7 +507,7 @@ type SuffixForSelector = '&' | '.' | 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | '
|
|
|
458
507
|
type Selector = `${SuffixForSelector}${string}`;
|
|
459
508
|
type NotSelector = Exclude<string, Selector | keyof StylesInterface>;
|
|
460
509
|
/** Special style keys that should not be wrapped in StyleValue/StyleValueStateMap */
|
|
461
|
-
type SpecialStyleKeys = '@keyframes' | '@properties' | 'recipe';
|
|
510
|
+
type SpecialStyleKeys = '@keyframes' | '@properties' | '@fontFace' | '@counterStyle' | 'recipe';
|
|
462
511
|
type StylesWithoutSelectors = { [key in keyof StylesInterface as key extends SpecialStyleKeys ? never : key]?: StyleValue<StylesInterface[key]> | StyleValueStateMap<StylesInterface[key]> };
|
|
463
512
|
/**
|
|
464
513
|
* Index signature for recipe-specific arbitrary keys.
|
|
@@ -476,16 +525,20 @@ type RecipeIndexSignature = Record<string, StyleValue<string | number | boolean
|
|
|
476
525
|
type RecipeStyles = StylesWithoutSelectors & RecipeIndexSignature & {
|
|
477
526
|
'@keyframes'?: StylesInterface['@keyframes'];
|
|
478
527
|
'@properties'?: StylesInterface['@properties'];
|
|
528
|
+
'@fontFace'?: StylesInterface['@fontFace'];
|
|
529
|
+
'@counterStyle'?: StylesInterface['@counterStyle'];
|
|
479
530
|
};
|
|
480
531
|
/** Special properties that are not regular style values */
|
|
481
532
|
interface SpecialStyleProperties {
|
|
482
533
|
'@keyframes'?: StylesInterface['@keyframes'];
|
|
483
534
|
'@properties'?: StylesInterface['@properties'];
|
|
535
|
+
'@fontFace'?: StylesInterface['@fontFace'];
|
|
536
|
+
'@counterStyle'?: StylesInterface['@counterStyle'];
|
|
484
537
|
recipe?: StylesInterface['recipe'];
|
|
485
538
|
}
|
|
486
539
|
/** Index signature for arbitrary style keys (sub-elements, CSS variables, etc.) */
|
|
487
540
|
interface StylesIndexSignature {
|
|
488
|
-
[key: string]: StyleValue<string | number | boolean | undefined> | StyleValueStateMap<string | number | boolean | undefined> | Styles | false | StylesInterface['@keyframes'] | StylesInterface['@properties'];
|
|
541
|
+
[key: string]: StyleValue<string | number | boolean | undefined> | StyleValueStateMap<string | number | boolean | undefined> | Styles | false | StylesInterface['@keyframes'] | StylesInterface['@properties'] | StylesInterface['@fontFace'] | StylesInterface['@counterStyle'];
|
|
489
542
|
/**
|
|
490
543
|
* Selector combinator: `undefined` (descendant, default), `'>'` (child), `'+'` (adjacent), `'~'` (sibling).
|
|
491
544
|
* Can chain with capitalized names: `'> Body > Row >'`. Spaces required around combinators.
|
|
@@ -493,6 +546,19 @@ interface StylesIndexSignature {
|
|
|
493
546
|
$?: string;
|
|
494
547
|
}
|
|
495
548
|
type Styles = StylesWithoutSelectors & SpecialStyleProperties & StylesIndexSignature;
|
|
549
|
+
/**
|
|
550
|
+
* Value type for design tokens passed to `configure({ tokens })`.
|
|
551
|
+
* Can be a direct value or a state map for responsive/theme-aware tokens.
|
|
552
|
+
*/
|
|
553
|
+
type ConfigTokenValue = string | number | boolean | Record<string, string | number | boolean | undefined | null | '@inherit'>;
|
|
554
|
+
/**
|
|
555
|
+
* Design tokens injected as CSS custom properties on `:root`.
|
|
556
|
+
* Keys must start with `$` (value tokens) or `#` (color tokens).
|
|
557
|
+
*
|
|
558
|
+
* - `$name` keys become `--name` CSS custom properties
|
|
559
|
+
* - `#name` keys become `--name-color` and `--name-color-{colorSpace}` properties
|
|
560
|
+
*/
|
|
561
|
+
type ConfigTokens = Record<`$${string}` | `#${string}`, ConfigTokenValue>;
|
|
496
562
|
//#endregion
|
|
497
|
-
export { NoType, NotSelector, RecipeStyles, Selector, Styles, StylesInterface, StylesWithoutSelectors, SuffixForSelector, TastyNamedColors, TastyPresetNames };
|
|
563
|
+
export { ConfigTokenValue, ConfigTokens, NoType, NotSelector, RecipeStyles, Selector, Styles, StylesInterface, StylesWithoutSelectors, SuffixForSelector, TastyNamedColors, TastyPresetNames };
|
|
498
564
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/styles/width.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ declare function widthStyle({
|
|
|
8
8
|
width,
|
|
9
9
|
minWidth,
|
|
10
10
|
maxWidth
|
|
11
|
-
}: WidthStyleProps): Record<string, string | string[]> |
|
|
11
|
+
}: WidthStyleProps): Record<string, string | string[]> | null;
|
|
12
12
|
declare namespace widthStyle {
|
|
13
13
|
var __lookupStyles: string[];
|
|
14
14
|
}
|
package/dist/styles/width.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { dimensionStyle } from "./dimension.js";
|
|
2
|
-
|
|
3
2
|
//#region src/styles/width.ts
|
|
4
3
|
const dimension = dimensionStyle("width");
|
|
5
4
|
function widthStyle({ width, minWidth, maxWidth }) {
|
|
@@ -14,7 +13,7 @@ widthStyle.__lookupStyles = [
|
|
|
14
13
|
"minWidth",
|
|
15
14
|
"maxWidth"
|
|
16
15
|
];
|
|
17
|
-
|
|
18
16
|
//#endregion
|
|
19
17
|
export { widthStyle };
|
|
18
|
+
|
|
20
19
|
//# sourceMappingURL=width.js.map
|
package/dist/styles/width.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"width.js","names":[],"sources":["../../src/styles/width.ts"],"sourcesContent":["import { dimensionStyle } from './dimension';\n\nconst dimension = dimensionStyle('width');\n\ninterface WidthStyleProps {\n width?: string | number | boolean;\n minWidth?: string | number | boolean;\n maxWidth?: string | number | boolean;\n}\n\nexport function widthStyle({ width, minWidth, maxWidth }: WidthStyleProps) {\n return dimension({ value: width, min: minWidth, max: maxWidth });\n}\n\nwidthStyle.__lookupStyles = ['width', 'minWidth', 'maxWidth'];\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"width.js","names":[],"sources":["../../src/styles/width.ts"],"sourcesContent":["import { dimensionStyle } from './dimension';\n\nconst dimension = dimensionStyle('width');\n\ninterface WidthStyleProps {\n width?: string | number | boolean;\n minWidth?: string | number | boolean;\n maxWidth?: string | number | boolean;\n}\n\nexport function widthStyle({ width, minWidth, maxWidth }: WidthStyleProps) {\n return dimension({ value: width, min: minWidth, max: maxWidth });\n}\n\nwidthStyle.__lookupStyles = ['width', 'minWidth', 'maxWidth'];\n"],"mappings":";;AAEA,MAAM,YAAY,eAAe,QAAQ;AAQzC,SAAgB,WAAW,EAAE,OAAO,UAAU,YAA6B;AACzE,QAAO,UAAU;EAAE,OAAO;EAAO,KAAK;EAAU,KAAK;EAAU,CAAC;;AAGlE,WAAW,iBAAiB;CAAC;CAAS;CAAY;CAAW"}
|