@castui/cast-ui 3.0.0 → 3.2.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.
Files changed (57) hide show
  1. package/dist/components/Button/Button.d.ts +40 -0
  2. package/dist/components/Button/Button.d.ts.map +1 -0
  3. package/dist/components/Button/Button.js +93 -0
  4. package/dist/components/Button/Button.js.map +1 -0
  5. package/dist/components/Button/index.d.ts +2 -0
  6. package/dist/components/Button/index.d.ts.map +1 -0
  7. package/dist/components/Button/index.js +2 -0
  8. package/dist/components/Button/index.js.map +1 -0
  9. package/dist/components/Dialog/Dialog.d.ts +57 -0
  10. package/dist/components/Dialog/Dialog.d.ts.map +1 -0
  11. package/dist/components/Dialog/Dialog.js +104 -0
  12. package/dist/components/Dialog/Dialog.js.map +1 -0
  13. package/dist/components/Dialog/index.d.ts +2 -0
  14. package/dist/components/Dialog/index.d.ts.map +1 -0
  15. package/dist/components/Dialog/index.js +2 -0
  16. package/dist/components/Dialog/index.js.map +1 -0
  17. package/dist/components/Icon/Icon.d.ts +25 -0
  18. package/dist/components/Icon/Icon.d.ts.map +1 -0
  19. package/dist/components/Icon/Icon.js +28 -0
  20. package/dist/components/Icon/Icon.js.map +1 -0
  21. package/dist/components/Icon/index.d.ts +2 -0
  22. package/dist/components/Icon/index.d.ts.map +1 -0
  23. package/dist/components/Icon/index.js +2 -0
  24. package/dist/components/Icon/index.js.map +1 -0
  25. package/dist/index.d.ts +5 -0
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +10 -3
  28. package/dist/index.js.map +1 -1
  29. package/dist/theme/ThemeContext.d.ts +59 -0
  30. package/dist/theme/ThemeContext.d.ts.map +1 -0
  31. package/dist/theme/ThemeContext.js +92 -0
  32. package/dist/theme/ThemeContext.js.map +1 -0
  33. package/dist/theme/index.d.ts +4 -0
  34. package/dist/theme/index.d.ts.map +1 -0
  35. package/dist/theme/index.js +3 -0
  36. package/dist/theme/index.js.map +1 -0
  37. package/dist/theme/themes.d.ts +14 -0
  38. package/dist/theme/themes.d.ts.map +1 -0
  39. package/dist/theme/themes.js +113 -0
  40. package/dist/theme/themes.js.map +1 -0
  41. package/dist/theme/types.d.ts +47 -0
  42. package/dist/theme/types.d.ts.map +1 -0
  43. package/dist/theme/types.js +8 -0
  44. package/dist/theme/types.js.map +1 -0
  45. package/dist/tokens/colors.d.ts +56 -0
  46. package/dist/tokens/colors.d.ts.map +1 -0
  47. package/dist/tokens/colors.js +95 -0
  48. package/dist/tokens/colors.js.map +1 -0
  49. package/dist/tokens/index.d.ts +3 -0
  50. package/dist/tokens/index.d.ts.map +1 -0
  51. package/dist/tokens/index.js +3 -0
  52. package/dist/tokens/index.js.map +1 -0
  53. package/dist/tokens/typography.d.ts +31 -0
  54. package/dist/tokens/typography.d.ts.map +1 -0
  55. package/dist/tokens/typography.js +40 -0
  56. package/dist/tokens/typography.js.map +1 -0
  57. package/package.json +1 -1
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Button — the foundational interactive component of Cast UI.
3
+ *
4
+ * Maps 1:1 to the Figma <Button> component:
5
+ * intent → neutral | brand | danger
6
+ * prominence → default | bold | subtle
7
+ * size → small | default | large
8
+ *
9
+ * Spacing tokens come from the density theme (compact/default/comfortable).
10
+ * Colours come from the semantic intent system (constant across densities).
11
+ * Typography uses the label scale (sm/md/lg) matched to the button size.
12
+ */
13
+ import React from 'react';
14
+ import { type ViewStyle, type StyleProp, type GestureResponderEvent } from 'react-native';
15
+ import type { IntentName, ProminenceName } from '../../tokens';
16
+ export type ButtonSize = 'small' | 'default' | 'large';
17
+ export type ButtonProps = {
18
+ /** The button label text. */
19
+ children: string;
20
+ /** Semantic intent — drives the colour scheme. */
21
+ intent?: IntentName;
22
+ /** Visual weight — default (outlined), bold (filled), or subtle (ghost). */
23
+ prominence?: ProminenceName;
24
+ /** Size variant — controls padding, gap, and typography scale. */
25
+ size?: ButtonSize;
26
+ /** Disables interaction and applies muted styling. */
27
+ disabled?: boolean;
28
+ /** Icon before the label — Material Symbols name string or a ReactNode. */
29
+ leadingIcon?: string | React.ReactNode;
30
+ /** Icon after the label — Material Symbols name string or a ReactNode. */
31
+ trailingIcon?: string | React.ReactNode;
32
+ /** Press handler. */
33
+ onPress?: (e: GestureResponderEvent) => void;
34
+ /** Outer style — use for positioning (margin, flex, alignSelf). */
35
+ style?: StyleProp<ViewStyle>;
36
+ /** Accessibility label — falls back to children text if not provided. */
37
+ accessibilityLabel?: string;
38
+ };
39
+ export declare function Button({ children, intent, prominence, size, disabled, leadingIcon, trailingIcon, onPress, style, accessibilityLabel, }: ButtonProps): import("react/jsx-runtime").JSX.Element;
40
+ //# sourceMappingURL=Button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAgC,MAAM,OAAO,CAAC;AACrD,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,qBAAqB,EAC3B,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAO/D,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;AAEvD,MAAM,MAAM,WAAW,GAAG;IACxB,6BAA6B;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,kDAAkD;IAClD,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,4EAA4E;IAC5E,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,kEAAkE;IAClE,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,sDAAsD;IACtD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,2EAA2E;IAC3E,WAAW,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACvC,0EAA0E;IAC1E,YAAY,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACxC,qBAAqB;IACrB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAC7C,mEAAmE;IACnE,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,yEAAyE;IACzE,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAoBF,wBAAgB,MAAM,CAAC,EACrB,QAAQ,EACR,MAAkB,EAClB,UAAsB,EACtB,IAAgB,EAChB,QAAgB,EAChB,WAAW,EACX,YAAY,EACZ,OAAO,EACP,KAAK,EACL,kBAAkB,GACnB,EAAE,WAAW,2CAwGb"}
@@ -0,0 +1,93 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * Button — the foundational interactive component of Cast UI.
4
+ *
5
+ * Maps 1:1 to the Figma <Button> component:
6
+ * intent → neutral | brand | danger
7
+ * prominence → default | bold | subtle
8
+ * size → small | default | large
9
+ *
10
+ * Spacing tokens come from the density theme (compact/default/comfortable).
11
+ * Colours come from the semantic intent system (constant across densities).
12
+ * Typography uses the label scale (sm/md/lg) matched to the button size.
13
+ */
14
+ import { useState, useCallback } from 'react';
15
+ import { Pressable, Text, View, Platform, } from 'react-native';
16
+ import { useTheme } from '../../theme';
17
+ import { fontFamily, fontWeight, label, controlTokens } from '../../tokens';
18
+ import { Icon } from '../Icon';
19
+ // ---------------------------------------------------------------------------
20
+ // Constants
21
+ // ---------------------------------------------------------------------------
22
+ /** Maps button size → label typography scale */
23
+ const LABEL_SCALE = {
24
+ small: 'sm',
25
+ default: 'md',
26
+ large: 'lg',
27
+ };
28
+ /** Icon size — fixed at 16px per Figma spec, all button sizes. */
29
+ const ICON_SIZE = 16;
30
+ // ---------------------------------------------------------------------------
31
+ // Component
32
+ // ---------------------------------------------------------------------------
33
+ export function Button({ children, intent = 'neutral', prominence = 'default', size = 'default', disabled = false, leadingIcon, trailingIcon, onPress, style, accessibilityLabel, }) {
34
+ const { components, colors } = useTheme();
35
+ const [isFocused, setIsFocused] = useState(false);
36
+ const [isHovered, setIsHovered] = useState(false);
37
+ // Resolve tokens for current size + density
38
+ const sizeTokens = components.button[size];
39
+ const labelTokens = label[LABEL_SCALE[size]];
40
+ const intentClrs = colors[intent];
41
+ // Resolve colours based on interaction state
42
+ const getStateColors = useCallback((pressed, hovered) => {
43
+ if (disabled) {
44
+ return {
45
+ bg: '#F3F4F6',
46
+ fg: '#9CA3AF',
47
+ border: '#E5E7EB',
48
+ };
49
+ }
50
+ if (pressed)
51
+ return intentClrs[prominence].active;
52
+ if (hovered)
53
+ return intentClrs[prominence].hover;
54
+ return intentClrs[prominence].default;
55
+ }, [disabled, intentClrs, prominence]);
56
+ return (_jsx(Pressable, { onPress: onPress, disabled: disabled, onFocus: () => setIsFocused(true), onBlur: () => setIsFocused(false), onHoverIn: () => setIsHovered(true), onHoverOut: () => setIsHovered(false), accessibilityRole: "button", accessibilityLabel: accessibilityLabel || children, accessibilityState: { disabled }, style: style, children: ({ pressed }) => {
57
+ const stateColors = getStateColors(pressed, isHovered);
58
+ const containerStyle = {
59
+ flexDirection: 'row',
60
+ alignItems: 'center',
61
+ justifyContent: 'center',
62
+ alignSelf: 'flex-start',
63
+ gap: sizeTokens.gap,
64
+ paddingHorizontal: sizeTokens.paddingX,
65
+ paddingVertical: sizeTokens.paddingY,
66
+ borderRadius: sizeTokens.borderRadius,
67
+ borderWidth: controlTokens.borderWidth,
68
+ borderColor: stateColors.border,
69
+ backgroundColor: stateColors.bg,
70
+ };
71
+ // Web-only: focus ring via CSS outline
72
+ const focusStyle = isFocused && !disabled && Platform.OS === 'web'
73
+ ? {
74
+ outlineWidth: sizeTokens.focusRingWidth,
75
+ outlineColor: intentClrs.ringColour,
76
+ outlineStyle: 'solid',
77
+ outlineOffset: sizeTokens.focusRingOffset,
78
+ }
79
+ : {};
80
+ // Resolve icon props — strings become <Icon> with auto-matched colour
81
+ const resolvedLeading = typeof leadingIcon === 'string' ? (_jsx(Icon, { name: leadingIcon, size: ICON_SIZE, color: stateColors.fg })) : (leadingIcon);
82
+ const resolvedTrailing = typeof trailingIcon === 'string' ? (_jsx(Icon, { name: trailingIcon, size: ICON_SIZE, color: stateColors.fg })) : (trailingIcon);
83
+ return (_jsxs(View, { style: [containerStyle, focusStyle], children: [resolvedLeading, _jsx(Text, { style: {
84
+ fontFamily: fontFamily.sans,
85
+ fontWeight: fontWeight.medium,
86
+ fontSize: labelTokens.fontSize,
87
+ lineHeight: labelTokens.lineHeight,
88
+ letterSpacing: labelTokens.letterSpacing,
89
+ color: stateColors.fg,
90
+ }, selectable: false, children: children }), resolvedTrailing] }));
91
+ } }));
92
+ }
93
+ //# sourceMappingURL=Button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;AAEH,OAAc,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EACL,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,QAAQ,GAIT,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE5E,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AA+B/B,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAE9E,gDAAgD;AAChD,MAAM,WAAW,GAA2C;IAC1D,KAAK,EAAE,IAAI;IACX,OAAO,EAAE,IAAI;IACb,KAAK,EAAE,IAAI;CACZ,CAAC;AAEF,kEAAkE;AAClE,MAAM,SAAS,GAAG,EAAE,CAAC;AAErB,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAE9E,MAAM,UAAU,MAAM,CAAC,EACrB,QAAQ,EACR,MAAM,GAAG,SAAS,EACl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AI,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,CAAC,EAAE,GAAI,CACpE,CAAC,CAAC,CAAC,CACF,WAAW,CACZ,CAAC;YACJ,MAAM,gBAAgB,GACpB,OAAO,YAAY,KAAK,QAAQ,CAAC,CAAC,CAAC,CACjC,KAAC,IAAI,IAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,CAAC,EAAE,GAAI,CACrE,CAAC,CAAC,CAAC,CACF,YAAY,CACb,CAAC;YAEJ,OAAO,CACL,MAAC,IAAI,IAAC,KAAK,EAAE,CAAC,cAAc,EAAE,UAAuB,CAAC,aACnD,eAAe,EAChB,KAAC,IAAI,IACH,KAAK,EAAE;4BACL,UAAU,EAAE,UAAU,CAAC,IAAI;4BAC3B,UAAU,EAAE,UAAU,CAAC,MAAM;4BAC7B,QAAQ,EAAE,WAAW,CAAC,QAAQ;4BAC9B,UAAU,EAAE,WAAW,CAAC,UAAU;4BAClC,aAAa,EAAE,WAAW,CAAC,aAAa;4BACxC,KAAK,EAAE,WAAW,CAAC,EAAE;yBACtB,EACD,UAAU,EAAE,KAAK,YAEhB,QAAQ,GACJ,EACN,gBAAgB,IACZ,CACR,CAAC;QACJ,CAAC,GACS,CACb,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { Button, type ButtonProps, type ButtonSize } from './Button';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { Button } from './Button';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAqC,MAAM,UAAU,CAAC"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Dialog — modal overlay for focused tasks, confirmations, and alerts.
3
+ *
4
+ * Maps to the Figma <Dialog> component:
5
+ * size → small | default | large
6
+ *
7
+ * Structure: scrim backdrop → card (icon + title + description + slot + actions)
8
+ * Surface styling uses shared overlay tokens (bg, border, radius, shadow).
9
+ * Spacing tokens come from the density theme.
10
+ *
11
+ * Exports:
12
+ * Dialog — full modal (backdrop + card)
13
+ * DialogContent — just the card, for inline use or custom overlays
14
+ */
15
+ import React from 'react';
16
+ import { type ViewStyle, type StyleProp } from 'react-native';
17
+ export type DialogSize = 'small' | 'default' | 'large';
18
+ export type DialogAction = {
19
+ /** Button label text. */
20
+ label: string;
21
+ /** Press handler. */
22
+ onPress: () => void;
23
+ };
24
+ export type DialogContentProps = {
25
+ /** Dialog title — always visible. */
26
+ title: string;
27
+ /** Supporting text below the title. */
28
+ description?: string;
29
+ /** Header icon — Material Symbols name string or ReactNode. */
30
+ icon?: string | React.ReactNode;
31
+ /** Size variant — controls padding, gap, typography, icon size, and width. */
32
+ size?: DialogSize;
33
+ /** Custom content between the description and actions. */
34
+ children?: React.ReactNode;
35
+ /** Primary action button (brand/bold). Rendered on the right. */
36
+ primaryAction?: DialogAction;
37
+ /** Secondary action button (neutral/default). Rendered on the left. */
38
+ secondaryAction?: DialogAction;
39
+ /** Style override for the card. */
40
+ style?: StyleProp<ViewStyle>;
41
+ /** Accessibility label — falls back to title if not provided. */
42
+ accessibilityLabel?: string;
43
+ };
44
+ export type DialogProps = DialogContentProps & {
45
+ /** Controls visibility. */
46
+ open: boolean;
47
+ /** Called when the backdrop is pressed or the dialog requests close. */
48
+ onClose?: () => void;
49
+ };
50
+ /**
51
+ * The dialog card rendered inline — no modal, no backdrop.
52
+ * Use this for static display (e.g., Storybook visual stories)
53
+ * or when building custom overlay implementations.
54
+ */
55
+ export declare function DialogContent({ title: titleText, description, icon, size, children, primaryAction, secondaryAction, style, accessibilityLabel, }: DialogContentProps): import("react/jsx-runtime").JSX.Element;
56
+ export declare function Dialog({ open, onClose, ...contentProps }: DialogProps): import("react/jsx-runtime").JSX.Element;
57
+ //# sourceMappingURL=Dialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAML,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAmBtB,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;AAEvD,MAAM,MAAM,YAAY,GAAG;IACzB,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,qBAAqB;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+DAA+D;IAC/D,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAChC,8EAA8E;IAC9E,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,iEAAiE;IACjE,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B,uEAAuE;IACvE,eAAe,CAAC,EAAE,YAAY,CAAC;IAC/B,mCAAmC;IACnC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,iEAAiE;IACjE,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,kBAAkB,GAAG;IAC7C,2BAA2B;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAiDF;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EAAE,SAAS,EAChB,WAAW,EACX,IAAI,EACJ,IAAgB,EAChB,QAAQ,EACR,aAAa,EACb,eAAe,EACf,KAAK,EACL,kBAAkB,GACnB,EAAE,kBAAkB,2CA2GpB;AAMD,wBAAgB,MAAM,CAAC,EACrB,IAAI,EACJ,OAAO,EACP,GAAG,YAAY,EAChB,EAAE,WAAW,2CA6Bb"}
@@ -0,0 +1,104 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Modal, Pressable, View, Text, Platform, } from 'react-native';
3
+ import { useTheme } from '../../theme';
4
+ import { Button } from '../Button';
5
+ import { Icon } from '../Icon';
6
+ import { fontFamily, fontWeight, title, body, surfaceTokens, textTokens, overlayTokens, controlTokens, } from '../../tokens';
7
+ // ---------------------------------------------------------------------------
8
+ // Constants
9
+ // ---------------------------------------------------------------------------
10
+ /** Maps dialog size → typography scale key */
11
+ const TYPO_SCALE = {
12
+ small: 'sm',
13
+ default: 'md',
14
+ large: 'lg',
15
+ };
16
+ /** Maps dialog size → button size */
17
+ const BUTTON_SIZE = {
18
+ small: 'small',
19
+ default: 'default',
20
+ large: 'large',
21
+ };
22
+ /** Fixed widths per dialog size (from Figma spec) */
23
+ const DIALOG_WIDTH = {
24
+ small: 360,
25
+ default: 480,
26
+ large: 600,
27
+ };
28
+ /** Internal spacing constants (semantic tokens, constant across densities) */
29
+ const HEADER_ICON_GAP = 8; // space/5
30
+ const TITLE_DESC_GAP = 2; // space/2
31
+ /** Shadow for web — matches Figma shadow/lg */
32
+ const SHADOW_WEB = {
33
+ boxShadow: '0px 4px 6px rgba(0,0,0,0.04), 0px 10px 15px rgba(0,0,0,0.08)',
34
+ };
35
+ /** Shadow for native */
36
+ const SHADOW_NATIVE = {
37
+ shadowColor: '#000000',
38
+ shadowOffset: { width: 0, height: 10 },
39
+ shadowOpacity: 0.08,
40
+ shadowRadius: 15,
41
+ elevation: 8,
42
+ };
43
+ // ---------------------------------------------------------------------------
44
+ // DialogContent — the card, without modal/backdrop
45
+ // ---------------------------------------------------------------------------
46
+ /**
47
+ * The dialog card rendered inline — no modal, no backdrop.
48
+ * Use this for static display (e.g., Storybook visual stories)
49
+ * or when building custom overlay implementations.
50
+ */
51
+ export function DialogContent({ title: titleText, description, icon, size = 'default', children, primaryAction, secondaryAction, style, accessibilityLabel, }) {
52
+ const { components, colors } = useTheme();
53
+ const sizeTokens = components.dialog[size];
54
+ const titleTokens = title[TYPO_SCALE[size]];
55
+ const bodyTokens = body[TYPO_SCALE[size]];
56
+ const buttonSize = BUTTON_SIZE[size];
57
+ const fgColor = colors.neutral.default.default.fg;
58
+ const resolvedIcon = typeof icon === 'string' ? (_jsx(Icon, { name: icon, size: sizeTokens.iconSize, color: fgColor })) : (icon);
59
+ const hasActions = primaryAction || secondaryAction;
60
+ return (_jsxs(View, { accessibilityRole: "alert", accessibilityLabel: accessibilityLabel || titleText, style: [
61
+ {
62
+ width: DIALOG_WIDTH[size],
63
+ maxWidth: '100%',
64
+ backgroundColor: surfaceTokens.overlay.bg,
65
+ borderWidth: controlTokens.borderWidth,
66
+ borderColor: surfaceTokens.overlay.border,
67
+ borderRadius: surfaceTokens.overlay.borderRadius,
68
+ padding: sizeTokens.padding,
69
+ gap: sizeTokens.gap,
70
+ ...(Platform.OS === 'web' ? SHADOW_WEB : SHADOW_NATIVE),
71
+ },
72
+ style,
73
+ ], children: [_jsxs(View, { style: { gap: TITLE_DESC_GAP }, children: [_jsxs(View, { style: { gap: HEADER_ICON_GAP }, children: [resolvedIcon, _jsx(Text, { accessibilityRole: "header", style: {
74
+ fontFamily: fontFamily.sans,
75
+ fontWeight: fontWeight.medium,
76
+ fontSize: titleTokens.fontSize,
77
+ lineHeight: titleTokens.lineHeight,
78
+ letterSpacing: titleTokens.letterSpacing,
79
+ color: fgColor,
80
+ }, children: titleText })] }), description ? (_jsx(Text, { style: {
81
+ fontFamily: fontFamily.sans,
82
+ fontWeight: fontWeight.regular,
83
+ fontSize: bodyTokens.fontSize,
84
+ lineHeight: bodyTokens.lineHeight,
85
+ letterSpacing: bodyTokens.letterSpacing,
86
+ color: textTokens.description,
87
+ }, children: description })) : null] }), children, hasActions ? (_jsxs(View, { style: {
88
+ flexDirection: 'row',
89
+ justifyContent: 'flex-end',
90
+ gap: sizeTokens.gap,
91
+ }, children: [secondaryAction ? (_jsx(Button, { intent: "neutral", prominence: "default", size: buttonSize, onPress: secondaryAction.onPress, children: secondaryAction.label })) : null, primaryAction ? (_jsx(Button, { intent: "brand", prominence: "bold", size: buttonSize, onPress: primaryAction.onPress, children: primaryAction.label })) : null] })) : null] }));
92
+ }
93
+ // ---------------------------------------------------------------------------
94
+ // Dialog — full modal with backdrop
95
+ // ---------------------------------------------------------------------------
96
+ export function Dialog({ open, onClose, ...contentProps }) {
97
+ return (_jsx(Modal, { visible: open, transparent: true, animationType: "fade", onRequestClose: onClose, children: _jsx(Pressable, { onPress: onClose, accessibilityRole: "button", accessibilityLabel: "Close dialog", style: {
98
+ flex: 1,
99
+ backgroundColor: `rgba(0, 0, 0, ${overlayTokens.scrimOpacity})`,
100
+ justifyContent: 'center',
101
+ alignItems: 'center',
102
+ }, children: _jsx(Pressable, { onPress: (e) => e.stopPropagation(), accessibilityRole: "none", style: { maxWidth: '90%' }, children: _jsx(DialogContent, { ...contentProps }) }) }) }));
103
+ }
104
+ //# sourceMappingURL=Dialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":";AAgBA,OAAO,EACL,KAAK,EACL,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,QAAQ,GAGT,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO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C,CAAC,CAAC,IAAI,EACP,aAAa,CAAC,CAAC,CAAC,CACf,KAAC,MAAM,IACL,MAAM,EAAC,OAAO,EACd,UAAU,EAAC,MAAM,EACjB,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,aAAa,CAAC,OAAO,YAE7B,aAAa,CAAC,KAAK,GACb,CACV,CAAC,CAAC,CAAC,IAAI,IACH,CACR,CAAC,CAAC,CAAC,IAAI,IACH,CACR,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,oCAAoC;AACpC,8EAA8E;AAE9E,MAAM,UAAU,MAAM,CAAC,EACrB,IAAI,EACJ,OAAO,EACP,GAAG,YAAY,EACH;IACZ,OAAO,CACL,KAAC,KAAK,IACJ,OAAO,EAAE,IAAI,EACb,WAAW,QACX,aAAa,EAAC,MAAM,EACpB,cAAc,EAAE,OAAO,YAEvB,KAAC,SAAS,IACR,OAAO,EAAE,OAAO,EAChB,iBAAiB,EAAC,QAAQ,EAC1B,kBAAkB,EAAC,cAAc,EACjC,KAAK,EAAE;gBACL,IAAI,EAAE,CAAC;gBACP,eAAe,EAAE,iBAAiB,aAAa,CAAC,YAAY,GAAG;gBAC/D,cAAc,EAAE,QAAQ;gBACxB,UAAU,EAAE,QAAQ;aACrB,YAED,KAAC,SAAS,IACR,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,EACnC,iBAAiB,EAAC,MAAM,EACxB,KAAK,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,YAE1B,KAAC,aAAa,OAAK,YAAY,GAAI,GACzB,GACF,GACN,CACT,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { Dialog, DialogContent, type DialogProps, type DialogContentProps, type DialogAction, type DialogSize, } from './Dialog';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,aAAa,EACb,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,UAAU,GAChB,MAAM,UAAU,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { Dialog, DialogContent, } from './Dialog';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Dialog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,aAAa,GAKd,MAAM,UAAU,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Icon — renders a Material Symbols Outlined icon by name.
3
+ *
4
+ * Uses the Material Symbols font with ligature rendering.
5
+ * The `name` prop matches Material Symbols names exactly
6
+ * (e.g., "star", "close", "chevron_right", "add").
7
+ *
8
+ * Requires the MaterialSymbolsOutlined font to be loaded:
9
+ * - Web: Google Fonts CSS import
10
+ * - Expo: expo-font
11
+ * - Bare RN: font asset linking
12
+ */
13
+ import { type TextStyle, type StyleProp } from 'react-native';
14
+ export type IconProps = {
15
+ /** Material Symbols icon name (e.g., "star", "close", "settings"). */
16
+ name: string;
17
+ /** Icon size in pixels. Defaults to 20. */
18
+ size?: number;
19
+ /** Icon colour. Defaults to "#374151" (neutral fg). */
20
+ color?: string;
21
+ /** Additional style overrides. */
22
+ style?: StyleProp<TextStyle>;
23
+ };
24
+ export declare function Icon({ name, size, color, style }: IconProps): import("react/jsx-runtime").JSX.Element;
25
+ //# sourceMappingURL=Icon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/Icon.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAkB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9E,MAAM,MAAM,SAAS,GAAG;IACtB,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC;AAOF,wBAAgB,IAAI,CAAC,EAAE,IAAI,EAAE,IAAS,EAAE,KAAiB,EAAE,KAAK,EAAE,EAAE,SAAS,2CA6B5E"}
@@ -0,0 +1,28 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Text, Platform } from 'react-native';
3
+ const FONT_FAMILY = Platform.select({
4
+ web: '"Material Symbols Outlined", sans-serif',
5
+ default: 'MaterialSymbolsOutlined',
6
+ });
7
+ export function Icon({ name, size = 20, color = '#374151', style }) {
8
+ return (_jsx(Text, { selectable: false, accessibilityElementsHidden: true, importantForAccessibility: "no", style: [
9
+ {
10
+ fontFamily: FONT_FAMILY,
11
+ fontSize: size,
12
+ lineHeight: size,
13
+ color,
14
+ // Prevent ligature text from taking extra space
15
+ width: size,
16
+ height: size,
17
+ textAlign: 'center',
18
+ // Reset any inherited text styles
19
+ fontWeight: '400',
20
+ fontStyle: 'normal',
21
+ letterSpacing: 0,
22
+ textTransform: 'none',
23
+ textDecorationLine: 'none',
24
+ },
25
+ style,
26
+ ], children: name }));
27
+ }
28
+ //# sourceMappingURL=Icon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Icon.js","sourceRoot":"","sources":["../../../src/components/Icon/Icon.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAkC,MAAM,cAAc,CAAC;AAa9E,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC;IAClC,GAAG,EAAE,yCAAyC;IAC9C,OAAO,EAAE,yBAAyB;CACnC,CAAC,CAAC;AAEH,MAAM,UAAU,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,GAAG,EAAE,EAAE,KAAK,GAAG,SAAS,EAAE,KAAK,EAAa;IAC3E,OAAO,CACL,KAAC,IAAI,IACH,UAAU,EAAE,KAAK,EACjB,2BAA2B,QAC3B,yBAAyB,EAAC,IAAI,EAC9B,KAAK,EAAE;YACL;gBACE,UAAU,EAAE,WAAW;gBACvB,QAAQ,EAAE,IAAI;gBACd,UAAU,EAAE,IAAI;gBAChB,KAAK;gBACL,gDAAgD;gBAChD,KAAK,EAAE,IAAI;gBACX,MAAM,EAAE,IAAI;gBACZ,SAAS,EAAE,QAAQ;gBACnB,kCAAkC;gBAClC,UAAU,EAAE,KAAK;gBACjB,SAAS,EAAE,QAAQ;gBACnB,aAAa,EAAE,CAAC;gBAChB,aAAa,EAAE,MAAM;gBACrB,kBAAkB,EAAE,MAAM;aAC3B;YACD,KAAK;SACN,YAEA,IAAI,GACA,CACR,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { Icon, type IconProps } from './Icon';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { Icon } from './Icon';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Icon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,QAAQ,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1 +1,6 @@
1
+ export { intentColors, disabledColors, controlTokens, surfaceTokens, textTokens, overlayTokens, fontFamily, fontWeight, label, title, body, type IntentName, type ProminenceName, type StateName, type LabelSize, } from './tokens';
2
+ export { ThemeProvider, useTheme, themes, type Theme, type ThemeProviderProps, type DensityTheme, type ComponentTokens, type ButtonSizeTokens, type ButtonThemeTokens, type DialogSizeTokens, type DialogThemeTokens, type DeepPartial, } from './theme';
3
+ export { Button, type ButtonProps, type ButtonSize } from './components/Button';
4
+ export { Icon, type IconProps } from './components/Icon';
5
+ export { Dialog, DialogContent, type DialogProps, type DialogContentProps, type DialogAction, type DialogSize, } from './components/Dialog';
1
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,YAAY,EACZ,cAAc,EACd,aAAa,EACb,aAAa,EACb,UAAU,EACV,aAAa,EACb,UAAU,EACV,UAAU,EACV,KAAK,EACL,KAAK,EACL,IAAI,EACJ,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,SAAS,GACf,MAAM,UAAU,CAAC;AAGlB,OAAO,EACL,aAAa,EACb,QAAQ,EACR,MAAM,EACN,KAAK,KAAK,EACV,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,WAAW,GACjB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EACL,MAAM,EACN,aAAa,EACb,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,UAAU,GAChB,MAAM,qBAAqB,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1,11 @@
1
- "use strict";
2
- // Cast UI - Component Library
3
- // Export components here as they are created
1
+ // Cast UI — Cross-platform design system component library
2
+ //
3
+ // Tokens
4
+ export { intentColors, disabledColors, controlTokens, surfaceTokens, textTokens, overlayTokens, fontFamily, fontWeight, label, title, body, } from './tokens';
5
+ // Theme
6
+ export { ThemeProvider, useTheme, themes, } from './theme';
7
+ // Components
8
+ export { Button } from './components/Button';
9
+ export { Icon } from './components/Icon';
10
+ export { Dialog, DialogContent, } from './components/Dialog';
4
11
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,8BAA8B;AAC9B,6CAA6C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,EAAE;AACF,SAAS;AACT,OAAO,EACL,YAAY,EACZ,cAAc,EACd,aAAa,EACb,aAAa,EACb,UAAU,EACV,aAAa,EACb,UAAU,EACV,UAAU,EACV,KAAK,EACL,KAAK,EACL,IAAI,GAKL,MAAM,UAAU,CAAC;AAElB,QAAQ;AACR,OAAO,EACL,aAAa,EACb,QAAQ,EACR,MAAM,GAUP,MAAM,SAAS,CAAC;AAEjB,aAAa;AACb,OAAO,EAAE,MAAM,EAAqC,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,IAAI,EAAkB,MAAM,mBAAmB,CAAC;AACzD,OAAO,EACL,MAAM,EACN,aAAa,GAKd,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * ThemeProvider — wraps your app to enable density theming and colour customisation.
3
+ *
4
+ * @example Basic usage — switch density
5
+ * ```tsx
6
+ * import { ThemeProvider } from '@castui/cast-ui';
7
+ *
8
+ * <ThemeProvider density="comfortable">
9
+ * <App />
10
+ * </ThemeProvider>
11
+ * ```
12
+ *
13
+ * @example Rebrand — override intent colours
14
+ * ```tsx
15
+ * <ThemeProvider
16
+ * density="default"
17
+ * colors={{
18
+ * brand: {
19
+ * bold: {
20
+ * default: { bg: '#7C3AED', fg: '#FFFFFF', border: '#7C3AED' },
21
+ * hover: { bg: '#6D28D9', fg: '#FFFFFF', border: '#6D28D9' },
22
+ * active: { bg: '#5B21B6', fg: '#FFFFFF', border: '#5B21B6' },
23
+ * },
24
+ * },
25
+ * }}
26
+ * >
27
+ * <App />
28
+ * </ThemeProvider>
29
+ * ```
30
+ */
31
+ import React from 'react';
32
+ import { intentColors as defaultIntentColors, disabledColors as defaultDisabledColors } from '../tokens/colors';
33
+ import type { IntentName } from '../tokens/colors';
34
+ import type { DensityTheme, ComponentTokens, DeepPartial } from './types';
35
+ type IntentColorMap = typeof defaultIntentColors;
36
+ export type Theme = {
37
+ density: DensityTheme;
38
+ components: ComponentTokens;
39
+ colors: IntentColorMap;
40
+ disabledColors: typeof defaultDisabledColors;
41
+ };
42
+ export type ThemeProviderProps = {
43
+ /** Density theme — controls spacing and padding across all components. */
44
+ density?: DensityTheme;
45
+ /**
46
+ * Partial colour overrides — deep-merged with the default intent colours.
47
+ * Only provide the values you want to change; everything else stays default.
48
+ */
49
+ colors?: Partial<Record<IntentName, DeepPartial<IntentColorMap[IntentName]>>>;
50
+ children: React.ReactNode;
51
+ };
52
+ export declare function ThemeProvider({ density, colors, children, }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
53
+ /**
54
+ * Access the current theme — density tokens, intent colours, and component tokens.
55
+ * Must be called within a ThemeProvider; falls back to the "default" density if not.
56
+ */
57
+ export declare function useTheme(): Theme;
58
+ export {};
59
+ //# sourceMappingURL=ThemeContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThemeContext.d.ts","sourceRoot":"","sources":["../../src/theme/ThemeContext.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAA6C,MAAM,OAAO,CAAC;AAElE,OAAO,EACL,YAAY,IAAI,mBAAmB,EACnC,cAAc,IAAI,qBAAqB,EACxC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAM1E,KAAK,cAAc,GAAG,OAAO,mBAAmB,CAAC;AAEjD,MAAM,MAAM,KAAK,GAAG;IAClB,OAAO,EAAE,YAAY,CAAC;IACtB,UAAU,EAAE,eAAe,CAAC;IAC5B,MAAM,EAAE,cAAc,CAAC;IACvB,cAAc,EAAE,OAAO,qBAAqB,CAAC;CAC9C,CAAC;AAkDF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,0EAA0E;IAC1E,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9E,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAC5B,OAAmB,EACnB,MAAM,EACN,QAAQ,GACT,EAAE,kBAAkB,2CAiBpB;AAMD;;;GAGG;AACH,wBAAgB,QAAQ,IAAI,KAAK,CAEhC"}
@@ -0,0 +1,92 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * ThemeProvider — wraps your app to enable density theming and colour customisation.
4
+ *
5
+ * @example Basic usage — switch density
6
+ * ```tsx
7
+ * import { ThemeProvider } from '@castui/cast-ui';
8
+ *
9
+ * <ThemeProvider density="comfortable">
10
+ * <App />
11
+ * </ThemeProvider>
12
+ * ```
13
+ *
14
+ * @example Rebrand — override intent colours
15
+ * ```tsx
16
+ * <ThemeProvider
17
+ * density="default"
18
+ * colors={{
19
+ * brand: {
20
+ * bold: {
21
+ * default: { bg: '#7C3AED', fg: '#FFFFFF', border: '#7C3AED' },
22
+ * hover: { bg: '#6D28D9', fg: '#FFFFFF', border: '#6D28D9' },
23
+ * active: { bg: '#5B21B6', fg: '#FFFFFF', border: '#5B21B6' },
24
+ * },
25
+ * },
26
+ * }}
27
+ * >
28
+ * <App />
29
+ * </ThemeProvider>
30
+ * ```
31
+ */
32
+ import { createContext, useContext, useMemo } from 'react';
33
+ import { themes } from './themes';
34
+ import { intentColors as defaultIntentColors, disabledColors as defaultDisabledColors, } from '../tokens/colors';
35
+ // ---------------------------------------------------------------------------
36
+ // Deep merge utility (for partial colour overrides)
37
+ // ---------------------------------------------------------------------------
38
+ function deepMerge(base, overrides) {
39
+ const result = { ...base };
40
+ for (const key of Object.keys(overrides)) {
41
+ if (key === '__proto__' || key === 'constructor' || key === 'prototype')
42
+ continue;
43
+ const baseVal = base[key];
44
+ const overVal = overrides[key];
45
+ if (overVal &&
46
+ typeof overVal === 'object' &&
47
+ !Array.isArray(overVal) &&
48
+ baseVal &&
49
+ typeof baseVal === 'object') {
50
+ result[key] = deepMerge(baseVal, overVal);
51
+ }
52
+ else {
53
+ result[key] = overVal;
54
+ }
55
+ }
56
+ return result;
57
+ }
58
+ // ---------------------------------------------------------------------------
59
+ // Context
60
+ // ---------------------------------------------------------------------------
61
+ const defaultTheme = {
62
+ density: 'default',
63
+ components: themes.default,
64
+ colors: defaultIntentColors,
65
+ disabledColors: defaultDisabledColors,
66
+ };
67
+ const ThemeContext = createContext(defaultTheme);
68
+ export function ThemeProvider({ density = 'default', colors, children, }) {
69
+ const theme = useMemo(() => {
70
+ const resolvedColors = colors
71
+ ? deepMerge(defaultIntentColors, colors)
72
+ : defaultIntentColors;
73
+ return {
74
+ density,
75
+ components: themes[density],
76
+ colors: resolvedColors,
77
+ disabledColors: defaultDisabledColors,
78
+ };
79
+ }, [density, colors]);
80
+ return (_jsx(ThemeContext.Provider, { value: theme, children: children }));
81
+ }
82
+ // ---------------------------------------------------------------------------
83
+ // Hook
84
+ // ---------------------------------------------------------------------------
85
+ /**
86
+ * Access the current theme — density tokens, intent colours, and component tokens.
87
+ * Must be called within a ThemeProvider; falls back to the "default" density if not.
88
+ */
89
+ export function useTheme() {
90
+ return useContext(ThemeContext);
91
+ }
92
+ //# sourceMappingURL=ThemeContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThemeContext.js","sourceRoot":"","sources":["../../src/theme/ThemeContext.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAc,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EACL,YAAY,IAAI,mBAAmB,EACnC,cAAc,IAAI,qBAAqB,GACxC,MAAM,kBAAkB,CAAC;AAiB1B,8EAA8E;AAC9E,oDAAoD;AACpD,8EAA8E;AAE9E,SAAS,SAAS,CAChB,IAAO,EACP,SAAkC;IAElC,MAAM,MAAM,GAA4B,EAAE,GAAG,IAAI,EAAE,CAAC;IACpD,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;QACzC,IAAI,GAAG,KAAK,WAAW,IAAI,GAAG,KAAK,aAAa,IAAI,GAAG,KAAK,WAAW;YAAE,SAAS;QAClF,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;QAC1B,MAAM,OAAO,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC;QAC/B,IACE,OAAO;YACP,OAAO,OAAO,KAAK,QAAQ;YAC3B,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;YACvB,OAAO;YACP,OAAO,OAAO,KAAK,QAAQ,EAC3B,CAAC;YACD,MAAM,CAAC,GAAG,CAAC,GAAG,SAAS,CACrB,OAAkC,EAClC,OAAkC,CACnC,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC;QACxB,CAAC;IACH,CAAC;IACD,OAAO,MAAW,CAAC;AACrB,CAAC;AAED,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E,MAAM,YAAY,GAAU;IAC1B,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,MAAM,CAAC,OAAO;IAC1B,MAAM,EAAE,mBAAmB;IAC3B,cAAc,EAAE,qBAAqB;CACtC,CAAC;AAEF,MAAM,YAAY,GAAG,aAAa,CAAQ,YAAY,CAAC,CAAC;AAiBxD,MAAM,UAAU,aAAa,CAAC,EAC5B,OAAO,GAAG,SAAS,EACnB,MAAM,EACN,QAAQ,GACW;IACnB,MAAM,KAAK,GAAG,OAAO,CAAQ,GAAG,EAAE;QAChC,MAAM,cAAc,GAAG,MAAM;YAC3B,CAAC,CAAC,SAAS,CAAC,mBAAmB,EAAE,MAAiC,CAAC;YACnE,CAAC,CAAC,mBAAmB,CAAC;QAExB,OAAO;YACL,OAAO;YACP,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC;YAC3B,MAAM,EAAE,cAAgC;YACxC,cAAc,EAAE,qBAAqB;SACtC,CAAC;IACJ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;IAEtB,OAAO,CACL,KAAC,YAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,GAAyB,CACxE,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,OAAO;AACP,8EAA8E;AAE9E;;;GAGG;AACH,MAAM,UAAU,QAAQ;IACtB,OAAO,UAAU,CAAC,YAAY,CAAC,CAAC;AAClC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { ThemeProvider, useTheme, type ThemeProviderProps, type Theme } from './ThemeContext';
2
+ export { themes } from './themes';
3
+ export type { DensityTheme, ComponentTokens, ButtonSizeTokens, ButtonThemeTokens, DialogSizeTokens, DialogThemeTokens, DeepPartial, } from './types';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,kBAAkB,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC9F,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EACV,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,GACZ,MAAM,SAAS,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { ThemeProvider, useTheme } from './ThemeContext';
2
+ export { themes } from './themes';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAuC,MAAM,gBAAgB,CAAC;AAC9F,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Density theme definitions — extracted from component token files.
3
+ *
4
+ * Source files:
5
+ * design-tokens/component/component-compact.tokens.json
6
+ * design-tokens/component/component-default.tokens.json
7
+ * design-tokens/component/component-comfortable.tokens.json
8
+ *
9
+ * Values verified against Figma variable defs.
10
+ * Only spacing/sizing tokens live here — colours are constant across densities.
11
+ */
12
+ import type { DensityTheme, ComponentTokens } from './types';
13
+ export declare const themes: Record<DensityTheme, ComponentTokens>;
14
+ //# sourceMappingURL=themes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../../src/theme/themes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE7D,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,YAAY,EAAE,eAAe,CAsGxD,CAAC"}
@@ -0,0 +1,113 @@
1
+ /**
2
+ * Density theme definitions — extracted from component token files.
3
+ *
4
+ * Source files:
5
+ * design-tokens/component/component-compact.tokens.json
6
+ * design-tokens/component/component-default.tokens.json
7
+ * design-tokens/component/component-comfortable.tokens.json
8
+ *
9
+ * Values verified against Figma variable defs.
10
+ * Only spacing/sizing tokens live here — colours are constant across densities.
11
+ */
12
+ export const themes = {
13
+ compact: {
14
+ dialog: {
15
+ small: { padding: 16, gap: 12, iconSize: 24 },
16
+ default: { padding: 24, gap: 16, iconSize: 32 },
17
+ large: { padding: 32, gap: 24, iconSize: 40 },
18
+ },
19
+ button: {
20
+ small: {
21
+ gap: 4,
22
+ paddingX: 6,
23
+ paddingY: 2,
24
+ borderRadius: 8,
25
+ focusRingWidth: 2,
26
+ focusRingOffset: 2,
27
+ },
28
+ default: {
29
+ gap: 8,
30
+ paddingX: 10,
31
+ paddingY: 6,
32
+ borderRadius: 8,
33
+ focusRingWidth: 2,
34
+ focusRingOffset: 2,
35
+ },
36
+ large: {
37
+ gap: 16,
38
+ paddingX: 20,
39
+ paddingY: 14,
40
+ borderRadius: 8,
41
+ focusRingWidth: 2,
42
+ focusRingOffset: 2,
43
+ },
44
+ },
45
+ },
46
+ default: {
47
+ dialog: {
48
+ small: { padding: 24, gap: 16, iconSize: 24 },
49
+ default: { padding: 32, gap: 24, iconSize: 32 },
50
+ large: { padding: 40, gap: 32, iconSize: 40 },
51
+ },
52
+ button: {
53
+ small: {
54
+ gap: 8,
55
+ paddingX: 10,
56
+ paddingY: 6,
57
+ borderRadius: 8,
58
+ focusRingWidth: 2,
59
+ focusRingOffset: 2,
60
+ },
61
+ default: {
62
+ gap: 12,
63
+ paddingX: 14,
64
+ paddingY: 10,
65
+ borderRadius: 8,
66
+ focusRingWidth: 2,
67
+ focusRingOffset: 2,
68
+ },
69
+ large: {
70
+ gap: 20,
71
+ paddingX: 24,
72
+ paddingY: 16,
73
+ borderRadius: 8,
74
+ focusRingWidth: 2,
75
+ focusRingOffset: 2,
76
+ },
77
+ },
78
+ },
79
+ comfortable: {
80
+ dialog: {
81
+ small: { padding: 40, gap: 24, iconSize: 24 },
82
+ default: { padding: 40, gap: 32, iconSize: 32 },
83
+ large: { padding: 48, gap: 40, iconSize: 40 },
84
+ },
85
+ button: {
86
+ small: {
87
+ gap: 12,
88
+ paddingX: 14,
89
+ paddingY: 10,
90
+ borderRadius: 8,
91
+ focusRingWidth: 2,
92
+ focusRingOffset: 2,
93
+ },
94
+ default: {
95
+ gap: 16,
96
+ paddingX: 20,
97
+ paddingY: 14,
98
+ borderRadius: 8,
99
+ focusRingWidth: 2,
100
+ focusRingOffset: 2,
101
+ },
102
+ large: {
103
+ gap: 24,
104
+ paddingX: 32,
105
+ paddingY: 20,
106
+ borderRadius: 8,
107
+ focusRingWidth: 2,
108
+ focusRingOffset: 2,
109
+ },
110
+ },
111
+ },
112
+ };
113
+ //# sourceMappingURL=themes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themes.js","sourceRoot":"","sources":["../../src/theme/themes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,MAAM,CAAC,MAAM,MAAM,GAA0C;IAC3D,OAAO,EAAE;QACP,MAAM,EAAE;YACN,KAAK,EAAI,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YAC/C,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YAC/C,KAAK,EAAI,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;SAChD;QACD,MAAM,EAAE;YACN,KAAK,EAAE;gBACL,GAAG,EAAE,CAAC;gBACN,QAAQ,EAAE,CAAC;gBACX,QAAQ,EAAE,CAAC;gBACX,YAAY,EAAE,CAAC;gBACf,cAAc,EAAE,CAAC;gBACjB,eAAe,EAAE,CAAC;aACnB;YACD,OAAO,EAAE;gBACP,GAAG,EAAE,CAAC;gBACN,QAAQ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AAE,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YAC/C,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YAC/C,KAAK,EAAI,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;SAChD;QACD,MAAM,EAAE;YACN,KAAK,EAAE;gBACL,GAAG,EAAE,EAAE;gBACP,QAAQ,EAAE,EAAE;gBACZ,QAAQ,EAAE,EAAE;gBACZ,YAAY,EAAE,CAAC;gBACf,cAAc,EAAE,CAAC;gBACjB,eAAe,EAAE,CAAC;aACnB;YACD,OAAO,EAAE;gBACP,GAAG,EAAE,EAAE;gBACP,QAAQ,EAAE,EAAE;gBACZ,QAAQ,EAAE,EAAE;gBACZ,YAAY,EAAE,CAAC;gBACf,cAAc,EAAE,CAAC;gBACjB,eAAe,EAAE,CAAC;aACnB;YACD,KAAK,EAAE;gBACL,GAAG,EAAE,EAAE;gBACP,QAAQ,EAAE,EAAE;gBACZ,QAAQ,EAAE,EAAE;gBACZ,YAAY,EAAE,CAAC;gBACf,cAAc,EAAE,CAAC;gBACjB,eAAe,EAAE,CAAC;aACnB;SACF;KACF;CACF,CAAC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Theme type definitions for the Cast UI density system.
3
+ *
4
+ * The density axis controls spacing/sizing tokens only.
5
+ * Colours and typography are constants — they don't change with density.
6
+ */
7
+ export type DensityTheme = 'compact' | 'default' | 'comfortable';
8
+ /** Spacing/sizing tokens for a single button size variant */
9
+ export type ButtonSizeTokens = {
10
+ gap: number;
11
+ paddingX: number;
12
+ paddingY: number;
13
+ borderRadius: number;
14
+ focusRingWidth: number;
15
+ focusRingOffset: number;
16
+ };
17
+ /** All three button sizes */
18
+ export type ButtonThemeTokens = {
19
+ small: ButtonSizeTokens;
20
+ default: ButtonSizeTokens;
21
+ large: ButtonSizeTokens;
22
+ };
23
+ /** Spacing/sizing tokens for a single dialog size variant */
24
+ export type DialogSizeTokens = {
25
+ padding: number;
26
+ gap: number;
27
+ iconSize: number;
28
+ };
29
+ /** All three dialog sizes */
30
+ export type DialogThemeTokens = {
31
+ small: DialogSizeTokens;
32
+ default: DialogSizeTokens;
33
+ large: DialogSizeTokens;
34
+ };
35
+ /**
36
+ * Component-level tokens that vary by density theme.
37
+ * Extended as new components are added to the library.
38
+ */
39
+ export type ComponentTokens = {
40
+ button: ButtonThemeTokens;
41
+ dialog: DialogThemeTokens;
42
+ };
43
+ /** Utility type for partial overrides at any depth */
44
+ export type DeepPartial<T> = {
45
+ [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
46
+ };
47
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/theme/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,aAAa,CAAC;AAEjE,6DAA6D;AAC7D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,6BAA6B;AAC7B,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,gBAAgB,CAAC;IACxB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,KAAK,EAAE,gBAAgB,CAAC;CACzB,CAAC;AAEF,6DAA6D;AAC7D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,6BAA6B;AAC7B,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,gBAAgB,CAAC;IACxB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,KAAK,EAAE,gBAAgB,CAAC;CACzB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,MAAM,EAAE,iBAAiB,CAAC;CAC3B,CAAC;AAEF,sDAAsD;AACtD,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAChE,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Theme type definitions for the Cast UI density system.
3
+ *
4
+ * The density axis controls spacing/sizing tokens only.
5
+ * Colours and typography are constants — they don't change with density.
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/theme/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Semantic intent colors — derived from semantic.tokens.json
3
+ * Maps: intent → prominence → state → { bg, fg, border }
4
+ *
5
+ * Source tokens: intent/{intent}/{prominence}/{state}/{bg|fg|border}
6
+ * Primitive palette refs: blue (brand), cool-grey (neutral), red (danger)
7
+ */
8
+ type StateColors = {
9
+ bg: string;
10
+ fg: string;
11
+ border: string;
12
+ };
13
+ type ProminenceColors = {
14
+ default: StateColors;
15
+ hover: StateColors;
16
+ active: StateColors;
17
+ };
18
+ type IntentColors = {
19
+ default: ProminenceColors;
20
+ bold: ProminenceColors;
21
+ subtle: ProminenceColors;
22
+ ringColour: string;
23
+ };
24
+ export type IntentName = 'brand' | 'neutral' | 'danger';
25
+ export type ProminenceName = 'default' | 'bold' | 'subtle';
26
+ export type StateName = 'default' | 'hover' | 'active';
27
+ export declare const intentColors: Record<IntentName, IntentColors>;
28
+ /** Disabled state — shared across all intents */
29
+ export declare const disabledColors: StateColors;
30
+ /** Semantic control constants */
31
+ export declare const controlTokens: {
32
+ borderWidth: number;
33
+ };
34
+ /** Surface tokens — backgrounds and overlay styling */
35
+ export declare const surfaceTokens: {
36
+ /** Page/screen background — cool-grey/50 */
37
+ base: string;
38
+ /** Subtle background for sections/cards — cool-grey/100 */
39
+ subtle: string;
40
+ /** Overlay surfaces (Dialog, Popover, Tooltip, Select, etc.) */
41
+ overlay: {
42
+ bg: string;
43
+ border: string;
44
+ borderRadius: number;
45
+ };
46
+ };
47
+ /** Semantic text tokens */
48
+ export declare const textTokens: {
49
+ description: string;
50
+ };
51
+ /** Overlay/scrim opacity */
52
+ export declare const overlayTokens: {
53
+ scrimOpacity: number;
54
+ };
55
+ export {};
56
+ //# sourceMappingURL=colors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/tokens/colors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,KAAK,gBAAgB,GAAG;IACtB,OAAO,EAAE,WAAW,CAAC;IACrB,KAAK,EAAE,WAAW,CAAC;IACnB,MAAM,EAAE,WAAW,CAAC;CACrB,CAAC;AAEF,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,IAAI,EAAE,gBAAgB,CAAC;IACvB,MAAM,EAAE,gBAAgB,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAC;AACxD,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;AAC3D,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEvD,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,UAAU,EAAE,YAAY,CAuDzD,CAAC;AAEF,iDAAiD;AACjD,eAAO,MAAM,cAAc,EAAE,WAI5B,CAAC;AAEF,iCAAiC;AACjC,eAAO,MAAM,aAAa;;CAEzB,CAAC;AAEF,uDAAuD;AACvD,eAAO,MAAM,aAAa;IACxB,4CAA4C;;IAE5C,2DAA2D;;IAE3D,gEAAgE;;;;;;CAMjE,CAAC;AAEF,2BAA2B;AAC3B,eAAO,MAAM,UAAU;;CAEtB,CAAC;AAEF,4BAA4B;AAC5B,eAAO,MAAM,aAAa;;CAEzB,CAAC"}
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Semantic intent colors — derived from semantic.tokens.json
3
+ * Maps: intent → prominence → state → { bg, fg, border }
4
+ *
5
+ * Source tokens: intent/{intent}/{prominence}/{state}/{bg|fg|border}
6
+ * Primitive palette refs: blue (brand), cool-grey (neutral), red (danger)
7
+ */
8
+ export const intentColors = {
9
+ neutral: {
10
+ default: {
11
+ default: { bg: '#FFFFFF', fg: '#374151', border: '#D1D5DB' },
12
+ hover: { bg: '#F9FAFB', fg: '#1F2937', border: '#9CA3AF' },
13
+ active: { bg: '#F3F4F6', fg: '#111827', border: '#6B7280' },
14
+ },
15
+ bold: {
16
+ default: { bg: '#374151', fg: '#FFFFFF', border: '#374151' },
17
+ hover: { bg: '#1F2937', fg: '#FFFFFF', border: '#1F2937' },
18
+ active: { bg: '#111827', fg: '#FFFFFF', border: '#111827' },
19
+ },
20
+ subtle: {
21
+ default: { bg: 'transparent', fg: '#374151', border: 'transparent' },
22
+ hover: { bg: '#F9FAFB', fg: '#1F2937', border: 'transparent' },
23
+ active: { bg: '#F3F4F6', fg: '#111827', border: 'transparent' },
24
+ },
25
+ ringColour: '#9CA3AF',
26
+ },
27
+ brand: {
28
+ default: {
29
+ default: { bg: '#FFFFFF', fg: '#2563EB', border: '#93C5FD' },
30
+ hover: { bg: '#EFF6FF', fg: '#1D4ED8', border: '#60A5FA' },
31
+ active: { bg: '#DBEAFE', fg: '#1E40AF', border: '#3B82F6' },
32
+ },
33
+ bold: {
34
+ default: { bg: '#2563EB', fg: '#FFFFFF', border: '#2563EB' },
35
+ hover: { bg: '#1D4ED8', fg: '#FFFFFF', border: '#1D4ED8' },
36
+ active: { bg: '#1E40AF', fg: '#FFFFFF', border: '#1E40AF' },
37
+ },
38
+ subtle: {
39
+ default: { bg: 'transparent', fg: '#2563EB', border: 'transparent' },
40
+ hover: { bg: '#EFF6FF', fg: '#1D4ED8', border: 'transparent' },
41
+ active: { bg: '#DBEAFE', fg: '#1E40AF', border: 'transparent' },
42
+ },
43
+ ringColour: '#60A5FA',
44
+ },
45
+ danger: {
46
+ default: {
47
+ default: { bg: '#FFFFFF', fg: '#DC2626', border: '#FCA5A5' },
48
+ hover: { bg: '#FEF2F2', fg: '#B91C1C', border: '#F87171' },
49
+ active: { bg: '#FEE2E2', fg: '#991B1B', border: '#EF4444' },
50
+ },
51
+ bold: {
52
+ default: { bg: '#DC2626', fg: '#FFFFFF', border: '#DC2626' },
53
+ hover: { bg: '#B91C1C', fg: '#FFFFFF', border: '#B91C1C' },
54
+ active: { bg: '#991B1B', fg: '#FFFFFF', border: '#991B1B' },
55
+ },
56
+ subtle: {
57
+ default: { bg: 'transparent', fg: '#DC2626', border: 'transparent' },
58
+ hover: { bg: '#FEF2F2', fg: '#B91C1C', border: 'transparent' },
59
+ active: { bg: '#FEE2E2', fg: '#991B1B', border: 'transparent' },
60
+ },
61
+ ringColour: '#F87171',
62
+ },
63
+ };
64
+ /** Disabled state — shared across all intents */
65
+ export const disabledColors = {
66
+ bg: '#F3F4F6',
67
+ fg: '#9CA3AF',
68
+ border: '#E5E7EB',
69
+ };
70
+ /** Semantic control constants */
71
+ export const controlTokens = {
72
+ borderWidth: 1,
73
+ };
74
+ /** Surface tokens — backgrounds and overlay styling */
75
+ export const surfaceTokens = {
76
+ /** Page/screen background — cool-grey/50 */
77
+ base: '#F9FAFB',
78
+ /** Subtle background for sections/cards — cool-grey/100 */
79
+ subtle: '#F3F4F6',
80
+ /** Overlay surfaces (Dialog, Popover, Tooltip, Select, etc.) */
81
+ overlay: {
82
+ bg: '#FFFFFF',
83
+ border: '#E5E7EB',
84
+ borderRadius: 8,
85
+ },
86
+ };
87
+ /** Semantic text tokens */
88
+ export const textTokens = {
89
+ description: '#6B7280',
90
+ };
91
+ /** Overlay/scrim opacity */
92
+ export const overlayTokens = {
93
+ scrimOpacity: 0.5,
94
+ };
95
+ //# sourceMappingURL=colors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colors.js","sourceRoot":"","sources":["../../src/tokens/colors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAyBH,MAAM,CAAC,MAAM,YAAY,GAAqC;IAC5D,OAAO,EAAE;QACP,OAAO,EAAE;YACP,OAAO,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE;YAC5D,KAAK,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE;YAC1D,MAAM,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE;SAC5D;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE;YAC5D,KAAK,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE;YAC1D,MAAM,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EA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SAAS;IACb,MAAM,EAAE,SAAS;CAClB,CAAC;AAEF,iCAAiC;AACjC,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,WAAW,EAAE,CAAC;CACf,CAAC;AAEF,uDAAuD;AACvD,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,4CAA4C;IAC5C,IAAI,EAAE,SAAS;IACf,2DAA2D;IAC3D,MAAM,EAAE,SAAS;IACjB,gEAAgE;IAChE,OAAO,EAAE;QACP,EAAE,EAAE,SAAS;QACb,MAAM,EAAE,SAAS;QACjB,YAAY,EAAE,CAAC;KAChB;CACF,CAAC;AAEF,2BAA2B;AAC3B,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,WAAW,EAAE,SAAS;CACvB,CAAC;AAEF,4BAA4B;AAC5B,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,YAAY,EAAE,GAAG;CAClB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { intentColors, disabledColors, controlTokens, surfaceTokens, textTokens, overlayTokens, type IntentName, type ProminenceName, type StateName, } from './colors';
2
+ export { fontFamily, fontWeight, label, title, body, type LabelSize } from './typography';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tokens/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,cAAc,EACd,aAAa,EACb,aAAa,EACb,UAAU,EACV,aAAa,EACb,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,SAAS,GACf,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { intentColors, disabledColors, controlTokens, surfaceTokens, textTokens, overlayTokens, } from './colors';
2
+ export { fontFamily, fontWeight, label, title, body } from './typography';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tokens/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,cAAc,EACd,aAAa,EACb,aAAa,EACb,UAAU,EACV,aAAa,GAId,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAkB,MAAM,cAAc,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Typography tokens — derived from primitive.tokens.json + semantic.tokens.json
3
+ *
4
+ * Source tokens:
5
+ * font-family/{sans|mono|serif}
6
+ * font-weight/{light|regular|medium|semibold|bold}
7
+ * label/{sm|md|lg}, title/{sm|md|lg}, body/{sm|md|lg} → fontSize, lineHeight, letterSpacing
8
+ */
9
+ export declare const fontFamily: {
10
+ readonly sans: string;
11
+ readonly mono: string;
12
+ readonly serif: string;
13
+ };
14
+ export declare const fontWeight: {
15
+ light: "300";
16
+ regular: "400";
17
+ medium: "500";
18
+ semibold: "600";
19
+ bold: "700";
20
+ };
21
+ export type LabelSize = 'sm' | 'md' | 'lg';
22
+ type TypographyScale = Record<'sm' | 'md' | 'lg', {
23
+ fontSize: number;
24
+ lineHeight: number;
25
+ letterSpacing: number;
26
+ }>;
27
+ export declare const label: TypographyScale;
28
+ export declare const title: TypographyScale;
29
+ export declare const body: TypographyScale;
30
+ export {};
31
+ //# sourceMappingURL=typography.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../../src/tokens/typography.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,eAAO,MAAM,UAAU;;;;CAOb,CAAC;AAEX,eAAO,MAAM,UAAU;;;;;;CAMtB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE3C,KAAK,eAAe,GAAG,MAAM,CAC3B,IAAI,GAAG,IAAI,GAAG,IAAI,EAClB;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAChE,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,eAInB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,eAInB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,eAIlB,CAAC"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Typography tokens — derived from primitive.tokens.json + semantic.tokens.json
3
+ *
4
+ * Source tokens:
5
+ * font-family/{sans|mono|serif}
6
+ * font-weight/{light|regular|medium|semibold|bold}
7
+ * label/{sm|md|lg}, title/{sm|md|lg}, body/{sm|md|lg} → fontSize, lineHeight, letterSpacing
8
+ */
9
+ import { Platform } from 'react-native';
10
+ export const fontFamily = {
11
+ sans: Platform.select({ web: 'Inter, system-ui, sans-serif', default: 'Inter' }),
12
+ mono: Platform.select({
13
+ web: '"JetBrains Mono", monospace',
14
+ default: 'JetBrains Mono',
15
+ }),
16
+ serif: Platform.select({ web: '"Noto Serif", serif', default: 'Noto Serif' }),
17
+ };
18
+ export const fontWeight = {
19
+ light: '300',
20
+ regular: '400',
21
+ medium: '500',
22
+ semibold: '600',
23
+ bold: '700',
24
+ };
25
+ export const label = {
26
+ sm: { fontSize: 12, lineHeight: 16, letterSpacing: 0.25 },
27
+ md: { fontSize: 14, lineHeight: 20, letterSpacing: 0 },
28
+ lg: { fontSize: 16, lineHeight: 24, letterSpacing: 0 },
29
+ };
30
+ export const title = {
31
+ sm: { fontSize: 16, lineHeight: 24, letterSpacing: 0 },
32
+ md: { fontSize: 18, lineHeight: 24, letterSpacing: 0 },
33
+ lg: { fontSize: 20, lineHeight: 28, letterSpacing: 0 },
34
+ };
35
+ export const body = {
36
+ sm: { fontSize: 12, lineHeight: 18, letterSpacing: 0.25 },
37
+ md: { fontSize: 14, lineHeight: 20, letterSpacing: 0 },
38
+ lg: { fontSize: 16, lineHeight: 24, letterSpacing: 0 },
39
+ };
40
+ //# sourceMappingURL=typography.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typography.js","sourceRoot":"","sources":["../../src/tokens/typography.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,8BAA8B,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;IAChF,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC;QACpB,GAAG,EAAE,6BAA6B;QAClC,OAAO,EAAE,gBAAgB;KAC1B,CAAC;IACF,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,qBAAqB,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;CACrE,CAAC;AAEX,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,KAAK,EAAE,KAAc;IACrB,OAAO,EAAE,KAAc;IACvB,MAAM,EAAE,KAAc;IACtB,QAAQ,EAAE,KAAc;IACxB,IAAI,EAAE,KAAc;CACrB,CAAC;AASF,MAAM,CAAC,MAAM,KAAK,GAAoB;IACpC,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE;IACzD,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE;IACtD,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE;CACvD,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAoB;IACpC,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE;IACtD,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE;IACtD,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE;CACvD,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAoB;IACnC,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE;IACzD,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE;IACtD,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE;CACvD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@castui/cast-ui",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "A cross-platform design system for React Native (iOS, Android, Web) with multi-theme support.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",