@titan-design/react-ui 0.1.0 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -1
- package/dist/{chunk-MGW37MPO.mjs → chunk-UXVRPOME.mjs} +173 -3
- package/dist/chunk-UXVRPOME.mjs.map +1 -0
- package/dist/index.d.mts +101 -12
- package/dist/index.d.ts +101 -12
- package/dist/index.js +1267 -468
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +734 -112
- package/dist/index.mjs.map +1 -1
- package/dist/theme/index.d.mts +86 -1
- package/dist/theme/index.d.ts +86 -1
- package/dist/theme/index.js +166 -0
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/index.mjs +1 -1
- package/package.json +22 -6
- package/src/components/custom/DateTime/DateTime.stories.tsx +180 -0
- package/src/components/custom/DateTime/DateTime.test.tsx +152 -0
- package/src/components/custom/DateTime/DateTime.tsx +235 -0
- package/src/components/custom/DateTime/index.ts +2 -0
- package/src/components/custom/EmptyState/EmptyState.stories.tsx +99 -0
- package/src/components/custom/EmptyState/EmptyState.test.tsx +106 -0
- package/src/components/custom/EmptyState/EmptyState.tsx +68 -0
- package/src/components/custom/EmptyState/index.ts +2 -0
- package/src/components/custom/Metric/Metric.stories.tsx +133 -0
- package/src/components/custom/Metric/Metric.test.tsx +120 -0
- package/src/components/custom/Metric/Metric.tsx +92 -0
- package/src/components/custom/Metric/index.ts +2 -0
- package/src/components/custom/Sidebar/Sidebar.stories.tsx +227 -0
- package/src/components/custom/Sidebar/Sidebar.test.tsx +185 -0
- package/src/components/custom/Sidebar/Sidebar.tsx +257 -0
- package/src/components/custom/Sidebar/index.ts +18 -0
- package/src/components/custom/Table/Table.stories.tsx +481 -0
- package/src/components/custom/Table/Table.test.tsx +531 -0
- package/src/components/custom/Table/Table.tsx +696 -0
- package/src/components/custom/Table/index.ts +22 -0
- package/src/components/custom/Typography/Typography.stories.tsx +153 -0
- package/src/components/custom/Typography/Typography.test.tsx +107 -0
- package/src/components/custom/Typography/Typography.tsx +218 -0
- package/src/components/custom/Typography/index.ts +19 -0
- package/src/components/custom/Workout/RestTimer.stories.tsx +71 -0
- package/src/components/custom/Workout/RestTimer.test.tsx +145 -0
- package/src/components/custom/Workout/RestTimer.tsx +172 -0
- package/src/components/custom/Workout/SupersetWrapper.stories.tsx +144 -0
- package/src/components/custom/Workout/SupersetWrapper.test.tsx +130 -0
- package/src/components/custom/Workout/SupersetWrapper.tsx +63 -0
- package/src/components/custom/Workout/index.ts +2 -0
- package/src/components/custom/index.ts +9 -0
- package/src/components/custom/stepper/Stepper.stories.tsx +245 -0
- package/src/components/custom/stepper/Stepper.test.tsx +230 -0
- package/src/components/custom/stepper/Stepper.tsx +250 -0
- package/src/components/custom/stepper/index.ts +10 -0
- package/src/components/index.ts +5 -0
- package/src/components/ui/alert/Alert.stories.tsx +154 -0
- package/src/components/ui/alert/Alert.test.tsx +202 -0
- package/src/components/ui/alert/Alert.tsx +170 -0
- package/src/components/ui/alert/index.ts +8 -0
- package/src/components/ui/autocomplete/Autocomplete.stories.tsx +299 -0
- package/src/components/ui/autocomplete/Autocomplete.test.tsx +247 -0
- package/src/components/ui/autocomplete/Autocomplete.tsx +332 -0
- package/src/components/ui/autocomplete/index.ts +2 -0
- package/src/components/ui/avatar/Avatar.stories.tsx +105 -0
- package/src/components/ui/avatar/Avatar.test.tsx +152 -0
- package/src/components/ui/avatar/Avatar.tsx +176 -0
- package/src/components/ui/avatar/index.ts +2 -0
- package/src/components/ui/badge/Badge.stories.tsx +100 -0
- package/src/components/ui/badge/Badge.test.tsx +103 -0
- package/src/components/ui/badge/Badge.tsx +119 -0
- package/src/components/ui/badge/index.ts +3 -0
- package/src/components/ui/breadcrumbs/Breadcrumbs.stories.tsx +70 -0
- package/src/components/ui/breadcrumbs/Breadcrumbs.test.tsx +156 -0
- package/src/components/ui/breadcrumbs/Breadcrumbs.tsx +127 -0
- package/src/components/ui/breadcrumbs/index.ts +2 -0
- package/src/components/ui/button/Button.stories.tsx +216 -0
- package/src/components/ui/button/Button.test.tsx +132 -0
- package/src/components/ui/button/Button.tsx +297 -0
- package/src/components/ui/button/index.ts +10 -0
- package/src/components/ui/card/Card.stories.tsx +443 -0
- package/src/components/ui/card/Card.test.tsx +294 -0
- package/src/components/ui/card/Card.tsx +401 -0
- package/src/components/ui/card/index.ts +20 -0
- package/src/components/ui/checkbox/Checkbox.stories.tsx +126 -0
- package/src/components/ui/checkbox/Checkbox.test.tsx +152 -0
- package/src/components/ui/checkbox/Checkbox.tsx +163 -0
- package/src/components/ui/checkbox/index.ts +2 -0
- package/src/components/ui/chip/Chip.stories.tsx +112 -0
- package/src/components/ui/chip/Chip.test.tsx +119 -0
- package/src/components/ui/chip/Chip.tsx +151 -0
- package/src/components/ui/chip/index.ts +2 -0
- package/src/components/ui/collapse/Collapse.stories.tsx +313 -0
- package/src/components/ui/collapse/Collapse.test.tsx +298 -0
- package/src/components/ui/collapse/Collapse.tsx +275 -0
- package/src/components/ui/collapse/index.ts +18 -0
- package/src/components/ui/data-row/DataRow.stories.tsx +78 -0
- package/src/components/ui/data-row/DataRow.test.tsx +78 -0
- package/src/components/ui/data-row/DataRow.tsx +29 -0
- package/src/components/ui/data-row/index.ts +2 -0
- package/src/components/ui/divider/Divider.stories.tsx +71 -0
- package/src/components/ui/divider/Divider.test.tsx +55 -0
- package/src/components/ui/divider/Divider.tsx +37 -0
- package/src/components/ui/divider/index.ts +2 -0
- package/src/components/ui/drawer/Drawer.stories.tsx +228 -0
- package/src/components/ui/drawer/Drawer.test.tsx +142 -0
- package/src/components/ui/drawer/Drawer.tsx +228 -0
- package/src/components/ui/drawer/index.ts +9 -0
- package/src/components/ui/form-field/FormField.stories.tsx +260 -0
- package/src/components/ui/form-field/FormField.test.tsx +280 -0
- package/src/components/ui/form-field/FormField.tsx +308 -0
- package/src/components/ui/form-field/index.ts +2 -0
- package/src/components/ui/help-tip/HelpTip.stories.tsx +250 -0
- package/src/components/ui/help-tip/HelpTip.test.tsx +198 -0
- package/src/components/ui/help-tip/HelpTip.tsx +229 -0
- package/src/components/ui/help-tip/index.ts +2 -0
- package/src/components/ui/icon-box/IconBox.stories.tsx +139 -0
- package/src/components/ui/icon-box/IconBox.test.tsx +120 -0
- package/src/components/ui/icon-box/IconBox.tsx +57 -0
- package/src/components/ui/icon-box/index.ts +1 -0
- package/src/components/ui/index.ts +38 -0
- package/src/components/ui/indicator/Indicator.stories.tsx +74 -0
- package/src/components/ui/indicator/Indicator.test.tsx +55 -0
- package/src/components/ui/indicator/Indicator.tsx +73 -0
- package/src/components/ui/indicator/index.ts +2 -0
- package/src/components/ui/input/Input.stories.tsx +192 -0
- package/src/components/ui/input/Input.test.tsx +86 -0
- package/src/components/ui/input/Input.tsx +273 -0
- package/src/components/ui/input/index.ts +2 -0
- package/src/components/ui/link/Link.stories.tsx +78 -0
- package/src/components/ui/link/Link.test.tsx +94 -0
- package/src/components/ui/link/Link.tsx +86 -0
- package/src/components/ui/link/index.ts +2 -0
- package/src/components/ui/list-item/ListItem.stories.tsx +146 -0
- package/src/components/ui/list-item/ListItem.test.tsx +128 -0
- package/src/components/ui/list-item/ListItem.tsx +89 -0
- package/src/components/ui/list-item/index.ts +14 -0
- package/src/components/ui/menu/Menu.stories.tsx +180 -0
- package/src/components/ui/menu/Menu.test.tsx +353 -0
- package/src/components/ui/menu/Menu.tsx +222 -0
- package/src/components/ui/menu/index.ts +2 -0
- package/src/components/ui/modal/Modal.stories.tsx +350 -0
- package/src/components/ui/modal/Modal.test.tsx +159 -0
- package/src/components/ui/modal/Modal.tsx +254 -0
- package/src/components/ui/modal/index.ts +19 -0
- package/src/components/ui/pill/Pill.stories.tsx +71 -0
- package/src/components/ui/pill/Pill.test.tsx +69 -0
- package/src/components/ui/pill/Pill.tsx +104 -0
- package/src/components/ui/pill/index.ts +2 -0
- package/src/components/ui/popover/Popover.stories.tsx +190 -0
- package/src/components/ui/popover/Popover.test.tsx +419 -0
- package/src/components/ui/popover/Popover.tsx +237 -0
- package/src/components/ui/popover/index.ts +2 -0
- package/src/components/ui/progress/Progress.stories.tsx +190 -0
- package/src/components/ui/progress/Progress.test.tsx +210 -0
- package/src/components/ui/progress/Progress.tsx +339 -0
- package/src/components/ui/progress/index.ts +9 -0
- package/src/components/ui/radio/Radio.stories.tsx +199 -0
- package/src/components/ui/radio/Radio.test.tsx +166 -0
- package/src/components/ui/radio/Radio.tsx +200 -0
- package/src/components/ui/radio/index.ts +2 -0
- package/src/components/ui/section/Section.stories.tsx +111 -0
- package/src/components/ui/section/Section.test.tsx +121 -0
- package/src/components/ui/section/Section.tsx +52 -0
- package/src/components/ui/section/index.ts +6 -0
- package/src/components/ui/select/Select.stories.tsx +286 -0
- package/src/components/ui/select/Select.test.tsx +200 -0
- package/src/components/ui/select/Select.tsx +243 -0
- package/src/components/ui/select/index.ts +2 -0
- package/src/components/ui/skeleton/Skeleton.stories.tsx +153 -0
- package/src/components/ui/skeleton/Skeleton.test.tsx +162 -0
- package/src/components/ui/skeleton/Skeleton.tsx +229 -0
- package/src/components/ui/skeleton/index.ts +16 -0
- package/src/components/ui/spinner/Spinner.stories.tsx +67 -0
- package/src/components/ui/spinner/Spinner.test.tsx +67 -0
- package/src/components/ui/spinner/Spinner.tsx +72 -0
- package/src/components/ui/spinner/index.ts +2 -0
- package/src/components/ui/stack/Stack.stories.tsx +127 -0
- package/src/components/ui/stack/Stack.test.tsx +184 -0
- package/src/components/ui/stack/Stack.tsx +76 -0
- package/src/components/ui/stack/index.ts +2 -0
- package/src/components/ui/surface/Surface.stories.tsx +91 -0
- package/src/components/ui/surface/Surface.test.tsx +63 -0
- package/src/components/ui/surface/Surface.tsx +51 -0
- package/src/components/ui/surface/index.ts +1 -0
- package/src/components/ui/switch/Switch.stories.tsx +111 -0
- package/src/components/ui/switch/Switch.test.tsx +112 -0
- package/src/components/ui/switch/Switch.tsx +103 -0
- package/src/components/ui/switch/index.ts +2 -0
- package/src/components/ui/tabs/Tabs.stories.tsx +213 -0
- package/src/components/ui/tabs/Tabs.test.tsx +192 -0
- package/src/components/ui/tabs/Tabs.tsx +253 -0
- package/src/components/ui/tabs/index.ts +16 -0
- package/src/components/ui/toast/Toast.stories.tsx +255 -0
- package/src/components/ui/toast/Toast.test.tsx +207 -0
- package/src/components/ui/toast/Toast.tsx +327 -0
- package/src/components/ui/toast/index.ts +9 -0
- package/src/components/ui/toolbar-button/ToolbarButton.stories.tsx +415 -0
- package/src/components/ui/toolbar-button/ToolbarButton.test.tsx +224 -0
- package/src/components/ui/toolbar-button/ToolbarButton.tsx +307 -0
- package/src/components/ui/toolbar-button/index.ts +7 -0
- package/src/components/ui/tooltip/Tooltip.stories.tsx +126 -0
- package/src/components/ui/tooltip/Tooltip.test.tsx +262 -0
- package/src/components/ui/tooltip/Tooltip.tsx +234 -0
- package/src/components/ui/tooltip/index.ts +2 -0
- package/src/index.ts +10 -0
- package/src/stories/PresetShowcase.stories.tsx +462 -0
- package/src/stories/ThemePresets.stories.tsx +85 -0
- package/src/test/setup.ts +19 -0
- package/src/theme/Colors.stories.tsx +258 -0
- package/src/theme/config.ts +193 -0
- package/src/theme/elevation.stories.tsx +346 -0
- package/src/theme/elevation.test.ts +27 -0
- package/src/theme/elevation.ts +567 -0
- package/src/theme/global.css +129 -1
- package/src/theme/index.ts +40 -0
- package/src/theme/presets/apply.ts +97 -0
- package/src/theme/presets/audiobook.ts +93 -0
- package/src/theme/presets/default.ts +6 -0
- package/src/theme/presets/index.ts +4 -0
- package/src/theme/presets/presets.test.ts +51 -0
- package/src/theme/presets/types.ts +76 -0
- package/src/theme/shadows.stories.tsx +523 -0
- package/src/theme/shadows.ts +439 -0
- package/src/theme/tokens/index.ts +2 -0
- package/src/theme/tokens/primitives.ts +354 -0
- package/src/theme/tokens/semantic.ts +381 -0
- package/src/types/jest-axe.d.ts +16 -0
- package/src/types/nativewind.d.ts +54 -0
- package/src/utils/avatar-color.test.ts +30 -0
- package/src/utils/avatar-color.ts +20 -0
- package/src/utils/cn.ts +14 -0
- package/src/utils/colors.ts +140 -0
- package/src/utils/form.ts +188 -0
- package/src/utils/index.ts +29 -0
- package/src/utils/useTheme.ts +72 -0
- package/src/web-jsx/jsx-dev-runtime.ts +28 -0
- package/src/web-jsx/jsx-runtime.ts +41 -0
- package/tailwind.config.js +53 -3
- package/dist/chunk-MGW37MPO.mjs.map +0 -1
package/dist/theme/index.d.mts
CHANGED
|
@@ -1299,4 +1299,89 @@ declare const neumorphicShadows: {
|
|
|
1299
1299
|
};
|
|
1300
1300
|
};
|
|
1301
1301
|
|
|
1302
|
-
|
|
1302
|
+
interface ThemePresetColors {
|
|
1303
|
+
'brand-primary'?: string;
|
|
1304
|
+
'brand-primary-light'?: string;
|
|
1305
|
+
'brand-primary-dark'?: string;
|
|
1306
|
+
'brand-primary-subtle'?: string;
|
|
1307
|
+
'brand-primary-hover'?: string;
|
|
1308
|
+
'brand-primary-active'?: string;
|
|
1309
|
+
'brand-secondary'?: string;
|
|
1310
|
+
'brand-secondary-light'?: string;
|
|
1311
|
+
'brand-secondary-dark'?: string;
|
|
1312
|
+
'brand-secondary-subtle'?: string;
|
|
1313
|
+
'brand-secondary-hover'?: string;
|
|
1314
|
+
'brand-secondary-active'?: string;
|
|
1315
|
+
'on-brand-primary'?: string;
|
|
1316
|
+
'on-brand-secondary'?: string;
|
|
1317
|
+
'status-success'?: string;
|
|
1318
|
+
'status-error'?: string;
|
|
1319
|
+
'status-warning'?: string;
|
|
1320
|
+
'status-info'?: string;
|
|
1321
|
+
'text-primary'?: string;
|
|
1322
|
+
'text-secondary'?: string;
|
|
1323
|
+
'text-tertiary'?: string;
|
|
1324
|
+
'surface-base'?: string;
|
|
1325
|
+
'surface-elevated'?: string;
|
|
1326
|
+
'surface-raised'?: string;
|
|
1327
|
+
'surface-overlay'?: string;
|
|
1328
|
+
'surface-input'?: string;
|
|
1329
|
+
'background-base'?: string;
|
|
1330
|
+
'background-default'?: string;
|
|
1331
|
+
'background-subtle'?: string;
|
|
1332
|
+
'border-default'?: string;
|
|
1333
|
+
'border-subtle'?: string;
|
|
1334
|
+
'border-strong'?: string;
|
|
1335
|
+
'border-focus'?: string;
|
|
1336
|
+
'divider'?: string;
|
|
1337
|
+
[key: `${string}`]: string | undefined;
|
|
1338
|
+
}
|
|
1339
|
+
interface ThemePresetFonts {
|
|
1340
|
+
sans?: string;
|
|
1341
|
+
body?: string;
|
|
1342
|
+
heading?: string;
|
|
1343
|
+
mono?: string;
|
|
1344
|
+
}
|
|
1345
|
+
interface ThemePresetRadii {
|
|
1346
|
+
sm?: string;
|
|
1347
|
+
DEFAULT?: string;
|
|
1348
|
+
md?: string;
|
|
1349
|
+
lg?: string;
|
|
1350
|
+
xl?: string;
|
|
1351
|
+
}
|
|
1352
|
+
interface ThemePresetShadows {
|
|
1353
|
+
sm?: string;
|
|
1354
|
+
DEFAULT?: string;
|
|
1355
|
+
md?: string;
|
|
1356
|
+
lg?: string;
|
|
1357
|
+
xl?: string;
|
|
1358
|
+
}
|
|
1359
|
+
interface ThemePreset {
|
|
1360
|
+
name: string;
|
|
1361
|
+
description?: string;
|
|
1362
|
+
colors?: {
|
|
1363
|
+
dark?: ThemePresetColors;
|
|
1364
|
+
light?: ThemePresetColors;
|
|
1365
|
+
};
|
|
1366
|
+
fonts?: ThemePresetFonts;
|
|
1367
|
+
radii?: ThemePresetRadii;
|
|
1368
|
+
shadows?: ThemePresetShadows;
|
|
1369
|
+
/** Additional CSS classes to add to root element */
|
|
1370
|
+
rootClasses?: string[];
|
|
1371
|
+
/** Google Fonts import URL (appended to existing imports) */
|
|
1372
|
+
fontImport?: string;
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
declare function applyThemePreset(preset: ThemePreset): () => void;
|
|
1376
|
+
|
|
1377
|
+
declare const defaultPreset: ThemePreset;
|
|
1378
|
+
|
|
1379
|
+
/**
|
|
1380
|
+
* Audiobook Studio preset.
|
|
1381
|
+
*
|
|
1382
|
+
* Warm copper/patina aesthetic inspired by vintage audio equipment
|
|
1383
|
+
* and reading lounges. Dark-mode only design with editorial typography.
|
|
1384
|
+
*/
|
|
1385
|
+
declare const audiobookPreset: ThemePreset;
|
|
1386
|
+
|
|
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 };
|
package/dist/theme/index.d.ts
CHANGED
|
@@ -1299,4 +1299,89 @@ declare const neumorphicShadows: {
|
|
|
1299
1299
|
};
|
|
1300
1300
|
};
|
|
1301
1301
|
|
|
1302
|
-
|
|
1302
|
+
interface ThemePresetColors {
|
|
1303
|
+
'brand-primary'?: string;
|
|
1304
|
+
'brand-primary-light'?: string;
|
|
1305
|
+
'brand-primary-dark'?: string;
|
|
1306
|
+
'brand-primary-subtle'?: string;
|
|
1307
|
+
'brand-primary-hover'?: string;
|
|
1308
|
+
'brand-primary-active'?: string;
|
|
1309
|
+
'brand-secondary'?: string;
|
|
1310
|
+
'brand-secondary-light'?: string;
|
|
1311
|
+
'brand-secondary-dark'?: string;
|
|
1312
|
+
'brand-secondary-subtle'?: string;
|
|
1313
|
+
'brand-secondary-hover'?: string;
|
|
1314
|
+
'brand-secondary-active'?: string;
|
|
1315
|
+
'on-brand-primary'?: string;
|
|
1316
|
+
'on-brand-secondary'?: string;
|
|
1317
|
+
'status-success'?: string;
|
|
1318
|
+
'status-error'?: string;
|
|
1319
|
+
'status-warning'?: string;
|
|
1320
|
+
'status-info'?: string;
|
|
1321
|
+
'text-primary'?: string;
|
|
1322
|
+
'text-secondary'?: string;
|
|
1323
|
+
'text-tertiary'?: string;
|
|
1324
|
+
'surface-base'?: string;
|
|
1325
|
+
'surface-elevated'?: string;
|
|
1326
|
+
'surface-raised'?: string;
|
|
1327
|
+
'surface-overlay'?: string;
|
|
1328
|
+
'surface-input'?: string;
|
|
1329
|
+
'background-base'?: string;
|
|
1330
|
+
'background-default'?: string;
|
|
1331
|
+
'background-subtle'?: string;
|
|
1332
|
+
'border-default'?: string;
|
|
1333
|
+
'border-subtle'?: string;
|
|
1334
|
+
'border-strong'?: string;
|
|
1335
|
+
'border-focus'?: string;
|
|
1336
|
+
'divider'?: string;
|
|
1337
|
+
[key: `${string}`]: string | undefined;
|
|
1338
|
+
}
|
|
1339
|
+
interface ThemePresetFonts {
|
|
1340
|
+
sans?: string;
|
|
1341
|
+
body?: string;
|
|
1342
|
+
heading?: string;
|
|
1343
|
+
mono?: string;
|
|
1344
|
+
}
|
|
1345
|
+
interface ThemePresetRadii {
|
|
1346
|
+
sm?: string;
|
|
1347
|
+
DEFAULT?: string;
|
|
1348
|
+
md?: string;
|
|
1349
|
+
lg?: string;
|
|
1350
|
+
xl?: string;
|
|
1351
|
+
}
|
|
1352
|
+
interface ThemePresetShadows {
|
|
1353
|
+
sm?: string;
|
|
1354
|
+
DEFAULT?: string;
|
|
1355
|
+
md?: string;
|
|
1356
|
+
lg?: string;
|
|
1357
|
+
xl?: string;
|
|
1358
|
+
}
|
|
1359
|
+
interface ThemePreset {
|
|
1360
|
+
name: string;
|
|
1361
|
+
description?: string;
|
|
1362
|
+
colors?: {
|
|
1363
|
+
dark?: ThemePresetColors;
|
|
1364
|
+
light?: ThemePresetColors;
|
|
1365
|
+
};
|
|
1366
|
+
fonts?: ThemePresetFonts;
|
|
1367
|
+
radii?: ThemePresetRadii;
|
|
1368
|
+
shadows?: ThemePresetShadows;
|
|
1369
|
+
/** Additional CSS classes to add to root element */
|
|
1370
|
+
rootClasses?: string[];
|
|
1371
|
+
/** Google Fonts import URL (appended to existing imports) */
|
|
1372
|
+
fontImport?: string;
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
declare function applyThemePreset(preset: ThemePreset): () => void;
|
|
1376
|
+
|
|
1377
|
+
declare const defaultPreset: ThemePreset;
|
|
1378
|
+
|
|
1379
|
+
/**
|
|
1380
|
+
* Audiobook Studio preset.
|
|
1381
|
+
*
|
|
1382
|
+
* Warm copper/patina aesthetic inspired by vintage audio equipment
|
|
1383
|
+
* and reading lounges. Dark-mode only design with editorial typography.
|
|
1384
|
+
*/
|
|
1385
|
+
declare const audiobookPreset: ThemePreset;
|
|
1386
|
+
|
|
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 };
|
package/dist/theme/index.js
CHANGED
|
@@ -1500,6 +1500,171 @@ function getGlowShadow(color, intensity = "medium") {
|
|
|
1500
1500
|
});
|
|
1501
1501
|
}
|
|
1502
1502
|
|
|
1503
|
+
// src/theme/presets/apply.ts
|
|
1504
|
+
function colorKeyToVar(key) {
|
|
1505
|
+
return `--color-${key}`;
|
|
1506
|
+
}
|
|
1507
|
+
function applyColorOverrides(colors, root) {
|
|
1508
|
+
for (const [key, value] of Object.entries(colors)) {
|
|
1509
|
+
if (value !== void 0) {
|
|
1510
|
+
root.style.setProperty(colorKeyToVar(key), value);
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1513
|
+
}
|
|
1514
|
+
function applyFontOverrides(fonts, root) {
|
|
1515
|
+
const fontVarMap = {
|
|
1516
|
+
sans: "--font-family-sans",
|
|
1517
|
+
body: "--font-family-body",
|
|
1518
|
+
heading: "--font-family-heading",
|
|
1519
|
+
mono: "--font-family-mono"
|
|
1520
|
+
};
|
|
1521
|
+
for (const [key, value] of Object.entries(fonts)) {
|
|
1522
|
+
if (value !== void 0 && fontVarMap[key]) {
|
|
1523
|
+
root.style.setProperty(fontVarMap[key], value);
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
function injectFontImport(url) {
|
|
1528
|
+
if (typeof document === "undefined") return;
|
|
1529
|
+
const existing = document.querySelector(`link[href="${url}"]`);
|
|
1530
|
+
if (existing) return;
|
|
1531
|
+
const link = document.createElement("link");
|
|
1532
|
+
link.rel = "stylesheet";
|
|
1533
|
+
link.href = url;
|
|
1534
|
+
document.head.appendChild(link);
|
|
1535
|
+
}
|
|
1536
|
+
function applyThemePreset(preset) {
|
|
1537
|
+
if (typeof document === "undefined") {
|
|
1538
|
+
return () => {
|
|
1539
|
+
};
|
|
1540
|
+
}
|
|
1541
|
+
const root = document.documentElement;
|
|
1542
|
+
const removals = [];
|
|
1543
|
+
if (preset.fontImport) {
|
|
1544
|
+
injectFontImport(preset.fontImport);
|
|
1545
|
+
}
|
|
1546
|
+
const isLight = root.classList.contains("light");
|
|
1547
|
+
const modeColors = isLight ? preset.colors?.light : preset.colors?.dark;
|
|
1548
|
+
if (modeColors) {
|
|
1549
|
+
const previousValues = {};
|
|
1550
|
+
for (const key of Object.keys(modeColors)) {
|
|
1551
|
+
previousValues[colorKeyToVar(key)] = root.style.getPropertyValue(colorKeyToVar(key)) || null;
|
|
1552
|
+
}
|
|
1553
|
+
applyColorOverrides(modeColors, root);
|
|
1554
|
+
removals.push(() => {
|
|
1555
|
+
for (const [varName, prev] of Object.entries(previousValues)) {
|
|
1556
|
+
if (prev === null) {
|
|
1557
|
+
root.style.removeProperty(varName);
|
|
1558
|
+
} else {
|
|
1559
|
+
root.style.setProperty(varName, prev);
|
|
1560
|
+
}
|
|
1561
|
+
}
|
|
1562
|
+
});
|
|
1563
|
+
}
|
|
1564
|
+
if (preset.fonts) {
|
|
1565
|
+
applyFontOverrides(preset.fonts, root);
|
|
1566
|
+
}
|
|
1567
|
+
if (preset.rootClasses) {
|
|
1568
|
+
for (const cls of preset.rootClasses) {
|
|
1569
|
+
root.classList.add(cls);
|
|
1570
|
+
}
|
|
1571
|
+
removals.push(() => {
|
|
1572
|
+
for (const cls of preset.rootClasses) {
|
|
1573
|
+
root.classList.remove(cls);
|
|
1574
|
+
}
|
|
1575
|
+
});
|
|
1576
|
+
}
|
|
1577
|
+
return () => {
|
|
1578
|
+
for (const remove of removals) {
|
|
1579
|
+
remove();
|
|
1580
|
+
}
|
|
1581
|
+
};
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
// src/theme/presets/default.ts
|
|
1585
|
+
var defaultPreset = {
|
|
1586
|
+
name: "default",
|
|
1587
|
+
description: "Titan Design System default theme \u2014 orange accent, steel secondary"
|
|
1588
|
+
};
|
|
1589
|
+
|
|
1590
|
+
// src/theme/presets/audiobook.ts
|
|
1591
|
+
var audiobookPreset = {
|
|
1592
|
+
name: "audiobook",
|
|
1593
|
+
description: "Warm copper/patina theme with editorial typography",
|
|
1594
|
+
fontImport: "https://fonts.googleapis.com/css2?family=Newsreader:ital,wght@0,400;0,600;0,700;1,400&family=Outfit:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap",
|
|
1595
|
+
fonts: {
|
|
1596
|
+
sans: "'Outfit', 'Avenir', 'Avenir Next', system-ui, sans-serif",
|
|
1597
|
+
body: "'Outfit', 'Avenir', 'Avenir Next', system-ui, sans-serif",
|
|
1598
|
+
heading: "'Newsreader', 'Libre Baskerville', Georgia, serif",
|
|
1599
|
+
mono: "'JetBrains Mono', 'SF Mono', 'Fira Code', monospace"
|
|
1600
|
+
},
|
|
1601
|
+
colors: {
|
|
1602
|
+
dark: {
|
|
1603
|
+
// Brand: Copper accent
|
|
1604
|
+
"brand-primary": "#d4782a",
|
|
1605
|
+
"brand-primary-light": "#e8944a",
|
|
1606
|
+
"brand-primary-dark": "#9a4a15",
|
|
1607
|
+
"brand-primary-subtle": "rgba(212, 120, 42, 0.12)",
|
|
1608
|
+
"brand-primary-hover": "#e8944a",
|
|
1609
|
+
"brand-primary-active": "#f5b070",
|
|
1610
|
+
// Brand secondary: Patina/verdigris
|
|
1611
|
+
"brand-secondary": "#3a9b8a",
|
|
1612
|
+
"brand-secondary-light": "#55baa7",
|
|
1613
|
+
"brand-secondary-dark": "#1f5c52",
|
|
1614
|
+
"brand-secondary-subtle": "rgba(58, 155, 138, 0.12)",
|
|
1615
|
+
"brand-secondary-hover": "#55baa7",
|
|
1616
|
+
"brand-secondary-active": "#7ed4c4",
|
|
1617
|
+
"on-brand-primary": "#FFFFFF",
|
|
1618
|
+
"on-brand-secondary": "#FFFFFF",
|
|
1619
|
+
// Status colors (audiobook's warmer status palette)
|
|
1620
|
+
"status-success": "#5fb870",
|
|
1621
|
+
"status-error": "#d85c4a",
|
|
1622
|
+
"status-warning": "#d4a43a",
|
|
1623
|
+
"status-info": "#5a8fd4",
|
|
1624
|
+
// Text: warm off-whites
|
|
1625
|
+
"text-primary": "#f4f3f1",
|
|
1626
|
+
"text-secondary": "#b5b3af",
|
|
1627
|
+
"text-tertiary": "#7a7875",
|
|
1628
|
+
// Surfaces: warm charcoals (not pure gray)
|
|
1629
|
+
"surface-base": "#101114",
|
|
1630
|
+
"surface-elevated": "#15171c",
|
|
1631
|
+
"surface-raised": "#1a1d24",
|
|
1632
|
+
"surface-overlay": "#15171c",
|
|
1633
|
+
"surface-input": "#15171c",
|
|
1634
|
+
// Backgrounds
|
|
1635
|
+
"background-base": "#0a0b0d",
|
|
1636
|
+
"background-default": "#101114",
|
|
1637
|
+
"background-subtle": "#1a1d24",
|
|
1638
|
+
// Borders
|
|
1639
|
+
"border-default": "rgba(255, 255, 255, 0.06)",
|
|
1640
|
+
"border-subtle": "rgba(255, 255, 255, 0.03)",
|
|
1641
|
+
"border-strong": "#2d323d",
|
|
1642
|
+
"border-focus": "#d4782a",
|
|
1643
|
+
"border-input": "#2d323d",
|
|
1644
|
+
"border-input-hover": "#454c5c",
|
|
1645
|
+
"border-input-focus": "#d4782a",
|
|
1646
|
+
"border-input-error": "#d85c4a",
|
|
1647
|
+
// Interactive
|
|
1648
|
+
"interactive-hover": "rgba(255, 255, 255, 0.04)",
|
|
1649
|
+
"interactive-focus": "rgba(255, 255, 255, 0.12)",
|
|
1650
|
+
"interactive-active": "rgba(255, 255, 255, 0.16)",
|
|
1651
|
+
"interactive-selected": "rgba(255, 255, 255, 0.08)",
|
|
1652
|
+
"divider": "rgba(255, 255, 255, 0.06)",
|
|
1653
|
+
// Glow RGB values for shadow utilities
|
|
1654
|
+
"brand-primary-rgb": "212, 120, 42",
|
|
1655
|
+
"brand-secondary-rgb": "58, 155, 138",
|
|
1656
|
+
"status-success-rgb": "95, 184, 112",
|
|
1657
|
+
"status-error-rgb": "216, 92, 74",
|
|
1658
|
+
"status-warning-rgb": "212, 164, 58",
|
|
1659
|
+
"status-info-rgb": "90, 143, 212",
|
|
1660
|
+
"background-base-rgb": "10, 11, 13"
|
|
1661
|
+
}
|
|
1662
|
+
},
|
|
1663
|
+
rootClasses: ["atmosphere-warm", "grain"]
|
|
1664
|
+
};
|
|
1665
|
+
|
|
1666
|
+
exports.applyThemePreset = applyThemePreset;
|
|
1667
|
+
exports.audiobookPreset = audiobookPreset;
|
|
1503
1668
|
exports.buttonSizes = buttonSizes;
|
|
1504
1669
|
exports.componentElevationRanges = componentElevationRanges;
|
|
1505
1670
|
exports.createFlatShadow = createFlatShadow;
|
|
@@ -1509,6 +1674,7 @@ exports.createRaisedHoverShadow = createRaisedHoverShadow;
|
|
|
1509
1674
|
exports.createRaisedShadow = createRaisedShadow;
|
|
1510
1675
|
exports.darkThemeCSSVars = darkThemeCSSVars;
|
|
1511
1676
|
exports.darken = darken;
|
|
1677
|
+
exports.defaultPreset = defaultPreset;
|
|
1512
1678
|
exports.discreteRainbow = discreteRainbow;
|
|
1513
1679
|
exports.elevationSystem = elevationSystem;
|
|
1514
1680
|
exports.getBaseSurfaceColor = getBaseSurfaceColor;
|