@tenphi/tasty 0.0.0-snapshot.056b911
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/LICENSE +21 -0
- package/README.md +635 -0
- package/dist/_virtual/_rolldown/runtime.js +7 -0
- package/dist/chunks/cacheKey.d.ts +1 -0
- package/dist/chunks/cacheKey.js +77 -0
- package/dist/chunks/cacheKey.js.map +1 -0
- package/dist/chunks/definitions.d.ts +37 -0
- package/dist/chunks/definitions.js +258 -0
- package/dist/chunks/definitions.js.map +1 -0
- package/dist/chunks/index.d.ts +1 -0
- package/dist/chunks/renderChunk.d.ts +1 -0
- package/dist/chunks/renderChunk.js +59 -0
- package/dist/chunks/renderChunk.js.map +1 -0
- package/dist/compute-styles.d.ts +31 -0
- package/dist/compute-styles.js +335 -0
- package/dist/compute-styles.js.map +1 -0
- package/dist/config.d.ts +409 -0
- package/dist/config.js +584 -0
- package/dist/config.js.map +1 -0
- package/dist/core/index.d.ts +34 -0
- package/dist/core/index.js +27 -0
- package/dist/counter-style/index.js +51 -0
- package/dist/counter-style/index.js.map +1 -0
- package/dist/debug.d.ts +89 -0
- package/dist/debug.js +453 -0
- package/dist/debug.js.map +1 -0
- 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 +64 -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 +46 -0
- package/dist/hooks/useGlobalStyles.js +88 -0
- package/dist/hooks/useGlobalStyles.js.map +1 -0
- package/dist/hooks/useKeyframes.d.ts +58 -0
- package/dist/hooks/useKeyframes.js +54 -0
- package/dist/hooks/useKeyframes.js.map +1 -0
- package/dist/hooks/useProperty.d.ts +81 -0
- package/dist/hooks/useProperty.js +96 -0
- package/dist/hooks/useProperty.js.map +1 -0
- package/dist/hooks/useRawCSS.d.ts +22 -0
- package/dist/hooks/useRawCSS.js +103 -0
- package/dist/hooks/useRawCSS.js.map +1 -0
- package/dist/hooks/useStyles.d.ts +40 -0
- package/dist/hooks/useStyles.js +31 -0
- package/dist/hooks/useStyles.js.map +1 -0
- package/dist/index.d.ts +51 -0
- package/dist/index.js +36 -0
- package/dist/injector/index.d.ts +182 -0
- package/dist/injector/index.js +185 -0
- package/dist/injector/index.js.map +1 -0
- package/dist/injector/injector.d.ts +193 -0
- package/dist/injector/injector.js +564 -0
- package/dist/injector/injector.js.map +1 -0
- package/dist/injector/sheet-manager.d.ts +132 -0
- package/dist/injector/sheet-manager.js +698 -0
- package/dist/injector/sheet-manager.js.map +1 -0
- package/dist/injector/types.d.ts +228 -0
- package/dist/keyframes/index.js +206 -0
- package/dist/keyframes/index.js.map +1 -0
- package/dist/parser/classify.js +319 -0
- package/dist/parser/classify.js.map +1 -0
- package/dist/parser/const.js +60 -0
- package/dist/parser/const.js.map +1 -0
- package/dist/parser/lru.js +109 -0
- package/dist/parser/lru.js.map +1 -0
- package/dist/parser/parser.d.ts +25 -0
- package/dist/parser/parser.js +115 -0
- package/dist/parser/parser.js.map +1 -0
- package/dist/parser/tokenizer.js +69 -0
- package/dist/parser/tokenizer.js.map +1 -0
- package/dist/parser/types.d.ts +51 -0
- package/dist/parser/types.js +46 -0
- package/dist/parser/types.js.map +1 -0
- package/dist/pipeline/conditions.d.ts +134 -0
- package/dist/pipeline/conditions.js +406 -0
- package/dist/pipeline/conditions.js.map +1 -0
- package/dist/pipeline/exclusive.js +230 -0
- package/dist/pipeline/exclusive.js.map +1 -0
- package/dist/pipeline/index.d.ts +55 -0
- package/dist/pipeline/index.js +708 -0
- package/dist/pipeline/index.js.map +1 -0
- package/dist/pipeline/materialize.js +1103 -0
- package/dist/pipeline/materialize.js.map +1 -0
- package/dist/pipeline/parseStateKey.d.ts +15 -0
- package/dist/pipeline/parseStateKey.js +446 -0
- package/dist/pipeline/parseStateKey.js.map +1 -0
- package/dist/pipeline/simplify.js +515 -0
- package/dist/pipeline/simplify.js.map +1 -0
- package/dist/pipeline/warnings.js +18 -0
- package/dist/pipeline/warnings.js.map +1 -0
- package/dist/plugins/index.d.ts +2 -0
- package/dist/plugins/okhsl-plugin.d.ts +35 -0
- package/dist/plugins/okhsl-plugin.js +97 -0
- package/dist/plugins/okhsl-plugin.js.map +1 -0
- package/dist/plugins/types.d.ts +87 -0
- package/dist/properties/index.js +222 -0
- package/dist/properties/index.js.map +1 -0
- 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 +81 -0
- package/dist/rsc-cache.js.map +1 -0
- package/dist/ssr/astro-client.d.ts +1 -0
- package/dist/ssr/astro-client.js +24 -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 +106 -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 +102 -0
- package/dist/ssr/collector.js +227 -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 +22 -0
- package/dist/ssr/hydrate.js +49 -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 +45 -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.d.ts +49 -0
- package/dist/states/index.js +170 -0
- package/dist/states/index.js.map +1 -0
- package/dist/static/index.d.ts +5 -0
- package/dist/static/index.js +4 -0
- 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.d.ts +46 -0
- package/dist/static/tastyStatic.js +30 -0
- package/dist/static/tastyStatic.js.map +1 -0
- package/dist/static/types.d.ts +49 -0
- package/dist/static/types.js +24 -0
- package/dist/static/types.js.map +1 -0
- package/dist/styles/border.d.ts +25 -0
- package/dist/styles/border.js +120 -0
- package/dist/styles/border.js.map +1 -0
- package/dist/styles/color.d.ts +14 -0
- package/dist/styles/color.js +26 -0
- package/dist/styles/color.js.map +1 -0
- package/dist/styles/const.js +17 -0
- package/dist/styles/const.js.map +1 -0
- package/dist/styles/createStyle.js +79 -0
- package/dist/styles/createStyle.js.map +1 -0
- package/dist/styles/dimension.js +109 -0
- package/dist/styles/dimension.js.map +1 -0
- package/dist/styles/directional.js +133 -0
- package/dist/styles/directional.js.map +1 -0
- package/dist/styles/display.d.ts +30 -0
- package/dist/styles/display.js +73 -0
- package/dist/styles/display.js.map +1 -0
- package/dist/styles/fade.d.ts +15 -0
- package/dist/styles/fade.js +62 -0
- package/dist/styles/fade.js.map +1 -0
- package/dist/styles/fill.d.ts +42 -0
- package/dist/styles/fill.js +51 -0
- package/dist/styles/fill.js.map +1 -0
- package/dist/styles/flow.d.ts +16 -0
- package/dist/styles/flow.js +12 -0
- package/dist/styles/flow.js.map +1 -0
- package/dist/styles/gap.d.ts +31 -0
- package/dist/styles/gap.js +38 -0
- package/dist/styles/gap.js.map +1 -0
- package/dist/styles/height.d.ts +17 -0
- package/dist/styles/height.js +19 -0
- package/dist/styles/height.js.map +1 -0
- package/dist/styles/index.d.ts +1 -0
- package/dist/styles/index.js +8 -0
- package/dist/styles/index.js.map +1 -0
- package/dist/styles/inset.d.ts +24 -0
- package/dist/styles/inset.js +34 -0
- package/dist/styles/inset.js.map +1 -0
- package/dist/styles/list.d.ts +16 -0
- package/dist/styles/list.js +100 -0
- package/dist/styles/list.js.map +1 -0
- package/dist/styles/margin.d.ts +24 -0
- package/dist/styles/margin.js +32 -0
- package/dist/styles/margin.js.map +1 -0
- package/dist/styles/outline.d.ts +29 -0
- package/dist/styles/outline.js +55 -0
- package/dist/styles/outline.js.map +1 -0
- package/dist/styles/padding.d.ts +24 -0
- package/dist/styles/padding.js +32 -0
- package/dist/styles/padding.js.map +1 -0
- 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 +71 -0
- package/dist/styles/predefined.js +237 -0
- package/dist/styles/predefined.js.map +1 -0
- package/dist/styles/preset.d.ts +52 -0
- package/dist/styles/preset.js +127 -0
- package/dist/styles/preset.js.map +1 -0
- package/dist/styles/radius.d.ts +12 -0
- package/dist/styles/radius.js +83 -0
- package/dist/styles/radius.js.map +1 -0
- 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 +25 -0
- package/dist/styles/scrollbar.js +51 -0
- package/dist/styles/scrollbar.js.map +1 -0
- package/dist/styles/shadow.d.ts +14 -0
- package/dist/styles/shadow.js +25 -0
- package/dist/styles/shadow.js.map +1 -0
- package/dist/styles/shared.js +17 -0
- package/dist/styles/shared.js.map +1 -0
- package/dist/styles/transition.d.ts +14 -0
- package/dist/styles/transition.js +159 -0
- package/dist/styles/transition.js.map +1 -0
- package/dist/styles/types.d.ts +564 -0
- package/dist/styles/width.d.ts +17 -0
- package/dist/styles/width.js +19 -0
- package/dist/styles/width.js.map +1 -0
- package/dist/tasty.d.ts +134 -0
- package/dist/tasty.js +243 -0
- package/dist/tasty.js.map +1 -0
- package/dist/types.d.ts +184 -0
- package/dist/utils/cache-wrapper.js +21 -0
- package/dist/utils/cache-wrapper.js.map +1 -0
- package/dist/utils/case-converter.js +8 -0
- package/dist/utils/case-converter.js.map +1 -0
- 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.d.ts +5 -0
- package/dist/utils/colors.js +10 -0
- package/dist/utils/colors.js.map +1 -0
- package/dist/utils/css-types.d.ts +7 -0
- package/dist/utils/deps-equal.js +15 -0
- package/dist/utils/deps-equal.js.map +1 -0
- package/dist/utils/dotize.d.ts +26 -0
- package/dist/utils/dotize.js +122 -0
- package/dist/utils/dotize.js.map +1 -0
- package/dist/utils/filter-base-props.d.ts +15 -0
- package/dist/utils/filter-base-props.js +45 -0
- package/dist/utils/filter-base-props.js.map +1 -0
- package/dist/utils/get-display-name.d.ts +7 -0
- package/dist/utils/get-display-name.js +10 -0
- package/dist/utils/get-display-name.js.map +1 -0
- 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 +19 -0
- package/dist/utils/is-dev-env.js.map +1 -0
- package/dist/utils/is-valid-element-type.js +15 -0
- package/dist/utils/is-valid-element-type.js.map +1 -0
- package/dist/utils/merge-styles.d.ts +7 -0
- package/dist/utils/merge-styles.js +145 -0
- package/dist/utils/merge-styles.js.map +1 -0
- package/dist/utils/mod-attrs.d.ts +6 -0
- package/dist/utils/mod-attrs.js +20 -0
- package/dist/utils/mod-attrs.js.map +1 -0
- package/dist/utils/process-tokens.d.ts +17 -0
- package/dist/utils/process-tokens.js +83 -0
- package/dist/utils/process-tokens.js.map +1 -0
- package/dist/utils/resolve-recipes.d.ts +17 -0
- package/dist/utils/resolve-recipes.js +146 -0
- package/dist/utils/resolve-recipes.js.map +1 -0
- package/dist/utils/selector-transform.js +32 -0
- package/dist/utils/selector-transform.js.map +1 -0
- package/dist/utils/string.js +8 -0
- package/dist/utils/string.js.map +1 -0
- package/dist/utils/styles.d.ts +99 -0
- package/dist/utils/styles.js +220 -0
- package/dist/utils/styles.js.map +1 -0
- package/dist/utils/typography.d.ts +58 -0
- package/dist/utils/typography.js +51 -0
- package/dist/utils/typography.js.map +1 -0
- package/dist/utils/warnings.d.ts +16 -0
- package/dist/utils/warnings.js +16 -0
- package/dist/utils/warnings.js.map +1 -0
- package/dist/zero/babel.d.ts +195 -0
- package/dist/zero/babel.js +456 -0
- package/dist/zero/babel.js.map +1 -0
- package/dist/zero/css-writer.d.ts +45 -0
- package/dist/zero/css-writer.js +73 -0
- package/dist/zero/css-writer.js.map +1 -0
- package/dist/zero/extractor.d.ts +24 -0
- package/dist/zero/extractor.js +266 -0
- package/dist/zero/extractor.js.map +1 -0
- package/dist/zero/index.d.ts +3 -0
- package/dist/zero/index.js +3 -0
- package/dist/zero/next.d.ts +86 -0
- package/dist/zero/next.js +143 -0
- package/dist/zero/next.js.map +1 -0
- package/docs/PIPELINE.md +519 -0
- package/docs/README.md +31 -0
- package/docs/adoption.md +298 -0
- package/docs/comparison.md +419 -0
- package/docs/configuration.md +389 -0
- package/docs/debug.md +318 -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/react-api.md +557 -0
- package/docs/ssr.md +440 -0
- package/docs/styles.md +596 -0
- package/docs/tasty-static.md +532 -0
- package/package.json +221 -0
- package/tasty.config.ts +14 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "./createStyle.js";
|
|
2
|
+
import { predefine } from "./predefined.js";
|
|
3
|
+
//#region src/styles/index.ts
|
|
4
|
+
const { STYLE_HANDLER_MAP, defineCustomStyle, defineStyleAlias } = predefine();
|
|
5
|
+
//#endregion
|
|
6
|
+
export { STYLE_HANDLER_MAP };
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/styles/index.ts"],"sourcesContent":["import { predefine, styleHandlers } from './predefined';\n\nconst { STYLE_HANDLER_MAP, defineCustomStyle, defineStyleAlias } = predefine();\n\nexport {\n STYLE_HANDLER_MAP,\n defineCustomStyle,\n defineStyleAlias,\n styleHandlers,\n};\nexport * from './createStyle';\nexport {\n normalizeHandlerDefinition,\n registerHandler,\n resetHandlers,\n validateHandlerResult,\n} from './predefined';\n"],"mappings":";;;AAEA,MAAM,EAAE,mBAAmB,mBAAmB,qBAAqB,WAAW"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region src/styles/inset.d.ts
|
|
2
|
+
declare function insetStyle({
|
|
3
|
+
inset,
|
|
4
|
+
insetBlock,
|
|
5
|
+
insetInline,
|
|
6
|
+
top,
|
|
7
|
+
right,
|
|
8
|
+
bottom,
|
|
9
|
+
left
|
|
10
|
+
}: {
|
|
11
|
+
inset?: string | number | boolean;
|
|
12
|
+
insetBlock?: string | number | boolean;
|
|
13
|
+
insetInline?: string | number | boolean;
|
|
14
|
+
top?: string | number | boolean;
|
|
15
|
+
right?: string | number | boolean;
|
|
16
|
+
bottom?: string | number | boolean;
|
|
17
|
+
left?: string | number | boolean;
|
|
18
|
+
}): Record<string, string> | null;
|
|
19
|
+
declare namespace insetStyle {
|
|
20
|
+
var __lookupStyles: string[];
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { insetStyle };
|
|
24
|
+
//# sourceMappingURL=inset.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { processDirectionalStyle } from "./directional.js";
|
|
2
|
+
//#region src/styles/inset.ts
|
|
3
|
+
const INSET_CONFIG = {
|
|
4
|
+
property: "inset",
|
|
5
|
+
defaultValue: "0",
|
|
6
|
+
trueValue: "0",
|
|
7
|
+
defaultInit: "auto",
|
|
8
|
+
individualOnly: true,
|
|
9
|
+
directionProperty: (dir) => dir
|
|
10
|
+
};
|
|
11
|
+
function insetStyle({ inset, insetBlock, insetInline, top, right, bottom, left }) {
|
|
12
|
+
return processDirectionalStyle(INSET_CONFIG, {
|
|
13
|
+
main: inset,
|
|
14
|
+
block: insetBlock,
|
|
15
|
+
inline: insetInline,
|
|
16
|
+
top,
|
|
17
|
+
right,
|
|
18
|
+
bottom,
|
|
19
|
+
left
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
insetStyle.__lookupStyles = [
|
|
23
|
+
"inset",
|
|
24
|
+
"insetBlock",
|
|
25
|
+
"insetInline",
|
|
26
|
+
"top",
|
|
27
|
+
"right",
|
|
28
|
+
"bottom",
|
|
29
|
+
"left"
|
|
30
|
+
];
|
|
31
|
+
//#endregion
|
|
32
|
+
export { insetStyle };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=inset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inset.js","names":[],"sources":["../../src/styles/inset.ts"],"sourcesContent":["import { type DirectionalConfig, processDirectionalStyle } from './directional';\n\nconst INSET_CONFIG: DirectionalConfig = {\n property: 'inset',\n defaultValue: '0',\n trueValue: '0',\n defaultInit: 'auto',\n individualOnly: true,\n directionProperty: (dir) => dir,\n};\n\nexport function insetStyle({\n inset,\n insetBlock,\n insetInline,\n top,\n right,\n bottom,\n left,\n}: {\n inset?: string | number | boolean;\n insetBlock?: string | number | boolean;\n insetInline?: string | number | boolean;\n top?: string | number | boolean;\n right?: string | number | boolean;\n bottom?: string | number | boolean;\n left?: string | number | boolean;\n}) {\n return processDirectionalStyle(INSET_CONFIG, {\n main: inset,\n block: insetBlock,\n inline: insetInline,\n top,\n right,\n bottom,\n left,\n });\n}\n\ninsetStyle.__lookupStyles = [\n 'inset',\n 'insetBlock',\n 'insetInline',\n 'top',\n 'right',\n 'bottom',\n 'left',\n];\n"],"mappings":";;AAEA,MAAM,eAAkC;CACtC,UAAU;CACV,cAAc;CACd,WAAW;CACX,aAAa;CACb,gBAAgB;CAChB,oBAAoB,QAAQ;CAC7B;AAED,SAAgB,WAAW,EACzB,OACA,YACA,aACA,KACA,OACA,QACA,QASC;AACD,QAAO,wBAAwB,cAAc;EAC3C,MAAM;EACN,OAAO;EACP,QAAQ;EACR;EACA;EACA;EACA;EACD,CAAC;;AAGJ,WAAW,iBAAiB;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/styles/list.d.ts
|
|
2
|
+
declare const BASE_STYLES: readonly ["display", "font", "preset", "hide", "whiteSpace", "opacity", "transition"];
|
|
3
|
+
declare const POSITION_STYLES: readonly ["gridArea", "order", "gridColumn", "gridRow", "placeSelf", "alignSelf", "justifySelf", "zIndex", "margin", "inset", "position", "scrollMargin"];
|
|
4
|
+
declare const BLOCK_INNER_STYLES: readonly ["padding", "paddingInline", "paddingBlock", "overflow", "scrollbar", "textAlign"];
|
|
5
|
+
declare const BLOCK_OUTER_STYLES: readonly ["border", "radius", "shadow", "outline"];
|
|
6
|
+
declare const BLOCK_STYLES: readonly ["padding", "paddingInline", "paddingBlock", "overflow", "scrollbar", "textAlign", "border", "radius", "shadow", "outline"];
|
|
7
|
+
declare const COLOR_STYLES: readonly ["color", "fill", "fade", "image"];
|
|
8
|
+
declare const TEXT_STYLES: readonly ["textTransform", "fontWeight", "fontStyle"];
|
|
9
|
+
declare const DIMENSION_STYLES: readonly ["width", "height", "flexBasis", "flexGrow", "flexShrink", "flex"];
|
|
10
|
+
declare const FLOW_STYLES: readonly ["flow", "place", "placeItems", "placeContent", "alignItems", "alignContent", "justifyItems", "justifyContent", "align", "justify", "gap", "columnGap", "rowGap", "gridColumns", "gridRows", "gridTemplate", "gridAreas"];
|
|
11
|
+
declare const CONTAINER_STYLES: readonly ["display", "font", "preset", "hide", "whiteSpace", "opacity", "transition", "color", "fill", "fade", "image", "width", "height", "flexBasis", "flexGrow", "flexShrink", "flex", "gridArea", "order", "gridColumn", "gridRow", "placeSelf", "alignSelf", "justifySelf", "zIndex", "margin", "inset", "position", "scrollMargin", "padding", "paddingInline", "paddingBlock", "overflow", "scrollbar", "textAlign", "border", "radius", "shadow", "outline", "flow", "place", "placeItems", "placeContent", "alignItems", "alignContent", "justifyItems", "justifyContent", "align", "justify", "gap", "columnGap", "rowGap", "gridColumns", "gridRows", "gridTemplate", "gridAreas"];
|
|
12
|
+
declare const OUTER_STYLES: readonly ["gridArea", "order", "gridColumn", "gridRow", "placeSelf", "alignSelf", "justifySelf", "zIndex", "margin", "inset", "position", "scrollMargin", "width", "height", "flexBasis", "flexGrow", "flexShrink", "flex", "border", "radius", "shadow", "outline"];
|
|
13
|
+
declare const INNER_STYLES: readonly ["display", "font", "preset", "hide", "whiteSpace", "opacity", "transition", "color", "fill", "fade", "image", "padding", "paddingInline", "paddingBlock", "overflow", "scrollbar", "textAlign", "flow", "place", "placeItems", "placeContent", "alignItems", "alignContent", "justifyItems", "justifyContent", "align", "justify", "gap", "columnGap", "rowGap", "gridColumns", "gridRows", "gridTemplate", "gridAreas"];
|
|
14
|
+
//#endregion
|
|
15
|
+
export { BASE_STYLES, BLOCK_INNER_STYLES, BLOCK_OUTER_STYLES, BLOCK_STYLES, COLOR_STYLES, CONTAINER_STYLES, DIMENSION_STYLES, FLOW_STYLES, INNER_STYLES, OUTER_STYLES, POSITION_STYLES, TEXT_STYLES };
|
|
16
|
+
//# sourceMappingURL=list.d.ts.map
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
//#region src/styles/list.ts
|
|
2
|
+
const BASE_STYLES = [
|
|
3
|
+
"display",
|
|
4
|
+
"font",
|
|
5
|
+
"preset",
|
|
6
|
+
"hide",
|
|
7
|
+
"whiteSpace",
|
|
8
|
+
"opacity",
|
|
9
|
+
"transition"
|
|
10
|
+
];
|
|
11
|
+
const POSITION_STYLES = [
|
|
12
|
+
"gridArea",
|
|
13
|
+
"order",
|
|
14
|
+
"gridColumn",
|
|
15
|
+
"gridRow",
|
|
16
|
+
"placeSelf",
|
|
17
|
+
"alignSelf",
|
|
18
|
+
"justifySelf",
|
|
19
|
+
"zIndex",
|
|
20
|
+
"margin",
|
|
21
|
+
"inset",
|
|
22
|
+
"position",
|
|
23
|
+
"scrollMargin"
|
|
24
|
+
];
|
|
25
|
+
const BLOCK_INNER_STYLES = [
|
|
26
|
+
"padding",
|
|
27
|
+
"paddingInline",
|
|
28
|
+
"paddingBlock",
|
|
29
|
+
"overflow",
|
|
30
|
+
"scrollbar",
|
|
31
|
+
"textAlign"
|
|
32
|
+
];
|
|
33
|
+
const BLOCK_OUTER_STYLES = [
|
|
34
|
+
"border",
|
|
35
|
+
"radius",
|
|
36
|
+
"shadow",
|
|
37
|
+
"outline"
|
|
38
|
+
];
|
|
39
|
+
const BLOCK_STYLES = [...BLOCK_INNER_STYLES, ...BLOCK_OUTER_STYLES];
|
|
40
|
+
const COLOR_STYLES = [
|
|
41
|
+
"color",
|
|
42
|
+
"fill",
|
|
43
|
+
"fade",
|
|
44
|
+
"image"
|
|
45
|
+
];
|
|
46
|
+
const TEXT_STYLES = [
|
|
47
|
+
"textTransform",
|
|
48
|
+
"fontWeight",
|
|
49
|
+
"fontStyle"
|
|
50
|
+
];
|
|
51
|
+
const DIMENSION_STYLES = [
|
|
52
|
+
"width",
|
|
53
|
+
"height",
|
|
54
|
+
"flexBasis",
|
|
55
|
+
"flexGrow",
|
|
56
|
+
"flexShrink",
|
|
57
|
+
"flex"
|
|
58
|
+
];
|
|
59
|
+
const FLOW_STYLES = [
|
|
60
|
+
"flow",
|
|
61
|
+
"place",
|
|
62
|
+
"placeItems",
|
|
63
|
+
"placeContent",
|
|
64
|
+
"alignItems",
|
|
65
|
+
"alignContent",
|
|
66
|
+
"justifyItems",
|
|
67
|
+
"justifyContent",
|
|
68
|
+
"align",
|
|
69
|
+
"justify",
|
|
70
|
+
"gap",
|
|
71
|
+
"columnGap",
|
|
72
|
+
"rowGap",
|
|
73
|
+
"gridColumns",
|
|
74
|
+
"gridRows",
|
|
75
|
+
"gridTemplate",
|
|
76
|
+
"gridAreas"
|
|
77
|
+
];
|
|
78
|
+
const CONTAINER_STYLES = [
|
|
79
|
+
...BASE_STYLES,
|
|
80
|
+
...COLOR_STYLES,
|
|
81
|
+
...DIMENSION_STYLES,
|
|
82
|
+
...POSITION_STYLES,
|
|
83
|
+
...BLOCK_STYLES,
|
|
84
|
+
...FLOW_STYLES
|
|
85
|
+
];
|
|
86
|
+
const OUTER_STYLES = [
|
|
87
|
+
...POSITION_STYLES,
|
|
88
|
+
...DIMENSION_STYLES,
|
|
89
|
+
...BLOCK_OUTER_STYLES
|
|
90
|
+
];
|
|
91
|
+
const INNER_STYLES = [
|
|
92
|
+
...BASE_STYLES,
|
|
93
|
+
...COLOR_STYLES,
|
|
94
|
+
...BLOCK_INNER_STYLES,
|
|
95
|
+
...FLOW_STYLES
|
|
96
|
+
];
|
|
97
|
+
//#endregion
|
|
98
|
+
export { BASE_STYLES, BLOCK_INNER_STYLES, BLOCK_OUTER_STYLES, BLOCK_STYLES, COLOR_STYLES, CONTAINER_STYLES, DIMENSION_STYLES, FLOW_STYLES, INNER_STYLES, OUTER_STYLES, POSITION_STYLES, TEXT_STYLES };
|
|
99
|
+
|
|
100
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","names":[],"sources":["../../src/styles/list.ts"],"sourcesContent":["export const BASE_STYLES = [\n 'display',\n 'font',\n 'preset',\n 'hide',\n 'whiteSpace',\n 'opacity',\n 'transition',\n] as const;\n\nexport const POSITION_STYLES = [\n 'gridArea',\n 'order',\n 'gridColumn',\n 'gridRow',\n 'placeSelf',\n 'alignSelf',\n 'justifySelf',\n 'zIndex',\n 'margin',\n 'inset',\n 'position',\n 'scrollMargin',\n] as const;\n\nexport const BLOCK_INNER_STYLES = [\n 'padding',\n 'paddingInline',\n 'paddingBlock',\n 'overflow',\n 'scrollbar',\n 'textAlign',\n] as const;\n\nexport const BLOCK_OUTER_STYLES = [\n 'border',\n 'radius',\n 'shadow',\n 'outline',\n] as const;\n\nexport const BLOCK_STYLES = [\n ...BLOCK_INNER_STYLES,\n ...BLOCK_OUTER_STYLES,\n] as const;\n\nexport const COLOR_STYLES = ['color', 'fill', 'fade', 'image'] as const;\n\nexport const TEXT_STYLES = [\n 'textTransform',\n 'fontWeight',\n 'fontStyle',\n] as const;\n\nexport const DIMENSION_STYLES = [\n 'width',\n 'height',\n 'flexBasis',\n 'flexGrow',\n 'flexShrink',\n 'flex',\n] as const;\n\nexport const FLOW_STYLES = [\n 'flow',\n 'place',\n 'placeItems',\n 'placeContent',\n 'alignItems',\n 'alignContent',\n 'justifyItems',\n 'justifyContent',\n 'align',\n 'justify',\n 'gap',\n 'columnGap',\n 'rowGap',\n 'gridColumns',\n 'gridRows',\n 'gridTemplate',\n 'gridAreas',\n] as const;\n\nexport const CONTAINER_STYLES = [\n ...BASE_STYLES,\n ...COLOR_STYLES,\n ...DIMENSION_STYLES,\n ...POSITION_STYLES,\n ...BLOCK_STYLES,\n ...FLOW_STYLES,\n] as const;\n\nexport const OUTER_STYLES = [\n ...POSITION_STYLES,\n ...DIMENSION_STYLES,\n ...BLOCK_OUTER_STYLES,\n] as const;\n\nexport const INNER_STYLES = [\n ...BASE_STYLES,\n ...COLOR_STYLES,\n ...BLOCK_INNER_STYLES,\n ...FLOW_STYLES,\n] as const;\n"],"mappings":";AAAA,MAAa,cAAc;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAa,kBAAkB;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAa,qBAAqB;CAChC;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAa,qBAAqB;CAChC;CACA;CACA;CACA;CACD;AAED,MAAa,eAAe,CAC1B,GAAG,oBACH,GAAG,mBACJ;AAED,MAAa,eAAe;CAAC;CAAS;CAAQ;CAAQ;CAAQ;AAE9D,MAAa,cAAc;CACzB;CACA;CACA;CACD;AAED,MAAa,mBAAmB;CAC9B;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAa,cAAc;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAa,mBAAmB;CAC9B,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACJ;AAED,MAAa,eAAe;CAC1B,GAAG;CACH,GAAG;CACH,GAAG;CACJ;AAED,MAAa,eAAe;CAC1B,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACJ"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region src/styles/margin.d.ts
|
|
2
|
+
declare function marginStyle({
|
|
3
|
+
margin,
|
|
4
|
+
marginBlock,
|
|
5
|
+
marginInline,
|
|
6
|
+
marginTop,
|
|
7
|
+
marginRight,
|
|
8
|
+
marginBottom,
|
|
9
|
+
marginLeft
|
|
10
|
+
}: {
|
|
11
|
+
margin?: string | number | boolean;
|
|
12
|
+
marginBlock?: string | number | boolean;
|
|
13
|
+
marginInline?: string | number | boolean;
|
|
14
|
+
marginTop?: string | number | boolean;
|
|
15
|
+
marginRight?: string | number | boolean;
|
|
16
|
+
marginBottom?: string | number | boolean;
|
|
17
|
+
marginLeft?: string | number | boolean;
|
|
18
|
+
}): Record<string, string> | null;
|
|
19
|
+
declare namespace marginStyle {
|
|
20
|
+
var __lookupStyles: string[];
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { marginStyle };
|
|
24
|
+
//# sourceMappingURL=margin.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { processDirectionalStyle } from "./directional.js";
|
|
2
|
+
//#region src/styles/margin.ts
|
|
3
|
+
const MARGIN_CONFIG = {
|
|
4
|
+
property: "margin",
|
|
5
|
+
defaultValue: "var(--gap)",
|
|
6
|
+
trueValue: "1x",
|
|
7
|
+
defaultInit: "0"
|
|
8
|
+
};
|
|
9
|
+
function marginStyle({ margin, marginBlock, marginInline, marginTop, marginRight, marginBottom, marginLeft }) {
|
|
10
|
+
return processDirectionalStyle(MARGIN_CONFIG, {
|
|
11
|
+
main: margin,
|
|
12
|
+
block: marginBlock,
|
|
13
|
+
inline: marginInline,
|
|
14
|
+
top: marginTop,
|
|
15
|
+
right: marginRight,
|
|
16
|
+
bottom: marginBottom,
|
|
17
|
+
left: marginLeft
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
marginStyle.__lookupStyles = [
|
|
21
|
+
"margin",
|
|
22
|
+
"marginTop",
|
|
23
|
+
"marginRight",
|
|
24
|
+
"marginBottom",
|
|
25
|
+
"marginLeft",
|
|
26
|
+
"marginBlock",
|
|
27
|
+
"marginInline"
|
|
28
|
+
];
|
|
29
|
+
//#endregion
|
|
30
|
+
export { marginStyle };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=margin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"margin.js","names":[],"sources":["../../src/styles/margin.ts"],"sourcesContent":["import { processDirectionalStyle } from './directional';\n\nconst MARGIN_CONFIG = {\n property: 'margin',\n defaultValue: 'var(--gap)',\n trueValue: '1x',\n defaultInit: '0',\n} as const;\n\nexport function marginStyle({\n margin,\n marginBlock,\n marginInline,\n marginTop,\n marginRight,\n marginBottom,\n marginLeft,\n}: {\n margin?: string | number | boolean;\n marginBlock?: string | number | boolean;\n marginInline?: string | number | boolean;\n marginTop?: string | number | boolean;\n marginRight?: string | number | boolean;\n marginBottom?: string | number | boolean;\n marginLeft?: string | number | boolean;\n}) {\n return processDirectionalStyle(MARGIN_CONFIG, {\n main: margin,\n block: marginBlock,\n inline: marginInline,\n top: marginTop,\n right: marginRight,\n bottom: marginBottom,\n left: marginLeft,\n });\n}\n\nmarginStyle.__lookupStyles = [\n 'margin',\n 'marginTop',\n 'marginRight',\n 'marginBottom',\n 'marginLeft',\n 'marginBlock',\n 'marginInline',\n];\n"],"mappings":";;AAEA,MAAM,gBAAgB;CACpB,UAAU;CACV,cAAc;CACd,WAAW;CACX,aAAa;CACd;AAED,SAAgB,YAAY,EAC1B,QACA,aACA,cACA,WACA,aACA,cACA,cASC;AACD,QAAO,wBAAwB,eAAe;EAC5C,MAAM;EACN,OAAO;EACP,QAAQ;EACR,KAAK;EACL,OAAO;EACP,QAAQ;EACR,MAAM;EACP,CAAC;;AAGJ,YAAY,iBAAiB;CAC3B;CACA;CACA;CACA;CACA;CACA;CACA;CACD"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//#region src/styles/outline.d.ts
|
|
2
|
+
interface OutlineStyleProps {
|
|
3
|
+
outline?: string | boolean | number;
|
|
4
|
+
outlineOffset?: string | number;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Generates CSS for outline property with optional offset.
|
|
8
|
+
*
|
|
9
|
+
* Syntax:
|
|
10
|
+
* - `outline="2px solid #red"` - outline only
|
|
11
|
+
* - `outline="2px solid #red / 4px"` - outline with offset (slash separator)
|
|
12
|
+
* - `outline="2px / 4px"` - width with offset (simpler form)
|
|
13
|
+
* - `outline={true}` - default 1ow solid outline
|
|
14
|
+
* - `outlineOffset="4px"` - offset as separate prop (can be combined with outline)
|
|
15
|
+
*
|
|
16
|
+
* Priority: slash syntax in outline takes precedence over outlineOffset prop
|
|
17
|
+
*
|
|
18
|
+
* @return CSS properties for outline and optionally outline-offset
|
|
19
|
+
*/
|
|
20
|
+
declare function outlineStyle({
|
|
21
|
+
outline,
|
|
22
|
+
outlineOffset
|
|
23
|
+
}: OutlineStyleProps): Record<string, string> | null;
|
|
24
|
+
declare namespace outlineStyle {
|
|
25
|
+
var __lookupStyles: string[];
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { outlineStyle };
|
|
29
|
+
//# sourceMappingURL=outline.d.ts.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { CSS_WIDE_KEYWORDS } from "../parser/const.js";
|
|
2
|
+
import { filterMods, parseStyle } from "../utils/styles.js";
|
|
3
|
+
import { BORDER_STYLES } from "./const.js";
|
|
4
|
+
//#region src/styles/outline.ts
|
|
5
|
+
/**
|
|
6
|
+
* Generates CSS for outline property with optional offset.
|
|
7
|
+
*
|
|
8
|
+
* Syntax:
|
|
9
|
+
* - `outline="2px solid #red"` - outline only
|
|
10
|
+
* - `outline="2px solid #red / 4px"` - outline with offset (slash separator)
|
|
11
|
+
* - `outline="2px / 4px"` - width with offset (simpler form)
|
|
12
|
+
* - `outline={true}` - default 1ow solid outline
|
|
13
|
+
* - `outlineOffset="4px"` - offset as separate prop (can be combined with outline)
|
|
14
|
+
*
|
|
15
|
+
* Priority: slash syntax in outline takes precedence over outlineOffset prop
|
|
16
|
+
*
|
|
17
|
+
* @return CSS properties for outline and optionally outline-offset
|
|
18
|
+
*/
|
|
19
|
+
function outlineStyle({ outline, outlineOffset }) {
|
|
20
|
+
const result = {};
|
|
21
|
+
if (outline != null && outline !== false) if (typeof outline === "string" && CSS_WIDE_KEYWORDS.has(outline)) result["outline"] = outline;
|
|
22
|
+
else {
|
|
23
|
+
let outlineValue = outline;
|
|
24
|
+
if (outline === true) outlineValue = "1ow";
|
|
25
|
+
if (outline === 0) outlineValue = "0";
|
|
26
|
+
const group = parseStyle(String(outlineValue)).groups[0];
|
|
27
|
+
if (group) {
|
|
28
|
+
const { parts } = group;
|
|
29
|
+
const outlinePart = parts[0] ?? {
|
|
30
|
+
values: [],
|
|
31
|
+
mods: [],
|
|
32
|
+
colors: []
|
|
33
|
+
};
|
|
34
|
+
const offsetPart = parts[1];
|
|
35
|
+
const typeMods = filterMods(outlinePart.mods, BORDER_STYLES);
|
|
36
|
+
result["outline"] = [
|
|
37
|
+
outlinePart.values[0] || "var(--outline-width)",
|
|
38
|
+
typeMods[0] || "solid",
|
|
39
|
+
outlinePart.colors[0] || "var(--outline-color)"
|
|
40
|
+
].join(" ");
|
|
41
|
+
if (offsetPart?.values[0]) result["outline-offset"] = offsetPart.values[0];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (outlineOffset != null && !result["outline-offset"]) {
|
|
45
|
+
const offsetValue = typeof outlineOffset === "number" ? `${outlineOffset}px` : outlineOffset;
|
|
46
|
+
result["outline-offset"] = parseStyle(offsetValue).groups[0]?.values[0] || offsetValue;
|
|
47
|
+
}
|
|
48
|
+
if (Object.keys(result).length === 0) return null;
|
|
49
|
+
return result;
|
|
50
|
+
}
|
|
51
|
+
outlineStyle.__lookupStyles = ["outline", "outlineOffset"];
|
|
52
|
+
//#endregion
|
|
53
|
+
export { outlineStyle };
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=outline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outline.js","names":[],"sources":["../../src/styles/outline.ts"],"sourcesContent":["import { CSS_WIDE_KEYWORDS } from '../parser/const';\nimport { filterMods, parseStyle } from '../utils/styles';\nimport { BORDER_STYLES } from './const';\n\ninterface OutlineStyleProps {\n outline?: string | boolean | number;\n outlineOffset?: string | number;\n}\n\n/**\n * Generates CSS for outline property with optional offset.\n *\n * Syntax:\n * - `outline=\"2px solid #red\"` - outline only\n * - `outline=\"2px solid #red / 4px\"` - outline with offset (slash separator)\n * - `outline=\"2px / 4px\"` - width with offset (simpler form)\n * - `outline={true}` - default 1ow solid outline\n * - `outlineOffset=\"4px\"` - offset as separate prop (can be combined with outline)\n *\n * Priority: slash syntax in outline takes precedence over outlineOffset prop\n *\n * @return CSS properties for outline and optionally outline-offset\n */\nexport function outlineStyle({ outline, outlineOffset }: OutlineStyleProps) {\n const result: Record<string, string> = {};\n\n // Handle outline (0 is valid - means no outline)\n if (outline != null && outline !== false) {\n if (typeof outline === 'string' && CSS_WIDE_KEYWORDS.has(outline)) {\n result['outline'] = outline;\n } else {\n let outlineValue: string | boolean | number = outline;\n if (outline === true) outlineValue = '1ow';\n if (outline === 0) outlineValue = '0';\n\n const processed = parseStyle(String(outlineValue));\n const group = processed.groups[0];\n\n if (group) {\n const { parts } = group;\n const outlinePart = parts[0] ?? { values: [], mods: [], colors: [] };\n const offsetPart = parts[1];\n\n const typeMods = filterMods(\n outlinePart.mods,\n BORDER_STYLES as unknown as string[],\n );\n\n const value = outlinePart.values[0] || 'var(--outline-width)';\n const type = typeMods[0] || 'solid';\n const outlineColor = outlinePart.colors[0] || 'var(--outline-color)';\n\n result['outline'] = [value, type, outlineColor].join(' ');\n\n if (offsetPart?.values[0]) {\n result['outline-offset'] = offsetPart.values[0];\n }\n }\n }\n }\n\n // Handle outlineOffset prop (only if not already set by slash syntax)\n if (outlineOffset != null && !result['outline-offset']) {\n const offsetValue =\n typeof outlineOffset === 'number' ? `${outlineOffset}px` : outlineOffset;\n const processed = parseStyle(offsetValue);\n result['outline-offset'] = processed.groups[0]?.values[0] || offsetValue;\n }\n\n if (Object.keys(result).length === 0) {\n return null;\n }\n\n return result;\n}\n\noutlineStyle.__lookupStyles = ['outline', 'outlineOffset'];\n"],"mappings":";;;;;;;;;;;;;;;;;;AAuBA,SAAgB,aAAa,EAAE,SAAS,iBAAoC;CAC1E,MAAM,SAAiC,EAAE;AAGzC,KAAI,WAAW,QAAQ,YAAY,MACjC,KAAI,OAAO,YAAY,YAAY,kBAAkB,IAAI,QAAQ,CAC/D,QAAO,aAAa;MACf;EACL,IAAI,eAA0C;AAC9C,MAAI,YAAY,KAAM,gBAAe;AACrC,MAAI,YAAY,EAAG,gBAAe;EAGlC,MAAM,QADY,WAAW,OAAO,aAAa,CAAC,CAC1B,OAAO;AAE/B,MAAI,OAAO;GACT,MAAM,EAAE,UAAU;GAClB,MAAM,cAAc,MAAM,MAAM;IAAE,QAAQ,EAAE;IAAE,MAAM,EAAE;IAAE,QAAQ,EAAE;IAAE;GACpE,MAAM,aAAa,MAAM;GAEzB,MAAM,WAAW,WACf,YAAY,MACZ,cACD;AAMD,UAAO,aAAa;IAJN,YAAY,OAAO,MAAM;IAC1B,SAAS,MAAM;IACP,YAAY,OAAO,MAAM;IAEC,CAAC,KAAK,IAAI;AAEzD,OAAI,YAAY,OAAO,GACrB,QAAO,oBAAoB,WAAW,OAAO;;;AAOrD,KAAI,iBAAiB,QAAQ,CAAC,OAAO,mBAAmB;EACtD,MAAM,cACJ,OAAO,kBAAkB,WAAW,GAAG,cAAc,MAAM;AAE7D,SAAO,oBADW,WAAW,YAAY,CACJ,OAAO,IAAI,OAAO,MAAM;;AAG/D,KAAI,OAAO,KAAK,OAAO,CAAC,WAAW,EACjC,QAAO;AAGT,QAAO;;AAGT,aAAa,iBAAiB,CAAC,WAAW,gBAAgB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region src/styles/padding.d.ts
|
|
2
|
+
declare function paddingStyle({
|
|
3
|
+
padding,
|
|
4
|
+
paddingBlock,
|
|
5
|
+
paddingInline,
|
|
6
|
+
paddingTop,
|
|
7
|
+
paddingRight,
|
|
8
|
+
paddingBottom,
|
|
9
|
+
paddingLeft
|
|
10
|
+
}: {
|
|
11
|
+
padding?: string | number | boolean;
|
|
12
|
+
paddingBlock?: string | number | boolean;
|
|
13
|
+
paddingInline?: string | number | boolean;
|
|
14
|
+
paddingTop?: string | number | boolean;
|
|
15
|
+
paddingRight?: string | number | boolean;
|
|
16
|
+
paddingBottom?: string | number | boolean;
|
|
17
|
+
paddingLeft?: string | number | boolean;
|
|
18
|
+
}): Record<string, string> | null;
|
|
19
|
+
declare namespace paddingStyle {
|
|
20
|
+
var __lookupStyles: string[];
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { paddingStyle };
|
|
24
|
+
//# sourceMappingURL=padding.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { processDirectionalStyle } from "./directional.js";
|
|
2
|
+
//#region src/styles/padding.ts
|
|
3
|
+
const PADDING_CONFIG = {
|
|
4
|
+
property: "padding",
|
|
5
|
+
defaultValue: "var(--gap)",
|
|
6
|
+
trueValue: "1x",
|
|
7
|
+
defaultInit: "0"
|
|
8
|
+
};
|
|
9
|
+
function paddingStyle({ padding, paddingBlock, paddingInline, paddingTop, paddingRight, paddingBottom, paddingLeft }) {
|
|
10
|
+
return processDirectionalStyle(PADDING_CONFIG, {
|
|
11
|
+
main: padding,
|
|
12
|
+
block: paddingBlock,
|
|
13
|
+
inline: paddingInline,
|
|
14
|
+
top: paddingTop,
|
|
15
|
+
right: paddingRight,
|
|
16
|
+
bottom: paddingBottom,
|
|
17
|
+
left: paddingLeft
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
paddingStyle.__lookupStyles = [
|
|
21
|
+
"padding",
|
|
22
|
+
"paddingTop",
|
|
23
|
+
"paddingRight",
|
|
24
|
+
"paddingBottom",
|
|
25
|
+
"paddingLeft",
|
|
26
|
+
"paddingBlock",
|
|
27
|
+
"paddingInline"
|
|
28
|
+
];
|
|
29
|
+
//#endregion
|
|
30
|
+
export { paddingStyle };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=padding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"padding.js","names":[],"sources":["../../src/styles/padding.ts"],"sourcesContent":["import { processDirectionalStyle } from './directional';\n\nconst PADDING_CONFIG = {\n property: 'padding',\n defaultValue: 'var(--gap)',\n trueValue: '1x',\n defaultInit: '0',\n} as const;\n\nexport function paddingStyle({\n padding,\n paddingBlock,\n paddingInline,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n}: {\n padding?: string | number | boolean;\n paddingBlock?: string | number | boolean;\n paddingInline?: string | number | boolean;\n paddingTop?: string | number | boolean;\n paddingRight?: string | number | boolean;\n paddingBottom?: string | number | boolean;\n paddingLeft?: string | number | boolean;\n}) {\n return processDirectionalStyle(PADDING_CONFIG, {\n main: padding,\n block: paddingBlock,\n inline: paddingInline,\n top: paddingTop,\n right: paddingRight,\n bottom: paddingBottom,\n left: paddingLeft,\n });\n}\n\npaddingStyle.__lookupStyles = [\n 'padding',\n 'paddingTop',\n 'paddingRight',\n 'paddingBottom',\n 'paddingLeft',\n 'paddingBlock',\n 'paddingInline',\n];\n"],"mappings":";;AAEA,MAAM,iBAAiB;CACrB,UAAU;CACV,cAAc;CACd,WAAW;CACX,aAAa;CACd;AAED,SAAgB,aAAa,EAC3B,SACA,cACA,eACA,YACA,cACA,eACA,eASC;AACD,QAAO,wBAAwB,gBAAgB;EAC7C,MAAM;EACN,OAAO;EACP,QAAQ;EACR,KAAK;EACL,OAAO;EACP,QAAQ;EACR,MAAM;EACP,CAAC;;AAGJ,aAAa,iBAAiB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACD"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
//#region src/styles/placement.d.ts
|
|
2
|
+
interface PlacementStyleProps {
|
|
3
|
+
place?: string | boolean;
|
|
4
|
+
placeItems?: string | boolean;
|
|
5
|
+
placeContent?: string | boolean;
|
|
6
|
+
align?: string | boolean;
|
|
7
|
+
justify?: string | boolean;
|
|
8
|
+
alignItems?: string | boolean;
|
|
9
|
+
alignContent?: string | boolean;
|
|
10
|
+
justifyItems?: string | boolean;
|
|
11
|
+
justifyContent?: string | boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Unified placement handler replacing align, justify, and place.
|
|
15
|
+
*
|
|
16
|
+
* Priority (later overrides earlier):
|
|
17
|
+
* 1. place (lowest) — sets all 4 longhands
|
|
18
|
+
* 2. placeItems, placeContent, align, justify (medium) — each sets 2 longhands
|
|
19
|
+
* 3. alignItems, alignContent, justifyItems, justifyContent (highest) — each sets 1 longhand
|
|
20
|
+
*/
|
|
21
|
+
declare function placementStyle({
|
|
22
|
+
place,
|
|
23
|
+
placeItems,
|
|
24
|
+
placeContent,
|
|
25
|
+
align,
|
|
26
|
+
justify,
|
|
27
|
+
alignItems,
|
|
28
|
+
alignContent,
|
|
29
|
+
justifyItems,
|
|
30
|
+
justifyContent
|
|
31
|
+
}: PlacementStyleProps): Record<string, string> | null;
|
|
32
|
+
declare namespace placementStyle {
|
|
33
|
+
var __lookupStyles: string[];
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { placementStyle };
|
|
37
|
+
//# sourceMappingURL=placement.d.ts.map
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
//#region src/styles/placement.ts
|
|
2
|
+
function str(val) {
|
|
3
|
+
if (val == null || val === false || val === "") return null;
|
|
4
|
+
if (val === true) return "center";
|
|
5
|
+
return String(val);
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Unified placement handler replacing align, justify, and place.
|
|
9
|
+
*
|
|
10
|
+
* Priority (later overrides earlier):
|
|
11
|
+
* 1. place (lowest) — sets all 4 longhands
|
|
12
|
+
* 2. placeItems, placeContent, align, justify (medium) — each sets 2 longhands
|
|
13
|
+
* 3. alignItems, alignContent, justifyItems, justifyContent (highest) — each sets 1 longhand
|
|
14
|
+
*/
|
|
15
|
+
function placementStyle({ place, placeItems, placeContent, align, justify, alignItems, alignContent, justifyItems, justifyContent }) {
|
|
16
|
+
const result = {};
|
|
17
|
+
const placeVal = str(place);
|
|
18
|
+
if (placeVal) {
|
|
19
|
+
const parts = placeVal.split(/\s+/);
|
|
20
|
+
const first = parts[0];
|
|
21
|
+
const second = parts[1] || first;
|
|
22
|
+
result["align-items"] = first;
|
|
23
|
+
result["justify-items"] = second;
|
|
24
|
+
result["align-content"] = first;
|
|
25
|
+
result["justify-content"] = second;
|
|
26
|
+
}
|
|
27
|
+
const placeItemsVal = str(placeItems);
|
|
28
|
+
if (placeItemsVal) {
|
|
29
|
+
const parts = placeItemsVal.split(/\s+/);
|
|
30
|
+
result["align-items"] = parts[0];
|
|
31
|
+
result["justify-items"] = parts[1] || parts[0];
|
|
32
|
+
}
|
|
33
|
+
const placeContentVal = str(placeContent);
|
|
34
|
+
if (placeContentVal) {
|
|
35
|
+
const parts = placeContentVal.split(/\s+/);
|
|
36
|
+
result["align-content"] = parts[0];
|
|
37
|
+
result["justify-content"] = parts[1] || parts[0];
|
|
38
|
+
}
|
|
39
|
+
const alignVal = str(align);
|
|
40
|
+
if (alignVal) {
|
|
41
|
+
result["align-items"] = alignVal;
|
|
42
|
+
result["align-content"] = alignVal;
|
|
43
|
+
}
|
|
44
|
+
const justifyVal = str(justify);
|
|
45
|
+
if (justifyVal) {
|
|
46
|
+
result["justify-items"] = justifyVal;
|
|
47
|
+
result["justify-content"] = justifyVal;
|
|
48
|
+
}
|
|
49
|
+
const alignItemsVal = str(alignItems);
|
|
50
|
+
if (alignItemsVal) result["align-items"] = alignItemsVal;
|
|
51
|
+
const alignContentVal = str(alignContent);
|
|
52
|
+
if (alignContentVal) result["align-content"] = alignContentVal;
|
|
53
|
+
const justifyItemsVal = str(justifyItems);
|
|
54
|
+
if (justifyItemsVal) result["justify-items"] = justifyItemsVal;
|
|
55
|
+
const justifyContentVal = str(justifyContent);
|
|
56
|
+
if (justifyContentVal) result["justify-content"] = justifyContentVal;
|
|
57
|
+
if (Object.keys(result).length === 0) return null;
|
|
58
|
+
return result;
|
|
59
|
+
}
|
|
60
|
+
placementStyle.__lookupStyles = [
|
|
61
|
+
"place",
|
|
62
|
+
"placeItems",
|
|
63
|
+
"placeContent",
|
|
64
|
+
"align",
|
|
65
|
+
"justify",
|
|
66
|
+
"alignItems",
|
|
67
|
+
"alignContent",
|
|
68
|
+
"justifyItems",
|
|
69
|
+
"justifyContent"
|
|
70
|
+
];
|
|
71
|
+
//#endregion
|
|
72
|
+
export { placementStyle };
|
|
73
|
+
|
|
74
|
+
//# sourceMappingURL=placement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placement.js","names":[],"sources":["../../src/styles/placement.ts"],"sourcesContent":["interface PlacementStyleProps {\n place?: string | boolean;\n placeItems?: string | boolean;\n placeContent?: string | boolean;\n align?: string | boolean;\n justify?: string | boolean;\n alignItems?: string | boolean;\n alignContent?: string | boolean;\n justifyItems?: string | boolean;\n justifyContent?: string | boolean;\n}\n\nfunction str(val: string | boolean | undefined): string | null {\n if (val == null || val === false || val === '') return null;\n if (val === true) return 'center';\n\n return String(val);\n}\n\n/**\n * Unified placement handler replacing align, justify, and place.\n *\n * Priority (later overrides earlier):\n * 1. place (lowest) — sets all 4 longhands\n * 2. placeItems, placeContent, align, justify (medium) — each sets 2 longhands\n * 3. alignItems, alignContent, justifyItems, justifyContent (highest) — each sets 1 longhand\n */\nexport function placementStyle({\n place,\n placeItems,\n placeContent,\n align,\n justify,\n alignItems,\n alignContent,\n justifyItems,\n justifyContent,\n}: PlacementStyleProps) {\n const result: Record<string, string> = {};\n\n const placeVal = str(place);\n\n if (placeVal) {\n const parts = placeVal.split(/\\s+/);\n const first = parts[0];\n const second = parts[1] || first;\n\n result['align-items'] = first;\n result['justify-items'] = second;\n result['align-content'] = first;\n result['justify-content'] = second;\n }\n\n const placeItemsVal = str(placeItems);\n\n if (placeItemsVal) {\n const parts = placeItemsVal.split(/\\s+/);\n\n result['align-items'] = parts[0];\n result['justify-items'] = parts[1] || parts[0];\n }\n\n const placeContentVal = str(placeContent);\n\n if (placeContentVal) {\n const parts = placeContentVal.split(/\\s+/);\n\n result['align-content'] = parts[0];\n result['justify-content'] = parts[1] || parts[0];\n }\n\n const alignVal = str(align);\n\n if (alignVal) {\n result['align-items'] = alignVal;\n result['align-content'] = alignVal;\n }\n\n const justifyVal = str(justify);\n\n if (justifyVal) {\n result['justify-items'] = justifyVal;\n result['justify-content'] = justifyVal;\n }\n\n const alignItemsVal = str(alignItems);\n\n if (alignItemsVal) result['align-items'] = alignItemsVal;\n\n const alignContentVal = str(alignContent);\n\n if (alignContentVal) result['align-content'] = alignContentVal;\n\n const justifyItemsVal = str(justifyItems);\n\n if (justifyItemsVal) result['justify-items'] = justifyItemsVal;\n\n const justifyContentVal = str(justifyContent);\n\n if (justifyContentVal) result['justify-content'] = justifyContentVal;\n\n if (Object.keys(result).length === 0) return null;\n\n return result;\n}\n\nplacementStyle.__lookupStyles = [\n 'place',\n 'placeItems',\n 'placeContent',\n 'align',\n 'justify',\n 'alignItems',\n 'alignContent',\n 'justifyItems',\n 'justifyContent',\n];\n"],"mappings":";AAYA,SAAS,IAAI,KAAkD;AAC7D,KAAI,OAAO,QAAQ,QAAQ,SAAS,QAAQ,GAAI,QAAO;AACvD,KAAI,QAAQ,KAAM,QAAO;AAEzB,QAAO,OAAO,IAAI;;;;;;;;;;AAWpB,SAAgB,eAAe,EAC7B,OACA,YACA,cACA,OACA,SACA,YACA,cACA,cACA,kBACsB;CACtB,MAAM,SAAiC,EAAE;CAEzC,MAAM,WAAW,IAAI,MAAM;AAE3B,KAAI,UAAU;EACZ,MAAM,QAAQ,SAAS,MAAM,MAAM;EACnC,MAAM,QAAQ,MAAM;EACpB,MAAM,SAAS,MAAM,MAAM;AAE3B,SAAO,iBAAiB;AACxB,SAAO,mBAAmB;AAC1B,SAAO,mBAAmB;AAC1B,SAAO,qBAAqB;;CAG9B,MAAM,gBAAgB,IAAI,WAAW;AAErC,KAAI,eAAe;EACjB,MAAM,QAAQ,cAAc,MAAM,MAAM;AAExC,SAAO,iBAAiB,MAAM;AAC9B,SAAO,mBAAmB,MAAM,MAAM,MAAM;;CAG9C,MAAM,kBAAkB,IAAI,aAAa;AAEzC,KAAI,iBAAiB;EACnB,MAAM,QAAQ,gBAAgB,MAAM,MAAM;AAE1C,SAAO,mBAAmB,MAAM;AAChC,SAAO,qBAAqB,MAAM,MAAM,MAAM;;CAGhD,MAAM,WAAW,IAAI,MAAM;AAE3B,KAAI,UAAU;AACZ,SAAO,iBAAiB;AACxB,SAAO,mBAAmB;;CAG5B,MAAM,aAAa,IAAI,QAAQ;AAE/B,KAAI,YAAY;AACd,SAAO,mBAAmB;AAC1B,SAAO,qBAAqB;;CAG9B,MAAM,gBAAgB,IAAI,WAAW;AAErC,KAAI,cAAe,QAAO,iBAAiB;CAE3C,MAAM,kBAAkB,IAAI,aAAa;AAEzC,KAAI,gBAAiB,QAAO,mBAAmB;CAE/C,MAAM,kBAAkB,IAAI,aAAa;AAEzC,KAAI,gBAAiB,QAAO,mBAAmB;CAE/C,MAAM,oBAAoB,IAAI,eAAe;AAE7C,KAAI,kBAAmB,QAAO,qBAAqB;AAEnD,KAAI,OAAO,KAAK,OAAO,CAAC,WAAW,EAAG,QAAO;AAE7C,QAAO;;AAGT,eAAe,iBAAiB;CAC9B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { borderStyle } from "./border.js";
|
|
2
|
+
import { colorStyle } from "./color.js";
|
|
3
|
+
import { displayStyle } from "./display.js";
|
|
4
|
+
import { fadeStyle } from "./fade.js";
|
|
5
|
+
import { fillStyle, svgFillStyle } from "./fill.js";
|
|
6
|
+
import { flowStyle } from "./flow.js";
|
|
7
|
+
import { gapStyle } from "./gap.js";
|
|
8
|
+
import { heightStyle } from "./height.js";
|
|
9
|
+
import { insetStyle } from "./inset.js";
|
|
10
|
+
import { marginStyle } from "./margin.js";
|
|
11
|
+
import { outlineStyle } from "./outline.js";
|
|
12
|
+
import { paddingStyle } from "./padding.js";
|
|
13
|
+
import { placementStyle } from "./placement.js";
|
|
14
|
+
import { presetStyle } from "./preset.js";
|
|
15
|
+
import { radiusStyle } from "./radius.js";
|
|
16
|
+
import { scrollMarginStyle } from "./scrollMargin.js";
|
|
17
|
+
import { scrollbarStyle } from "./scrollbar.js";
|
|
18
|
+
import { shadowStyle } from "./shadow.js";
|
|
19
|
+
import { transitionStyle } from "./transition.js";
|
|
20
|
+
import { widthStyle } from "./width.js";
|
|
21
|
+
|
|
22
|
+
//#region src/styles/predefined.d.ts
|
|
23
|
+
/**
|
|
24
|
+
* Exported object containing wrapped predefined style handlers.
|
|
25
|
+
* Users can import and call these to extend or delegate to built-in behavior.
|
|
26
|
+
*
|
|
27
|
+
* Internal handlers use *Style suffix for searchability.
|
|
28
|
+
* External API uses short names for convenience.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* import { styleHandlers, configure } from '@tenphi/tasty';
|
|
33
|
+
*
|
|
34
|
+
* configure({
|
|
35
|
+
* handlers: {
|
|
36
|
+
* fill: ({ fill }) => {
|
|
37
|
+
* if (fill?.startsWith('gradient:')) {
|
|
38
|
+
* return { background: fill.slice(9) };
|
|
39
|
+
* }
|
|
40
|
+
* return styleHandlers.fill({ fill });
|
|
41
|
+
* },
|
|
42
|
+
* },
|
|
43
|
+
* });
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
declare const styleHandlers: {
|
|
47
|
+
readonly border: typeof borderStyle;
|
|
48
|
+
readonly color: typeof colorStyle;
|
|
49
|
+
readonly display: typeof displayStyle;
|
|
50
|
+
readonly fade: typeof fadeStyle;
|
|
51
|
+
readonly fill: typeof fillStyle;
|
|
52
|
+
readonly svgFill: typeof svgFillStyle;
|
|
53
|
+
readonly flow: typeof flowStyle;
|
|
54
|
+
readonly gap: typeof gapStyle;
|
|
55
|
+
readonly height: typeof heightStyle;
|
|
56
|
+
readonly inset: typeof insetStyle;
|
|
57
|
+
readonly margin: typeof marginStyle;
|
|
58
|
+
readonly outline: typeof outlineStyle;
|
|
59
|
+
readonly padding: typeof paddingStyle;
|
|
60
|
+
readonly placement: typeof placementStyle;
|
|
61
|
+
readonly preset: typeof presetStyle;
|
|
62
|
+
readonly radius: typeof radiusStyle;
|
|
63
|
+
readonly scrollMargin: typeof scrollMarginStyle;
|
|
64
|
+
readonly scrollbar: typeof scrollbarStyle;
|
|
65
|
+
readonly shadow: typeof shadowStyle;
|
|
66
|
+
readonly transition: typeof transitionStyle;
|
|
67
|
+
readonly width: typeof widthStyle;
|
|
68
|
+
};
|
|
69
|
+
//#endregion
|
|
70
|
+
export { styleHandlers };
|
|
71
|
+
//# sourceMappingURL=predefined.d.ts.map
|