@tenphi/tasty 2.0.2 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ssr/async-storage.js → async-storage-B7_o6FKt.js} +2 -2
- package/dist/async-storage-B7_o6FKt.js.map +1 -0
- package/dist/{ssr/collector.d.ts → collector-CkZ517g4.d.ts} +3 -3
- package/dist/{ssr/collector.js → collector-DXqvGOb1.js} +5 -10
- package/dist/collector-DXqvGOb1.js.map +1 -0
- package/dist/config-5jzS6k6B.js +10005 -0
- package/dist/config-5jzS6k6B.js.map +1 -0
- package/dist/config-DknGsfMo.d.ts +857 -0
- package/dist/{ssr/context.js → context-CkSg-kDT.js} +11 -3
- package/dist/context-CkSg-kDT.js.map +1 -0
- package/dist/core/index.d.ts +5 -34
- package/dist/core/index.js +5 -26
- package/dist/core-CtU6-9OC.js +1507 -0
- package/dist/core-CtU6-9OC.js.map +1 -0
- package/dist/{zero/extractor.js → css-writer-DHkX0JuE.js} +74 -11
- package/dist/css-writer-DHkX0JuE.js.map +1 -0
- package/dist/{ssr/format-global-rules.js → format-global-rules-Dbc_1tc3.js} +2 -2
- package/dist/format-global-rules-Dbc_1tc3.js.map +1 -0
- package/dist/format-rules-DH13ewDu.js +143 -0
- package/dist/format-rules-DH13ewDu.js.map +1 -0
- package/dist/{ssr/hydrate.js → hydrate-C1Gv-DoS.js} +3 -3
- package/dist/hydrate-C1Gv-DoS.js.map +1 -0
- package/dist/{styles/types.d.ts → index-PzENbpAq.d.ts} +701 -5
- package/dist/index-o7zV2yCr.d.ts +1561 -0
- package/dist/index.d.ts +5 -51
- package/dist/index.js +728 -35
- package/dist/index.js.map +1 -0
- package/dist/keyframes-b7X3UxDV.js +587 -0
- package/dist/keyframes-b7X3UxDV.js.map +1 -0
- package/dist/{utils/merge-styles.d.ts → merge-styles-C7KTy7MY.d.ts} +3 -3
- package/dist/{utils/merge-styles.js → merge-styles-Tgo3BbL2.js} +3 -4
- package/dist/merge-styles-Tgo3BbL2.js.map +1 -0
- package/dist/{utils/resolve-recipes.js → resolve-recipes-Ca2-5CxM.js} +4 -6
- package/dist/resolve-recipes-Ca2-5CxM.js.map +1 -0
- package/dist/ssr/astro-client.js +1 -1
- package/dist/ssr/astro.js +4 -4
- package/dist/ssr/index.d.ts +44 -4
- package/dist/ssr/index.js +4 -4
- package/dist/ssr/next.d.ts +1 -1
- package/dist/ssr/next.js +6 -6
- package/dist/ssr/next.js.map +1 -1
- package/dist/static/index.d.ts +91 -5
- package/dist/static/index.js +49 -3
- package/dist/static/index.js.map +1 -0
- package/dist/zero/babel.d.ts +1 -1
- package/dist/zero/babel.js +10 -6
- package/dist/zero/babel.js.map +1 -1
- package/dist/zero/index.d.ts +67 -3
- package/dist/zero/index.js +1 -2
- package/docs/pipeline.md +204 -50
- package/package.json +3 -3
- package/dist/_virtual/_rolldown/runtime.js +0 -7
- package/dist/chunks/cacheKey.d.ts +0 -1
- package/dist/chunks/cacheKey.js +0 -77
- package/dist/chunks/cacheKey.js.map +0 -1
- package/dist/chunks/definitions.d.ts +0 -37
- package/dist/chunks/definitions.js +0 -258
- package/dist/chunks/definitions.js.map +0 -1
- package/dist/chunks/index.d.ts +0 -1
- package/dist/chunks/renderChunk.d.ts +0 -1
- package/dist/chunks/renderChunk.js +0 -59
- package/dist/chunks/renderChunk.js.map +0 -1
- package/dist/compute-styles.d.ts +0 -31
- package/dist/compute-styles.js +0 -322
- package/dist/compute-styles.js.map +0 -1
- package/dist/config.d.ts +0 -407
- package/dist/config.js +0 -591
- package/dist/config.js.map +0 -1
- package/dist/counter-style/index.js +0 -51
- package/dist/counter-style/index.js.map +0 -1
- package/dist/debug.d.ts +0 -89
- package/dist/debug.js +0 -453
- package/dist/debug.js.map +0 -1
- package/dist/font-face/index.js +0 -63
- package/dist/font-face/index.js.map +0 -1
- package/dist/hooks/index.d.ts +0 -7
- package/dist/hooks/useCounterStyle.d.ts +0 -36
- package/dist/hooks/useCounterStyle.js +0 -65
- package/dist/hooks/useCounterStyle.js.map +0 -1
- package/dist/hooks/useFontFace.d.ts +0 -45
- package/dist/hooks/useFontFace.js +0 -66
- package/dist/hooks/useFontFace.js.map +0 -1
- package/dist/hooks/useGlobalStyles.d.ts +0 -46
- package/dist/hooks/useGlobalStyles.js +0 -88
- package/dist/hooks/useGlobalStyles.js.map +0 -1
- package/dist/hooks/useKeyframes.d.ts +0 -58
- package/dist/hooks/useKeyframes.js +0 -55
- package/dist/hooks/useKeyframes.js.map +0 -1
- package/dist/hooks/useProperty.d.ts +0 -81
- package/dist/hooks/useProperty.js +0 -96
- package/dist/hooks/useProperty.js.map +0 -1
- package/dist/hooks/useRawCSS.d.ts +0 -22
- package/dist/hooks/useRawCSS.js +0 -103
- package/dist/hooks/useRawCSS.js.map +0 -1
- package/dist/hooks/useStyles.d.ts +0 -40
- package/dist/hooks/useStyles.js +0 -31
- package/dist/hooks/useStyles.js.map +0 -1
- package/dist/injector/index.d.ts +0 -182
- package/dist/injector/index.js +0 -185
- package/dist/injector/index.js.map +0 -1
- package/dist/injector/injector.d.ts +0 -198
- package/dist/injector/injector.js +0 -651
- package/dist/injector/injector.js.map +0 -1
- package/dist/injector/sheet-manager.d.ts +0 -132
- package/dist/injector/sheet-manager.js +0 -699
- package/dist/injector/sheet-manager.js.map +0 -1
- package/dist/injector/types.d.ts +0 -235
- package/dist/keyframes/index.js +0 -206
- package/dist/keyframes/index.js.map +0 -1
- package/dist/parser/classify.js +0 -319
- package/dist/parser/classify.js.map +0 -1
- package/dist/parser/const.js +0 -60
- package/dist/parser/const.js.map +0 -1
- package/dist/parser/lru.js +0 -109
- package/dist/parser/lru.js.map +0 -1
- package/dist/parser/parser.d.ts +0 -25
- package/dist/parser/parser.js +0 -115
- package/dist/parser/parser.js.map +0 -1
- package/dist/parser/tokenizer.js +0 -69
- package/dist/parser/tokenizer.js.map +0 -1
- package/dist/parser/types.d.ts +0 -51
- package/dist/parser/types.js +0 -46
- package/dist/parser/types.js.map +0 -1
- package/dist/pipeline/conditions.d.ts +0 -134
- package/dist/pipeline/conditions.js +0 -406
- package/dist/pipeline/conditions.js.map +0 -1
- package/dist/pipeline/exclusive.js +0 -382
- package/dist/pipeline/exclusive.js.map +0 -1
- package/dist/pipeline/index.d.ts +0 -55
- package/dist/pipeline/index.js +0 -708
- package/dist/pipeline/index.js.map +0 -1
- package/dist/pipeline/materialize.js +0 -1157
- package/dist/pipeline/materialize.js.map +0 -1
- package/dist/pipeline/parseStateKey.d.ts +0 -15
- package/dist/pipeline/parseStateKey.js +0 -446
- package/dist/pipeline/parseStateKey.js.map +0 -1
- package/dist/pipeline/simplify.js +0 -690
- package/dist/pipeline/simplify.js.map +0 -1
- package/dist/pipeline/warnings.js +0 -18
- package/dist/pipeline/warnings.js.map +0 -1
- package/dist/plugins/index.d.ts +0 -2
- package/dist/plugins/okhsl-plugin.d.ts +0 -35
- package/dist/plugins/okhsl-plugin.js +0 -97
- package/dist/plugins/okhsl-plugin.js.map +0 -1
- package/dist/plugins/types.d.ts +0 -87
- package/dist/properties/index.js +0 -222
- package/dist/properties/index.js.map +0 -1
- package/dist/properties/property-type-resolver.d.ts +0 -24
- package/dist/properties/property-type-resolver.js +0 -90
- package/dist/properties/property-type-resolver.js.map +0 -1
- package/dist/rsc-cache.js +0 -79
- package/dist/rsc-cache.js.map +0 -1
- package/dist/ssr/async-storage.d.ts +0 -17
- package/dist/ssr/async-storage.js.map +0 -1
- package/dist/ssr/collect-auto-properties.js +0 -58
- package/dist/ssr/collect-auto-properties.js.map +0 -1
- package/dist/ssr/collector.js.map +0 -1
- package/dist/ssr/context.js.map +0 -1
- package/dist/ssr/format-global-rules.js.map +0 -1
- package/dist/ssr/format-keyframes.js +0 -69
- package/dist/ssr/format-keyframes.js.map +0 -1
- package/dist/ssr/format-property.js +0 -49
- package/dist/ssr/format-property.js.map +0 -1
- package/dist/ssr/format-rules.js +0 -73
- package/dist/ssr/format-rules.js.map +0 -1
- package/dist/ssr/hydrate.d.ts +0 -29
- package/dist/ssr/hydrate.js.map +0 -1
- package/dist/ssr/ssr-collector-ref.js +0 -29
- package/dist/ssr/ssr-collector-ref.js.map +0 -1
- package/dist/states/index.d.ts +0 -49
- package/dist/states/index.js +0 -170
- package/dist/states/index.js.map +0 -1
- package/dist/static/tastyStatic.d.ts +0 -46
- package/dist/static/tastyStatic.js +0 -30
- package/dist/static/tastyStatic.js.map +0 -1
- package/dist/static/types.d.ts +0 -49
- package/dist/static/types.js +0 -24
- package/dist/static/types.js.map +0 -1
- package/dist/styles/border.d.ts +0 -25
- package/dist/styles/border.js +0 -120
- package/dist/styles/border.js.map +0 -1
- package/dist/styles/color.d.ts +0 -14
- package/dist/styles/color.js +0 -26
- package/dist/styles/color.js.map +0 -1
- package/dist/styles/const.js +0 -17
- package/dist/styles/const.js.map +0 -1
- package/dist/styles/createStyle.js +0 -79
- package/dist/styles/createStyle.js.map +0 -1
- package/dist/styles/dimension.js +0 -109
- package/dist/styles/dimension.js.map +0 -1
- package/dist/styles/directional.js +0 -133
- package/dist/styles/directional.js.map +0 -1
- package/dist/styles/display.d.ts +0 -30
- package/dist/styles/display.js +0 -73
- package/dist/styles/display.js.map +0 -1
- package/dist/styles/fade.d.ts +0 -15
- package/dist/styles/fade.js +0 -62
- package/dist/styles/fade.js.map +0 -1
- package/dist/styles/fill.d.ts +0 -42
- package/dist/styles/fill.js +0 -51
- package/dist/styles/fill.js.map +0 -1
- package/dist/styles/flow.d.ts +0 -16
- package/dist/styles/flow.js +0 -12
- package/dist/styles/flow.js.map +0 -1
- package/dist/styles/gap.d.ts +0 -31
- package/dist/styles/gap.js +0 -38
- package/dist/styles/gap.js.map +0 -1
- package/dist/styles/height.d.ts +0 -17
- package/dist/styles/height.js +0 -19
- package/dist/styles/height.js.map +0 -1
- package/dist/styles/index.d.ts +0 -1
- package/dist/styles/index.js +0 -8
- package/dist/styles/index.js.map +0 -1
- package/dist/styles/inset.d.ts +0 -24
- package/dist/styles/inset.js +0 -34
- package/dist/styles/inset.js.map +0 -1
- package/dist/styles/list.d.ts +0 -16
- package/dist/styles/list.js +0 -100
- package/dist/styles/list.js.map +0 -1
- package/dist/styles/margin.d.ts +0 -24
- package/dist/styles/margin.js +0 -32
- package/dist/styles/margin.js.map +0 -1
- package/dist/styles/outline.d.ts +0 -29
- package/dist/styles/outline.js +0 -55
- package/dist/styles/outline.js.map +0 -1
- package/dist/styles/padding.d.ts +0 -24
- package/dist/styles/padding.js +0 -32
- package/dist/styles/padding.js.map +0 -1
- package/dist/styles/placement.d.ts +0 -37
- package/dist/styles/placement.js +0 -74
- package/dist/styles/placement.js.map +0 -1
- package/dist/styles/predefined.d.ts +0 -71
- package/dist/styles/predefined.js +0 -237
- package/dist/styles/predefined.js.map +0 -1
- package/dist/styles/preset.d.ts +0 -52
- package/dist/styles/preset.js +0 -127
- package/dist/styles/preset.js.map +0 -1
- package/dist/styles/radius.d.ts +0 -12
- package/dist/styles/radius.js +0 -83
- package/dist/styles/radius.js.map +0 -1
- package/dist/styles/scrollMargin.d.ts +0 -24
- package/dist/styles/scrollMargin.js +0 -32
- package/dist/styles/scrollMargin.js.map +0 -1
- package/dist/styles/scrollbar.d.ts +0 -25
- package/dist/styles/scrollbar.js +0 -51
- package/dist/styles/scrollbar.js.map +0 -1
- package/dist/styles/shadow.d.ts +0 -14
- package/dist/styles/shadow.js +0 -25
- package/dist/styles/shadow.js.map +0 -1
- package/dist/styles/shared.js +0 -17
- package/dist/styles/shared.js.map +0 -1
- package/dist/styles/transition.d.ts +0 -14
- package/dist/styles/transition.js +0 -159
- package/dist/styles/transition.js.map +0 -1
- package/dist/styles/width.d.ts +0 -17
- package/dist/styles/width.js +0 -19
- package/dist/styles/width.js.map +0 -1
- package/dist/tasty.d.ts +0 -134
- package/dist/tasty.js +0 -248
- package/dist/tasty.js.map +0 -1
- package/dist/types.d.ts +0 -184
- package/dist/utils/cache-wrapper.js +0 -21
- package/dist/utils/cache-wrapper.js.map +0 -1
- package/dist/utils/case-converter.js +0 -8
- package/dist/utils/case-converter.js.map +0 -1
- package/dist/utils/color-math.d.ts +0 -46
- package/dist/utils/color-math.js +0 -749
- package/dist/utils/color-math.js.map +0 -1
- package/dist/utils/color-space.d.ts +0 -5
- package/dist/utils/color-space.js +0 -228
- package/dist/utils/color-space.js.map +0 -1
- package/dist/utils/colors.d.ts +0 -5
- package/dist/utils/colors.js +0 -10
- package/dist/utils/colors.js.map +0 -1
- package/dist/utils/css-types.d.ts +0 -7
- package/dist/utils/deps-equal.js +0 -15
- package/dist/utils/deps-equal.js.map +0 -1
- package/dist/utils/dotize.d.ts +0 -26
- package/dist/utils/dotize.js +0 -122
- package/dist/utils/dotize.js.map +0 -1
- package/dist/utils/filter-base-props.d.ts +0 -15
- package/dist/utils/filter-base-props.js +0 -45
- package/dist/utils/filter-base-props.js.map +0 -1
- package/dist/utils/get-display-name.d.ts +0 -7
- package/dist/utils/get-display-name.js +0 -10
- package/dist/utils/get-display-name.js.map +0 -1
- package/dist/utils/has-keys.js +0 -13
- package/dist/utils/has-keys.js.map +0 -1
- package/dist/utils/hash.js +0 -14
- package/dist/utils/hash.js.map +0 -1
- package/dist/utils/is-dev-env.js +0 -19
- package/dist/utils/is-dev-env.js.map +0 -1
- package/dist/utils/is-valid-element-type.js +0 -15
- package/dist/utils/is-valid-element-type.js.map +0 -1
- package/dist/utils/merge-styles.js.map +0 -1
- package/dist/utils/mod-attrs.d.ts +0 -6
- package/dist/utils/mod-attrs.js +0 -20
- package/dist/utils/mod-attrs.js.map +0 -1
- package/dist/utils/process-tokens.d.ts +0 -17
- package/dist/utils/process-tokens.js +0 -83
- package/dist/utils/process-tokens.js.map +0 -1
- package/dist/utils/resolve-recipes.d.ts +0 -17
- package/dist/utils/resolve-recipes.js.map +0 -1
- package/dist/utils/selector-transform.js +0 -32
- package/dist/utils/selector-transform.js.map +0 -1
- package/dist/utils/string.js +0 -8
- package/dist/utils/string.js.map +0 -1
- package/dist/utils/styles.d.ts +0 -99
- package/dist/utils/styles.js +0 -220
- package/dist/utils/styles.js.map +0 -1
- package/dist/utils/typography.d.ts +0 -58
- package/dist/utils/typography.js +0 -51
- package/dist/utils/typography.js.map +0 -1
- package/dist/utils/warnings.d.ts +0 -16
- package/dist/utils/warnings.js +0 -16
- package/dist/utils/warnings.js.map +0 -1
- package/dist/zero/css-writer.d.ts +0 -45
- package/dist/zero/css-writer.js +0 -73
- package/dist/zero/css-writer.js.map +0 -1
- package/dist/zero/extractor.d.ts +0 -24
- package/dist/zero/extractor.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"border.js","names":[],"sources":["../../src/styles/border.ts"],"sourcesContent":["import { CSS_WIDE_KEYWORDS } from '../parser/const';\nimport { DIRECTIONS, filterMods, parseStyle } from '../utils/styles';\nimport { BORDER_STYLES } from './const';\nimport { extractCSSWideKeyword } from './shared';\n\ntype Direction = (typeof DIRECTIONS)[number];\n\ninterface GroupData {\n values: string[];\n mods: string[];\n colors: string[];\n}\n\ninterface BorderValue {\n width: string;\n style: string;\n color: string;\n}\n\n/**\n * Process a single group and return border values for its directions.\n * @returns Object with directions as keys and border values, or null for \"all directions\"\n */\nfunction processGroup(group: GroupData): {\n directions: Direction[];\n borderValue: BorderValue;\n} {\n const { values, mods, colors } = group;\n\n const directions = filterMods(mods, DIRECTIONS) as Direction[];\n const typeMods = filterMods(mods, BORDER_STYLES as unknown as string[]);\n\n const width = values[0] || 'var(--border-width)';\n const style = typeMods[0] || 'solid';\n const color = colors?.[0] || 'var(--border-color, currentColor)';\n\n return {\n directions,\n borderValue: { width, style, color },\n };\n}\n\n/**\n * Format a border value to CSS string.\n */\nfunction formatBorderValue(value: BorderValue): string {\n return `${value.width} ${value.style} ${value.color}`;\n}\n\n/**\n * Border style handler with multi-group support.\n *\n * Single group (backward compatible):\n * - `border=\"1bw solid #red\"` - all sides\n * - `border=\"1bw solid #red top left\"` - only top and left\n *\n * Multi-group (new):\n * - `border=\"1bw #red, 2bw #blue top\"` - all sides red 1bw, then top overridden to blue 2bw\n * - `border=\"1bw, dashed top bottom, #purple left right\"` - base 1bw, dashed on top/bottom, purple on left/right\n *\n * Later groups override earlier groups for conflicting directions.\n */\nexport function borderStyle({\n border,\n}: {\n border?: string | number | boolean;\n}) {\n if (!border && border !== 0) return null;\n\n if (border === true) border = '1bw';\n\n const strBorder = String(border);\n\n if (CSS_WIDE_KEYWORDS.has(strBorder)) {\n return { border: strBorder };\n }\n\n const processed = parseStyle(strBorder);\n const groups = processed.groups ?? [];\n\n if (!groups.length) return null;\n\n const useLonghand = groups.some((g) => (g.mods ?? []).includes('longhand'));\n\n // Single group - use original logic for backward compatibility\n if (groups.length === 1) {\n const group = groups[0];\n const keyword = extractCSSWideKeyword(group);\n\n if (keyword) {\n if (useLonghand) {\n return Object.fromEntries(\n DIRECTIONS.map((dir) => [`border-${dir}`, keyword]),\n );\n }\n\n return { border: keyword };\n }\n\n const { directions, borderValue } = processGroup({\n values: group.values ?? [],\n mods: group.mods ?? [],\n colors: group.colors ?? [],\n });\n\n const styleValue = formatBorderValue(borderValue);\n\n if (!directions.length) {\n if (useLonghand) {\n return Object.fromEntries(\n DIRECTIONS.map((dir) => [`border-${dir}`, styleValue]),\n );\n }\n\n return { border: styleValue };\n }\n\n const zeroValue = `0 ${borderValue.style} ${borderValue.color}`;\n\n return DIRECTIONS.reduce(\n (styles, dir) => {\n if (directions.includes(dir)) {\n styles[`border-${dir}`] = styleValue;\n } else {\n styles[`border-${dir}`] = zeroValue;\n }\n return styles;\n },\n {} as Record<string, string>,\n );\n }\n\n // Multi-group - process groups in order, later groups override earlier\n // Track whether any group specifies directions\n let hasAnyDirections = false;\n\n // Build a map of direction -> border value\n // Start with undefined (no border set)\n const directionMap: Record<Direction, BorderValue | null> = {\n top: null,\n right: null,\n bottom: null,\n left: null,\n };\n\n // Track the last \"all directions\" value for fallback\n let allDirectionsValue: BorderValue | null = null;\n\n // Process groups in order (first to last)\n for (const group of groups) {\n const { directions, borderValue } = processGroup({\n values: group.values ?? [],\n mods: group.mods ?? [],\n colors: group.colors ?? [],\n });\n\n if (directions.length === 0) {\n // No specific directions - applies to all\n allDirectionsValue = borderValue;\n // Set all directions\n for (const dir of DIRECTIONS) {\n directionMap[dir] = borderValue;\n }\n } else {\n // Specific directions - override only those\n hasAnyDirections = true;\n for (const dir of directions) {\n directionMap[dir] = borderValue;\n }\n }\n }\n\n // If no group specified any directions and we have an all-directions value,\n // return the simple `border` shorthand (or longhands if requested)\n if (!hasAnyDirections && allDirectionsValue) {\n const formatted = formatBorderValue(allDirectionsValue);\n\n if (useLonghand) {\n return Object.fromEntries(\n DIRECTIONS.map((dir) => [`border-${dir}`, formatted]),\n );\n }\n\n return { border: formatted };\n }\n\n // Otherwise, output individual border-* properties\n const result: Record<string, string> = {};\n\n for (const dir of DIRECTIONS) {\n const value = directionMap[dir];\n if (value) {\n result[`border-${dir}`] = formatBorderValue(value);\n } else {\n // No border for this direction - set to 0\n // Use the last all-directions value for style/color consistency, or defaults\n const fallback = allDirectionsValue || {\n width: '0',\n style: 'solid',\n color: 'var(--border-color, currentColor)',\n };\n result[`border-${dir}`] = `0 ${fallback.style} ${fallback.color}`;\n }\n }\n\n return result;\n}\n\nborderStyle.__lookupStyles = ['border'];\n"],"mappings":";;;;;;;;;AAuBA,SAAS,aAAa,OAGpB;CACA,MAAM,EAAE,QAAQ,MAAM,WAAW;CAEjC,MAAM,aAAa,WAAW,MAAM,WAAW;CAC/C,MAAM,WAAW,WAAW,MAAM,cAAqC;AAMvE,QAAO;EACL;EACA,aAAa;GAAE,OANH,OAAO,MAAM;GAMH,OALV,SAAS,MAAM;GAKE,OAJjB,SAAS,MAAM;GAIS;EACrC;;;;;AAMH,SAAS,kBAAkB,OAA4B;AACrD,QAAO,GAAG,MAAM,MAAM,GAAG,MAAM,MAAM,GAAG,MAAM;;;;;;;;;;;;;;;AAgBhD,SAAgB,YAAY,EAC1B,UAGC;AACD,KAAI,CAAC,UAAU,WAAW,EAAG,QAAO;AAEpC,KAAI,WAAW,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AQ,MAAM,UAAU,EAAE;GAC1B,MAAM,MAAM,QAAQ,EAAE;GACtB,QAAQ,MAAM,UAAU,EAAE;GAC3B,CAAC;AAEF,MAAI,WAAW,WAAW,GAAG;AAE3B,wBAAqB;AAErB,QAAK,MAAM,OAAO,WAChB,cAAa,OAAO;SAEjB;AAEL,sBAAmB;AACnB,QAAK,MAAM,OAAO,WAChB,cAAa,OAAO;;;AAO1B,KAAI,CAAC,oBAAoB,oBAAoB;EAC3C,MAAM,YAAY,kBAAkB,mBAAmB;AAEvD,MAAI,YACF,QAAO,OAAO,YACZ,WAAW,KAAK,QAAQ,CAAC,UAAU,OAAO,UAAU,CAAC,CACtD;AAGH,SAAO,EAAE,QAAQ,WAAW;;CAI9B,MAAM,SAAiC,EAAE;AAEzC,MAAK,MAAM,OAAO,YAAY;EAC5B,MAAM,QAAQ,aAAa;AAC3B,MAAI,MACF,QAAO,UAAU,SAAS,kBAAkB,MAAM;OAC7C;GAGL,MAAM,WAAW,sBAAsB;IACrC,OAAO;IACP,OAAO;IACP,OAAO;IACR;AACD,UAAO,UAAU,SAAS,KAAK,SAAS,MAAM,GAAG,SAAS;;;AAI9D,QAAO;;AAGT,YAAY,iBAAiB,CAAC,SAAS"}
|
package/dist/styles/color.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
//#region src/styles/color.d.ts
|
|
2
|
-
declare function colorStyle({
|
|
3
|
-
color
|
|
4
|
-
}: {
|
|
5
|
-
color?: string | boolean;
|
|
6
|
-
}): {
|
|
7
|
-
color: string;
|
|
8
|
-
} | null;
|
|
9
|
-
declare namespace colorStyle {
|
|
10
|
-
var __lookupStyles: string[];
|
|
11
|
-
}
|
|
12
|
-
//#endregion
|
|
13
|
-
export { colorStyle };
|
|
14
|
-
//# sourceMappingURL=color.d.ts.map
|
package/dist/styles/color.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { getColorSpaceSuffix } from "../utils/color-space.js";
|
|
2
|
-
import { parseColor } from "../utils/styles.js";
|
|
3
|
-
import { convertColorChainToComponentChain } from "./createStyle.js";
|
|
4
|
-
//#region src/styles/color.ts
|
|
5
|
-
function colorStyle({ color }) {
|
|
6
|
-
if (!color) return null;
|
|
7
|
-
if (color === true) color = "currentColor";
|
|
8
|
-
if (typeof color === "string" && (color.startsWith("#") || color.startsWith("(#"))) color = parseColor(color).color || color;
|
|
9
|
-
const match = color.match(/var\(--(.+?)-color/);
|
|
10
|
-
let name = "";
|
|
11
|
-
if (match) name = match[1];
|
|
12
|
-
const styles = { color };
|
|
13
|
-
if (name && name !== "current") {
|
|
14
|
-
const suffix = getColorSpaceSuffix();
|
|
15
|
-
Object.assign(styles, {
|
|
16
|
-
"--current-color": color,
|
|
17
|
-
[`--current-color-${suffix}`]: convertColorChainToComponentChain(color)
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
return styles;
|
|
21
|
-
}
|
|
22
|
-
colorStyle.__lookupStyles = ["color"];
|
|
23
|
-
//#endregion
|
|
24
|
-
export { colorStyle };
|
|
25
|
-
|
|
26
|
-
//# sourceMappingURL=color.js.map
|
package/dist/styles/color.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"color.js","names":[],"sources":["../../src/styles/color.ts"],"sourcesContent":["import { getColorSpaceSuffix } from '../utils/color-space';\nimport { parseColor } from '../utils/styles';\n\nimport { convertColorChainToComponentChain } from './createStyle';\n\nexport function colorStyle({ color }: { color?: string | boolean }) {\n if (!color) return null;\n\n if (color === true) color = 'currentColor';\n\n if (\n typeof color === 'string' &&\n (color.startsWith('#') || color.startsWith('(#'))\n ) {\n color = parseColor(color).color || color;\n }\n\n const match = color.match(/var\\(--(.+?)-color/);\n let name = '';\n\n if (match) {\n name = match[1];\n }\n\n const styles = {\n color: color,\n };\n\n if (name && name !== 'current') {\n const suffix = getColorSpaceSuffix();\n Object.assign(styles, {\n '--current-color': color,\n [`--current-color-${suffix}`]: convertColorChainToComponentChain(color),\n });\n }\n\n return styles;\n}\n\ncolorStyle.__lookupStyles = ['color'];\n"],"mappings":";;;;AAKA,SAAgB,WAAW,EAAE,SAAuC;AAClE,KAAI,CAAC,MAAO,QAAO;AAEnB,KAAI,UAAU,KAAM,SAAQ;AAE5B,KACE,OAAO,UAAU,aAChB,MAAM,WAAW,IAAI,IAAI,MAAM,WAAW,KAAK,EAEhD,SAAQ,WAAW,MAAM,CAAC,SAAS;CAGrC,MAAM,QAAQ,MAAM,MAAM,qBAAqB;CAC/C,IAAI,OAAO;AAEX,KAAI,MACF,QAAO,MAAM;CAGf,MAAM,SAAS,EACN,OACR;AAED,KAAI,QAAQ,SAAS,WAAW;EAC9B,MAAM,SAAS,qBAAqB;AACpC,SAAO,OAAO,QAAQ;GACpB,mBAAmB;IAClB,mBAAmB,WAAW,kCAAkC,MAAM;GACxE,CAAC;;AAGJ,QAAO;;AAGT,WAAW,iBAAiB,CAAC,QAAQ"}
|
package/dist/styles/const.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
//#region src/styles/const.ts
|
|
2
|
-
const BORDER_STYLES = [
|
|
3
|
-
"none",
|
|
4
|
-
"hidden",
|
|
5
|
-
"dotted",
|
|
6
|
-
"dashed",
|
|
7
|
-
"solid",
|
|
8
|
-
"double",
|
|
9
|
-
"groove",
|
|
10
|
-
"ridge",
|
|
11
|
-
"inset",
|
|
12
|
-
"outset"
|
|
13
|
-
];
|
|
14
|
-
//#endregion
|
|
15
|
-
export { BORDER_STYLES };
|
|
16
|
-
|
|
17
|
-
//# sourceMappingURL=const.js.map
|
package/dist/styles/const.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"const.js","names":[],"sources":["../../src/styles/const.ts"],"sourcesContent":["export const BORDER_STYLES = [\n 'none',\n 'hidden',\n 'dotted',\n 'dashed',\n 'solid',\n 'double',\n 'groove',\n 'ridge',\n 'inset',\n 'outset',\n] as const;\n"],"mappings":";AAAA,MAAa,gBAAgB;CAC3B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD"}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { getColorSpaceComponents, getColorSpaceSuffix, strToColorSpace } from "../utils/color-space.js";
|
|
2
|
-
import { normalizeColorTokenValue, parseColor, parseStyle } from "../utils/styles.js";
|
|
3
|
-
import { toSnakeCase } from "../utils/string.js";
|
|
4
|
-
//#region src/styles/createStyle.ts
|
|
5
|
-
const CACHE = {};
|
|
6
|
-
/**
|
|
7
|
-
* Convert color fallback chain to component fallback chain.
|
|
8
|
-
* Example: var(--primary-color, var(--secondary-color))
|
|
9
|
-
* → var(--primary-color-oklch, var(--secondary-color-oklch))
|
|
10
|
-
*/
|
|
11
|
-
function convertColorChainToComponentChain(colorValue) {
|
|
12
|
-
const suffix = getColorSpaceSuffix();
|
|
13
|
-
const componentVarMatch = colorValue.match(/^(?:rgb|hsl|oklch)a?\(\s*(var\(--[a-z0-9-]+-color-(?:rgb|hsl|oklch)\))\s*\//);
|
|
14
|
-
if (componentVarMatch) return componentVarMatch[1];
|
|
15
|
-
const match = colorValue.match(/var\(--([a-z0-9-]+)-color\s*(?:,\s*(.+))?\)/);
|
|
16
|
-
if (!match) {
|
|
17
|
-
const components = getColorSpaceComponents(colorValue);
|
|
18
|
-
if (components !== colorValue) return components;
|
|
19
|
-
return colorValue;
|
|
20
|
-
}
|
|
21
|
-
const [, name, fallback] = match;
|
|
22
|
-
if (!fallback) return `var(--${name}-color-${suffix})`;
|
|
23
|
-
return `var(--${name}-color-${suffix}, ${convertColorChainToComponentChain(fallback.trim())})`;
|
|
24
|
-
}
|
|
25
|
-
function createStyle(styleName, cssStyle, converter) {
|
|
26
|
-
const key = `${styleName}.${cssStyle ?? ""}`;
|
|
27
|
-
if (!CACHE[key]) {
|
|
28
|
-
const styleHandler = (styleMap) => {
|
|
29
|
-
let styleValue = styleMap[styleName];
|
|
30
|
-
if (styleValue == null || styleValue === false) return null;
|
|
31
|
-
let finalCssStyle;
|
|
32
|
-
const isColorToken = !cssStyle && typeof styleName === "string" && styleName.startsWith("#");
|
|
33
|
-
if (isColorToken) finalCssStyle = `--${toSnakeCase(styleName.slice(1)).replace(/^-+/, "")}-color`;
|
|
34
|
-
else finalCssStyle = cssStyle || toSnakeCase(styleName).replace(/^\$/, "--");
|
|
35
|
-
if (isColorToken) {
|
|
36
|
-
const normalized = normalizeColorTokenValue(styleValue);
|
|
37
|
-
if (normalized === null) return null;
|
|
38
|
-
styleValue = normalized;
|
|
39
|
-
}
|
|
40
|
-
if (converter && typeof styleValue !== "string") {
|
|
41
|
-
styleValue = converter(styleValue);
|
|
42
|
-
if (!styleValue) return null;
|
|
43
|
-
}
|
|
44
|
-
if (typeof styleValue === "string" && finalCssStyle.startsWith("--") && finalCssStyle.endsWith("-color")) {
|
|
45
|
-
styleValue = styleValue.trim();
|
|
46
|
-
const suffix = getColorSpaceSuffix();
|
|
47
|
-
const colorSpaceStr = strToColorSpace(styleValue);
|
|
48
|
-
const { color, name } = parseColor(styleValue);
|
|
49
|
-
if (name && colorSpaceStr) return {
|
|
50
|
-
[finalCssStyle]: `var(--${name}-color, ${colorSpaceStr})`,
|
|
51
|
-
[`${finalCssStyle}-${suffix}`]: `var(--${name}-color-${suffix}, ${getColorSpaceComponents(colorSpaceStr)})`
|
|
52
|
-
};
|
|
53
|
-
else if (name) {
|
|
54
|
-
if (color) return {
|
|
55
|
-
[finalCssStyle]: color,
|
|
56
|
-
[`${finalCssStyle}-${suffix}`]: convertColorChainToComponentChain(color)
|
|
57
|
-
};
|
|
58
|
-
return {
|
|
59
|
-
[finalCssStyle]: `var(--${name}-color)`,
|
|
60
|
-
[`${finalCssStyle}-${suffix}`]: `var(--${name}-color-${suffix})`
|
|
61
|
-
};
|
|
62
|
-
} else if (colorSpaceStr) return {
|
|
63
|
-
[finalCssStyle]: colorSpaceStr,
|
|
64
|
-
[`${finalCssStyle}-${suffix}`]: getColorSpaceComponents(colorSpaceStr)
|
|
65
|
-
};
|
|
66
|
-
return { [finalCssStyle]: color ?? "" };
|
|
67
|
-
}
|
|
68
|
-
const processed = parseStyle(styleValue);
|
|
69
|
-
return { [finalCssStyle]: processed.output };
|
|
70
|
-
};
|
|
71
|
-
styleHandler.__lookupStyles = [styleName];
|
|
72
|
-
CACHE[key] = styleHandler;
|
|
73
|
-
}
|
|
74
|
-
return CACHE[key];
|
|
75
|
-
}
|
|
76
|
-
//#endregion
|
|
77
|
-
export { convertColorChainToComponentChain, createStyle };
|
|
78
|
-
|
|
79
|
-
//# sourceMappingURL=createStyle.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createStyle.js","names":[],"sources":["../../src/styles/createStyle.ts"],"sourcesContent":["import {\n getColorSpaceComponents,\n getColorSpaceSuffix,\n strToColorSpace,\n} from '../utils/color-space';\nimport { toSnakeCase } from '../utils/string';\nimport {\n normalizeColorTokenValue,\n parseColor,\n parseStyle,\n} from '../utils/styles';\nimport type {\n CSSMap,\n StyleHandler,\n StyleValue,\n StyleValueStateMap,\n} from '../utils/styles';\n\nconst CACHE: Record<string, StyleHandler> = {};\n\n/**\n * Convert color fallback chain to component fallback chain.\n * Example: var(--primary-color, var(--secondary-color))\n * → var(--primary-color-oklch, var(--secondary-color-oklch))\n */\nexport function convertColorChainToComponentChain(colorValue: string): string {\n const suffix = getColorSpaceSuffix();\n\n // Handle func(var(--name-color-{suffix}) / alpha) pattern.\n // When #name.opacity is parsed, the classifier produces e.g.\n // oklch(var(--name-color-oklch) / .opacity).\n // The component chain should be just the inner var() reference.\n const componentVarMatch = colorValue.match(\n /^(?:rgb|hsl|oklch)a?\\(\\s*(var\\(--[a-z0-9-]+-color-(?:rgb|hsl|oklch)\\))\\s*\\//,\n );\n if (componentVarMatch) {\n return componentVarMatch[1];\n }\n\n // Match var(--name-color, ...) pattern\n const varPattern = /var\\(--([a-z0-9-]+)-color\\s*(?:,\\s*(.+))?\\)/;\n const match = colorValue.match(varPattern);\n\n if (!match) {\n // Not a color variable — try to convert to components\n const components = getColorSpaceComponents(colorValue);\n if (components !== colorValue) return components;\n return colorValue;\n }\n\n const [, name, fallback] = match;\n\n if (!fallback) {\n return `var(--${name}-color-${suffix})`;\n }\n\n const processedFallback = convertColorChainToComponentChain(fallback.trim());\n return `var(--${name}-color-${suffix}, ${processedFallback})`;\n}\n\nexport function createStyle(\n styleName: string,\n cssStyle?: string,\n converter?: (styleValue: string | number | true) => string | undefined,\n) {\n const key = `${styleName}.${cssStyle ?? ''}`;\n\n if (!CACHE[key]) {\n const styleHandler = (styleMap: StyleValueStateMap): CSSMap | null => {\n let styleValue = styleMap[styleName];\n\n if (styleValue == null || styleValue === false) return null;\n\n let finalCssStyle: string;\n const isColorToken =\n !cssStyle && typeof styleName === 'string' && styleName.startsWith('#');\n\n if (isColorToken) {\n const raw = styleName.slice(1);\n const name = toSnakeCase(raw).replace(/^-+/, '');\n finalCssStyle = `--${name}-color`;\n } else {\n finalCssStyle = cssStyle || toSnakeCase(styleName).replace(/^\\$/, '--');\n }\n\n if (isColorToken) {\n const normalized = normalizeColorTokenValue(styleValue);\n if (normalized === null) return null;\n styleValue = normalized;\n }\n\n if (converter && typeof styleValue !== 'string') {\n styleValue = converter(styleValue as string | number | true);\n\n if (!styleValue) return null;\n }\n\n if (\n typeof styleValue === 'string' &&\n finalCssStyle.startsWith('--') &&\n finalCssStyle.endsWith('-color')\n ) {\n styleValue = styleValue.trim();\n const suffix = getColorSpaceSuffix();\n\n const colorSpaceStr = strToColorSpace(styleValue as string);\n\n const { color, name } = parseColor(styleValue as string);\n\n if (name && colorSpaceStr) {\n return {\n [finalCssStyle]: `var(--${name}-color, ${colorSpaceStr})`,\n [`${finalCssStyle}-${suffix}`]: `var(--${name}-color-${suffix}, ${getColorSpaceComponents(\n colorSpaceStr,\n )})`,\n };\n } else if (name) {\n if (color) {\n return {\n [finalCssStyle]: color,\n [`${finalCssStyle}-${suffix}`]:\n convertColorChainToComponentChain(color),\n };\n }\n\n return {\n [finalCssStyle]: `var(--${name}-color)`,\n [`${finalCssStyle}-${suffix}`]: `var(--${name}-color-${suffix})`,\n };\n } else if (colorSpaceStr) {\n return {\n [finalCssStyle]: colorSpaceStr,\n [`${finalCssStyle}-${suffix}`]:\n getColorSpaceComponents(colorSpaceStr),\n };\n }\n\n return {\n [finalCssStyle]: color ?? '',\n };\n }\n\n const processed = parseStyle(styleValue as StyleValue);\n return { [finalCssStyle]: processed.output };\n };\n\n styleHandler.__lookupStyles = [styleName];\n\n CACHE[key] = styleHandler;\n }\n\n return CACHE[key];\n}\n"],"mappings":";;;;AAkBA,MAAM,QAAsC,EAAE;;;;;;AAO9C,SAAgB,kCAAkC,YAA4B;CAC5E,MAAM,SAAS,qBAAqB;CAMpC,MAAM,oBAAoB,WAAW,MACnC,8EACD;AACD,KAAI,kBACF,QAAO,kBAAkB;CAK3B,MAAM,QAAQ,WAAW,MADN,8CACuB;AAE1C,KAAI,CAAC,OAAO;EAEV,MAAM,aAAa,wBAAwB,WAAW;AACtD,MAAI,eAAe,WAAY,QAAO;AACtC,SAAO;;CAGT,MAAM,GAAG,MAAM,YAAY;AAE3B,KAAI,CAAC,SACH,QAAO,SAAS,KAAK,SAAS,OAAO;AAIvC,QAAO,SAAS,KAAK,SAAS,OAAO,IADX,kCAAkC,SAAS,MAAM,CAAC,CACjB;;AAG7D,SAAgB,YACd,WACA,UACA,WACA;CACA,MAAM,MAAM,GAAG,UAAU,GAAG,YAAY;AAExC,KAAI,CAAC,MAAM,MAAM;EACf,MAAM,gBAAgB,aAAgD;GACpE,IAAI,aAAa,SAAS;AAE1B,OAAI,cAAc,QAAQ,eAAe,MAAO,QAAO;GAEvD,IAAI;GACJ,MAAM,eACJ,CAAC,YAAY,OAAO,cAAc,YAAY,UAAU,WAAW,IAAI;AAEzE,OAAI,aAGF,iBAAgB,KADH,YADD,UAAU,MAAM,EAAE,CACD,CAAC,QAAQ,OAAO,GAAG,CACtB;OAE1B,iBAAgB,YAAY,YAAY,UAAU,CAAC,QAAQ,OAAO,KAAK;AAGzE,OAAI,cAAc;IAChB,MAAM,aAAa,yBAAyB,WAAW;AACvD,QAAI,eAAe,KAAM,QAAO;AAChC,iBAAa;;AAGf,OAAI,aAAa,OAAO,eAAe,UAAU;AAC/C,iBAAa,UAAU,WAAqC;AAE5D,QAAI,CAAC,WAAY,QAAO;;AAG1B,OACE,OAAO,eAAe,YACtB,cAAc,WAAW,KAAK,IAC9B,cAAc,SAAS,SAAS,EAChC;AACA,iBAAa,WAAW,MAAM;IAC9B,MAAM,SAAS,qBAAqB;IAEpC,MAAM,gBAAgB,gBAAgB,WAAqB;IAE3D,MAAM,EAAE,OAAO,SAAS,WAAW,WAAqB;AAExD,QAAI,QAAQ,cACV,QAAO;MACJ,gBAAgB,SAAS,KAAK,UAAU,cAAc;MACtD,GAAG,cAAc,GAAG,WAAW,SAAS,KAAK,SAAS,OAAO,IAAI,wBAChE,cACD,CAAC;KACH;aACQ,MAAM;AACf,SAAI,MACF,QAAO;OACJ,gBAAgB;OAChB,GAAG,cAAc,GAAG,WACnB,kCAAkC,MAAM;MAC3C;AAGH,YAAO;OACJ,gBAAgB,SAAS,KAAK;OAC9B,GAAG,cAAc,GAAG,WAAW,SAAS,KAAK,SAAS,OAAO;MAC/D;eACQ,cACT,QAAO;MACJ,gBAAgB;MAChB,GAAG,cAAc,GAAG,WACnB,wBAAwB,cAAc;KACzC;AAGH,WAAO,GACJ,gBAAgB,SAAS,IAC3B;;GAGH,MAAM,YAAY,WAAW,WAAyB;AACtD,UAAO,GAAG,gBAAgB,UAAU,QAAQ;;AAG9C,eAAa,iBAAiB,CAAC,UAAU;AAEzC,QAAM,OAAO;;AAGf,QAAO,MAAM"}
|
package/dist/styles/dimension.js
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { CSS_WIDE_KEYWORDS } from "../parser/const.js";
|
|
2
|
-
import { makeEmptyDetails } from "../parser/types.js";
|
|
3
|
-
import { parseStyle } from "../utils/styles.js";
|
|
4
|
-
//#region src/styles/dimension.ts
|
|
5
|
-
const DEFAULT_MIN_SIZE = "var(--gap)";
|
|
6
|
-
const DEFAULT_MAX_SIZE = "100%";
|
|
7
|
-
/**
|
|
8
|
-
* Parse a dimension value (string, number, or boolean) into a CSS value
|
|
9
|
-
*/
|
|
10
|
-
function parseDimensionValue(val) {
|
|
11
|
-
if (val == null) return null;
|
|
12
|
-
if (typeof val === "number") return `${val}px`;
|
|
13
|
-
if (val === true) return "initial";
|
|
14
|
-
return parseStyle(String(val)).groups[0]?.values[0] || null;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Creates a dimension style handler for width or height.
|
|
18
|
-
*
|
|
19
|
-
* Supports:
|
|
20
|
-
* - Main dimension prop (width/height) with syntax for min/max
|
|
21
|
-
* - Separate min/max props (minWidth/maxWidth or minHeight/maxHeight)
|
|
22
|
-
*
|
|
23
|
-
* Priority: Individual min/max props override values from main prop syntax
|
|
24
|
-
*/
|
|
25
|
-
function dimensionStyle(name) {
|
|
26
|
-
const minStyle = `min-${name}`;
|
|
27
|
-
const maxStyle = `max-${name}`;
|
|
28
|
-
return ({ value, min, max }) => {
|
|
29
|
-
if (value == null && min == null && max == null) return null;
|
|
30
|
-
if (value != null && typeof value === "string" && CSS_WIDE_KEYWORDS.has(value)) {
|
|
31
|
-
const styles = {
|
|
32
|
-
[name]: value,
|
|
33
|
-
[minStyle]: value,
|
|
34
|
-
[maxStyle]: value
|
|
35
|
-
};
|
|
36
|
-
const minVal = parseDimensionValue(min);
|
|
37
|
-
const maxVal = parseDimensionValue(max);
|
|
38
|
-
if (minVal) styles[minStyle] = minVal;
|
|
39
|
-
if (maxVal) styles[maxStyle] = maxVal;
|
|
40
|
-
return styles;
|
|
41
|
-
}
|
|
42
|
-
if (value === true) {
|
|
43
|
-
const styles = {
|
|
44
|
-
[name]: "auto",
|
|
45
|
-
[minStyle]: "initial",
|
|
46
|
-
[maxStyle]: "initial"
|
|
47
|
-
};
|
|
48
|
-
const minVal = parseDimensionValue(min);
|
|
49
|
-
const maxVal = parseDimensionValue(max);
|
|
50
|
-
if (minVal) styles[minStyle] = minVal;
|
|
51
|
-
if (maxVal) styles[maxStyle] = maxVal;
|
|
52
|
-
return styles;
|
|
53
|
-
}
|
|
54
|
-
const styles = {
|
|
55
|
-
[name]: "auto",
|
|
56
|
-
[minStyle]: "initial",
|
|
57
|
-
[maxStyle]: "initial"
|
|
58
|
-
};
|
|
59
|
-
if (value != null) {
|
|
60
|
-
let val = value;
|
|
61
|
-
if (typeof val === "number") val = `${val}px`;
|
|
62
|
-
val = String(val);
|
|
63
|
-
const { mods, values } = parseStyle(val).groups[0] ?? makeEmptyDetails();
|
|
64
|
-
let flag = false;
|
|
65
|
-
for (const mod of mods) switch (mod) {
|
|
66
|
-
case "min":
|
|
67
|
-
styles[minStyle] = values[0] || DEFAULT_MIN_SIZE;
|
|
68
|
-
flag = true;
|
|
69
|
-
break;
|
|
70
|
-
case "max":
|
|
71
|
-
styles[maxStyle] = values[0] || DEFAULT_MAX_SIZE;
|
|
72
|
-
flag = true;
|
|
73
|
-
break;
|
|
74
|
-
case "fixed": {
|
|
75
|
-
const fixedValue = values[0] || "max-content";
|
|
76
|
-
styles[minStyle] = fixedValue;
|
|
77
|
-
styles[name] = fixedValue;
|
|
78
|
-
styles[maxStyle] = fixedValue;
|
|
79
|
-
flag = true;
|
|
80
|
-
break;
|
|
81
|
-
}
|
|
82
|
-
default: break;
|
|
83
|
-
}
|
|
84
|
-
if (!flag || !mods.length) if (values.length === 2) {
|
|
85
|
-
styles[minStyle] = values[0];
|
|
86
|
-
styles[maxStyle] = values[1];
|
|
87
|
-
} else if (values.length === 3) {
|
|
88
|
-
styles[minStyle] = values[0];
|
|
89
|
-
styles[name] = values[1];
|
|
90
|
-
styles[maxStyle] = values[2];
|
|
91
|
-
} else styles[name] = values[0] || "auto";
|
|
92
|
-
if (styles[name] === "stretch") if (name === "width") styles[name] = [
|
|
93
|
-
"stretch",
|
|
94
|
-
"-webkit-fill-available",
|
|
95
|
-
"-moz-available"
|
|
96
|
-
];
|
|
97
|
-
else styles[name] = "auto";
|
|
98
|
-
}
|
|
99
|
-
const minVal = parseDimensionValue(min);
|
|
100
|
-
const maxVal = parseDimensionValue(max);
|
|
101
|
-
if (minVal) styles[minStyle] = minVal;
|
|
102
|
-
if (maxVal) styles[maxStyle] = maxVal;
|
|
103
|
-
return styles;
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
//#endregion
|
|
107
|
-
export { dimensionStyle };
|
|
108
|
-
|
|
109
|
-
//# sourceMappingURL=dimension.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dimension.js","names":[],"sources":["../../src/styles/dimension.ts"],"sourcesContent":["import { CSS_WIDE_KEYWORDS } from '../parser/const';\nimport { makeEmptyDetails } from '../parser/types';\nimport { parseStyle } from '../utils/styles';\n\nconst DEFAULT_MIN_SIZE = 'var(--gap)';\nconst DEFAULT_MAX_SIZE = '100%';\n\n/**\n * Parse a dimension value (string, number, or boolean) into a CSS value\n */\nfunction parseDimensionValue(\n val: string | number | boolean | undefined,\n): string | null {\n if (val == null) return null;\n if (typeof val === 'number') return `${val}px`;\n if (val === true) return 'initial';\n\n const processed = parseStyle(String(val));\n return processed.groups[0]?.values[0] || null;\n}\n\ninterface DimensionProps {\n value?: string | number | boolean;\n min?: string | number | boolean;\n max?: string | number | boolean;\n}\n\n/**\n * Creates a dimension style handler for width or height.\n *\n * Supports:\n * - Main dimension prop (width/height) with syntax for min/max\n * - Separate min/max props (minWidth/maxWidth or minHeight/maxHeight)\n *\n * Priority: Individual min/max props override values from main prop syntax\n */\nexport function dimensionStyle(name: 'width' | 'height') {\n const minStyle = `min-${name}`;\n const maxStyle = `max-${name}`;\n\n return ({ value, min, max }: DimensionProps) => {\n if (value == null && min == null && max == null) return null;\n\n if (\n value != null &&\n typeof value === 'string' &&\n CSS_WIDE_KEYWORDS.has(value)\n ) {\n const styles: Record<string, string> = {\n [name]: value,\n [minStyle]: value,\n [maxStyle]: value,\n };\n\n const minVal = parseDimensionValue(min);\n const maxVal = parseDimensionValue(max);\n if (minVal) styles[minStyle] = minVal;\n if (maxVal) styles[maxStyle] = maxVal;\n\n return styles;\n }\n\n if (value === true) {\n const styles: Record<string, string | string[]> = {\n [name]: 'auto',\n [minStyle]: 'initial',\n [maxStyle]: 'initial',\n };\n\n // Apply individual min/max overrides\n const minVal = parseDimensionValue(min);\n const maxVal = parseDimensionValue(max);\n if (minVal) styles[minStyle] = minVal;\n if (maxVal) styles[maxStyle] = maxVal;\n\n return styles;\n }\n\n const styles: Record<string, string | string[]> = {\n [name]: 'auto',\n [minStyle]: 'initial',\n [maxStyle]: 'initial',\n };\n\n // Process main dimension value\n if (value != null) {\n let val = value;\n if (typeof val === 'number') {\n val = `${val}px`;\n }\n\n val = String(val);\n\n const processed = parseStyle(val);\n const { mods, values } = processed.groups[0] ?? makeEmptyDetails();\n\n let flag = false;\n\n for (const mod of mods) {\n switch (mod) {\n case 'min':\n styles[minStyle] = values[0] || DEFAULT_MIN_SIZE;\n flag = true;\n break;\n case 'max':\n styles[maxStyle] = values[0] || DEFAULT_MAX_SIZE;\n flag = true;\n break;\n case 'fixed': {\n // Fixed modifier: set all three dimensions to the same value\n const fixedValue = values[0] || 'max-content';\n styles[minStyle] = fixedValue;\n styles[name] = fixedValue;\n styles[maxStyle] = fixedValue;\n flag = true;\n break;\n }\n default:\n break;\n }\n }\n\n if (!flag || !mods.length) {\n if (values.length === 2) {\n styles[minStyle] = values[0];\n styles[maxStyle] = values[1];\n } else if (values.length === 3) {\n styles[minStyle] = values[0];\n styles[name] = values[1];\n styles[maxStyle] = values[2];\n } else {\n styles[name] = values[0] || 'auto';\n }\n }\n\n if (styles[name] === 'stretch') {\n if (name === 'width') {\n styles[name] = [\n 'stretch',\n '-webkit-fill-available',\n '-moz-available',\n ];\n } else {\n styles[name] = 'auto';\n }\n }\n }\n\n // Apply individual min/max props (higher priority, override main prop syntax)\n const minVal = parseDimensionValue(min);\n const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,WAAW,IAAI,CACE,OAAO,MAAM,kBAAkB;GAElE,IAAI,OAAO;AAEX,QAAK,MAAM,OAAO,KAChB,SAAQ,KAAR;IACE,KAAK;AACH,YAAO,YAAY,OAAO,MAAM;AAChC,YAAO;AACP;IACF,KAAK;AACH,YAAO,YAAY,OAAO,MAAM;AAChC,YAAO;AACP;IACF,KAAK,SAAS;KAEZ,MAAM,aAAa,OAAO,MAAM;AAChC,YAAO,YAAY;AACnB,YAAO,QAAQ;AACf,YAAO,YAAY;AACnB,YAAO;AACP;;IAEF,QACE;;AAIN,OAAI,CAAC,QAAQ,CAAC,KAAK,OACjB,KAAI,OAAO,WAAW,GAAG;AACvB,WAAO,YAAY,OAAO;AAC1B,WAAO,YAAY,OAAO;cACjB,OAAO,WAAW,GAAG;AAC9B,WAAO,YAAY,OAAO;AAC1B,WAAO,QAAQ,OAAO;AACtB,WAAO,YAAY,OAAO;SAE1B,QAAO,QAAQ,OAAO,MAAM;AAIhC,OAAI,OAAO,UAAU,UACnB,KAAI,SAAS,QACX,QAAO,QAAQ;IACb;IACA;IACA;IACD;OAED,QAAO,QAAQ;;EAMrB,MAAM,SAAS,oBAAoB,IAAI;EACvC,MAAM,SAAS,oBAAoB,IAAI;AACvC,MAAI,OAAQ,QAAO,YAAY;AAC/B,MAAI,OAAQ,QAAO,YAAY;AAE/B,SAAO"}
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { CSS_WIDE_KEYWORDS } from "../parser/const.js";
|
|
2
|
-
import { DIRECTIONS, filterMods, parseStyle } from "../utils/styles.js";
|
|
3
|
-
import { extractCSSWideKeyword } from "./shared.js";
|
|
4
|
-
//#region src/styles/directional.ts
|
|
5
|
-
function parseSingleValue(val, defaultValue, trueValue) {
|
|
6
|
-
if (typeof val === "number") return `${val}px`;
|
|
7
|
-
if (!val) return null;
|
|
8
|
-
if (val === true) val = trueValue;
|
|
9
|
-
const strVal = String(val);
|
|
10
|
-
if (CSS_WIDE_KEYWORDS.has(strVal)) return strVal;
|
|
11
|
-
const { values } = parseStyle(strVal).groups[0] ?? { values: [] };
|
|
12
|
-
return values[0] || defaultValue;
|
|
13
|
-
}
|
|
14
|
-
function extractGroupData(group, defaultValue) {
|
|
15
|
-
const { values = [], mods = [] } = group;
|
|
16
|
-
return {
|
|
17
|
-
values: values.length ? values : [defaultValue],
|
|
18
|
-
directions: filterMods(mods, DIRECTIONS)
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
function applyGroup(dirs, values, directions) {
|
|
22
|
-
if (!values.length) return;
|
|
23
|
-
if (directions.length === 0) {
|
|
24
|
-
dirs.top = values[0];
|
|
25
|
-
dirs.right = values[1] || values[0];
|
|
26
|
-
dirs.bottom = values[2] || values[0];
|
|
27
|
-
dirs.left = values[3] || values[1] || values[0];
|
|
28
|
-
} else directions.forEach((dir, i) => {
|
|
29
|
-
dirs[dir] = values[i] ?? values[0];
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
function optimizeShorthand(property, dirs) {
|
|
33
|
-
const { top, right, bottom, left } = dirs;
|
|
34
|
-
if (top === right && right === bottom && bottom === left) return { [property]: top };
|
|
35
|
-
if (top === bottom && left === right) return { [property]: `${top} ${left}` };
|
|
36
|
-
return { [property]: `${top} ${right} ${bottom} ${left}` };
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Core directional style logic shared by padding, margin, inset, scrollMargin.
|
|
40
|
-
*/
|
|
41
|
-
function processDirectionalStyle(config, props) {
|
|
42
|
-
const { main, block, inline, top, right, bottom, left } = props;
|
|
43
|
-
if (main == null && block == null && inline == null && top == null && right == null && bottom == null && left == null) return null;
|
|
44
|
-
const { property, defaultValue, trueValue, defaultInit, individualOnly, directionProperty } = config;
|
|
45
|
-
const dirProp = directionProperty ?? ((dir) => `${property}-${dir}`);
|
|
46
|
-
if (individualOnly) {
|
|
47
|
-
if (main == null && block == null && inline == null) {
|
|
48
|
-
const result = {};
|
|
49
|
-
if (top != null) {
|
|
50
|
-
const val = parseSingleValue(top, defaultValue, trueValue);
|
|
51
|
-
if (val) result[dirProp("top")] = val;
|
|
52
|
-
}
|
|
53
|
-
if (right != null) {
|
|
54
|
-
const val = parseSingleValue(right, defaultValue, trueValue);
|
|
55
|
-
if (val) result[dirProp("right")] = val;
|
|
56
|
-
}
|
|
57
|
-
if (bottom != null) {
|
|
58
|
-
const val = parseSingleValue(bottom, defaultValue, trueValue);
|
|
59
|
-
if (val) result[dirProp("bottom")] = val;
|
|
60
|
-
}
|
|
61
|
-
if (left != null) {
|
|
62
|
-
const val = parseSingleValue(left, defaultValue, trueValue);
|
|
63
|
-
if (val) result[dirProp("left")] = val;
|
|
64
|
-
}
|
|
65
|
-
return Object.keys(result).length > 0 ? result : null;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
const dirs = {
|
|
69
|
-
top: defaultInit,
|
|
70
|
-
right: defaultInit,
|
|
71
|
-
bottom: defaultInit,
|
|
72
|
-
left: defaultInit
|
|
73
|
-
};
|
|
74
|
-
let useLonghand = false;
|
|
75
|
-
if (main != null) if (typeof main === "number") dirs.top = dirs.right = dirs.bottom = dirs.left = `${main}px`;
|
|
76
|
-
else {
|
|
77
|
-
const strMain = main === true ? trueValue : String(main);
|
|
78
|
-
if (strMain) {
|
|
79
|
-
const keyword = CSS_WIDE_KEYWORDS.has(strMain) ? strMain : null;
|
|
80
|
-
if (keyword) dirs.top = dirs.right = dirs.bottom = dirs.left = keyword;
|
|
81
|
-
else {
|
|
82
|
-
const groups = parseStyle(strMain).groups ?? [];
|
|
83
|
-
for (const group of groups) {
|
|
84
|
-
if (group.mods.includes("longhand")) useLonghand = true;
|
|
85
|
-
const kw = extractCSSWideKeyword(group);
|
|
86
|
-
if (kw) {
|
|
87
|
-
const groupDirs = filterMods(group.mods, DIRECTIONS);
|
|
88
|
-
if (groupDirs.length === 0) dirs.top = dirs.right = dirs.bottom = dirs.left = kw;
|
|
89
|
-
else for (const dir of groupDirs) dirs[dir] = kw;
|
|
90
|
-
} else {
|
|
91
|
-
const { values, directions } = extractGroupData(group, defaultValue);
|
|
92
|
-
applyGroup(dirs, values, directions);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
if (block != null) {
|
|
99
|
-
const val = parseSingleValue(block, defaultValue, trueValue);
|
|
100
|
-
if (val) dirs.top = dirs.bottom = val;
|
|
101
|
-
}
|
|
102
|
-
if (inline != null) {
|
|
103
|
-
const val = parseSingleValue(inline, defaultValue, trueValue);
|
|
104
|
-
if (val) dirs.left = dirs.right = val;
|
|
105
|
-
}
|
|
106
|
-
if (top != null) {
|
|
107
|
-
const val = parseSingleValue(top, defaultValue, trueValue);
|
|
108
|
-
if (val) dirs.top = val;
|
|
109
|
-
}
|
|
110
|
-
if (right != null) {
|
|
111
|
-
const val = parseSingleValue(right, defaultValue, trueValue);
|
|
112
|
-
if (val) dirs.right = val;
|
|
113
|
-
}
|
|
114
|
-
if (bottom != null) {
|
|
115
|
-
const val = parseSingleValue(bottom, defaultValue, trueValue);
|
|
116
|
-
if (val) dirs.bottom = val;
|
|
117
|
-
}
|
|
118
|
-
if (left != null) {
|
|
119
|
-
const val = parseSingleValue(left, defaultValue, trueValue);
|
|
120
|
-
if (val) dirs.left = val;
|
|
121
|
-
}
|
|
122
|
-
if (useLonghand) return {
|
|
123
|
-
[dirProp("top")]: dirs.top,
|
|
124
|
-
[dirProp("right")]: dirs.right,
|
|
125
|
-
[dirProp("bottom")]: dirs.bottom,
|
|
126
|
-
[dirProp("left")]: dirs.left
|
|
127
|
-
};
|
|
128
|
-
return optimizeShorthand(property, dirs);
|
|
129
|
-
}
|
|
130
|
-
//#endregion
|
|
131
|
-
export { processDirectionalStyle };
|
|
132
|
-
|
|
133
|
-
//# sourceMappingURL=directional.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"directional.js","names":[],"sources":["../../src/styles/directional.ts"],"sourcesContent":["import type { StyleDetails } from '../parser/types';\nimport { CSS_WIDE_KEYWORDS } from '../parser/const';\nimport { DIRECTIONS, filterMods, parseStyle } from '../utils/styles';\nimport { extractCSSWideKeyword } from './shared';\n\ntype Direction = (typeof DIRECTIONS)[number];\n\nexport interface DirectionalConfig {\n /** CSS property name (e.g. 'padding', 'margin', 'inset', 'scroll-margin') */\n property: string;\n /** Default value when parsing yields empty (e.g. 'var(--gap)', '0') */\n defaultValue: string;\n /** Value used when the prop is `true` (e.g. '1x', '0') */\n trueValue: string;\n /** Default per-direction init value (e.g. '0', 'auto') */\n defaultInit: string;\n /**\n * When true, if only individual direction props are set (no shorthand,\n * no block/inline), output individual CSS properties instead of the\n * shorthand. Needed by inset for correct CSS cascade with modifiers.\n */\n individualOnly?: boolean;\n /**\n * Maps individual direction CSS property names. Defaults to\n * `${property}-top`, `${property}-right`, etc. For inset this is\n * `top`, `right`, `bottom`, `left`.\n */\n directionProperty?: (dir: Direction) => string;\n}\n\nexport function parseSingleValue(\n val: string | number | boolean,\n defaultValue: string,\n trueValue: string,\n): string | null {\n if (typeof val === 'number') return `${val}px`;\n if (!val) return null;\n if (val === true) val = trueValue;\n\n const strVal = String(val);\n\n if (CSS_WIDE_KEYWORDS.has(strVal)) return strVal;\n\n const { values } = parseStyle(strVal).groups[0] ?? { values: [] };\n\n return values[0] || defaultValue;\n}\n\nfunction extractGroupData(\n group: StyleDetails,\n defaultValue: string,\n): {\n values: string[];\n directions: Direction[];\n} {\n const { values = [], mods = [] } = group;\n\n return {\n values: values.length ? values : [defaultValue],\n directions: filterMods(mods, DIRECTIONS) as Direction[],\n };\n}\n\nfunction applyGroup(\n dirs: Record<Direction, string>,\n values: string[],\n directions: Direction[],\n): void {\n if (!values.length) return;\n\n if (directions.length === 0) {\n dirs.top = values[0];\n dirs.right = values[1] || values[0];\n dirs.bottom = values[2] || values[0];\n dirs.left = values[3] || values[1] || values[0];\n } else {\n directions.forEach((dir, i) => {\n dirs[dir] = values[i] ?? values[0];\n });\n }\n}\n\nfunction optimizeShorthand(\n property: string,\n dirs: Record<Direction, string>,\n): Record<string, string> {\n const { top, right, bottom, left } = dirs;\n\n if (top === right && right === bottom && bottom === left) {\n return { [property]: top };\n }\n if (top === bottom && left === right) {\n return { [property]: `${top} ${left}` };\n }\n\n return { [property]: `${top} ${right} ${bottom} ${left}` };\n}\n\nexport interface DirectionalProps {\n main?: string | number | boolean;\n block?: string | number | boolean;\n inline?: 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\n/**\n * Core directional style logic shared by padding, margin, inset, scrollMargin.\n */\nexport function processDirectionalStyle(\n config: DirectionalConfig,\n props: DirectionalProps,\n): Record<string, string> | null {\n const { main, block, inline, top, right, bottom, left } = props;\n\n if (\n main == null &&\n block == null &&\n inline == null &&\n top == null &&\n right == null &&\n bottom == null &&\n left == null\n ) {\n return null;\n }\n\n const {\n property,\n defaultValue,\n trueValue,\n defaultInit,\n individualOnly,\n directionProperty,\n } = config;\n const dirProp =\n directionProperty ?? ((dir: Direction) => `${property}-${dir}`);\n\n if (individualOnly) {\n const onlyIndividualProps = main == null && block == null && inline == null;\n\n if (onlyIndividualProps) {\n const result: Record<string, string> = {};\n\n if (top != null) {\n const val = parseSingleValue(top, defaultValue, trueValue);\n if (val) result[dirProp('top')] = val;\n }\n if (right != null) {\n const val = parseSingleValue(right, defaultValue, trueValue);\n if (val) result[dirProp('right')] = val;\n }\n if (bottom != null) {\n const val = parseSingleValue(bottom, defaultValue, trueValue);\n if (val) result[dirProp('bottom')] = val;\n }\n if (left != null) {\n const val = parseSingleValue(left, defaultValue, trueValue);\n if (val) result[dirProp('left')] = val;\n }\n\n return Object.keys(result).length > 0 ? result : null;\n }\n }\n\n const dirs: Record<Direction, string> = {\n top: defaultInit,\n right: defaultInit,\n bottom: defaultInit,\n left: defaultInit,\n };\n\n let useLonghand = false;\n\n if (main != null) {\n if (typeof main === 'number') {\n const v = `${main}px`;\n dirs.top = dirs.right = dirs.bottom = dirs.left = v;\n } else {\n const strMain = main === true ? trueValue : String(main);\n\n if (strMain) {\n const keyword = CSS_WIDE_KEYWORDS.has(strMain) ? strMain : null;\n\n if (keyword) {\n dirs.top = dirs.right = dirs.bottom = dirs.left = keyword;\n } else {\n const processed = parseStyle(strMain);\n const groups = processed.groups ?? [];\n\n for (const group of groups) {\n if (group.mods.includes('longhand')) {\n useLonghand = true;\n }\n\n const kw = extractCSSWideKeyword(group);\n\n if (kw) {\n const groupDirs = filterMods(\n group.mods,\n DIRECTIONS,\n ) as Direction[];\n\n if (groupDirs.length === 0) {\n dirs.top = dirs.right = dirs.bottom = dirs.left = kw;\n } else {\n for (const dir of groupDirs) {\n dirs[dir] = kw;\n }\n }\n } else {\n const { values, directions } = extractGroupData(\n group,\n defaultValue,\n );\n applyGroup(dirs, values, directions);\n }\n }\n }\n }\n }\n }\n\n if (block != null) {\n const val = parseSingleValue(block, defaultValue, trueValue);\n if (val) dirs.top = dirs.bottom = val;\n }\n if (inline != null) {\n const val = parseSingleValue(inline, defaultValue, trueValue);\n if (val) dirs.left = dirs.right = val;\n }\n\n if (top != null) {\n const val = parseSingleValue(top, defaultValue, trueValue);\n if (val) dirs.top = val;\n }\n if (right != null) {\n const val = parseSingleValue(right, defaultValue, trueValue);\n if (val) dirs.right = val;\n }\n if (bottom != null) {\n const val = parseSingleValue(bottom, defaultValue, trueValue);\n if (val) dirs.bottom = val;\n }\n if (left != null) {\n const val = parseSingleValue(left, defaultValue, trueValue);\n if (val) dirs.left = val;\n }\n\n if (useLonghand) {\n return {\n [dirProp('top')]: dirs.top,\n [dirProp('right')]: dirs.right,\n [dirProp('bottom')]: dirs.bottom,\n [dirProp('left')]: dirs.left,\n };\n }\n\n return optimizeShorthand(property, dirs);\n}\n"],"mappings":";;;;AA8BA,SAAgB,iBACd,KACA,cACA,WACe;AACf,KAAI,OAAO,QAAQ,SAAU,QAAO,GAAG,IAAI;AAC3C,KAAI,CAAC,IAAK,QAAO;AACjB,KAAI,Q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
|
-
hide?: boolean;
|
|
5
|
-
textOverflow?: string | boolean;
|
|
6
|
-
overflow?: string;
|
|
7
|
-
whiteSpace?: string;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Handles display, hide, textOverflow, overflow, and whiteSpace styles.
|
|
11
|
-
*
|
|
12
|
-
* Priority:
|
|
13
|
-
* 1. `hide` takes precedence (display: none)
|
|
14
|
-
* 2. Multi-line `textOverflow` forces display: -webkit-box
|
|
15
|
-
* 3. Single-line `textOverflow` defaults white-space to nowrap
|
|
16
|
-
* 4. Explicit `whiteSpace` overrides the default from `textOverflow`
|
|
17
|
-
*/
|
|
18
|
-
declare function displayStyle({
|
|
19
|
-
display,
|
|
20
|
-
hide,
|
|
21
|
-
textOverflow,
|
|
22
|
-
overflow,
|
|
23
|
-
whiteSpace
|
|
24
|
-
}: DisplayStyleProps): Record<string, string | number> | null;
|
|
25
|
-
declare namespace displayStyle {
|
|
26
|
-
var __lookupStyles: string[];
|
|
27
|
-
}
|
|
28
|
-
//#endregion
|
|
29
|
-
export { displayStyle };
|
|
30
|
-
//# sourceMappingURL=display.d.ts.map
|
package/dist/styles/display.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { parseStyle } from "../utils/styles.js";
|
|
2
|
-
//#region src/styles/display.ts
|
|
3
|
-
/**
|
|
4
|
-
* Process textOverflow into CSS properties for truncation/clamping.
|
|
5
|
-
*
|
|
6
|
-
* - `ellipsis` — single-line truncation with ellipsis
|
|
7
|
-
* - `ellipsis / 3` — multi-line clamping (3 lines) with ellipsis
|
|
8
|
-
* - `clip` — single-line truncation with clip
|
|
9
|
-
* - `clip / 2` — multi-line clip (2 lines)
|
|
10
|
-
* - `true` or `initial` — reset to initial
|
|
11
|
-
*/
|
|
12
|
-
function processTextOverflow(textOverflow, whiteSpace) {
|
|
13
|
-
if (textOverflow === true || textOverflow === "initial") return { "text-overflow": "initial" };
|
|
14
|
-
const group = parseStyle(String(textOverflow)).groups[0];
|
|
15
|
-
if (!group) return null;
|
|
16
|
-
const { parts } = group;
|
|
17
|
-
const modePart = parts[0];
|
|
18
|
-
const clampPart = parts[1];
|
|
19
|
-
const hasEllipsis = modePart?.mods.includes("ellipsis");
|
|
20
|
-
const hasClip = modePart?.mods.includes("clip");
|
|
21
|
-
if (!hasEllipsis && !hasClip) return null;
|
|
22
|
-
let clamp = 1;
|
|
23
|
-
if (clampPart?.values[0]) {
|
|
24
|
-
const parsed = parseInt(clampPart.values[0], 10);
|
|
25
|
-
if (!isNaN(parsed) && parsed > 0) clamp = parsed;
|
|
26
|
-
}
|
|
27
|
-
const result = {
|
|
28
|
-
overflow: "hidden",
|
|
29
|
-
"text-overflow": hasEllipsis ? "ellipsis" : "clip"
|
|
30
|
-
};
|
|
31
|
-
if (clamp === 1) result["white-space"] = whiteSpace || "nowrap";
|
|
32
|
-
else {
|
|
33
|
-
result["display"] = "-webkit-box";
|
|
34
|
-
result["-webkit-box-orient"] = "vertical";
|
|
35
|
-
result["-webkit-line-clamp"] = clamp;
|
|
36
|
-
result["line-clamp"] = clamp;
|
|
37
|
-
result["white-space"] = whiteSpace || "initial";
|
|
38
|
-
}
|
|
39
|
-
return result;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Handles display, hide, textOverflow, overflow, and whiteSpace styles.
|
|
43
|
-
*
|
|
44
|
-
* Priority:
|
|
45
|
-
* 1. `hide` takes precedence (display: none)
|
|
46
|
-
* 2. Multi-line `textOverflow` forces display: -webkit-box
|
|
47
|
-
* 3. Single-line `textOverflow` defaults white-space to nowrap
|
|
48
|
-
* 4. Explicit `whiteSpace` overrides the default from `textOverflow`
|
|
49
|
-
*/
|
|
50
|
-
function displayStyle({ display, hide, textOverflow, overflow, whiteSpace }) {
|
|
51
|
-
const result = {};
|
|
52
|
-
if (textOverflow != null && textOverflow !== false) {
|
|
53
|
-
const textResult = processTextOverflow(textOverflow, whiteSpace);
|
|
54
|
-
if (textResult) Object.assign(result, textResult);
|
|
55
|
-
}
|
|
56
|
-
if (overflow && !result["overflow"]) result["overflow"] = overflow;
|
|
57
|
-
if (whiteSpace && !result["white-space"]) result["white-space"] = whiteSpace;
|
|
58
|
-
if (hide) result["display"] = "none";
|
|
59
|
-
else if (!result["display"] && display) result["display"] = display;
|
|
60
|
-
if (Object.keys(result).length === 0) return null;
|
|
61
|
-
return result;
|
|
62
|
-
}
|
|
63
|
-
displayStyle.__lookupStyles = [
|
|
64
|
-
"display",
|
|
65
|
-
"hide",
|
|
66
|
-
"textOverflow",
|
|
67
|
-
"overflow",
|
|
68
|
-
"whiteSpace"
|
|
69
|
-
];
|
|
70
|
-
//#endregion
|
|
71
|
-
export { displayStyle };
|
|
72
|
-
|
|
73
|
-
//# sourceMappingURL=display.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"display.js","names":[],"sources":["../../src/styles/display.ts"],"sourcesContent":["import { parseStyle } from '../utils/styles';\n\ninterface DisplayStyleProps {\n display?: string;\n hide?: boolean;\n textOverflow?: string | boolean;\n overflow?: string;\n whiteSpace?: string;\n}\n\n/**\n * Process textOverflow into CSS properties for truncation/clamping.\n *\n * - `ellipsis` — single-line truncation with ellipsis\n * - `ellipsis / 3` — multi-line clamping (3 lines) with ellipsis\n * - `clip` — single-line truncation with clip\n * - `clip / 2` — multi-line clip (2 lines)\n * - `true` or `initial` — reset to initial\n */\nfunction processTextOverflow(\n textOverflow: string | boolean,\n whiteSpace?: string,\n): Record<string, string | number> | null {\n if (textOverflow === true || textOverflow === 'initial') {\n return { 'text-overflow': 'initial' };\n }\n\n const processed = parseStyle(String(textOverflow));\n const group = processed.groups[0];\n\n if (!group) return null;\n\n const { parts } = group;\n const modePart = parts[0];\n const clampPart = parts[1];\n\n const hasEllipsis = modePart?.mods.includes('ellipsis');\n const hasClip = modePart?.mods.includes('clip');\n\n if (!hasEllipsis && !hasClip) return null;\n\n let clamp = 1;\n\n if (clampPart?.values[0]) {\n const parsed = parseInt(clampPart.values[0], 10);\n\n if (!isNaN(parsed) && parsed > 0) {\n clamp = parsed;\n }\n }\n\n const result: Record<string, string | number> = {\n overflow: 'hidden',\n 'text-overflow': hasEllipsis ? 'ellipsis' : 'clip',\n };\n\n if (clamp === 1) {\n result['white-space'] = whiteSpace || 'nowrap';\n } else {\n result['display'] = '-webkit-box';\n result['-webkit-box-orient'] = 'vertical';\n result['-webkit-line-clamp'] = clamp;\n result['line-clamp'] = clamp;\n result['white-space'] = whiteSpace || 'initial';\n }\n\n return result;\n}\n\n/**\n * Handles display, hide, textOverflow, overflow, and whiteSpace styles.\n *\n * Priority:\n * 1. `hide` takes precedence (display: none)\n * 2. Multi-line `textOverflow` forces display: -webkit-box\n * 3. Single-line `textOverflow` defaults white-space to nowrap\n * 4. Explicit `whiteSpace` overrides the default from `textOverflow`\n */\nexport function displayStyle({\n display,\n hide,\n textOverflow,\n overflow,\n whiteSpace,\n}: DisplayStyleProps) {\n const result: Record<string, string | number> = {};\n\n if (textOverflow != null && textOverflow !== false) {\n const textResult = processTextOverflow(textOverflow, whiteSpace);\n\n if (textResult) Object.assign(result, textResult);\n }\n\n if (overflow && !result['overflow']) {\n result['overflow'] = overflow;\n }\n if (whiteSpace && !result['white-space']) {\n result['white-space'] = whiteSpace;\n }\n\n if (hide) {\n result['display'] = 'none';\n } else if (!result['display'] && display) {\n result['display'] = display;\n }\n\n if (Object.keys(result).length === 0) {\n return null;\n }\n\n return result;\n}\n\ndisplayStyle.__lookupStyles = [\n 'display',\n 'hide',\n 'textOverflow',\n 'overflow',\n 'whiteSpace',\n];\n"],"mappings":";;;;;;;;;;;AAmBA,SAAS,oBACP,cACA,YACwC;AACxC,KAAI,iBAAiB,QAAQ,iBAAiB,UAC5C,QAAO,EAAE,iBAAiB,WAAW;CAIvC,MAAM,QADY,WAAW,OAAO,aAAa,CAAC,CAC1B,OAAO;AAE/B,KAAI,CAAC,MAAO,QAAO;CAEnB,MAAM,EAAE,UAAU;CAClB,MAAM,WAAW,MAAM;CACvB,MAAM,YA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
mask: string;
|
|
8
|
-
'mask-composite': string;
|
|
9
|
-
} | null;
|
|
10
|
-
declare namespace fadeStyle {
|
|
11
|
-
var __lookupStyles: string[];
|
|
12
|
-
}
|
|
13
|
-
//#endregion
|
|
14
|
-
export { fadeStyle };
|
|
15
|
-
//# sourceMappingURL=fade.d.ts.map
|