@titan-design/react-ui 0.2.5 → 0.2.7
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/chunk-3VLOBS6O.mjs +846 -0
- package/dist/chunk-3VLOBS6O.mjs.map +1 -0
- package/dist/{chunk-UXVRPOME.mjs → chunk-5SSKGS6E.mjs} +3 -783
- package/dist/chunk-5SSKGS6E.mjs.map +1 -0
- package/dist/index.d.mts +1005 -4
- package/dist/index.d.ts +1005 -4
- package/dist/index.js +6043 -213
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5901 -177
- package/dist/index.mjs.map +1 -1
- package/dist/theme/index.d.mts +57 -1
- package/dist/theme/index.d.ts +57 -1
- package/dist/theme/index.js +63 -0
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/index.mjs +2 -1
- package/dist/theme/tokens-css.d.mts +18 -0
- package/dist/theme/tokens-css.d.ts +18 -0
- package/dist/theme/tokens-css.js +289 -0
- package/dist/theme/tokens-css.js.map +1 -0
- package/dist/theme/tokens-css.mjs +24 -0
- package/dist/theme/tokens-css.mjs.map +1 -0
- package/docs/WEB_SETUP.md +217 -0
- package/package.json +17 -5
- package/src/components/custom/DateTime/DateTime.stories.tsx +1 -1
- package/src/components/custom/Gauge/Gauge.stories.tsx +45 -0
- package/src/components/custom/Gauge/Gauge.test.tsx +71 -0
- package/src/components/custom/Gauge/Gauge.tsx +167 -0
- package/src/components/custom/Gauge/index.ts +2 -0
- package/src/components/custom/Scatter/Scatter.stories.tsx +85 -0
- package/src/components/custom/Scatter/Scatter.test.tsx +96 -0
- package/src/components/custom/Scatter/Scatter.tsx +260 -0
- package/src/components/custom/Scatter/index.ts +2 -0
- package/src/components/custom/Sidebar/Sidebar.tsx +1 -1
- package/src/components/custom/Treemap/Treemap.stories.tsx +60 -0
- package/src/components/custom/Treemap/Treemap.test.tsx +67 -0
- package/src/components/custom/Treemap/Treemap.tsx +192 -0
- package/src/components/custom/Treemap/index.ts +2 -0
- package/src/components/custom/Workout/BaseBadge.stories.tsx +75 -0
- package/src/components/custom/Workout/BaseBadge.test.tsx +102 -0
- package/src/components/custom/Workout/BaseBadge.tsx +113 -0
- package/src/components/custom/Workout/BodyMap.stories.tsx +121 -0
- package/src/components/custom/Workout/BodyMap.test.tsx +124 -0
- package/src/components/custom/Workout/BodyMap.tsx +348 -0
- package/src/components/custom/Workout/BodyMapDetailPanel.stories.tsx +171 -0
- package/src/components/custom/Workout/BodyMapDetailPanel.test.tsx +225 -0
- package/src/components/custom/Workout/BodyMapDetailPanel.tsx +478 -0
- package/src/components/custom/Workout/CapacityBandChart.stories.tsx +125 -0
- package/src/components/custom/Workout/CapacityBandChart.test.tsx +193 -0
- package/src/components/custom/Workout/CapacityBandChart.tsx +493 -0
- package/src/components/custom/Workout/DeviationBar.stories.tsx +58 -0
- package/src/components/custom/Workout/DeviationBar.test.tsx +86 -0
- package/src/components/custom/Workout/DeviationBar.tsx +78 -0
- package/src/components/custom/Workout/ExerciseCard.stories.tsx +186 -0
- package/src/components/custom/Workout/ExerciseCard.test.tsx +319 -0
- package/src/components/custom/Workout/ExerciseCard.tsx +429 -0
- package/src/components/custom/Workout/InputBar.stories.tsx +75 -0
- package/src/components/custom/Workout/InputBar.test.tsx +116 -0
- package/src/components/custom/Workout/InputBar.tsx +163 -0
- package/src/components/custom/Workout/IntensityBar.stories.tsx +60 -0
- package/src/components/custom/Workout/IntensityBar.test.tsx +113 -0
- package/src/components/custom/Workout/IntensityBar.tsx +166 -0
- package/src/components/custom/Workout/MesoCard.stories.tsx +152 -0
- package/src/components/custom/Workout/MesoCard.test.tsx +170 -0
- package/src/components/custom/Workout/MesoCard.tsx +235 -0
- package/src/components/custom/Workout/MesoProgressBar.stories.tsx +85 -0
- package/src/components/custom/Workout/MesoProgressBar.test.tsx +141 -0
- package/src/components/custom/Workout/MesoProgressBar.tsx +161 -0
- package/src/components/custom/Workout/MesoStatusCard.stories.tsx +126 -0
- package/src/components/custom/Workout/MesoStatusCard.test.tsx +209 -0
- package/src/components/custom/Workout/MesoStatusCard.tsx +456 -0
- package/src/components/custom/Workout/MuscleGroupChip.stories.tsx +118 -0
- package/src/components/custom/Workout/MuscleGroupChip.test.tsx +91 -0
- package/src/components/custom/Workout/MuscleGroupChip.tsx +92 -0
- package/src/components/custom/Workout/PlaceholderStrip.stories.tsx +94 -0
- package/src/components/custom/Workout/PlaceholderStrip.test.tsx +83 -0
- package/src/components/custom/Workout/PlaceholderStrip.tsx +91 -0
- package/src/components/custom/Workout/PrBadge.stories.tsx +105 -0
- package/src/components/custom/Workout/PrBadge.test.tsx +111 -0
- package/src/components/custom/Workout/PrBadge.tsx +103 -0
- package/src/components/custom/Workout/PrHistoryModal.stories.tsx +116 -0
- package/src/components/custom/Workout/PrHistoryModal.test.tsx +161 -0
- package/src/components/custom/Workout/PrHistoryModal.tsx +244 -0
- package/src/components/custom/Workout/ReadinessCheck.stories.tsx +126 -0
- package/src/components/custom/Workout/ReadinessCheck.test.tsx +181 -0
- package/src/components/custom/Workout/ReadinessCheck.tsx +266 -0
- package/src/components/custom/Workout/RestTimer.tsx +8 -6
- package/src/components/custom/Workout/SetRow.stories.tsx +165 -0
- package/src/components/custom/Workout/SetRow.test.tsx +222 -0
- package/src/components/custom/Workout/SetRow.tsx +253 -0
- package/src/components/custom/Workout/Sparkline.stories.tsx +125 -0
- package/src/components/custom/Workout/Sparkline.test.tsx +113 -0
- package/src/components/custom/Workout/Sparkline.tsx +188 -0
- package/src/components/custom/Workout/StatusDot.stories.tsx +150 -0
- package/src/components/custom/Workout/StatusDot.test.tsx +165 -0
- package/src/components/custom/Workout/StatusDot.tsx +159 -0
- package/src/components/custom/Workout/StrengthTrendChart.stories.tsx +130 -0
- package/src/components/custom/Workout/StrengthTrendChart.test.tsx +217 -0
- package/src/components/custom/Workout/StrengthTrendChart.tsx +628 -0
- package/src/components/custom/Workout/SupersetWrapper.tsx +1 -2
- package/src/components/custom/Workout/TempoDisplay.stories.tsx +66 -0
- package/src/components/custom/Workout/TempoDisplay.test.tsx +90 -0
- package/src/components/custom/Workout/TempoDisplay.tsx +207 -0
- package/src/components/custom/Workout/VelocityStrip.stories.tsx +125 -0
- package/src/components/custom/Workout/VelocityStrip.test.tsx +234 -0
- package/src/components/custom/Workout/VelocityStrip.tsx +287 -0
- package/src/components/custom/Workout/WeekRow.stories.tsx +121 -0
- package/src/components/custom/Workout/WeekRow.test.tsx +117 -0
- package/src/components/custom/Workout/WeekRow.tsx +140 -0
- package/src/components/custom/Workout/WeightBadge.stories.tsx +87 -0
- package/src/components/custom/Workout/WeightBadge.test.tsx +164 -0
- package/src/components/custom/Workout/WeightBadge.tsx +113 -0
- package/src/components/custom/Workout/WorkoutCard.stories.tsx +135 -0
- package/src/components/custom/Workout/WorkoutCard.test.tsx +172 -0
- package/src/components/custom/Workout/WorkoutCard.tsx +226 -0
- package/src/components/custom/Workout/WorkoutPill.stories.tsx +63 -0
- package/src/components/custom/Workout/WorkoutPill.test.tsx +153 -0
- package/src/components/custom/Workout/WorkoutPill.tsx +177 -0
- package/src/components/custom/Workout/index.ts +113 -0
- package/src/components/custom/Workout/muscleTaxonomy.ts +252 -0
- package/src/components/custom/index.ts +3 -0
- package/src/components/custom/stepper/Stepper.stories.tsx +1 -1
- package/src/components/custom/stepper/Stepper.tsx +2 -2
- package/src/components/ui/autocomplete/Autocomplete.stories.tsx +1 -1
- package/src/components/ui/autocomplete/Autocomplete.tsx +1 -1
- package/src/components/ui/card/Card.tsx +1 -1
- package/src/components/ui/checkbox/Checkbox.tsx +1 -1
- package/src/components/ui/collapse/Collapse.tsx +1 -1
- package/src/components/ui/data-row/DataRow.stories.tsx +1 -1
- package/src/components/ui/drawer/Drawer.tsx +3 -3
- package/src/components/ui/form-field/FormField.tsx +1 -1
- package/src/components/ui/help-tip/HelpTip.tsx +1 -1
- package/src/components/ui/menu/Menu.tsx +2 -2
- package/src/components/ui/pill/Pill.tsx +1 -1
- package/src/components/ui/popover/Popover.stories.tsx +2 -2
- package/src/components/ui/popover/Popover.tsx +1 -1
- package/src/components/ui/radio/Radio.stories.tsx +1 -1
- package/src/components/ui/section/Section.stories.tsx +4 -4
- package/src/components/ui/select/Select.tsx +1 -1
- package/src/components/ui/stack/Stack.stories.tsx +4 -4
- package/src/components/ui/tabs/Tabs.tsx +2 -2
- package/src/components/ui/toolbar-button/ToolbarButton.stories.tsx +1 -1
- package/src/components/ui/toolbar-button/ToolbarButton.tsx +1 -1
- package/src/examples/react-hook-form/ControlledFields.tsx +171 -0
- package/src/examples/react-hook-form/ReactHookForm.stories.tsx +51 -0
- package/src/examples/react-hook-form/ReactHookForm.test.tsx +61 -0
- package/src/examples/react-hook-form/RhfContactForm.tsx +99 -0
- package/src/stories/PresetShowcase.stories.tsx +15 -15
- package/src/theme/index.ts +2 -1
- package/src/theme/manifest/css-property-manifest.example.json +79 -0
- package/src/theme/manifest/css-property-manifest.schema.json +93 -0
- package/src/theme/manifest/css-property-manifest.test.ts +81 -0
- package/src/theme/manifest/css-property-manifest.types.ts +49 -0
- package/src/theme/manifest/css-property-manifest.validate.ts +84 -0
- package/src/theme/manifest/index.ts +11 -0
- package/src/theme/tokens-css.test.ts +28 -0
- package/src/theme/tokens-css.ts +34 -0
- package/src/theme/workout-tokens.ts +61 -0
- package/dist/chunk-UXVRPOME.mjs.map +0 -1
package/dist/theme/index.d.mts
CHANGED
|
@@ -1299,6 +1299,62 @@ declare const neumorphicShadows: {
|
|
|
1299
1299
|
};
|
|
1300
1300
|
};
|
|
1301
1301
|
|
|
1302
|
+
/**
|
|
1303
|
+
* TypeScript mirror of css-property-manifest.schema.json.
|
|
1304
|
+
*
|
|
1305
|
+
* A manifest records, per component, which visual CSS properties are tracked,
|
|
1306
|
+
* which design token each one resolves from, the expected computed style
|
|
1307
|
+
* value, and any per-variant overrides. Manifests are the fixtures consumed
|
|
1308
|
+
* by Playwright computed-style assertions (see packages/ui/tests/visual).
|
|
1309
|
+
*/
|
|
1310
|
+
/** Variant axis name/value pairs, e.g. { variant: 'solid', color: 'primary', size: 'md' }. */
|
|
1311
|
+
type VariantAxes = Record<string, string>;
|
|
1312
|
+
/** A resolvedValue/token override that applies when the given variant axes match. */
|
|
1313
|
+
interface VariantOverride {
|
|
1314
|
+
/** Partial variant axis values that trigger this override, merged onto baseVariant. */
|
|
1315
|
+
variant: VariantAxes;
|
|
1316
|
+
/** Semantic token key for this override, or null for a literal (non-tokenized) value. */
|
|
1317
|
+
token?: string | null;
|
|
1318
|
+
/** CSS custom property backing the token for this override, if any. */
|
|
1319
|
+
cssVariable?: string | null;
|
|
1320
|
+
/** Expected getComputedStyle value when the variant axes match. */
|
|
1321
|
+
resolvedValue: string;
|
|
1322
|
+
}
|
|
1323
|
+
/** A single tracked CSS property for a component. */
|
|
1324
|
+
interface CssPropertyEntry {
|
|
1325
|
+
/** CSS property name in camelCase, as returned by window.getComputedStyle (e.g. "backgroundColor"). */
|
|
1326
|
+
property: string;
|
|
1327
|
+
/** Semantic token key this property is sourced from, or null if not backed by a token. */
|
|
1328
|
+
token: string | null;
|
|
1329
|
+
/** CSS custom property backing the token (e.g. "--color-brand-primary"), if any. */
|
|
1330
|
+
cssVariable?: string | null;
|
|
1331
|
+
/** Expected computed style value for baseVariant. */
|
|
1332
|
+
resolvedValue: string;
|
|
1333
|
+
/** Overrides of token/resolvedValue for specific variant axis combinations. */
|
|
1334
|
+
variantOverrides?: VariantOverride[];
|
|
1335
|
+
}
|
|
1336
|
+
/** The full per-component CSS property manifest. */
|
|
1337
|
+
interface CssPropertyManifest {
|
|
1338
|
+
/** Component identifier matching its src/components/ui/{component} directory and Storybook id. */
|
|
1339
|
+
component: string;
|
|
1340
|
+
/** Optional human-readable note about what this manifest covers. */
|
|
1341
|
+
description?: string;
|
|
1342
|
+
/** Variant axis values each property's top-level resolvedValue was captured against. */
|
|
1343
|
+
baseVariant?: VariantAxes;
|
|
1344
|
+
/** Tracked CSS properties for this component. */
|
|
1345
|
+
properties: CssPropertyEntry[];
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
/** Result of validating a candidate manifest: valid iff errors is empty. */
|
|
1349
|
+
interface ManifestValidationResult {
|
|
1350
|
+
valid: boolean;
|
|
1351
|
+
errors: string[];
|
|
1352
|
+
}
|
|
1353
|
+
/** Structurally validates a candidate value against the CssPropertyManifest shape. */
|
|
1354
|
+
declare function validateCssPropertyManifest(candidate: unknown): ManifestValidationResult;
|
|
1355
|
+
/** Type guard variant of validateCssPropertyManifest for use in narrowing contexts. */
|
|
1356
|
+
declare function isCssPropertyManifest(candidate: unknown): candidate is CssPropertyManifest;
|
|
1357
|
+
|
|
1302
1358
|
interface ThemePresetColors {
|
|
1303
1359
|
'brand-primary'?: string;
|
|
1304
1360
|
'brand-primary-light'?: string;
|
|
@@ -1384,4 +1440,4 @@ declare const defaultPreset: ThemePreset;
|
|
|
1384
1440
|
*/
|
|
1385
1441
|
declare const audiobookPreset: ThemePreset;
|
|
1386
1442
|
|
|
1387
|
-
export { type ComponentType, type ElevationConfig, type ElevationLevel, type GlowIntensity, type ShadowIntensity, type ShadowSurface, type ThemeConfig, type ThemeMode, type ThemePreset, type ThemePresetColors, type ThemePresetFonts, type ThemePresetRadii, type ThemePresetShadows, applyThemePreset, audiobookPreset, buttonSizes, componentElevationRanges, createFlatShadow, createPressedHoverShadow, createPressedShadow, createRaisedHoverShadow, createRaisedShadow, darkThemeCSSVars, darken, defaultPreset, discreteRainbow, elevationSystem, getBaseSurfaceColor, getDiscreteRainbowColor, getElevationConfig, getElevationShadow, getElevationSurface, getGlowShadow, getHoverColors, getSemanticColors, getThemeCSSVars, getValidatedElevation, gluestackConfig, hexToRgb, hsvToRgb, isDark, lightThemeCSSVars, lighten, neumorphicShadows, primitiveBorderRadius, primitiveBreakpoints, primitiveColors, primitiveShadows, primitiveSpacing, primitiveTypography, primitiveZIndex, rgbToHex, rgbToHsv, semanticColorsDark, semanticColorsLight, semanticTypography, shadowColors };
|
|
1443
|
+
export { type ComponentType, type CssPropertyEntry, type CssPropertyManifest, type ElevationConfig, type ElevationLevel, type GlowIntensity, type ManifestValidationResult, type ShadowIntensity, type ShadowSurface, type ThemeConfig, type ThemeMode, type ThemePreset, type ThemePresetColors, type ThemePresetFonts, type ThemePresetRadii, type ThemePresetShadows, type VariantAxes, type VariantOverride, applyThemePreset, audiobookPreset, buttonSizes, componentElevationRanges, createFlatShadow, createPressedHoverShadow, createPressedShadow, createRaisedHoverShadow, createRaisedShadow, darkThemeCSSVars, darken, defaultPreset, discreteRainbow, elevationSystem, getBaseSurfaceColor, getDiscreteRainbowColor, getElevationConfig, getElevationShadow, getElevationSurface, getGlowShadow, getHoverColors, getSemanticColors, getThemeCSSVars, getValidatedElevation, gluestackConfig, hexToRgb, hsvToRgb, isCssPropertyManifest, isDark, lightThemeCSSVars, lighten, neumorphicShadows, primitiveBorderRadius, primitiveBreakpoints, primitiveColors, primitiveShadows, primitiveSpacing, primitiveTypography, primitiveZIndex, rgbToHex, rgbToHsv, semanticColorsDark, semanticColorsLight, semanticTypography, shadowColors, validateCssPropertyManifest };
|
package/dist/theme/index.d.ts
CHANGED
|
@@ -1299,6 +1299,62 @@ declare const neumorphicShadows: {
|
|
|
1299
1299
|
};
|
|
1300
1300
|
};
|
|
1301
1301
|
|
|
1302
|
+
/**
|
|
1303
|
+
* TypeScript mirror of css-property-manifest.schema.json.
|
|
1304
|
+
*
|
|
1305
|
+
* A manifest records, per component, which visual CSS properties are tracked,
|
|
1306
|
+
* which design token each one resolves from, the expected computed style
|
|
1307
|
+
* value, and any per-variant overrides. Manifests are the fixtures consumed
|
|
1308
|
+
* by Playwright computed-style assertions (see packages/ui/tests/visual).
|
|
1309
|
+
*/
|
|
1310
|
+
/** Variant axis name/value pairs, e.g. { variant: 'solid', color: 'primary', size: 'md' }. */
|
|
1311
|
+
type VariantAxes = Record<string, string>;
|
|
1312
|
+
/** A resolvedValue/token override that applies when the given variant axes match. */
|
|
1313
|
+
interface VariantOverride {
|
|
1314
|
+
/** Partial variant axis values that trigger this override, merged onto baseVariant. */
|
|
1315
|
+
variant: VariantAxes;
|
|
1316
|
+
/** Semantic token key for this override, or null for a literal (non-tokenized) value. */
|
|
1317
|
+
token?: string | null;
|
|
1318
|
+
/** CSS custom property backing the token for this override, if any. */
|
|
1319
|
+
cssVariable?: string | null;
|
|
1320
|
+
/** Expected getComputedStyle value when the variant axes match. */
|
|
1321
|
+
resolvedValue: string;
|
|
1322
|
+
}
|
|
1323
|
+
/** A single tracked CSS property for a component. */
|
|
1324
|
+
interface CssPropertyEntry {
|
|
1325
|
+
/** CSS property name in camelCase, as returned by window.getComputedStyle (e.g. "backgroundColor"). */
|
|
1326
|
+
property: string;
|
|
1327
|
+
/** Semantic token key this property is sourced from, or null if not backed by a token. */
|
|
1328
|
+
token: string | null;
|
|
1329
|
+
/** CSS custom property backing the token (e.g. "--color-brand-primary"), if any. */
|
|
1330
|
+
cssVariable?: string | null;
|
|
1331
|
+
/** Expected computed style value for baseVariant. */
|
|
1332
|
+
resolvedValue: string;
|
|
1333
|
+
/** Overrides of token/resolvedValue for specific variant axis combinations. */
|
|
1334
|
+
variantOverrides?: VariantOverride[];
|
|
1335
|
+
}
|
|
1336
|
+
/** The full per-component CSS property manifest. */
|
|
1337
|
+
interface CssPropertyManifest {
|
|
1338
|
+
/** Component identifier matching its src/components/ui/{component} directory and Storybook id. */
|
|
1339
|
+
component: string;
|
|
1340
|
+
/** Optional human-readable note about what this manifest covers. */
|
|
1341
|
+
description?: string;
|
|
1342
|
+
/** Variant axis values each property's top-level resolvedValue was captured against. */
|
|
1343
|
+
baseVariant?: VariantAxes;
|
|
1344
|
+
/** Tracked CSS properties for this component. */
|
|
1345
|
+
properties: CssPropertyEntry[];
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
/** Result of validating a candidate manifest: valid iff errors is empty. */
|
|
1349
|
+
interface ManifestValidationResult {
|
|
1350
|
+
valid: boolean;
|
|
1351
|
+
errors: string[];
|
|
1352
|
+
}
|
|
1353
|
+
/** Structurally validates a candidate value against the CssPropertyManifest shape. */
|
|
1354
|
+
declare function validateCssPropertyManifest(candidate: unknown): ManifestValidationResult;
|
|
1355
|
+
/** Type guard variant of validateCssPropertyManifest for use in narrowing contexts. */
|
|
1356
|
+
declare function isCssPropertyManifest(candidate: unknown): candidate is CssPropertyManifest;
|
|
1357
|
+
|
|
1302
1358
|
interface ThemePresetColors {
|
|
1303
1359
|
'brand-primary'?: string;
|
|
1304
1360
|
'brand-primary-light'?: string;
|
|
@@ -1384,4 +1440,4 @@ declare const defaultPreset: ThemePreset;
|
|
|
1384
1440
|
*/
|
|
1385
1441
|
declare const audiobookPreset: ThemePreset;
|
|
1386
1442
|
|
|
1387
|
-
export { type ComponentType, type ElevationConfig, type ElevationLevel, type GlowIntensity, type ShadowIntensity, type ShadowSurface, type ThemeConfig, type ThemeMode, type ThemePreset, type ThemePresetColors, type ThemePresetFonts, type ThemePresetRadii, type ThemePresetShadows, applyThemePreset, audiobookPreset, buttonSizes, componentElevationRanges, createFlatShadow, createPressedHoverShadow, createPressedShadow, createRaisedHoverShadow, createRaisedShadow, darkThemeCSSVars, darken, defaultPreset, discreteRainbow, elevationSystem, getBaseSurfaceColor, getDiscreteRainbowColor, getElevationConfig, getElevationShadow, getElevationSurface, getGlowShadow, getHoverColors, getSemanticColors, getThemeCSSVars, getValidatedElevation, gluestackConfig, hexToRgb, hsvToRgb, isDark, lightThemeCSSVars, lighten, neumorphicShadows, primitiveBorderRadius, primitiveBreakpoints, primitiveColors, primitiveShadows, primitiveSpacing, primitiveTypography, primitiveZIndex, rgbToHex, rgbToHsv, semanticColorsDark, semanticColorsLight, semanticTypography, shadowColors };
|
|
1443
|
+
export { type ComponentType, type CssPropertyEntry, type CssPropertyManifest, type ElevationConfig, type ElevationLevel, type GlowIntensity, type ManifestValidationResult, type ShadowIntensity, type ShadowSurface, type ThemeConfig, type ThemeMode, type ThemePreset, type ThemePresetColors, type ThemePresetFonts, type ThemePresetRadii, type ThemePresetShadows, type VariantAxes, type VariantOverride, applyThemePreset, audiobookPreset, buttonSizes, componentElevationRanges, createFlatShadow, createPressedHoverShadow, createPressedShadow, createRaisedHoverShadow, createRaisedShadow, darkThemeCSSVars, darken, defaultPreset, discreteRainbow, elevationSystem, getBaseSurfaceColor, getDiscreteRainbowColor, getElevationConfig, getElevationShadow, getElevationSurface, getGlowShadow, getHoverColors, getSemanticColors, getThemeCSSVars, getValidatedElevation, gluestackConfig, hexToRgb, hsvToRgb, isCssPropertyManifest, isDark, lightThemeCSSVars, lighten, neumorphicShadows, primitiveBorderRadius, primitiveBreakpoints, primitiveColors, primitiveShadows, primitiveSpacing, primitiveTypography, primitiveZIndex, rgbToHex, rgbToHsv, semanticColorsDark, semanticColorsLight, semanticTypography, shadowColors, validateCssPropertyManifest };
|
package/dist/theme/index.js
CHANGED
|
@@ -1500,6 +1500,67 @@ function getGlowShadow(color, intensity = "medium") {
|
|
|
1500
1500
|
});
|
|
1501
1501
|
}
|
|
1502
1502
|
|
|
1503
|
+
// src/theme/manifest/css-property-manifest.validate.ts
|
|
1504
|
+
var isPlainObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1505
|
+
var isVariantAxes = (value) => isPlainObject(value) && Object.keys(value).length > 0 && Object.values(value).every((axisValue) => typeof axisValue === "string");
|
|
1506
|
+
function collectVariantOverrideErrors(override, path) {
|
|
1507
|
+
if (!isPlainObject(override)) return [`${path} must be an object`];
|
|
1508
|
+
const errors = [];
|
|
1509
|
+
if (!isVariantAxes(override.variant))
|
|
1510
|
+
errors.push(`${path}.variant must be a non-empty string-keyed object`);
|
|
1511
|
+
if (override.token !== void 0 && override.token !== null && typeof override.token !== "string") {
|
|
1512
|
+
errors.push(`${path}.token must be a string or null`);
|
|
1513
|
+
}
|
|
1514
|
+
if (typeof override.resolvedValue !== "string" || override.resolvedValue.length === 0) {
|
|
1515
|
+
errors.push(`${path}.resolvedValue must be a non-empty string`);
|
|
1516
|
+
}
|
|
1517
|
+
return errors;
|
|
1518
|
+
}
|
|
1519
|
+
function collectPropertyErrors(entry, path) {
|
|
1520
|
+
if (!isPlainObject(entry)) return [`${path} must be an object`];
|
|
1521
|
+
const errors = [];
|
|
1522
|
+
if (typeof entry.property !== "string" || entry.property.length === 0) {
|
|
1523
|
+
errors.push(`${path}.property must be a non-empty string`);
|
|
1524
|
+
}
|
|
1525
|
+
if (entry.token !== null && typeof entry.token !== "string") {
|
|
1526
|
+
errors.push(`${path}.token must be a string or null`);
|
|
1527
|
+
}
|
|
1528
|
+
if (typeof entry.resolvedValue !== "string" || entry.resolvedValue.length === 0) {
|
|
1529
|
+
errors.push(`${path}.resolvedValue must be a non-empty string`);
|
|
1530
|
+
}
|
|
1531
|
+
if (entry.variantOverrides !== void 0) {
|
|
1532
|
+
if (!Array.isArray(entry.variantOverrides)) {
|
|
1533
|
+
errors.push(`${path}.variantOverrides must be an array`);
|
|
1534
|
+
} else {
|
|
1535
|
+
entry.variantOverrides.forEach(
|
|
1536
|
+
(override, i) => errors.push(...collectVariantOverrideErrors(override, `${path}.variantOverrides[${i}]`))
|
|
1537
|
+
);
|
|
1538
|
+
}
|
|
1539
|
+
}
|
|
1540
|
+
return errors;
|
|
1541
|
+
}
|
|
1542
|
+
function validateCssPropertyManifest(candidate) {
|
|
1543
|
+
if (!isPlainObject(candidate)) return { valid: false, errors: ["manifest must be an object"] };
|
|
1544
|
+
const errors = [];
|
|
1545
|
+
if (typeof candidate.component !== "string" || candidate.component.length === 0) {
|
|
1546
|
+
errors.push("component must be a non-empty string");
|
|
1547
|
+
}
|
|
1548
|
+
if (candidate.baseVariant !== void 0 && !isVariantAxes(candidate.baseVariant)) {
|
|
1549
|
+
errors.push("baseVariant must be a non-empty string-keyed object");
|
|
1550
|
+
}
|
|
1551
|
+
if (!Array.isArray(candidate.properties) || candidate.properties.length === 0) {
|
|
1552
|
+
errors.push("properties must be a non-empty array");
|
|
1553
|
+
} else {
|
|
1554
|
+
candidate.properties.forEach(
|
|
1555
|
+
(entry, i) => errors.push(...collectPropertyErrors(entry, `properties[${i}]`))
|
|
1556
|
+
);
|
|
1557
|
+
}
|
|
1558
|
+
return { valid: errors.length === 0, errors };
|
|
1559
|
+
}
|
|
1560
|
+
function isCssPropertyManifest(candidate) {
|
|
1561
|
+
return validateCssPropertyManifest(candidate).valid;
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1503
1564
|
// src/theme/presets/apply.ts
|
|
1504
1565
|
function colorKeyToVar(key) {
|
|
1505
1566
|
return `--color-${key}`;
|
|
@@ -1690,6 +1751,7 @@ exports.getValidatedElevation = getValidatedElevation;
|
|
|
1690
1751
|
exports.gluestackConfig = gluestackConfig;
|
|
1691
1752
|
exports.hexToRgb = hexToRgb;
|
|
1692
1753
|
exports.hsvToRgb = hsvToRgb;
|
|
1754
|
+
exports.isCssPropertyManifest = isCssPropertyManifest;
|
|
1693
1755
|
exports.isDark = isDark;
|
|
1694
1756
|
exports.lightThemeCSSVars = lightThemeCSSVars;
|
|
1695
1757
|
exports.lighten = lighten;
|
|
@@ -1707,5 +1769,6 @@ exports.semanticColorsDark = semanticColorsDark;
|
|
|
1707
1769
|
exports.semanticColorsLight = semanticColorsLight;
|
|
1708
1770
|
exports.semanticTypography = semanticTypography;
|
|
1709
1771
|
exports.shadowColors = shadowColors;
|
|
1772
|
+
exports.validateCssPropertyManifest = validateCssPropertyManifest;
|
|
1710
1773
|
//# sourceMappingURL=index.js.map
|
|
1711
1774
|
//# sourceMappingURL=index.js.map
|