@castui/cast-ui 4.1.1 → 4.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 (155) hide show
  1. package/README.md +129 -19
  2. package/dist/components/Alert/Alert.d.ts +41 -0
  3. package/dist/components/Alert/Alert.d.ts.map +1 -0
  4. package/dist/components/Alert/Alert.js +69 -0
  5. package/dist/components/Alert/Alert.js.map +1 -0
  6. package/dist/components/Alert/index.d.ts +2 -0
  7. package/dist/components/Alert/index.d.ts.map +1 -0
  8. package/dist/components/Alert/index.js +2 -0
  9. package/dist/components/Alert/index.js.map +1 -0
  10. package/dist/components/Avatar/Avatar.d.ts +32 -0
  11. package/dist/components/Avatar/Avatar.d.ts.map +1 -0
  12. package/dist/components/Avatar/Avatar.js +53 -0
  13. package/dist/components/Avatar/Avatar.js.map +1 -0
  14. package/dist/components/Avatar/index.d.ts +2 -0
  15. package/dist/components/Avatar/index.d.ts.map +1 -0
  16. package/dist/components/Avatar/index.js +2 -0
  17. package/dist/components/Avatar/index.js.map +1 -0
  18. package/dist/components/Badge/Badge.d.ts +42 -0
  19. package/dist/components/Badge/Badge.d.ts.map +1 -0
  20. package/dist/components/Badge/Badge.js +69 -0
  21. package/dist/components/Badge/Badge.js.map +1 -0
  22. package/dist/components/Badge/index.d.ts +2 -0
  23. package/dist/components/Badge/index.d.ts.map +1 -0
  24. package/dist/components/Badge/index.js +2 -0
  25. package/dist/components/Badge/index.js.map +1 -0
  26. package/dist/components/Card/Card.d.ts +42 -0
  27. package/dist/components/Card/Card.d.ts.map +1 -0
  28. package/dist/components/Card/Card.js +89 -0
  29. package/dist/components/Card/Card.js.map +1 -0
  30. package/dist/components/Card/index.d.ts +2 -0
  31. package/dist/components/Card/index.d.ts.map +1 -0
  32. package/dist/components/Card/index.js +2 -0
  33. package/dist/components/Card/index.js.map +1 -0
  34. package/dist/components/Checkbox/Checkbox.d.ts +33 -0
  35. package/dist/components/Checkbox/Checkbox.d.ts.map +1 -0
  36. package/dist/components/Checkbox/Checkbox.js +105 -0
  37. package/dist/components/Checkbox/Checkbox.js.map +1 -0
  38. package/dist/components/Checkbox/index.d.ts +2 -0
  39. package/dist/components/Checkbox/index.d.ts.map +1 -0
  40. package/dist/components/Checkbox/index.js +2 -0
  41. package/dist/components/Checkbox/index.js.map +1 -0
  42. package/dist/components/Chip/Chip.d.ts +47 -0
  43. package/dist/components/Chip/Chip.d.ts.map +1 -0
  44. package/dist/components/Chip/Chip.js +80 -0
  45. package/dist/components/Chip/Chip.js.map +1 -0
  46. package/dist/components/Chip/index.d.ts +2 -0
  47. package/dist/components/Chip/index.d.ts.map +1 -0
  48. package/dist/components/Chip/index.js +2 -0
  49. package/dist/components/Chip/index.js.map +1 -0
  50. package/dist/components/Dialog/Dialog.d.ts.map +1 -1
  51. package/dist/components/Dialog/Dialog.js +6 -2
  52. package/dist/components/Dialog/Dialog.js.map +1 -1
  53. package/dist/components/Divider/Divider.d.ts +23 -0
  54. package/dist/components/Divider/Divider.d.ts.map +1 -0
  55. package/dist/components/Divider/Divider.js +17 -0
  56. package/dist/components/Divider/Divider.js.map +1 -0
  57. package/dist/components/Divider/index.d.ts +2 -0
  58. package/dist/components/Divider/index.d.ts.map +1 -0
  59. package/dist/components/Divider/index.js +2 -0
  60. package/dist/components/Divider/index.js.map +1 -0
  61. package/dist/components/Icon/Icon.d.ts +26 -8
  62. package/dist/components/Icon/Icon.d.ts.map +1 -1
  63. package/dist/components/Icon/Icon.js +9 -1
  64. package/dist/components/Icon/Icon.js.map +1 -1
  65. package/dist/components/Input/Input.d.ts +63 -0
  66. package/dist/components/Input/Input.d.ts.map +1 -0
  67. package/dist/components/Input/Input.js +139 -0
  68. package/dist/components/Input/Input.js.map +1 -0
  69. package/dist/components/Input/index.d.ts +2 -0
  70. package/dist/components/Input/index.d.ts.map +1 -0
  71. package/dist/components/Input/index.js +2 -0
  72. package/dist/components/Input/index.js.map +1 -0
  73. package/dist/components/List/List.d.ts +59 -0
  74. package/dist/components/List/List.d.ts.map +1 -0
  75. package/dist/components/List/List.js +111 -0
  76. package/dist/components/List/List.js.map +1 -0
  77. package/dist/components/List/index.d.ts +2 -0
  78. package/dist/components/List/index.d.ts.map +1 -0
  79. package/dist/components/List/index.js +2 -0
  80. package/dist/components/List/index.js.map +1 -0
  81. package/dist/components/Popover/Popover.d.ts +35 -0
  82. package/dist/components/Popover/Popover.d.ts.map +1 -0
  83. package/dist/components/Popover/Popover.js +60 -0
  84. package/dist/components/Popover/Popover.js.map +1 -0
  85. package/dist/components/Popover/index.d.ts +2 -0
  86. package/dist/components/Popover/index.d.ts.map +1 -0
  87. package/dist/components/Popover/index.js +2 -0
  88. package/dist/components/Popover/index.js.map +1 -0
  89. package/dist/components/Radio/Radio.d.ts +53 -0
  90. package/dist/components/Radio/Radio.d.ts.map +1 -0
  91. package/dist/components/Radio/Radio.js +124 -0
  92. package/dist/components/Radio/Radio.js.map +1 -0
  93. package/dist/components/Radio/index.d.ts +2 -0
  94. package/dist/components/Radio/index.d.ts.map +1 -0
  95. package/dist/components/Radio/index.js +2 -0
  96. package/dist/components/Radio/index.js.map +1 -0
  97. package/dist/components/Select/Select.d.ts.map +1 -1
  98. package/dist/components/Select/Select.js +20 -9
  99. package/dist/components/Select/Select.js.map +1 -1
  100. package/dist/components/Skeleton/Skeleton.d.ts +34 -0
  101. package/dist/components/Skeleton/Skeleton.d.ts.map +1 -0
  102. package/dist/components/Skeleton/Skeleton.js +64 -0
  103. package/dist/components/Skeleton/Skeleton.js.map +1 -0
  104. package/dist/components/Skeleton/index.d.ts +2 -0
  105. package/dist/components/Skeleton/index.d.ts.map +1 -0
  106. package/dist/components/Skeleton/index.js +2 -0
  107. package/dist/components/Skeleton/index.js.map +1 -0
  108. package/dist/components/Toast/Toast.d.ts +36 -0
  109. package/dist/components/Toast/Toast.d.ts.map +1 -0
  110. package/dist/components/Toast/Toast.js +77 -0
  111. package/dist/components/Toast/Toast.js.map +1 -0
  112. package/dist/components/Toast/index.d.ts +2 -0
  113. package/dist/components/Toast/index.d.ts.map +1 -0
  114. package/dist/components/Toast/index.js +2 -0
  115. package/dist/components/Toast/index.js.map +1 -0
  116. package/dist/components/Toggle/Toggle.d.ts +32 -0
  117. package/dist/components/Toggle/Toggle.d.ts.map +1 -0
  118. package/dist/components/Toggle/Toggle.js +89 -0
  119. package/dist/components/Toggle/Toggle.js.map +1 -0
  120. package/dist/components/Toggle/index.d.ts +2 -0
  121. package/dist/components/Toggle/index.d.ts.map +1 -0
  122. package/dist/components/Toggle/index.js +2 -0
  123. package/dist/components/Toggle/index.js.map +1 -0
  124. package/dist/components/Tooltip/Tooltip.d.ts +35 -0
  125. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -0
  126. package/dist/components/Tooltip/Tooltip.js +65 -0
  127. package/dist/components/Tooltip/Tooltip.js.map +1 -0
  128. package/dist/components/Tooltip/index.d.ts +2 -0
  129. package/dist/components/Tooltip/index.d.ts.map +1 -0
  130. package/dist/components/Tooltip/index.js +2 -0
  131. package/dist/components/Tooltip/index.js.map +1 -0
  132. package/dist/index.d.ts +17 -2
  133. package/dist/index.d.ts.map +1 -1
  134. package/dist/index.js +16 -1
  135. package/dist/index.js.map +1 -1
  136. package/dist/theme/ThemeContext.d.ts +24 -7
  137. package/dist/theme/ThemeContext.d.ts.map +1 -1
  138. package/dist/theme/ThemeContext.js +27 -11
  139. package/dist/theme/ThemeContext.js.map +1 -1
  140. package/dist/theme/index.d.ts +1 -1
  141. package/dist/theme/index.d.ts.map +1 -1
  142. package/dist/theme/themes.d.ts.map +1 -1
  143. package/dist/theme/themes.js +210 -0
  144. package/dist/theme/themes.js.map +1 -1
  145. package/dist/theme/types.d.ts +183 -0
  146. package/dist/theme/types.d.ts.map +1 -1
  147. package/dist/tokens/colors.d.ts +294 -25
  148. package/dist/tokens/colors.d.ts.map +1 -1
  149. package/dist/tokens/colors.js +319 -96
  150. package/dist/tokens/colors.js.map +1 -1
  151. package/dist/tokens/index.d.ts +1 -1
  152. package/dist/tokens/index.d.ts.map +1 -1
  153. package/dist/tokens/index.js +1 -1
  154. package/dist/tokens/index.js.map +1 -1
  155. package/package.json +1 -1
