@yahoo/uds 3.157.0 → 3.158.0
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/automated-config/dist/generated/autoVariants.cjs +26 -0
- package/dist/automated-config/dist/generated/autoVariants.d.cts +17 -0
- package/dist/automated-config/dist/generated/autoVariants.d.ts +17 -0
- package/dist/automated-config/dist/generated/autoVariants.js +26 -0
- package/dist/automated-config/dist/generated/generatedConfigs.cjs +3287 -596
- package/dist/automated-config/dist/generated/generatedConfigs.d.cts +350 -12
- package/dist/automated-config/dist/generated/generatedConfigs.d.ts +350 -12
- package/dist/automated-config/dist/generated/generatedConfigs.js +3285 -597
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.cjs +276 -45
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.d.cts +8 -2
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.d.ts +8 -2
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.js +276 -45
- package/dist/automated-config/dist/properties.cjs +8 -1
- package/dist/automated-config/dist/properties.d.cts +8 -0
- package/dist/automated-config/dist/properties.d.ts +8 -0
- package/dist/automated-config/dist/properties.js +8 -1
- package/dist/automated-config/dist/types/ComponentConfig.d.cts +3 -1
- package/dist/automated-config/dist/types/ComponentConfig.d.ts +3 -1
- package/dist/automated-config/dist/utils/buildConfigSchema.cjs +48 -33
- package/dist/automated-config/dist/utils/buildConfigSchema.d.cts +14 -4
- package/dist/automated-config/dist/utils/buildConfigSchema.d.ts +14 -4
- package/dist/automated-config/dist/utils/buildConfigSchema.js +49 -34
- package/dist/automated-config/dist/utils/componentStatePseudoStates.cjs +4 -0
- package/dist/automated-config/dist/utils/componentStatePseudoStates.js +4 -1
- package/dist/automated-config/dist/utils/getButtonControlHeight.cjs +129 -0
- package/dist/automated-config/dist/utils/getButtonControlHeight.d.cts +133 -0
- package/dist/automated-config/dist/utils/getButtonControlHeight.d.ts +133 -0
- package/dist/automated-config/dist/utils/getButtonControlHeight.js +122 -0
- package/dist/automated-config/dist/utils/getButtonControlHeightPx.cjs +114 -0
- package/dist/automated-config/dist/utils/getButtonControlHeightPx.d.cts +78 -0
- package/dist/automated-config/dist/utils/getButtonControlHeightPx.d.ts +78 -0
- package/dist/automated-config/dist/utils/getButtonControlHeightPx.js +108 -0
- package/dist/automated-config/dist/utils/getConfigVariantProperties.d.cts +2 -2
- package/dist/automated-config/dist/utils/getConfigVariantProperties.d.ts +2 -2
- package/dist/automated-config/dist/utils/getConfigVariantPseudoStates.cjs +5 -2
- package/dist/automated-config/dist/utils/getConfigVariantPseudoStates.js +6 -3
- package/dist/automated-config/dist/utils/iconButtonMatchButtonHeight.cjs +110 -0
- package/dist/automated-config/dist/utils/iconButtonMatchButtonHeight.d.cts +19 -0
- package/dist/automated-config/dist/utils/iconButtonMatchButtonHeight.d.ts +19 -0
- package/dist/automated-config/dist/utils/iconButtonMatchButtonHeight.js +108 -0
- package/dist/automated-config/dist/utils/index.cjs +106 -33
- package/dist/automated-config/dist/utils/index.d.cts +16 -4
- package/dist/automated-config/dist/utils/index.d.ts +16 -4
- package/dist/automated-config/dist/utils/index.js +107 -34
- package/dist/automated-config/dist/utils/isConfiguratorPropertyVisible.cjs +15 -0
- package/dist/automated-config/dist/utils/isConfiguratorPropertyVisible.d.cts +20 -0
- package/dist/automated-config/dist/utils/isConfiguratorPropertyVisible.d.ts +20 -0
- package/dist/automated-config/dist/utils/isConfiguratorPropertyVisible.js +15 -0
- package/dist/automated-config/dist/utils/pseudoStateSelectors.cjs +6 -3
- package/dist/automated-config/dist/utils/pseudoStateSelectors.d.cts +1 -1
- package/dist/automated-config/dist/utils/pseudoStateSelectors.d.ts +1 -1
- package/dist/automated-config/dist/utils/pseudoStateSelectors.js +6 -3
- package/dist/components/client/Button.cjs +3 -3
- package/dist/components/client/Button.js +3 -3
- package/dist/components/client/Input/Input.cjs +1 -1
- package/dist/components/client/Input/Input.js +1 -1
- package/dist/components/client/Menu/Menu.Item.cjs +1 -0
- package/dist/components/client/Menu/Menu.Item.js +1 -0
- package/dist/components/client/Select/Select.cjs +179 -0
- package/dist/components/client/Select/Select.d.cts +55 -0
- package/dist/components/client/Select/Select.d.ts +56 -0
- package/dist/components/client/Select/Select.js +176 -0
- package/dist/components/client/Select/SelectContent.cjs +75 -0
- package/dist/components/client/Select/SelectContent.d.cts +44 -0
- package/dist/components/client/Select/SelectContent.d.ts +45 -0
- package/dist/components/client/Select/SelectContent.js +73 -0
- package/dist/components/client/Select/SelectDivider.cjs +63 -0
- package/dist/components/client/Select/SelectDivider.d.cts +44 -0
- package/dist/components/client/Select/SelectDivider.d.ts +45 -0
- package/dist/components/client/Select/SelectDivider.js +61 -0
- package/dist/components/client/Select/SelectHelpText.cjs +51 -0
- package/dist/components/client/Select/SelectHelpText.d.cts +27 -0
- package/dist/components/client/Select/SelectHelpText.d.ts +28 -0
- package/dist/components/client/Select/SelectHelpText.js +48 -0
- package/dist/components/client/Select/SelectItem.cjs +172 -0
- package/dist/components/client/Select/SelectItem.d.cts +29 -0
- package/dist/components/client/Select/SelectItem.d.ts +30 -0
- package/dist/components/client/Select/SelectItem.js +170 -0
- package/dist/components/client/Select/SelectTrigger.cjs +138 -0
- package/dist/components/client/Select/SelectTrigger.d.cts +27 -0
- package/dist/components/client/Select/SelectTrigger.d.ts +28 -0
- package/dist/components/client/Select/SelectTrigger.js +136 -0
- package/dist/components/client/Select/SelectValue.cjs +28 -0
- package/dist/components/client/Select/SelectValue.d.cts +19 -0
- package/dist/components/client/Select/SelectValue.d.ts +20 -0
- package/dist/components/client/Select/SelectValue.js +26 -0
- package/dist/components/client/Select/index.cjs +11 -0
- package/dist/components/client/Select/index.d.cts +6 -0
- package/dist/components/client/Select/index.d.ts +7 -0
- package/dist/components/client/Select/index.js +7 -0
- package/dist/components/client/Select/selectContext.cjs +20 -0
- package/dist/components/client/Select/selectContext.d.cts +23 -0
- package/dist/components/client/Select/selectContext.d.ts +24 -0
- package/dist/components/client/Select/selectContext.js +16 -0
- package/dist/components/client/Select/selectFieldStyles.cjs +85 -0
- package/dist/components/client/Select/selectFieldStyles.d.cts +37 -0
- package/dist/components/client/Select/selectFieldStyles.d.ts +38 -0
- package/dist/components/client/Select/selectFieldStyles.js +75 -0
- package/dist/components/client/index.cjs +8 -0
- package/dist/components/client/index.d.cts +5 -1
- package/dist/components/client/index.d.ts +5 -1
- package/dist/components/client/index.js +5 -1
- package/dist/components/index.cjs +8 -0
- package/dist/components/index.d.cts +5 -1
- package/dist/components/index.d.ts +5 -1
- package/dist/components/index.js +5 -1
- package/dist/config/dist/index.cjs +383 -73
- package/dist/config/dist/index.js +383 -73
- package/dist/css/dist/css/utils.cjs +3 -0
- package/dist/css/dist/css/utils.js +3 -0
- package/dist/css/dist/packages/automated-config/dist/properties.cjs +8 -1
- package/dist/css/dist/packages/automated-config/dist/properties.js +8 -1
- package/dist/css/dist/packages/config/dist/index.cjs +383 -73
- package/dist/css/dist/packages/config/dist/index.js +383 -73
- package/dist/css-tokens/dist/index.cjs +2 -0
- package/dist/css-tokens/dist/index.d.cts +2 -1
- package/dist/css-tokens/dist/index.d.ts +2 -1
- package/dist/css-tokens/dist/index.js +2 -1
- package/dist/index.cjs +34 -0
- package/dist/index.d.cts +12 -4
- package/dist/index.d.ts +12 -4
- package/dist/index.js +11 -3
- package/dist/styles/styler.d.cts +29 -12
- package/dist/styles/styler.d.ts +29 -12
- package/dist/styles/variants.d.cts +54 -0
- package/dist/styles/variants.d.ts +54 -0
- package/dist/tailwind/utils/index.cjs +3 -0
- package/dist/tailwind/utils/index.d.cts +2 -1
- package/dist/tailwind/utils/index.d.ts +2 -1
- package/dist/tailwind/utils/index.js +2 -1
- package/dist/tailwind-internal/dist/base/addColorModeVars.cjs +1 -1
- package/dist/tailwind-internal/dist/base/addColorModeVars.js +1 -1
- package/dist/tailwind-internal/dist/base/addColorModeVarsV2.cjs +1 -1
- package/dist/tailwind-internal/dist/base/addColorModeVarsV2.js +1 -1
- package/dist/tailwind-internal/dist/components/getFocusRingStyles.cjs +74 -6
- package/dist/tailwind-internal/dist/components/getFocusRingStyles.d.cts +14 -0
- package/dist/tailwind-internal/dist/components/getFocusRingStyles.d.ts +14 -0
- package/dist/tailwind-internal/dist/components/getFocusRingStyles.js +74 -7
- package/dist/tailwind-internal/dist/components/getResponsiveTextStyles.cjs +1 -1
- package/dist/tailwind-internal/dist/components/getResponsiveTextStyles.js +1 -1
- package/dist/tailwind-internal/dist/index.d.cts +1 -0
- package/dist/tailwind-internal/dist/index.d.ts +1 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/generated/generatedConfigs.cjs +3287 -596
- package/dist/tailwind-internal/dist/packages/automated-config/dist/generated/generatedConfigs.js +3285 -597
- package/dist/tailwind-internal/dist/packages/automated-config/dist/properties.cjs +8 -1
- package/dist/tailwind-internal/dist/packages/automated-config/dist/properties.js +8 -1
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/componentStatePseudoStates.cjs +4 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/componentStatePseudoStates.js +4 -1
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/getButtonControlHeight.cjs +126 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/getButtonControlHeight.js +123 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/iconButtonMatchButtonHeight.cjs +20 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/iconButtonMatchButtonHeight.js +20 -0
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/index.cjs +103 -33
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/index.js +104 -34
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/pseudoStateSelectors.cjs +6 -3
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/pseudoStateSelectors.js +6 -3
- package/dist/tailwind-internal/dist/packages/config/dist/index.cjs +383 -73
- package/dist/tailwind-internal/dist/packages/config/dist/index.js +383 -73
- package/dist/tailwind-internal/dist/packages/css-tokens/dist/index.cjs +12 -10
- package/dist/tailwind-internal/dist/packages/css-tokens/dist/index.js +3 -2
- package/dist/tailwind-internal/dist/plugins/a11y.cjs +6 -2
- package/dist/tailwind-internal/dist/plugins/a11y.js +6 -2
- package/dist/tailwind-internal/dist/plugins/blurBgFallback.cjs +1 -1
- package/dist/tailwind-internal/dist/plugins/blurBgFallback.js +1 -1
- package/dist/tailwind-internal/dist/plugins/borderRadius.cjs +1 -1
- package/dist/tailwind-internal/dist/plugins/borderRadius.js +1 -1
- package/dist/tailwind-internal/dist/plugins/borderWidth.cjs +1 -1
- package/dist/tailwind-internal/dist/plugins/borderWidth.js +1 -1
- package/dist/tailwind-internal/dist/plugins/colors.cjs +2 -2
- package/dist/tailwind-internal/dist/plugins/colors.js +2 -2
- package/dist/tailwind-internal/dist/plugins/components.cjs +5 -2
- package/dist/tailwind-internal/dist/plugins/components.js +6 -3
- package/dist/tailwind-internal/dist/plugins/elevation.cjs +1 -1
- package/dist/tailwind-internal/dist/plugins/elevation.js +1 -1
- package/dist/tailwind-internal/dist/plugins/shadows.cjs +1 -1
- package/dist/tailwind-internal/dist/plugins/shadows.js +1 -1
- package/dist/tailwind-internal/dist/plugins/typography.cjs +2 -2
- package/dist/tailwind-internal/dist/plugins/typography.js +2 -2
- package/dist/tailwind-internal/dist/utils/getElevationStyles.cjs +1 -1
- package/dist/tailwind-internal/dist/utils/getElevationStyles.js +1 -1
- package/dist/tailwind-internal/dist/utils/getFontStyles.cjs +1 -1
- package/dist/tailwind-internal/dist/utils/getFontStyles.js +1 -1
- package/dist/tailwind-internal/dist/utils/getMotionStyles.cjs +1 -1
- package/dist/tailwind-internal/dist/utils/getMotionStyles.js +1 -1
- package/dist/tailwind-internal/dist/utils/getShadowPresetValues.cjs +1 -1
- package/dist/tailwind-internal/dist/utils/getShadowPresetValues.js +1 -1
- package/dist/tailwind-internal/dist/utils/getShadowStyles.cjs +1 -1
- package/dist/tailwind-internal/dist/utils/getShadowStyles.js +1 -1
- package/dist/tailwind-internal/dist/utils/parseTokens.cjs +2 -2
- package/dist/tailwind-internal/dist/utils/parseTokens.js +2 -2
- package/dist/tokens/automation/configs/index.cjs +3 -0
- package/dist/tokens/automation/configs/index.d.cts +2 -2
- package/dist/tokens/automation/configs/index.d.ts +2 -2
- package/dist/tokens/automation/configs/index.js +2 -2
- package/dist/tokens/automation/index.cjs +25 -0
- package/dist/tokens/automation/index.d.cts +6 -2
- package/dist/tokens/automation/index.d.ts +6 -2
- package/dist/tokens/automation/index.js +6 -2
- package/dist/tokens/consts/cssTokens.cjs +1 -0
- package/dist/tokens/consts/cssTokens.d.cts +2 -2
- package/dist/tokens/consts/cssTokens.d.ts +2 -2
- package/dist/tokens/consts/cssTokens.js +2 -2
- package/dist/tokens/index.cjs +26 -0
- package/dist/tokens/index.d.cts +8 -4
- package/dist/tokens/index.d.ts +8 -4
- package/dist/tokens/index.js +7 -3
- package/dist/tokens/types.d.cts +2 -2
- package/dist/tokens/types.d.ts +2 -2
- package/dist/types/dist/index.d.cts +36 -1
- package/dist/types/dist/index.d.ts +36 -1
- package/dist/uds/generated/componentData.cjs +718 -308
- package/dist/uds/generated/componentData.js +718 -308
- package/dist/uds/generated/migrationSchemaVersion.cjs +1 -1
- package/dist/uds/generated/migrationSchemaVersion.js +1 -1
- package/dist/uds/generated/tailwindPurge.cjs +1501 -315
- package/dist/uds/generated/tailwindPurge.js +1501 -315
- package/generated/componentData.json +897 -398
- package/generated/migrationSchemaVersion.ts +1 -1
- package/generated/tailwindPurge.ts +4 -4
- package/package.json +1 -1
|
@@ -9565,7 +9565,7 @@ const defaultUniversalTokensConfigAuto = {
|
|
|
9565
9565
|
variables: {
|
|
9566
9566
|
"size/lg/icon": { size: { rest: {
|
|
9567
9567
|
type: "iconSizes",
|
|
9568
|
-
value: "
|
|
9568
|
+
value: "sm",
|
|
9569
9569
|
valueType: "alias"
|
|
9570
9570
|
} } },
|
|
9571
9571
|
"size/lg/root": { spacing: { rest: {
|
|
@@ -12069,30 +12069,23 @@ const defaultUniversalTokensConfigAuto = {
|
|
|
12069
12069
|
valueType: "alias"
|
|
12070
12070
|
}
|
|
12071
12071
|
} },
|
|
12072
|
-
"item/variant/default/active/off/text": {
|
|
12073
|
-
|
|
12074
|
-
|
|
12075
|
-
|
|
12076
|
-
|
|
12077
|
-
valueType: "alias"
|
|
12078
|
-
},
|
|
12079
|
-
hover: {
|
|
12080
|
-
type: "foregroundPaletteColors",
|
|
12081
|
-
value: "brand",
|
|
12082
|
-
valueType: "alias"
|
|
12083
|
-
},
|
|
12084
|
-
rest: {
|
|
12085
|
-
type: "foregroundPaletteColors",
|
|
12086
|
-
value: "brand",
|
|
12087
|
-
valueType: "alias"
|
|
12088
|
-
}
|
|
12072
|
+
"item/variant/default/active/off/text": { color: {
|
|
12073
|
+
focused: {
|
|
12074
|
+
type: "foregroundPaletteColors",
|
|
12075
|
+
value: "brand",
|
|
12076
|
+
valueType: "alias"
|
|
12089
12077
|
},
|
|
12090
|
-
|
|
12091
|
-
type: "
|
|
12092
|
-
value: "
|
|
12078
|
+
hover: {
|
|
12079
|
+
type: "foregroundPaletteColors",
|
|
12080
|
+
value: "brand",
|
|
12093
12081
|
valueType: "alias"
|
|
12094
|
-
}
|
|
12095
|
-
|
|
12082
|
+
},
|
|
12083
|
+
rest: {
|
|
12084
|
+
type: "foregroundPaletteColors",
|
|
12085
|
+
value: "brand",
|
|
12086
|
+
valueType: "alias"
|
|
12087
|
+
}
|
|
12088
|
+
} },
|
|
12096
12089
|
"item/variant/default/active/on/icon": { color: {
|
|
12097
12090
|
focused: {
|
|
12098
12091
|
type: "foregroundPaletteColors",
|
|
@@ -12127,30 +12120,23 @@ const defaultUniversalTokensConfigAuto = {
|
|
|
12127
12120
|
valueType: "alias"
|
|
12128
12121
|
}
|
|
12129
12122
|
} },
|
|
12130
|
-
"item/variant/default/active/on/text": {
|
|
12131
|
-
|
|
12132
|
-
|
|
12133
|
-
|
|
12134
|
-
|
|
12135
|
-
valueType: "alias"
|
|
12136
|
-
},
|
|
12137
|
-
hover: {
|
|
12138
|
-
type: "foregroundPaletteColors",
|
|
12139
|
-
value: "brand",
|
|
12140
|
-
valueType: "alias"
|
|
12141
|
-
},
|
|
12142
|
-
rest: {
|
|
12143
|
-
type: "foregroundPaletteColors",
|
|
12144
|
-
value: "brand",
|
|
12145
|
-
valueType: "alias"
|
|
12146
|
-
}
|
|
12123
|
+
"item/variant/default/active/on/text": { color: {
|
|
12124
|
+
focused: {
|
|
12125
|
+
type: "foregroundPaletteColors",
|
|
12126
|
+
value: "brand",
|
|
12127
|
+
valueType: "alias"
|
|
12147
12128
|
},
|
|
12148
|
-
|
|
12149
|
-
type: "
|
|
12150
|
-
value: "
|
|
12129
|
+
hover: {
|
|
12130
|
+
type: "foregroundPaletteColors",
|
|
12131
|
+
value: "brand",
|
|
12151
12132
|
valueType: "alias"
|
|
12152
|
-
}
|
|
12153
|
-
|
|
12133
|
+
},
|
|
12134
|
+
rest: {
|
|
12135
|
+
type: "foregroundPaletteColors",
|
|
12136
|
+
value: "brand",
|
|
12137
|
+
valueType: "alias"
|
|
12138
|
+
}
|
|
12139
|
+
} },
|
|
12154
12140
|
"itemCheckbox/variant/default/active/off/endIcon": { color: {
|
|
12155
12141
|
focused: {
|
|
12156
12142
|
type: "foregroundPaletteColors",
|
|
@@ -12311,6 +12297,11 @@ const defaultUniversalTokensConfigAuto = {
|
|
|
12311
12297
|
type: "iconSizes",
|
|
12312
12298
|
value: "sm",
|
|
12313
12299
|
valueType: "alias"
|
|
12300
|
+
} } },
|
|
12301
|
+
"size/default/text": { textVariant: { rest: {
|
|
12302
|
+
type: "textVariants",
|
|
12303
|
+
value: "label2",
|
|
12304
|
+
valueType: "alias"
|
|
12314
12305
|
} } }
|
|
12315
12306
|
}
|
|
12316
12307
|
},
|
|
@@ -14027,6 +14018,246 @@ const defaultUniversalTokensConfigAuto = {
|
|
|
14027
14018
|
} }
|
|
14028
14019
|
} }
|
|
14029
14020
|
},
|
|
14021
|
+
select: {
|
|
14022
|
+
defaults: {
|
|
14023
|
+
size: "md",
|
|
14024
|
+
variant: "default"
|
|
14025
|
+
},
|
|
14026
|
+
variables: { "variant/default/root": {} }
|
|
14027
|
+
},
|
|
14028
|
+
selectContent: {
|
|
14029
|
+
defaults: {
|
|
14030
|
+
size: "default",
|
|
14031
|
+
variant: "default"
|
|
14032
|
+
},
|
|
14033
|
+
variables: {
|
|
14034
|
+
"size/default/root": {
|
|
14035
|
+
borderRadius: { rest: {
|
|
14036
|
+
type: "borderRadii",
|
|
14037
|
+
value: "md",
|
|
14038
|
+
valueType: "alias"
|
|
14039
|
+
} },
|
|
14040
|
+
borderWidth: { rest: {
|
|
14041
|
+
type: "borderWidths",
|
|
14042
|
+
value: "thin",
|
|
14043
|
+
valueType: "alias"
|
|
14044
|
+
} },
|
|
14045
|
+
gap: { rest: {
|
|
14046
|
+
type: "spacingAliases",
|
|
14047
|
+
value: "0",
|
|
14048
|
+
valueType: "alias"
|
|
14049
|
+
} },
|
|
14050
|
+
shadow: { rest: {
|
|
14051
|
+
type: "shadowVariants",
|
|
14052
|
+
value: "lg",
|
|
14053
|
+
valueType: "alias"
|
|
14054
|
+
} },
|
|
14055
|
+
spacingHorizontal: { rest: {
|
|
14056
|
+
type: "spacingAliases",
|
|
14057
|
+
value: "0",
|
|
14058
|
+
valueType: "alias"
|
|
14059
|
+
} },
|
|
14060
|
+
spacingVertical: { rest: {
|
|
14061
|
+
type: "spacingAliases",
|
|
14062
|
+
value: "0",
|
|
14063
|
+
valueType: "alias"
|
|
14064
|
+
} }
|
|
14065
|
+
},
|
|
14066
|
+
"variant/default/root": {
|
|
14067
|
+
backgroundColor: { rest: {
|
|
14068
|
+
type: "backgroundPaletteColors",
|
|
14069
|
+
value: "primary",
|
|
14070
|
+
valueType: "alias"
|
|
14071
|
+
} },
|
|
14072
|
+
borderColor: { rest: {
|
|
14073
|
+
type: "spectrumColors",
|
|
14074
|
+
value: "gray-3",
|
|
14075
|
+
valueType: "alias"
|
|
14076
|
+
} }
|
|
14077
|
+
}
|
|
14078
|
+
}
|
|
14079
|
+
},
|
|
14080
|
+
selectItem: {
|
|
14081
|
+
defaults: {
|
|
14082
|
+
size: "default",
|
|
14083
|
+
variant: "default"
|
|
14084
|
+
},
|
|
14085
|
+
variables: {
|
|
14086
|
+
"divider/variant/default/line": {
|
|
14087
|
+
borderColor: { rest: {
|
|
14088
|
+
type: "linePaletteColors",
|
|
14089
|
+
value: "secondary",
|
|
14090
|
+
valueType: "alias"
|
|
14091
|
+
} },
|
|
14092
|
+
borderWidth: { rest: {
|
|
14093
|
+
type: "borderWidths",
|
|
14094
|
+
value: "thin",
|
|
14095
|
+
valueType: "alias"
|
|
14096
|
+
} }
|
|
14097
|
+
},
|
|
14098
|
+
"divider/variant/default/root": {},
|
|
14099
|
+
"divider/variant/default/text": {
|
|
14100
|
+
color: { rest: {
|
|
14101
|
+
type: "foregroundPaletteColors",
|
|
14102
|
+
value: "muted",
|
|
14103
|
+
valueType: "alias"
|
|
14104
|
+
} },
|
|
14105
|
+
textVariant: { rest: {
|
|
14106
|
+
type: "textVariants",
|
|
14107
|
+
value: "caption2",
|
|
14108
|
+
valueType: "alias"
|
|
14109
|
+
} }
|
|
14110
|
+
},
|
|
14111
|
+
"item/variant/default/active/off/icon": { color: {
|
|
14112
|
+
focused: {
|
|
14113
|
+
type: "foregroundPaletteColors",
|
|
14114
|
+
value: "secondary",
|
|
14115
|
+
valueType: "alias"
|
|
14116
|
+
},
|
|
14117
|
+
hover: {
|
|
14118
|
+
type: "foregroundPaletteColors",
|
|
14119
|
+
value: "secondary",
|
|
14120
|
+
valueType: "alias"
|
|
14121
|
+
},
|
|
14122
|
+
pressed: {
|
|
14123
|
+
type: "foregroundPaletteColors",
|
|
14124
|
+
value: "secondary",
|
|
14125
|
+
valueType: "alias"
|
|
14126
|
+
},
|
|
14127
|
+
rest: {
|
|
14128
|
+
type: "foregroundPaletteColors",
|
|
14129
|
+
value: "secondary",
|
|
14130
|
+
valueType: "alias"
|
|
14131
|
+
}
|
|
14132
|
+
} },
|
|
14133
|
+
"item/variant/default/active/off/root": { backgroundColor: {
|
|
14134
|
+
focused: {
|
|
14135
|
+
type: "backgroundPaletteColors",
|
|
14136
|
+
value: "primary",
|
|
14137
|
+
valueType: "alias"
|
|
14138
|
+
},
|
|
14139
|
+
hover: {
|
|
14140
|
+
type: "backgroundPaletteColors",
|
|
14141
|
+
value: "primary",
|
|
14142
|
+
valueType: "alias"
|
|
14143
|
+
},
|
|
14144
|
+
pressed: {
|
|
14145
|
+
type: "backgroundPaletteColors",
|
|
14146
|
+
value: "primary",
|
|
14147
|
+
valueType: "alias"
|
|
14148
|
+
},
|
|
14149
|
+
rest: {
|
|
14150
|
+
type: "backgroundPaletteColors",
|
|
14151
|
+
value: "primary",
|
|
14152
|
+
valueType: "alias"
|
|
14153
|
+
}
|
|
14154
|
+
} },
|
|
14155
|
+
"item/variant/default/active/off/text": { color: {
|
|
14156
|
+
focused: {
|
|
14157
|
+
type: "foregroundPaletteColors",
|
|
14158
|
+
value: "secondary",
|
|
14159
|
+
valueType: "alias"
|
|
14160
|
+
},
|
|
14161
|
+
hover: {
|
|
14162
|
+
type: "foregroundPaletteColors",
|
|
14163
|
+
value: "secondary",
|
|
14164
|
+
valueType: "alias"
|
|
14165
|
+
},
|
|
14166
|
+
pressed: {
|
|
14167
|
+
type: "foregroundPaletteColors",
|
|
14168
|
+
value: "secondary",
|
|
14169
|
+
valueType: "alias"
|
|
14170
|
+
},
|
|
14171
|
+
rest: {
|
|
14172
|
+
type: "foregroundPaletteColors",
|
|
14173
|
+
value: "secondary",
|
|
14174
|
+
valueType: "alias"
|
|
14175
|
+
}
|
|
14176
|
+
} },
|
|
14177
|
+
"item/variant/default/active/on/icon": { color: {
|
|
14178
|
+
focused: {
|
|
14179
|
+
type: "foregroundPaletteColors",
|
|
14180
|
+
value: "secondary",
|
|
14181
|
+
valueType: "alias"
|
|
14182
|
+
},
|
|
14183
|
+
hover: {
|
|
14184
|
+
type: "foregroundPaletteColors",
|
|
14185
|
+
value: "secondary",
|
|
14186
|
+
valueType: "alias"
|
|
14187
|
+
},
|
|
14188
|
+
pressed: {
|
|
14189
|
+
type: "foregroundPaletteColors",
|
|
14190
|
+
value: "secondary",
|
|
14191
|
+
valueType: "alias"
|
|
14192
|
+
},
|
|
14193
|
+
rest: {
|
|
14194
|
+
type: "foregroundPaletteColors",
|
|
14195
|
+
value: "secondary",
|
|
14196
|
+
valueType: "alias"
|
|
14197
|
+
}
|
|
14198
|
+
} },
|
|
14199
|
+
"item/variant/default/active/on/root": { backgroundColor: {
|
|
14200
|
+
focused: {
|
|
14201
|
+
type: "backgroundPaletteColors",
|
|
14202
|
+
value: "primary",
|
|
14203
|
+
valueType: "alias"
|
|
14204
|
+
},
|
|
14205
|
+
hover: {
|
|
14206
|
+
type: "backgroundPaletteColors",
|
|
14207
|
+
value: "primary",
|
|
14208
|
+
valueType: "alias"
|
|
14209
|
+
},
|
|
14210
|
+
pressed: {
|
|
14211
|
+
type: "backgroundPaletteColors",
|
|
14212
|
+
value: "primary",
|
|
14213
|
+
valueType: "alias"
|
|
14214
|
+
},
|
|
14215
|
+
rest: {
|
|
14216
|
+
type: "backgroundPaletteColors",
|
|
14217
|
+
value: "primary",
|
|
14218
|
+
valueType: "alias"
|
|
14219
|
+
}
|
|
14220
|
+
} },
|
|
14221
|
+
"item/variant/default/active/on/text": { color: {
|
|
14222
|
+
focused: {
|
|
14223
|
+
type: "foregroundPaletteColors",
|
|
14224
|
+
value: "secondary",
|
|
14225
|
+
valueType: "alias"
|
|
14226
|
+
},
|
|
14227
|
+
hover: {
|
|
14228
|
+
type: "foregroundPaletteColors",
|
|
14229
|
+
value: "secondary",
|
|
14230
|
+
valueType: "alias"
|
|
14231
|
+
},
|
|
14232
|
+
pressed: {
|
|
14233
|
+
type: "foregroundPaletteColors",
|
|
14234
|
+
value: "secondary",
|
|
14235
|
+
valueType: "alias"
|
|
14236
|
+
},
|
|
14237
|
+
rest: {
|
|
14238
|
+
type: "foregroundPaletteColors",
|
|
14239
|
+
value: "secondary",
|
|
14240
|
+
valueType: "alias"
|
|
14241
|
+
}
|
|
14242
|
+
} },
|
|
14243
|
+
"size/default/endIcon": { size: { rest: {
|
|
14244
|
+
type: "iconSizes",
|
|
14245
|
+
value: "sm",
|
|
14246
|
+
valueType: "alias"
|
|
14247
|
+
} } },
|
|
14248
|
+
"size/default/root": {},
|
|
14249
|
+
"size/default/startIcon": { size: { rest: {
|
|
14250
|
+
type: "iconSizes",
|
|
14251
|
+
value: "sm",
|
|
14252
|
+
valueType: "alias"
|
|
14253
|
+
} } },
|
|
14254
|
+
"size/default/text": { textVariant: { rest: {
|
|
14255
|
+
type: "textVariants",
|
|
14256
|
+
value: "ui1",
|
|
14257
|
+
valueType: "alias"
|
|
14258
|
+
} } }
|
|
14259
|
+
}
|
|
14260
|
+
},
|
|
14030
14261
|
switch: {
|
|
14031
14262
|
defaults: {
|
|
14032
14263
|
size: "md",
|
|
@@ -433,6 +433,12 @@ const paginationWidthVar = {
|
|
|
433
433
|
possibleFixtures: ["positiveIntegers"],
|
|
434
434
|
twThemePath: (_, value) => `${value}px`
|
|
435
435
|
};
|
|
436
|
+
const controlHeight = {
|
|
437
|
+
name: "controlHeight",
|
|
438
|
+
cssProperties: [],
|
|
439
|
+
possibleFixtures: ["positiveIntegers"],
|
|
440
|
+
twThemePath: (_, value) => `${value}px`
|
|
441
|
+
};
|
|
436
442
|
const publicProperties = {
|
|
437
443
|
backgroundColor,
|
|
438
444
|
borderWidth,
|
|
@@ -529,7 +535,8 @@ const publicProperties = {
|
|
|
529
535
|
twThemePath: () => "",
|
|
530
536
|
customValueRenderer: ({ value }) => `${String(value)}%`
|
|
531
537
|
},
|
|
532
|
-
paginationWidthVar
|
|
538
|
+
paginationWidthVar,
|
|
539
|
+
controlHeight
|
|
533
540
|
};
|
|
534
541
|
const internalProperties = {
|
|
535
542
|
outlineWidth,
|
|
@@ -70,6 +70,7 @@ declare const publicProperties: {
|
|
|
70
70
|
readonly scrimBackgroundColor: ConfigurableProperty<"backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases", unknown>;
|
|
71
71
|
readonly scrimOpacity: ConfigurableProperty<"opacitySteps", unknown>;
|
|
72
72
|
readonly paginationWidthVar: ConfigurableProperty<"positiveIntegers", unknown>;
|
|
73
|
+
readonly controlHeight: ConfigurableProperty<"positiveIntegers", unknown>;
|
|
73
74
|
};
|
|
74
75
|
declare const configurableProperties: {
|
|
75
76
|
outlineWidth: ConfigurableProperty<"borderWidths" | "spacingAliases", unknown>;
|
|
@@ -122,6 +123,7 @@ declare const configurableProperties: {
|
|
|
122
123
|
scrimBackgroundColor: ConfigurableProperty<"backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases", unknown>;
|
|
123
124
|
scrimOpacity: ConfigurableProperty<"opacitySteps", unknown>;
|
|
124
125
|
paginationWidthVar: ConfigurableProperty<"positiveIntegers", unknown>;
|
|
126
|
+
controlHeight: ConfigurableProperty<"positiveIntegers", unknown>;
|
|
125
127
|
};
|
|
126
128
|
type ExtendablePropertiesName = keyof typeof configurableProperties;
|
|
127
129
|
type ConfigurablePropertiesName = keyof typeof publicProperties;
|
|
@@ -131,6 +133,12 @@ interface SelectedConfigurableProperty<C extends ConfigurablePropertiesName, O e
|
|
|
131
133
|
typeOfFixture: T;
|
|
132
134
|
values: V;
|
|
133
135
|
skipRestState?: boolean;
|
|
136
|
+
/**
|
|
137
|
+
* When true, the property is omitted from `buildConfigSchema()` output and
|
|
138
|
+
* optional in stored branch configs. Used for opt-in-only vars (e.g.
|
|
139
|
+
* IconButton `controlHeight`) that are written at runtime, not seeded.
|
|
140
|
+
*/
|
|
141
|
+
optionalInDefaultSchema?: boolean;
|
|
134
142
|
/**
|
|
135
143
|
* Per-property pseudo state list (legacy). New components should declare
|
|
136
144
|
* atomic states at the layer level via `atomicStates` and use
|
|
@@ -70,6 +70,7 @@ declare const publicProperties: {
|
|
|
70
70
|
readonly scrimBackgroundColor: ConfigurableProperty<"backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases", unknown>;
|
|
71
71
|
readonly scrimOpacity: ConfigurableProperty<"opacitySteps", unknown>;
|
|
72
72
|
readonly paginationWidthVar: ConfigurableProperty<"positiveIntegers", unknown>;
|
|
73
|
+
readonly controlHeight: ConfigurableProperty<"positiveIntegers", unknown>;
|
|
73
74
|
};
|
|
74
75
|
declare const configurableProperties: {
|
|
75
76
|
outlineWidth: ConfigurableProperty<"borderWidths" | "spacingAliases", unknown>;
|
|
@@ -122,6 +123,7 @@ declare const configurableProperties: {
|
|
|
122
123
|
scrimBackgroundColor: ConfigurableProperty<"backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases", unknown>;
|
|
123
124
|
scrimOpacity: ConfigurableProperty<"opacitySteps", unknown>;
|
|
124
125
|
paginationWidthVar: ConfigurableProperty<"positiveIntegers", unknown>;
|
|
126
|
+
controlHeight: ConfigurableProperty<"positiveIntegers", unknown>;
|
|
125
127
|
};
|
|
126
128
|
type ExtendablePropertiesName = keyof typeof configurableProperties;
|
|
127
129
|
type ConfigurablePropertiesName = keyof typeof publicProperties;
|
|
@@ -131,6 +133,12 @@ interface SelectedConfigurableProperty<C extends ConfigurablePropertiesName, O e
|
|
|
131
133
|
typeOfFixture: T;
|
|
132
134
|
values: V;
|
|
133
135
|
skipRestState?: boolean;
|
|
136
|
+
/**
|
|
137
|
+
* When true, the property is omitted from `buildConfigSchema()` output and
|
|
138
|
+
* optional in stored branch configs. Used for opt-in-only vars (e.g.
|
|
139
|
+
* IconButton `controlHeight`) that are written at runtime, not seeded.
|
|
140
|
+
*/
|
|
141
|
+
optionalInDefaultSchema?: boolean;
|
|
134
142
|
/**
|
|
135
143
|
* Per-property pseudo state list (legacy). New components should declare
|
|
136
144
|
* atomic states at the layer level via `atomicStates` and use
|
|
@@ -433,6 +433,12 @@ const paginationWidthVar = {
|
|
|
433
433
|
possibleFixtures: ["positiveIntegers"],
|
|
434
434
|
twThemePath: (_, value) => `${value}px`
|
|
435
435
|
};
|
|
436
|
+
const controlHeight = {
|
|
437
|
+
name: "controlHeight",
|
|
438
|
+
cssProperties: [],
|
|
439
|
+
possibleFixtures: ["positiveIntegers"],
|
|
440
|
+
twThemePath: (_, value) => `${value}px`
|
|
441
|
+
};
|
|
436
442
|
const publicProperties = {
|
|
437
443
|
backgroundColor,
|
|
438
444
|
borderWidth,
|
|
@@ -529,7 +535,8 @@ const publicProperties = {
|
|
|
529
535
|
twThemePath: () => "",
|
|
530
536
|
customValueRenderer: ({ value }) => `${String(value)}%`
|
|
531
537
|
},
|
|
532
|
-
paginationWidthVar
|
|
538
|
+
paginationWidthVar,
|
|
539
|
+
controlHeight
|
|
533
540
|
};
|
|
534
541
|
const internalProperties = {
|
|
535
542
|
outlineWidth,
|
|
@@ -15,7 +15,7 @@ type AllPossibleProperties = Exclude<keyof typeof index_d_exports, 'iconButtonSi
|
|
|
15
15
|
* generator must still resolve their selectors. Drop entries as components
|
|
16
16
|
* migrate to layer-level `atomicStates`.
|
|
17
17
|
*/
|
|
18
|
-
type LegacyStateLiteral = 'disabled' | 'focused' | 'focused-keyboard';
|
|
18
|
+
type LegacyStateLiteral = 'disabled' | 'focused' | 'focused-keyboard' | 'selected';
|
|
19
19
|
/**
|
|
20
20
|
* All possible state keys a property can be styled for. Encoded structure
|
|
21
21
|
* matches the resolver's enumeration and the StateBuilder's depth cap: 0..3
|
|
@@ -64,6 +64,8 @@ interface ComponentStateConfig {
|
|
|
64
64
|
options: readonly string[];
|
|
65
65
|
/** Pseudo-states to omit for specific component state options (e.g. active/on). */
|
|
66
66
|
excludePseudoStatesForOptions?: Partial<Record<string, readonly PossibleStates[]>>;
|
|
67
|
+
/** Layers to omit from the configurator for specific component state options. */
|
|
68
|
+
excludeLayersForOptions?: Partial<Record<string, readonly string[]>>;
|
|
67
69
|
/**
|
|
68
70
|
* @deprecated Per-state property overrides are now authored at the schema
|
|
69
71
|
* level (Configurator UI, migrations), not in source configs. Each
|
|
@@ -15,7 +15,7 @@ type AllPossibleProperties = Exclude<keyof typeof index_d_exports, 'iconButtonSi
|
|
|
15
15
|
* generator must still resolve their selectors. Drop entries as components
|
|
16
16
|
* migrate to layer-level `atomicStates`.
|
|
17
17
|
*/
|
|
18
|
-
type LegacyStateLiteral = 'disabled' | 'focused' | 'focused-keyboard';
|
|
18
|
+
type LegacyStateLiteral = 'disabled' | 'focused' | 'focused-keyboard' | 'selected';
|
|
19
19
|
/**
|
|
20
20
|
* All possible state keys a property can be styled for. Encoded structure
|
|
21
21
|
* matches the resolver's enumeration and the StateBuilder's depth cap: 0..3
|
|
@@ -64,6 +64,8 @@ interface ComponentStateConfig {
|
|
|
64
64
|
options: readonly string[];
|
|
65
65
|
/** Pseudo-states to omit for specific component state options (e.g. active/on). */
|
|
66
66
|
excludePseudoStatesForOptions?: Partial<Record<string, readonly PossibleStates[]>>;
|
|
67
|
+
/** Layers to omit from the configurator for specific component state options. */
|
|
68
|
+
excludeLayersForOptions?: Partial<Record<string, readonly string[]>>;
|
|
67
69
|
/**
|
|
68
70
|
* @deprecated Per-state property overrides are now authored at the schema
|
|
69
71
|
* level (Configurator UI, migrations), not in source configs. Each
|
|
@@ -70,6 +70,9 @@ function buildPropertyStateMap(layer, property, variantOption, excludedStates =
|
|
|
70
70
|
function propertyVariesOnlyAtRest(property) {
|
|
71
71
|
return property.name === "textVariant";
|
|
72
72
|
}
|
|
73
|
+
function isOptionalInDefaultSchema(property) {
|
|
74
|
+
return property.optionalInDefaultSchema === true;
|
|
75
|
+
}
|
|
73
76
|
/** Resolves the fixture type by finding which value set contains the given value */
|
|
74
77
|
function findFixtureTypeForValue(property, value) {
|
|
75
78
|
const index = property.values.findIndex((arr) => arr.includes(value));
|
|
@@ -99,6 +102,7 @@ function emitUniversalLayerSchema(result, layers, variantKey, variantOption, sub
|
|
|
99
102
|
result.variables[schemaKey] = {};
|
|
100
103
|
for (const propertyKey in layer.properties) {
|
|
101
104
|
const property = layer.properties[propertyKey];
|
|
105
|
+
if (isOptionalInDefaultSchema(property)) continue;
|
|
102
106
|
result.variables[schemaKey] = {
|
|
103
107
|
...result.variables[schemaKey],
|
|
104
108
|
[propertyKey]: buildPropertyStateMap(layer, property, variantOption)
|
|
@@ -120,22 +124,27 @@ function buildConfigSchema(config) {
|
|
|
120
124
|
const componentStates = variantConfig.componentStates;
|
|
121
125
|
for (const componentStateKey in componentStates) {
|
|
122
126
|
const componentState = componentStates[componentStateKey];
|
|
123
|
-
for (const componentStateOption of componentState.options)
|
|
124
|
-
const
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
result.variables[schemaKey] = {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
127
|
+
for (const componentStateOption of componentState.options) {
|
|
128
|
+
const excludedLayers = new Set(require_componentStatePseudoStates.getExcludedLayersForComponentStateOption(componentState, componentStateOption));
|
|
129
|
+
for (const layerKey in componentState.layers) {
|
|
130
|
+
if (excludedLayers.has(layerKey)) continue;
|
|
131
|
+
const layer = componentState.layers[layerKey];
|
|
132
|
+
const schemaKey = require_generateSchemaKey.generateSchemaKey({
|
|
133
|
+
variantKey,
|
|
134
|
+
variantValue: variantOption,
|
|
135
|
+
componentStateKey,
|
|
136
|
+
componentStateValue: componentStateOption,
|
|
137
|
+
layer: layerKey
|
|
138
|
+
});
|
|
139
|
+
result.variables[schemaKey] = {};
|
|
140
|
+
for (const propertyKey in layer.properties) {
|
|
141
|
+
const property = layer.properties[propertyKey];
|
|
142
|
+
if (isOptionalInDefaultSchema(property)) continue;
|
|
143
|
+
result.variables[schemaKey] = {
|
|
144
|
+
...result.variables[schemaKey],
|
|
145
|
+
[propertyKey]: buildPropertyStateMap(layer, property, variantOption, require_componentStatePseudoStates.getExcludedPseudoStatesForComponentStateOption(componentState, componentStateOption))
|
|
146
|
+
};
|
|
147
|
+
}
|
|
139
148
|
}
|
|
140
149
|
}
|
|
141
150
|
}
|
|
@@ -145,6 +154,7 @@ function buildConfigSchema(config) {
|
|
|
145
154
|
result.variables[variantSchemaKey] = result.variables[variantSchemaKey] ?? {};
|
|
146
155
|
for (const propertyKey in variantConfig.variantProperties) {
|
|
147
156
|
const property = variantConfig.variantProperties[propertyKey];
|
|
157
|
+
if (isOptionalInDefaultSchema(property)) continue;
|
|
148
158
|
result.variables[variantSchemaKey] = {
|
|
149
159
|
...result.variables[variantSchemaKey],
|
|
150
160
|
[propertyKey]: buildPropertyStateMap({
|
|
@@ -167,23 +177,28 @@ function buildConfigSchema(config) {
|
|
|
167
177
|
const componentStates = variantConfig.componentStates;
|
|
168
178
|
for (const componentStateKey in componentStates) {
|
|
169
179
|
const componentState = componentStates[componentStateKey];
|
|
170
|
-
for (const componentStateOption of componentState.options)
|
|
171
|
-
const
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
result.variables[schemaKey] = {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
180
|
+
for (const componentStateOption of componentState.options) {
|
|
181
|
+
const excludedLayers = new Set(require_componentStatePseudoStates.getExcludedLayersForComponentStateOption(componentState, componentStateOption));
|
|
182
|
+
for (const layerKey in componentState.layers) {
|
|
183
|
+
if (excludedLayers.has(layerKey)) continue;
|
|
184
|
+
const layer = componentState.layers[layerKey];
|
|
185
|
+
const schemaKey = require_generateSchemaKey.generateSchemaKey({
|
|
186
|
+
variantKey,
|
|
187
|
+
variantValue: variantOption,
|
|
188
|
+
componentStateKey,
|
|
189
|
+
componentStateValue: componentStateOption,
|
|
190
|
+
layer: layerKey,
|
|
191
|
+
subComponentName: subComponentKey
|
|
192
|
+
});
|
|
193
|
+
result.variables[schemaKey] = {};
|
|
194
|
+
for (const propertyKey in layer.properties) {
|
|
195
|
+
const property = layer.properties[propertyKey];
|
|
196
|
+
if (isOptionalInDefaultSchema(property)) continue;
|
|
197
|
+
result.variables[schemaKey] = {
|
|
198
|
+
...result.variables[schemaKey],
|
|
199
|
+
[propertyKey]: buildPropertyStateMap(layer, property, variantOption, require_componentStatePseudoStates.getExcludedPseudoStatesForComponentStateOption(componentState, componentStateOption))
|
|
200
|
+
};
|
|
201
|
+
}
|
|
187
202
|
}
|
|
188
203
|
}
|
|
189
204
|
}
|
|
@@ -8,6 +8,13 @@ import { SchemaStateValue } from "../types/ConfigSchema.cjs";
|
|
|
8
8
|
import { OmitIndexSignature, SimplifyDeep, UnionToIntersection, WritableDeep } from "type-fest";
|
|
9
9
|
|
|
10
10
|
//#region ../automated-config/dist/utils/buildConfigSchema.d.ts
|
|
11
|
+
type OptionalInDefaultSchemaPropKeys<Props extends Record<string, SelectedConfigurableProperty<ConfigurablePropertiesName, string>>> = { [K in keyof Props]: Props[K] extends {
|
|
12
|
+
optionalInDefaultSchema: true;
|
|
13
|
+
} ? K : never }[keyof Props];
|
|
14
|
+
type RequiredInDefaultSchemaPropKeys<Props extends Record<string, SelectedConfigurableProperty<ConfigurablePropertiesName, string>>> = { [K in keyof Props]: Props[K] extends {
|
|
15
|
+
optionalInDefaultSchema: true;
|
|
16
|
+
} ? never : K }[keyof Props];
|
|
17
|
+
type InferredLayerPropertyMap<Props extends Record<string, SelectedConfigurableProperty<ConfigurablePropertiesName, string>>, Layer> = { [PropKey in RequiredInDefaultSchemaPropKeys<Props>]: InferredPropertyStates<Props[PropKey], Layer> } & { [PropKey in OptionalInDefaultSchemaPropKeys<Props>]?: InferredPropertyStates<Props[PropKey], Layer> };
|
|
11
18
|
/** Infers default option values from all component variants */
|
|
12
19
|
type InferredDefaults<C extends ComponentConfig> = (C['variants'] extends NonNullable<ComponentConfig['variants']> ? { [VarKey in keyof C['variants']]: C['variants'][VarKey]['options'][number] } : {}) & (C['subComponents'] extends NonNullable<ComponentConfig['subComponents']> ? UnionToIntersection<{ [SubCompKey in keyof C['subComponents']]: { [VarKey in keyof C['subComponents'][SubCompKey]['variants']]: C['subComponents'][SubCompKey]['variants'][VarKey]['options'][number] } }[keyof C['subComponents']]> : {});
|
|
13
20
|
/** Infers type-safe schema value structure for a configurable property */
|
|
@@ -45,6 +52,9 @@ type InferredPropertyStates<Prop extends SelectedConfigurableProperty<Configurab
|
|
|
45
52
|
type GetExcludedPseudoStatesForOption<StateConfig extends ComponentStateConfig, StateOption extends string> = StateConfig extends {
|
|
46
53
|
excludePseudoStatesForOptions?: infer Exclusions extends Partial<Record<string, readonly PossibleStates[]>>;
|
|
47
54
|
} ? StateOption extends keyof Exclusions ? Exclusions[StateOption] : undefined : undefined;
|
|
55
|
+
type GetExcludedLayersForOption<StateConfig extends ComponentStateConfig, StateOption extends string> = StateConfig extends {
|
|
56
|
+
excludeLayersForOptions?: infer Exclusions extends Partial<Record<string, readonly string[]>>;
|
|
57
|
+
} ? StateOption extends keyof Exclusions ? Exclusions[StateOption] extends readonly (infer Layer extends string)[] ? Layer : never : never : never;
|
|
48
58
|
/** Property states after applying per-option pseudo-state exclusions */
|
|
49
59
|
type InferredPropertyStatesForOption<Prop extends SelectedConfigurableProperty<ConfigurablePropertiesName, string>, ExcludedPseudoStates extends readonly PossibleStates[] | undefined> = (Prop['skipRestState'] extends true ? {} : {
|
|
50
60
|
rest: InferredPropertySchema<Prop>;
|
|
@@ -54,13 +64,13 @@ type InferredPropertyStatesForOption<Prop extends SelectedConfigurableProperty<C
|
|
|
54
64
|
/** Infers property-to-states mappings for a layer's properties */
|
|
55
65
|
type InferredLayerProperties<Layer> = Layer extends LayerConfig ? Layer extends {
|
|
56
66
|
properties: infer Props extends LayerConfig['properties'];
|
|
57
|
-
} ?
|
|
67
|
+
} ? InferredLayerPropertyMap<Props, Layer> : {} : {};
|
|
58
68
|
type InferredLayerPropertiesForOption<Layer, ExcludedPseudoStates extends readonly PossibleStates[] | undefined> = Layer extends LayerConfig ? Layer extends {
|
|
59
69
|
properties: infer Props extends LayerConfig['properties'];
|
|
60
|
-
} ? { [PropKey in
|
|
70
|
+
} ? { [PropKey in RequiredInDefaultSchemaPropKeys<Props>]: InferredPropertyStatesForOption<Props[PropKey], ExcludedPseudoStates> } & { [PropKey in OptionalInDefaultSchemaPropKeys<Props>]?: InferredPropertyStatesForOption<Props[PropKey], ExcludedPseudoStates> } : {} : {};
|
|
61
71
|
/** Generates schema key → properties mappings for a variant's layers or component states */
|
|
62
|
-
type InferredSchemaMap<VarKey extends string, VarConfig extends VariantConfig, LayersOrStates extends NonNullable<VariantConfigWithComponentStates['componentStates']> | NonNullable<VariantConfigWithProperties['layers']>, Prefix extends string = ''> = LayersOrStates extends NonNullable<VariantConfigWithComponentStates['componentStates']> ? UnionToIntersection<{ [StateKey in keyof OmitIndexSignature<LayersOrStates>]: UnionToIntersection<{ [StateOption in LayersOrStates[StateKey]['options'][number]]: { [LayerKey in keyof OmitIndexSignature<LayersOrStates[StateKey]['layers']
|
|
63
|
-
type InferredVariantLevelProperties<Props extends Record<string, SelectedConfigurableProperty<ConfigurablePropertiesName, string>>> = { [PropKey in
|
|
72
|
+
type InferredSchemaMap<VarKey extends string, VarConfig extends VariantConfig, LayersOrStates extends NonNullable<VariantConfigWithComponentStates['componentStates']> | NonNullable<VariantConfigWithProperties['layers']>, Prefix extends string = ''> = LayersOrStates extends NonNullable<VariantConfigWithComponentStates['componentStates']> ? UnionToIntersection<{ [StateKey in keyof OmitIndexSignature<LayersOrStates>]: UnionToIntersection<{ [StateOption in LayersOrStates[StateKey]['options'][number]]: { [LayerKey in Exclude<keyof OmitIndexSignature<LayersOrStates[StateKey]['layers']>, GetExcludedLayersForOption<LayersOrStates[StateKey], StateOption>> as `${Prefix}${VarKey}/${VarConfig['options'][number]}/${StateKey & string}/${StateOption}/${LayerKey & string}`]: InferredLayerPropertiesForOption<LayersOrStates[StateKey]['layers'][LayerKey], GetExcludedPseudoStatesForOption<LayersOrStates[StateKey], StateOption>> } }[LayersOrStates[StateKey]['options'][number]]> }[keyof OmitIndexSignature<LayersOrStates>]> : { [LayerKey in keyof OmitIndexSignature<LayersOrStates> as `${Prefix}${VarKey}/${VarConfig['options'][number]}/${LayerKey & string}`]: InferredLayerProperties<LayersOrStates[LayerKey]> };
|
|
73
|
+
type InferredVariantLevelProperties<Props extends Record<string, SelectedConfigurableProperty<ConfigurablePropertiesName, string>>> = { [PropKey in RequiredInDefaultSchemaPropKeys<Props>]: InferredPropertyStates<Props[PropKey]> } & { [PropKey in OptionalInDefaultSchemaPropKeys<Props>]?: InferredPropertyStates<Props[PropKey]> };
|
|
64
74
|
type InferredVariantPropertiesMap<VarKey extends string, VarConfig extends VariantConfigWithProperties, Prefix extends string = ''> = VarConfig extends {
|
|
65
75
|
variantProperties: infer Props extends Record<string, SelectedConfigurableProperty<ConfigurablePropertiesName, string>>;
|
|
66
76
|
} ? { [Option in VarConfig['options'][number] as `${Prefix}${VarKey}/${Option}`]: InferredVariantLevelProperties<Props> } : {};
|