@@ -1,14 +1,24 @@
1
1
  /**
2
2
  * Icon — renders a Material Symbols Outlined icon by name.
3
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").
4
+ * Why Material Symbols Outlined?
5
+ * - It's the icon set the Cast UI Figma uses (star, check, close,
6
+ * keyboard_arrow_down, …), so names map 1:1 to the design with zero drift.
7
+ * - Apache-2.0 licensed and free for commercial use.
8
+ * - It's a single *variable* font, so one asset covers every icon plus the
9
+ * fill / weight / grade / optical-size axes — keeping Cast UI's zero
10
+ * runtime dependencies (no per-icon SVG packages, no vector-icons dep).
7
11
  *
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
+ * Rendering uses font ligatures: the `name` text (e.g. "chevron_right") is
13
+ * shaped into the glyph by the font. Requires the font to be loaded:
14
+ * - Web: Google Fonts CSS import (see .storybook/preview-head.html), or
15
+ * self-host the same `Material Symbols Outlined` family.
16
+ * - Expo: load `MaterialSymbolsOutlined` via expo-font / useFonts.
17
+ * - Bare RN: link the .ttf as a font asset (react-native.config.js / Xcode).
18
+ *
19
+ * The fill / weight / grade / opticalSize axes are applied via CSS
20
+ * `fontVariationSettings` and therefore take effect on web (where the variable
21
+ * font is loaded). On native they require a matching static/variable font cut.
12
22
  */
13
23
  import { type TextStyle, type StyleProp } from 'react-native';
14
24
  export type IconProps = {
@@ -18,8 +28,16 @@ export type IconProps = {
18
28
  size?: number;
19
29
  /** Icon colour. Defaults to "#374151" (neutral fg). */
20
30
  color?: string;
31
+ /** Filled vs outlined glyph (FILL axis, 0–1). Defaults to false (outlined). */
32
+ fill?: boolean;
33
+ /** Stroke weight (wght axis, 100–700). Defaults to 400. */
34
+ weight?: 100 | 200 | 300 | 400 | 500 | 600 | 700;
35
+ /** Emphasis grade (GRAD axis, -25–200). Defaults to 0. */
36
+ grade?: number;
37
+ /** Optical size (opsz axis, 20–48). Defaults to the icon `size`. */
38
+ opticalSize?: number;
21
39
  /** Additional style overrides. */
22
40
  style?: StyleProp<TextStyle>;
23
41
  };
24
- export declare function Icon({ name, size, color, style }: IconProps): import("react/jsx-runtime").JSX.Element;
42
+ export declare function Icon({ name, size, color, fill, weight, grade, opticalSize, style, }: IconProps): import("react/jsx-runtime").JSX.Element;
25
43
  //# sourceMappingURL=Icon.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/Icon.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;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,+EAA+E;IAC/E,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,2DAA2D;IAC3D,MAAM,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IACjD,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kCAAkC;IAClC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC;AAOF,wBAAgB,IAAI,CAAC,EACnB,IAAI,EACJ,IAAS,EACT,KAAiB,EACjB,IAAY,EACZ,MAAY,EACZ,KAAS,EACT,WAAW,EACX,KAAK,GACN,EAAE,SAAS,2CAuCX"}
@@ -4,7 +4,14 @@ const FONT_FAMILY = Platform.select({
4
4
  web: '"Material Symbols Outlined", sans-serif',
5
5
  default: 'MaterialSymbolsOutlined',
6
6
  });
7
- export function Icon({ name, size = 20, color = '#374151', style }) {
7
+ export function Icon({ name, size = 20, color = '#374151', fill = false, weight = 400, grade = 0, opticalSize, style, }) {
8
+ // Material Symbols variable-font axes — applied on web via fontVariationSettings.
9
+ const opsz = Math.min(48, Math.max(20, opticalSize ?? size));
10
+ const variationStyle = Platform.OS === 'web'
11
+ ? {
12
+ fontVariationSettings: `'FILL' ${fill ? 1 : 0}, 'wght' ${weight}, 'GRAD' ${grade}, 'opsz' ${opsz}`,
13
+ }
14
+ : null;
8
15
  return (_jsx(Text, { selectable: false, accessibilityElementsHidden: true, importantForAccessibility: "no", style: [
9
16
  {
10
17
  fontFamily: FONT_FAMILY,
@@ -22,6 +29,7 @@ export function Icon({ name, size = 20, color = '#374151', style }) {
22
29
  textTransform: 'none',
23
30
  textDecorationLine: 'none',
24
31
  },
32
+ variationStyle,
25
33
  style,
26
34
  ], children: name }));
27
35
  }
@@ -1 +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"}
1
+ {"version":3,"file":"Icon.js","sourceRoot":"","sources":["../../../src/components/Icon/Icon.tsx"],"names":[],"mappings":";AAwBA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAkC,MAAM,cAAc,CAAC;AAqB9E,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC;IAClC,GAAG,EAAE,yCAAyC;IAC9C,OAAO,EAAE,yBAAyB;CACnC,CAAC,CAAC;AAEH,MAAM,UAAU,IAAI,CAAC,EACnB,IAAI,EACJ,IAAI,GAAG,EAAE,EACT,KAAK,GAAG,SAAS,EACjB,IAAI,GAAG,KAAK,EACZ,MAAM,GAAG,GAAG,EACZ,KAAK,GAAG,CAAC,EACT,WAAW,EACX,KAAK,GACK;IACV,kFAAkF;IAClF,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,WAAW,IAAI,IAAI,CAAC,CAAC,CAAC;IAC7D,MAAM,cAAc,GAClB,QAAQ,CAAC,EAAE,KAAK,KAAK;QACnB,CAAC,CAAE;YACC,qBAAqB,EAAE,UAAU,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,MAAM,YAAY,KAAK,YAAY,IAAI,EAAE;SAC1E;QAC5B,CAAC,CAAC,IAAI,CAAC;IAEX,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,cAAc;YACd,KAAK;SACN,YAEA,IAAI,GACA,CACR,CAAC;AACJ,CAAC"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Input — single-line text field with label and helper/error text.
3
+ *
4
+ * Maps to the Figma <Input> component (node 307:3476):
5
+ * size → small | default | large
6
+ * state → default | hover | focus | error | disabled
7
+ *
8
+ * `error` and `disabled` are props; `hover` and `focus` are interaction-driven.
9
+ * Field spacing comes from the density theme's `input` tokens (shared with the
10
+ * Select trigger). Colours come from the semantic intent system (neutral):
11
+ * default → neutral/default/default hover → neutral/default/hover
12
+ * focus → focus-ring border (2px) error → danger border + red helper
13
+ * disabled→ shared disabled colours
14
+ * Label uses the label scale, the value/placeholder the body scale (both
15
+ * matched to size); helper text uses the caption scale.
16
+ */
17
+ import React from 'react';
18
+ import { type ViewStyle, type StyleProp, type KeyboardTypeOptions, type ReturnKeyTypeOptions } from 'react-native';
19
+ export type InputSize = 'small' | 'default' | 'large';
20
+ export type InputProps = {
21
+ /** Form label above the field. */
22
+ label?: string;
23
+ /** Helper text below the field — turns red when `error` is set. */
24
+ helperText?: string;
25
+ /** Placeholder shown when the field is empty. */
26
+ placeholder?: string;
27
+ /** Controlled value. */
28
+ value?: string;
29
+ /** Uncontrolled initial value. */
30
+ defaultValue?: string;
31
+ /** Change handler — receives the new text. */
32
+ onChangeText?: (text: string) => void;
33
+ /** Size variant — controls padding, gap, and typography scale. */
34
+ size?: InputSize;
35
+ /** Error state — danger border and red helper text. */
36
+ error?: boolean;
37
+ /** Disables interaction and applies muted styling. */
38
+ disabled?: boolean;
39
+ /** Leading icon — Material Symbols name string or a ReactNode. */
40
+ leadingIcon?: string | React.ReactNode;
41
+ /** Trailing icon — Material Symbols name string or a ReactNode. */
42
+ trailingIcon?: string | React.ReactNode;
43
+ /** Masks the text (passwords). */
44
+ secureTextEntry?: boolean;
45
+ /** Keyboard type for native platforms. */
46
+ keyboardType?: KeyboardTypeOptions;
47
+ /** Auto-capitalisation behaviour. */
48
+ autoCapitalize?: 'none' | 'sentences' | 'words' | 'characters';
49
+ /** Return key label for native platforms. */
50
+ returnKeyType?: ReturnKeyTypeOptions;
51
+ /** Submit (return key) handler. */
52
+ onSubmitEditing?: () => void;
53
+ /** Focus handler. */
54
+ onFocus?: () => void;
55
+ /** Blur handler. */
56
+ onBlur?: () => void;
57
+ /** Style override for the outer container. */
58
+ style?: StyleProp<ViewStyle>;
59
+ /** Accessibility label — falls back to the label prop. */
60
+ accessibilityLabel?: string;
61
+ };
62
+ export declare function Input({ label: formLabel, helperText, placeholder, value, defaultValue, onChangeText, size, error, disabled, leadingIcon, trailingIcon, secureTextEntry, keyboardType, autoCapitalize, returnKeyType, onSubmitEditing, onFocus, onBlur, style, accessibilityLabel, }: InputProps): import("react/jsx-runtime").JSX.Element;
63
+ //# sourceMappingURL=Input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EAC1B,MAAM,cAAc,CAAC;AAgBtB,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;AAEtD,MAAM,MAAM,UAAU,GAAG;IACvB,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iDAAiD;IACjD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wBAAwB;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8CAA8C;IAC9C,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,kEAAkE;IAClE,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,uDAAuD;IACvD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,sDAAsD;IACtD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kEAAkE;IAClE,WAAW,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACvC,mEAAmE;IACnE,YAAY,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACxC,kCAAkC;IAClC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,0CAA0C;IAC1C,YAAY,CAAC,EAAE,mBAAmB,CAAC;IACnC,qCAAqC;IACrC,cAAc,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,OAAO,GAAG,YAAY,CAAC;IAC/D,6CAA6C;IAC7C,aAAa,CAAC,EAAE,oBAAoB,CAAC;IACrC,mCAAmC;IACnC,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,qBAAqB;IACrB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,oBAAoB;IACpB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,0DAA0D;IAC1D,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AA0BF,wBAAgB,KAAK,CAAC,EACpB,KAAK,EAAE,SAAS,EAChB,UAAU,EACV,WAAW,EACX,KAAK,EACL,YAAY,EACZ,YAAY,EACZ,IAAgB,EAChB,KAAa,EACb,QAAgB,EAChB,WAAW,EACX,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,cAAc,EACd,aAAa,EACb,eAAe,EACf,OAAO,EACP,MAAM,EACN,KAAK,EACL,kBAAkB,GACnB,EAAE,UAAU,2CA8KZ"}
@@ -0,0 +1,139 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * Input — single-line text field with label and helper/error text.
4
+ *
5
+ * Maps to the Figma <Input> component (node 307:3476):
6
+ * size → small | default | large
7
+ * state → default | hover | focus | error | disabled
8
+ *
9
+ * `error` and `disabled` are props; `hover` and `focus` are interaction-driven.
10
+ * Field spacing comes from the density theme's `input` tokens (shared with the
11
+ * Select trigger). Colours come from the semantic intent system (neutral):
12
+ * default → neutral/default/default hover → neutral/default/hover
13
+ * focus → focus-ring border (2px) error → danger border + red helper
14
+ * disabled→ shared disabled colours
15
+ * Label uses the label scale, the value/placeholder the body scale (both
16
+ * matched to size); helper text uses the caption scale.
17
+ */
18
+ import { useState } from 'react';
19
+ import { View, Text, TextInput, Platform, } from 'react-native';
20
+ import { useTheme } from '../../theme';
21
+ import { Icon } from '../Icon';
22
+ import { fontFamily, fontWeight, label, body, caption, controlTokens, } from '../../tokens';
23
+ // ---------------------------------------------------------------------------
24
+ // Constants
25
+ // ---------------------------------------------------------------------------
26
+ const ICON_SIZE = 16;
27
+ /** Maps input size → label typography scale (form label text) */
28
+ const LABEL_SCALE = {
29
+ small: 'sm',
30
+ default: 'md',
31
+ large: 'lg',
32
+ };
33
+ /** Maps input size → body typography scale (value + placeholder text) */
34
+ const BODY_SCALE = {
35
+ small: 'sm',
36
+ default: 'md',
37
+ large: 'lg',
38
+ };
39
+ // ---------------------------------------------------------------------------
40
+ // Component
41
+ // ---------------------------------------------------------------------------
42
+ export function Input({ label: formLabel, helperText, placeholder, value, defaultValue, onChangeText, size = 'default', error = false, disabled = false, leadingIcon, trailingIcon, secureTextEntry, keyboardType, autoCapitalize, returnKeyType, onSubmitEditing, onFocus, onBlur, style, accessibilityLabel, }) {
43
+ const { components, scheme } = useTheme();
44
+ const sizeTokens = components.input[size];
45
+ const labelTypo = label[LABEL_SCALE[size]];
46
+ const bodyTypo = body[BODY_SCALE[size]];
47
+ const [isHovered, setIsHovered] = useState(false);
48
+ const [isFocused, setIsFocused] = useState(false);
49
+ const disabledColors = scheme.disabled;
50
+ const errorTokens = scheme.error;
51
+ const textTokens = scheme.text;
52
+ const neutral = scheme.intents.neutral.default;
53
+ // Resolve field colours — state priority: disabled > error > focus > hover > default
54
+ let bg;
55
+ let borderColor;
56
+ let borderWidth;
57
+ if (disabled) {
58
+ bg = disabledColors.bg;
59
+ borderColor = disabledColors.border;
60
+ borderWidth = controlTokens.borderWidth;
61
+ }
62
+ else if (isFocused) {
63
+ bg = neutral.default.bg;
64
+ borderColor = scheme.focusRing.color;
65
+ borderWidth = controlTokens.focusRingWidth;
66
+ }
67
+ else if (error) {
68
+ bg = neutral.default.bg;
69
+ borderColor = errorTokens.border;
70
+ borderWidth = controlTokens.borderWidth;
71
+ }
72
+ else if (isHovered) {
73
+ bg = neutral.hover.bg;
74
+ borderColor = neutral.hover.border;
75
+ borderWidth = controlTokens.borderWidth;
76
+ }
77
+ else {
78
+ bg = neutral.default.bg;
79
+ borderColor = neutral.default.border;
80
+ borderWidth = controlTokens.borderWidth;
81
+ }
82
+ const textColor = disabled ? disabledColors.fg : neutral.default.fg;
83
+ const labelColor = disabled ? disabledColors.fg : neutral.default.fg;
84
+ const helperColor = disabled
85
+ ? disabledColors.fg
86
+ : error
87
+ ? errorTokens.fg
88
+ : textTokens.description;
89
+ const iconColor = disabled ? disabledColors.fg : neutral.default.fg;
90
+ const resolvedLeading = typeof leadingIcon === 'string' ? (_jsx(Icon, { name: leadingIcon, size: ICON_SIZE, color: iconColor })) : (leadingIcon);
91
+ const resolvedTrailing = typeof trailingIcon === 'string' ? (_jsx(Icon, { name: trailingIcon, size: ICON_SIZE, color: iconColor })) : (trailingIcon);
92
+ return (_jsxs(View, { style: [
93
+ { alignSelf: 'stretch', gap: components.input.fieldGap },
94
+ style,
95
+ ], children: [formLabel ? (_jsx(Text, { style: {
96
+ fontFamily: fontFamily.sans,
97
+ fontWeight: fontWeight.medium,
98
+ fontSize: labelTypo.fontSize,
99
+ lineHeight: labelTypo.lineHeight,
100
+ letterSpacing: labelTypo.letterSpacing,
101
+ color: labelColor,
102
+ }, selectable: false, children: formLabel })) : null, _jsxs(View, { onPointerEnter: disabled ? undefined : () => setIsHovered(true), onPointerLeave: disabled ? undefined : () => setIsHovered(false), style: {
103
+ flexDirection: 'row',
104
+ alignItems: 'center',
105
+ gap: sizeTokens.gap,
106
+ paddingHorizontal: sizeTokens.paddingX,
107
+ paddingVertical: sizeTokens.paddingY,
108
+ borderRadius: sizeTokens.borderRadius,
109
+ borderWidth,
110
+ borderColor,
111
+ backgroundColor: bg,
112
+ }, children: [resolvedLeading ? (_jsx(View, { accessibilityElementsHidden: true, importantForAccessibility: "no", style: { width: ICON_SIZE, height: ICON_SIZE }, children: resolvedLeading })) : null, _jsx(TextInput, { value: value, defaultValue: defaultValue, onChangeText: onChangeText, placeholder: placeholder, placeholderTextColor: textTokens.placeholder, editable: !disabled, secureTextEntry: secureTextEntry, keyboardType: keyboardType, autoCapitalize: autoCapitalize, returnKeyType: returnKeyType, onSubmitEditing: onSubmitEditing, onFocus: () => {
113
+ setIsFocused(true);
114
+ onFocus?.();
115
+ }, onBlur: () => {
116
+ setIsFocused(false);
117
+ onBlur?.();
118
+ }, accessibilityLabel: accessibilityLabel || formLabel, style: {
119
+ flex: 1,
120
+ fontFamily: fontFamily.sans,
121
+ fontWeight: fontWeight.regular,
122
+ fontSize: bodyTypo.fontSize,
123
+ lineHeight: bodyTypo.lineHeight,
124
+ letterSpacing: bodyTypo.letterSpacing,
125
+ color: textColor,
126
+ padding: 0,
127
+ ...(Platform.OS === 'web'
128
+ ? { outlineWidth: 0 }
129
+ : {}),
130
+ } }), resolvedTrailing ? (_jsx(View, { accessibilityElementsHidden: true, importantForAccessibility: "no", style: { width: ICON_SIZE, height: ICON_SIZE }, children: resolvedTrailing })) : null] }), helperText ? (_jsx(Text, { style: {
131
+ fontFamily: fontFamily.sans,
132
+ fontWeight: fontWeight.regular,
133
+ fontSize: caption.fontSize,
134
+ lineHeight: caption.lineHeight,
135
+ letterSpacing: caption.letterSpacing,
136
+ color: helperColor,
137
+ }, selectable: false, children: helperText })) : null] }));
138
+ }
139
+ //# sourceMappingURL=Input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Input.js","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,Q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;oBAC1B,UAAU,EAAE,OAAO,CAAC,UAAU;oBAC9B,aAAa,EAAE,OAAO,CAAC,aAAa;oBACpC,KAAK,EAAE,WAAW;iBACnB,EACD,UAAU,EAAE,KAAK,YAEhB,UAAU,GACN,CACR,CAAC,CAAC,CAAC,IAAI,IACH,CACR,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { Input, type InputProps, type InputSize } from './Input';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Input/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { Input } from './Input';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Input/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAmC,MAAM,SAAS,CAAC"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * List — vertical collection of items with optional section subheaders.
3
+ *
4
+ * Maps to the Figma <List> component (node 452:3401):
5
+ * List — the container surface (white bg, 1px section gap)
6
+ * ListSubheader — muted caption label for a section ("Inbox", "Labels")
7
+ * ListItem — icon + label + optional description, with
8
+ * default / selected / disabled states
9
+ * ListDivider — horizontal rule between sections
10
+ *
11
+ * Density (compact/default/comfortable) drives item padding, gap, and
12
+ * icon size via the theme's `list` tokens. Colours come from the theme's
13
+ * colour scheme (`scheme.list`, constant across densities).
14
+ */
15
+ import React from 'react';
16
+ import { type ViewStyle, type StyleProp, type GestureResponderEvent } from 'react-native';
17
+ export type ListProps = {
18
+ /** ListItem / ListSubheader / ListDivider children. */
19
+ children: React.ReactNode;
20
+ /** Style override for the outer container. */
21
+ style?: StyleProp<ViewStyle>;
22
+ /** Accessibility label for the list region. */
23
+ accessibilityLabel?: string;
24
+ };
25
+ export declare function List({ children, style, accessibilityLabel }: ListProps): import("react/jsx-runtime").JSX.Element;
26
+ export type ListSubheaderProps = {
27
+ /** Subheader label text. */
28
+ children: string;
29
+ /** Style override. */
30
+ style?: StyleProp<ViewStyle>;
31
+ };
32
+ export declare function ListSubheader({ children, style }: ListSubheaderProps): import("react/jsx-runtime").JSX.Element;
33
+ export type ListDividerProps = {
34
+ /** Style override for the divider line. */
35
+ style?: StyleProp<ViewStyle>;
36
+ };
37
+ export declare function ListDivider({ style }: ListDividerProps): import("react/jsx-runtime").JSX.Element;
38
+ export type ListItemProps = {
39
+ /** Primary label text. */
40
+ children: string;
41
+ /** Supporting description text below the label. */
42
+ description?: string;
43
+ /** Leading icon — Material Symbols name string or a ReactNode. */
44
+ icon?: string | React.ReactNode;
45
+ /** Trailing icon — Material Symbols name string or a ReactNode. */
46
+ trailingIcon?: string | React.ReactNode;
47
+ /** Marks the item as selected (highlighted). */
48
+ selected?: boolean;
49
+ /** Disables interaction and applies muted styling. */
50
+ disabled?: boolean;
51
+ /** Press handler. */
52
+ onPress?: (e: GestureResponderEvent) => void;
53
+ /** Style override for the item row. */
54
+ style?: StyleProp<ViewStyle>;
55
+ /** Accessibility label — falls back to the label text. */
56
+ accessibilityLabel?: string;
57
+ };
58
+ export declare function ListItem({ children, description, icon, trailingIcon, selected, disabled, onPress, style, accessibilityLabel, }: ListItemProps): import("react/jsx-runtime").JSX.Element;
59
+ //# sourceMappingURL=List.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../../src/components/List/List.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,qBAAqB,EAC3B,MAAM,cAAc,CAAC;AAetB,MAAM,MAAM,SAAS,GAAG;IACtB,uDAAuD;IACvD,QAAQ,EAAE,K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0D;IAC1D,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,wBAAgB,QAAQ,CAAC,EACvB,QAAQ,EACR,WAAW,EACX,IAAI,EACJ,YAAY,EACZ,QAAgB,EAChB,QAAgB,EAChB,OAAO,EACP,KAAK,EACL,kBAAkB,GACnB,EAAE,aAAa,2CA2Gf"}
@@ -0,0 +1,111 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * List — vertical collection of items with optional section subheaders.
4
+ *
5
+ * Maps to the Figma <List> component (node 452:3401):
6
+ * List — the container surface (white bg, 1px section gap)
7
+ * ListSubheader — muted caption label for a section ("Inbox", "Labels")
8
+ * ListItem — icon + label + optional description, with
9
+ * default / selected / disabled states
10
+ * ListDivider — horizontal rule between sections
11
+ *
12
+ * Density (compact/default/comfortable) drives item padding, gap, and
13
+ * icon size via the theme's `list` tokens. Colours come from the theme's
14
+ * colour scheme (`scheme.list`, constant across densities).
15
+ */
16
+ import { useState } from 'react';
17
+ import { Pressable, View, Text, } from 'react-native';
18
+ import { useTheme } from '../../theme';
19
+ import { Icon } from '../Icon';
20
+ import { fontFamily, fontWeight, label, body, caption, } from '../../tokens';
21
+ export function List({ children, style, accessibilityLabel }) {
22
+ const { components, scheme } = useTheme();
23
+ const listColors = scheme.list;
24
+ const tokens = components.list;
25
+ return (_jsx(View, { accessibilityRole: "list", accessibilityLabel: accessibilityLabel, style: [
26
+ {
27
+ backgroundColor: listColors.containerBg,
28
+ gap: tokens.sectionGap,
29
+ alignSelf: 'stretch',
30
+ },
31
+ style,
32
+ ], children: children }));
33
+ }
34
+ export function ListSubheader({ children, style }) {
35
+ const { components, scheme } = useTheme();
36
+ const listColors = scheme.list;
37
+ const tokens = components.list.subheader;
38
+ return (_jsx(View, { style: [
39
+ {
40
+ paddingHorizontal: tokens.paddingX,
41
+ paddingVertical: tokens.paddingY,
42
+ },
43
+ style,
44
+ ], children: _jsx(Text, { style: {
45
+ fontFamily: fontFamily.sans,
46
+ fontWeight: fontWeight.regular,
47
+ fontSize: caption.fontSize,
48
+ lineHeight: caption.lineHeight,
49
+ letterSpacing: caption.letterSpacing,
50
+ color: listColors.subheaderFg,
51
+ }, selectable: false, children: children }) }));
52
+ }
53
+ export function ListDivider({ style }) {
54
+ const { scheme } = useTheme();
55
+ const listColors = scheme.list;
56
+ return (_jsx(View, { accessibilityRole: "none", style: [
57
+ {
58
+ height: 1,
59
+ backgroundColor: listColors.separator,
60
+ },
61
+ style,
62
+ ] }));
63
+ }
64
+ export function ListItem({ children, description, icon, trailingIcon, selected = false, disabled = false, onPress, style, accessibilityLabel, }) {
65
+ const { components, scheme } = useTheme();
66
+ const listColors = scheme.list;
67
+ const tokens = components.list.item;
68
+ const [isHovered, setIsHovered] = useState(false);
69
+ // State priority: disabled > selected+hover > selected > hover > default
70
+ const colors = disabled
71
+ ? listColors.item.disabled
72
+ : selected && isHovered
73
+ ? listColors.item.selectedHover
74
+ : selected
75
+ ? listColors.item.selected
76
+ : isHovered
77
+ ? listColors.item.hover
78
+ : listColors.item.default;
79
+ const resolvedIcon = typeof icon === 'string' ? (_jsx(Icon, { name: icon, size: tokens.iconSize, color: colors.fg })) : (icon);
80
+ const resolvedTrailing = typeof trailingIcon === 'string' ? (_jsx(Icon, { name: trailingIcon, size: tokens.iconSize, color: colors.fg })) : (trailingIcon);
81
+ return (_jsxs(Pressable, { onPress: (e) => {
82
+ if (!disabled)
83
+ onPress?.(e);
84
+ }, onHoverIn: () => setIsHovered(true), onHoverOut: () => setIsHovered(false), disabled: disabled || !onPress, accessibilityRole: "menuitem", accessibilityLabel: accessibilityLabel || children, accessibilityState: { selected, disabled }, style: [
85
+ {
86
+ flexDirection: 'row',
87
+ alignItems: 'flex-start',
88
+ gap: tokens.gap,
89
+ paddingHorizontal: tokens.paddingX,
90
+ paddingVertical: tokens.paddingY,
91
+ borderRadius: tokens.borderRadius,
92
+ backgroundColor: colors.bg,
93
+ },
94
+ style,
95
+ ], children: [resolvedIcon ? (_jsx(View, { accessibilityElementsHidden: true, importantForAccessibility: "no", style: { width: tokens.iconSize, height: tokens.iconSize }, children: resolvedIcon })) : null, _jsxs(View, { style: { flex: 1, justifyContent: 'center' }, children: [_jsx(Text, { style: {
96
+ fontFamily: fontFamily.sans,
97
+ fontWeight: fontWeight.medium,
98
+ fontSize: label.md.fontSize,
99
+ lineHeight: label.md.lineHeight,
100
+ letterSpacing: label.md.letterSpacing,
101
+ color: colors.fg,
102
+ }, selectable: false, children: children }), description ? (_jsx(Text, { style: {
103
+ fontFamily: fontFamily.sans,
104
+ fontWeight: fontWeight.regular,
105
+ fontSize: body.md.fontSize,
106
+ lineHeight: body.md.lineHeight,
107
+ letterSpacing: body.md.letterSpacing,
108
+ color: disabled ? colors.fg : listColors.descriptionFg,
109
+ }, selectable: false, children: description })) : null] }), resolvedTrailing ? (_jsx(View, { accessibilityElementsHidden: true, importantForAccessibility: "no", style: { width: tokens.iconSize, height: tokens.iconSize }, children: resolvedTrailing })) : null] }));
110
+ }
111
+ //# sourceMappingURL=List.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"List.js","sourceRoot":"","sources":["../../../src/components/List/List.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EACL,SAAS,EACT,IAAI,EACJ,IAAI,GAIL,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EACL,UAAU,EACV,UAAU,EACV,KAAK,EACL,IAAI,EACJ,OAAO,GACR,MAAM,cAAc,CAAC;AAetB,MAAM,UAAU,IAAI,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,kBAAkB,EAAa;IACrE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAC;IA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ListProps, type ListItemProps, type ListSubheaderProps, type ListDividerProps, } from './List';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/List/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,WAAW,EACX,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,GACtB,MAAM,QAAQ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { List, ListItem, ListSubheader, ListDivider, } from './List';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/List/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,WAAW,GAKZ,MAAM,QAAQ,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Popover — a floating surface that points at an anchor with an arrow.
3
+ *
4
+ * Maps to the Figma <Popover> component (node 307:4149):
5
+ * direction → top | bottom | left | right (the edge the arrow sits on)
6
+ * size → small | default | large (drives content padding)
7
+ *
8
+ * This is the presentational bubble only: it renders the overlay surface
9
+ * (white background, 8px radius, shadow/md) with a directional arrow and your
10
+ * `children` inside. Positioning relative to a trigger is the caller's job —
11
+ * wrap it in a positioned container or pass a `style` with absolute coords.
12
+ *
13
+ * Padding comes from the `popover` density theme (size × density); the radius
14
+ * and arrow size are constant across densities.
15
+ */
16
+ import React from 'react';
17
+ import { type ViewStyle, type StyleProp } from 'react-native';
18
+ export type PopoverSize = 'small' | 'default' | 'large';
19
+ export type PopoverDirection = 'top' | 'bottom' | 'left' | 'right';
20
+ export type PopoverProps = {
21
+ /** Content rendered inside the bubble. */
22
+ children: React.ReactNode;
23
+ /** The edge the arrow sits on (points away from the bubble). */
24
+ direction?: PopoverDirection;
25
+ /** Size variant — controls content padding. */
26
+ size?: PopoverSize;
27
+ /** Hide the directional arrow. */
28
+ hideArrow?: boolean;
29
+ /** Outer style — use for positioning (absolute coords, margin, width). */
30
+ style?: StyleProp<ViewStyle>;
31
+ /** Accessibility label for the popover surface. */
32
+ accessibilityLabel?: string;
33
+ };
34
+ export declare function Popover({ children, direction, size, hideArrow, style, accessibilityLabel, }: PopoverProps): import("react/jsx-runtime").JSX.Element;
35
+ //# sourceMappingURL=Popover.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Popover.d.ts","sourceRoot":"","sources":["../../../src/components/Popover/Popover.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAOtB,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;AACxD,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAEnE,MAAM,MAAM,YAAY,GAAG;IACzB,0CAA0C;IAC1C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,gEAAgE;IAChE,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,+CAA+C;IAC/C,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,kCAAkC;IAClC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,0EAA0E;IAC1E,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,mDAAmD;IACnD,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAmDF,wBAAgB,OAAO,CAAC,EACtB,QAAQ,EACR,SAAoB,EACpB,IAAgB,EAChB,SAAiB,EACjB,KAAK,EACL,kBAAkB,GACnB,EAAE,YAAY,2CA8Bd"}
@@ -0,0 +1,60 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { View, Platform, } from 'react-native';
3
+ import { useTheme } from '../../theme';
4
+ // ---------------------------------------------------------------------------
5
+ // Constants
6
+ // ---------------------------------------------------------------------------
7
+ /** shadow/md — overlay drop shadow (two stacked layers). */
8
+ const SHADOW_WEB = {
9
+ boxShadow: '0px 4px 6px -1px rgba(0,0,0,0.07), 0px 2px 4px -2px rgba(0,0,0,0.05)',
10
+ };
11
+ const SHADOW_NATIVE = {
12
+ shadowColor: '#000000',
13
+ shadowOffset: { width: 0, height: 4 },
14
+ shadowOpacity: 0.07,
15
+ shadowRadius: 6,
16
+ elevation: 4,
17
+ };
18
+ const SHADOW = Platform.OS === 'web' ? SHADOW_WEB : SHADOW_NATIVE;
19
+ // ---------------------------------------------------------------------------
20
+ // Component
21
+ // ---------------------------------------------------------------------------
22
+ /** Positions the rotated-square arrow on the requested edge, centred. */
23
+ function arrowStyle(direction, arrowSize, backgroundColor) {
24
+ const half = arrowSize / 2;
25
+ const base = {
26
+ position: 'absolute',
27
+ width: arrowSize,
28
+ height: arrowSize,
29
+ backgroundColor,
30
+ transform: [{ rotate: '45deg' }],
31
+ };
32
+ switch (direction) {
33
+ case 'top':
34
+ return { ...base, top: -half, left: '50%', marginLeft: -half };
35
+ case 'left':
36
+ return { ...base, left: -half, top: '50%', marginTop: -half };
37
+ case 'right':
38
+ return { ...base, right: -half, top: '50%', marginTop: -half };
39
+ case 'bottom':
40
+ default:
41
+ return { ...base, bottom: -half, left: '50%', marginLeft: -half };
42
+ }
43
+ }
44
+ export function Popover({ children, direction = 'bottom', size = 'default', hideArrow = false, style, accessibilityLabel, }) {
45
+ const { components, scheme } = useTheme();
46
+ const surfaceTokens = scheme.surface;
47
+ const tokens = components.popover;
48
+ const sizeTokens = tokens[size];
49
+ return (_jsxs(View, { accessibilityLabel: accessibilityLabel, style: [
50
+ {
51
+ alignSelf: 'flex-start',
52
+ backgroundColor: surfaceTokens.overlay.bg,
53
+ borderRadius: tokens.borderRadius,
54
+ padding: sizeTokens.padding,
55
+ ...SHADOW,
56
+ },
57
+ style,
58
+ ], children: [!hideArrow ? (_jsx(View, { accessibilityElementsHidden: true, importantForAccessibility: "no", style: arrowStyle(direction, tokens.arrowSize, surfaceTokens.overlay.bg) })) : null, children] }));
59
+ }
60
+ //# sourceMappingURL=Popover.js.map