@impulse-ui-native/primitives 3.0.0 → 5.0.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 (90) hide show
  1. package/README.md +63 -21
  2. package/dist/components/atoms/avatar.d.mts +1 -1
  3. package/dist/components/atoms/avatar.js +14 -30
  4. package/dist/components/atoms/avatar.js.map +1 -1
  5. package/dist/components/atoms/badge/root.d.mts +1 -1
  6. package/dist/components/atoms/badge/root.js +25 -38
  7. package/dist/components/atoms/badge/root.js.map +1 -1
  8. package/dist/components/atoms/button.d.mts +1 -1
  9. package/dist/components/atoms/button.js +22 -31
  10. package/dist/components/atoms/button.js.map +1 -1
  11. package/dist/components/atoms/circular-progress.js +2 -2
  12. package/dist/components/atoms/circular-progress.js.map +1 -1
  13. package/dist/components/atoms/divider.d.mts +1 -1
  14. package/dist/components/atoms/divider.js +18 -14
  15. package/dist/components/atoms/divider.js.map +1 -1
  16. package/dist/components/atoms/icon-button.d.mts +1 -1
  17. package/dist/components/atoms/icon-button.js +18 -22
  18. package/dist/components/atoms/icon-button.js.map +1 -1
  19. package/dist/components/atoms/progress.d.mts +1 -1
  20. package/dist/components/atoms/progress.js +0 -28
  21. package/dist/components/atoms/progress.js.map +1 -1
  22. package/dist/components/atoms/spinner.d.mts +1 -1
  23. package/dist/components/atoms/spinner.js +8 -29
  24. package/dist/components/atoms/spinner.js.map +1 -1
  25. package/dist/components/atoms/tag.js +9 -5
  26. package/dist/components/atoms/tag.js.map +1 -1
  27. package/dist/components/atoms/typography.js +25 -1
  28. package/dist/components/atoms/typography.js.map +1 -1
  29. package/dist/components/card/card.d.mts +1 -1
  30. package/dist/components/card/pressable.d.mts +1 -1
  31. package/dist/components/card/pressable.js +2 -20
  32. package/dist/components/card/pressable.js.map +1 -1
  33. package/dist/components/controls/addon.js +6 -3
  34. package/dist/components/controls/addon.js.map +1 -1
  35. package/dist/components/controls/container.js +8 -4
  36. package/dist/components/controls/container.js.map +1 -1
  37. package/dist/components/controls/input.js +7 -5
  38. package/dist/components/controls/input.js.map +1 -1
  39. package/dist/components/controls/label.js +9 -3
  40. package/dist/components/controls/label.js.map +1 -1
  41. package/dist/components/controls/placeholder.js +6 -3
  42. package/dist/components/controls/placeholder.js.map +1 -1
  43. package/dist/components/controls/value.js +6 -3
  44. package/dist/components/controls/value.js.map +1 -1
  45. package/dist/components/index.d.mts +2 -0
  46. package/dist/components/index.js +1 -0
  47. package/dist/components/index.js.map +1 -1
  48. package/dist/components/list/content.d.mts +11 -0
  49. package/dist/components/list/content.js +27 -0
  50. package/dist/components/list/content.js.map +1 -0
  51. package/dist/components/list/index.d.mts +8 -0
  52. package/dist/components/list/index.js +5 -0
  53. package/dist/components/list/index.js.map +1 -0
  54. package/dist/components/list/item.d.mts +11 -0
  55. package/dist/components/list/item.js +32 -0
  56. package/dist/components/list/item.js.map +1 -0
  57. package/dist/components/list/leading.d.mts +11 -0
  58. package/dist/components/list/leading.js +32 -0
  59. package/dist/components/list/leading.js.map +1 -0
  60. package/dist/components/list/list.d.mts +18 -0
  61. package/dist/components/list/list.js +18 -0
  62. package/dist/components/list/list.js.map +1 -0
  63. package/dist/components/list/pressable.d.mts +11 -0
  64. package/dist/components/list/pressable.js +37 -0
  65. package/dist/components/list/pressable.js.map +1 -0
  66. package/dist/components/list/root.d.mts +11 -0
  67. package/dist/components/list/root.js +33 -0
  68. package/dist/components/list/root.js.map +1 -0
  69. package/dist/components/list/trailing.d.mts +11 -0
  70. package/dist/components/list/trailing.js +32 -0
  71. package/dist/components/list/trailing.js.map +1 -0
  72. package/dist/hocs/create-preset.hoc.d.mts +1 -1
  73. package/dist/hocs/create-preset.hoc.js +23 -8
  74. package/dist/hocs/create-preset.hoc.js.map +1 -1
  75. package/dist/hooks/use-indeterminate-progress-animation.hook.js +3 -24
  76. package/dist/hooks/use-indeterminate-progress-animation.hook.js.map +1 -1
  77. package/dist/index.d.mts +2 -0
  78. package/dist/types/avatar.types.d.mts +3 -3
  79. package/dist/types/badge.types.d.mts +3 -3
  80. package/dist/types/button.types.d.mts +4 -3
  81. package/dist/types/control-components.types.d.mts +2 -2
  82. package/dist/types/icon-button.types.d.mts +3 -2
  83. package/dist/types/index.d.mts +1 -0
  84. package/dist/types/index.js +1 -0
  85. package/dist/types/index.js.map +1 -1
  86. package/dist/types/list.types.d.mts +21 -0
  87. package/dist/types/list.types.js +1 -0
  88. package/dist/types/list.types.js.map +1 -0
  89. package/dist/types/tag.types.d.mts +3 -3
  90. package/package.json +6 -6
package/README.md CHANGED
@@ -25,7 +25,7 @@ pnpm add react-native-safe-area-context react-native-svg
25
25
  - `Tag` labels categories, filters, and metadata, with optional press and close behavior.
26
26
  - `Badge` provides compact semantic labels with visual variants and Input-style prefix and suffix addons.
27
27
  - `Spinner` provides token-aware sizes and semantic colors for indeterminate loading states.
28
- - `Progress` provides accessible linear and circular determinate or indeterminate progress.
28
+ - `Progress` provides linear and circular determinate or indeterminate progress.
29
29
  - `Card` provides compound `Root`, `Pressable`, `Header`, `Content`, `Footer`, and `Media` surfaces.
30
30
  - `Divider` separates content horizontally or vertically with logical insets and semantic colors.
31
31
  - `Avatar` represents identity with shared visual variants, images, initials, custom fallbacks, and semantic presence status.
@@ -33,6 +33,19 @@ pnpm add react-native-safe-area-context react-native-svg
33
33
  - `createPreset` creates reusable themed typography presets.
34
34
  - Public prop types describe every primitive and control part.
35
35
 
36
+ Typography presets update their colors with the active theme:
37
+
38
+ - `Subtitle1`, `Subtitle2`, `BodySmall`, `Caption`, `Helper`, `Overline`, and
39
+ `Eyebrow` use `theme.colors.text.secondary` for supporting text.
40
+ - The other presets use `theme.colors.text.primary` for headings and main content.
41
+
42
+ `createPreset` accepts a theme-based `color` in its configuration and falls back
43
+ to `text.primary` when omitted. Explicit `color` props override the preset color;
44
+ `style.color` takes precedence over both. Use tertiary, disabled, inverse, and
45
+ feedback colors explicitly when the surrounding component or state requires them.
46
+ Preset and explicit `fontFamily` and `fontVariant` values are honored, including
47
+ monospace Code. `numeric` selects tabular numbers; style overrides apply last.
48
+
36
49
  ## Example
37
50
 
38
51
  ```tsx
@@ -48,27 +61,21 @@ import {
48
61
  Typography,
49
62
  View,
50
63
  } from "@impulse-ui-native/primitives";
64
+ import { useSpace } from "@impulse-ui-native/theme";
51
65
 
52
66
  export function ProfileSummary() {
67
+ const space = useSpace();
68
+
53
69
  return (
54
- <View gap="md" padding="lg">
70
+ <View gap={space.md} padding={space.lg}>
55
71
  <Typography.Title3>Profile</Typography.Title3>
56
- <Avatar
57
- initials="AK"
58
- status="online"
59
- variant="soft"
60
- accessibilityLabel="Alex Kim, online"
61
- />
72
+ <Avatar initials="AK" status="online" variant="soft" />
62
73
  <Tag label="Active" color="success" />
63
74
  <Badge tone="success" variant="soft">
64
75
  Active
65
76
  </Badge>
66
- <Spinner
67
- size="small"
68
- tone="secondary"
69
- accessibilityLabel="Loading profile"
70
- />
71
- <Progress value={65} accessibilityLabel="Profile completion" />
77
+ <Spinner size="small" tone="secondary" />
78
+ <Progress value={65} />
72
79
  <Card.Root>
73
80
  <Card.Header>
74
81
  <Typography.Title4>Account activity</Typography.Title4>
@@ -88,16 +95,51 @@ export function ProfileSummary() {
88
95
 
89
96
  Use the compound `Control` when building a custom field that should share the same label, addon, error, size, and variant behavior as `Input` and `Select`.
90
97
 
91
- `Button` and `IconButton` replace their content with a loading indicator when `loading` is true. Loading controls block interaction and expose their busy state to assistive technologies. Provide an `accessibilityLabel` for every `IconButton` because its icon does not supply an accessible name.
98
+ `Button` and `IconButton` replace their content with a loading indicator when `loading` is true. Loading controls block interaction until loading ends.
99
+
100
+ `Spinner` defaults to the primary theme tone and medium size. Use `tone="inverse"` on inverse surfaces, or provide `color` when the indicator must match contextual content.
92
101
 
93
- `Spinner` defaults to the primary theme tone and medium size. Use `tone="inverse"` on inverse surfaces, or provide `color` when the indicator must match contextual content. Give standalone spinners an `accessibilityLabel` that describes what is loading.
102
+ `Progress` defaults to a medium linear indicator. Provide `value` for determinate progress or omit it for an indeterminate animation. Values are clamped between `min` and `max`, defaulting to `0` and `100`.
94
103
 
95
- `Progress` defaults to a medium linear indicator. Provide `value` for determinate progress or omit it for an indeterminate animation. Values are clamped between `min` and `max`, defaulting to `0` and `100`. Indeterminate animation respects the platform reduced-motion preference. Give each progress indicator an `accessibilityLabel` describing the operation.
104
+ Use `Card.Root` for a static surface and `Card.Pressable` when the whole card has one action. Avoid placing independently pressable controls inside `Card.Pressable`; use `Card.Root` with actions in `Card.Footer` instead.
96
105
 
97
- Use `Card.Root` for a static surface and `Card.Pressable` when the whole card has one action. Pressable cards default to the `button` accessibility role; override it when another role such as `link` is more accurate and provide an accessible label. Avoid placing independently pressable controls inside `Card.Pressable`; use `Card.Root` with actions in `Card.Footer` instead.
106
+ `Divider` defaults to a subtle horizontal separator. Use logical start/end insets to preserve RTL alignment, switch to vertical orientation inside a container with a defined height, and use `color` only when the semantic tones do not fit the surrounding surface.
98
107
 
99
- `Divider` defaults to a subtle horizontal separator and exposes `role="separator"`. Use logical start/end insets to preserve RTL alignment, switch to vertical orientation inside a container with a defined height, and use `color` only when the semantic tones do not fit the surrounding surface.
108
+ `Avatar` supports `filled`, `outlined`, and `soft` display variants. It renders fallback content below its image so initials or a custom fallback remain visible while the image loads or when it fails. Avatar grouping and overflow counts are intentionally handled separately.
100
109
 
101
- `Avatar` supports the same `filled`, `outlined`, `soft`, `ghost`, and `plain` variants as the control family. It renders fallback content below its image so initials or a custom fallback remain visible while the image loads or when it fails. Provide an `accessibilityLabel` when the represented identity is meaningful, and include presence status in that label when `status` conveys useful information. Avatar grouping and overflow counts are intentionally handled separately.
110
+ Use `Badge` for compact states and metadata. It supports `filled`, `outlined`, and `soft` display variants and semantic tones. Its addons follow Input: use `PrefixIcon` or `Prefix`, `SuffixIcon` or `Suffix`, and optionally `onPressPrefix` or `onPressSuffix`. A custom component takes precedence over its corresponding icon. Use `Tag` when the whole label needs built-in press or close behavior.
111
+
112
+ ## List
113
+
114
+ List is a presentation-focused compound component, exported through primitives
115
+ and the toolkit. It uses the existing theme provider and adds no runtime peers.
116
+
117
+ ```tsx
118
+ import { Divider, List, Typography } from "@impulse-ui-native/primitives";
119
+
120
+ <List.Root>
121
+ <List.Item>
122
+ <List.Leading>{/* Icon, avatar, or custom content */}</List.Leading>
123
+ <List.Content>
124
+ <Typography.Title6>Account</Typography.Title6>
125
+ <Typography.BodySmall>Personal details</Typography.BodySmall>
126
+ </List.Content>
127
+ <List.Trailing>{/* Badge, metadata, or indicator */}</List.Trailing>
128
+ </List.Item>
129
+ <Divider inset="both" />
130
+ <List.Pressable onPress={openPreferences}>
131
+ <List.Content>
132
+ <Typography.Body>Preferences</Typography.Body>
133
+ </List.Content>
134
+ </List.Pressable>
135
+ </List.Root>;
136
+ ```
102
137
 
103
- Use `Badge` for compact states and metadata. It supports the same `filled`, `outlined`, `soft`, `ghost`, and `plain` visual variants as controls and semantic tones. Its addons follow Input: use `PrefixIcon` or `Prefix`, `SuffixIcon` or `Suffix`, and optionally `onPressPrefix` or `onPressSuffix`. A custom component takes precedence over its corresponding icon. Use `Tag` when the whole label needs built-in press or close behavior.
138
+ Root supplies the surface; Item supplies a static row; Pressable supplies the
139
+ same row layout with native press and disabled behavior. Leading and Trailing
140
+ keep custom content at its natural size while Content fills the remaining width.
141
+ All parts accept their underlying primitive props and style overrides. Use
142
+ Typography for titles and descriptions and Divider for explicit separators.
143
+ Parts may also be composed without Root for standalone rows. Selection and
144
+ indicators remain application-owned; no context, selection state, or automatic
145
+ separator insertion is included. Theme defaults live in components.list.
@@ -5,6 +5,6 @@ import 'react-native';
5
5
  import '@impulse-ui-native/theme';
6
6
  import '../../types/view.types.mjs';
7
7
 
8
- declare const Avatar: react.MemoExoticComponent<({ accessibilityLabel, accessible, fallback, imageProps, initials, role, size, source, status, statusColor, style, variant, ...props }: AvatarProps) => react_jsx_runtime.JSX.Element>;
8
+ declare const Avatar: react.MemoExoticComponent<({ fallback, imageProps, initials, size, source, status, statusColor, style, variant, ...props }: AvatarProps) => react_jsx_runtime.JSX.Element>;
9
9
 
10
10
  export { Avatar };
@@ -4,12 +4,9 @@ import { Image, StyleSheet, Text } from "react-native";
4
4
  import { useStyleProps, useThemedStyles } from "@impulse-ui-native/theme";
5
5
  import { View } from "./view";
6
6
  const Avatar = memo(function Avatar2({
7
- accessibilityLabel,
8
- accessible,
9
7
  fallback,
10
8
  imageProps,
11
9
  initials,
12
- role,
13
10
  size = "medium",
14
11
  source,
15
12
  status,
@@ -24,37 +21,25 @@ const Avatar = memo(function Avatar2({
24
21
  { size, status, statusColor, variant },
25
22
  [size, status, statusColor, variant]
26
23
  );
27
- const resolvedAccessible = accessible ?? Boolean(accessibilityLabel);
28
- const resolvedRole = role ?? (resolvedAccessible ? "img" : "none");
29
24
  const sourceKey = useMemo(() => JSON.stringify(source), [source]);
30
25
  const containerStyle = useMemo(
31
26
  () => [styles.container, extractedStyleProps, style],
32
27
  [extractedStyleProps, style, styles.container]
33
28
  );
34
- return /* @__PURE__ */ jsxs(
35
- View,
36
- {
37
- ...props,
38
- accessibilityLabel,
39
- accessible: resolvedAccessible,
40
- role: resolvedRole,
41
- style: containerStyle,
42
- children: [
43
- /* @__PURE__ */ jsxs(View, { style: styles.content, children: [
44
- fallback ?? (initials ? /* @__PURE__ */ jsx(Text, { style: styles.initials, children: initials }) : null),
45
- source ? /* @__PURE__ */ jsx(
46
- AvatarImageLayer,
47
- {
48
- imageProps,
49
- source
50
- },
51
- sourceKey
52
- ) : null
53
- ] }),
54
- status ? /* @__PURE__ */ jsx(View, { accessible: false, style: styles.status }) : null
55
- ]
56
- }
57
- );
29
+ return /* @__PURE__ */ jsxs(View, { ...props, style: containerStyle, children: [
30
+ /* @__PURE__ */ jsxs(View, { style: styles.content, children: [
31
+ fallback ?? (initials ? /* @__PURE__ */ jsx(Text, { style: styles.initials, children: initials }) : null),
32
+ source ? /* @__PURE__ */ jsx(
33
+ AvatarImageLayer,
34
+ {
35
+ imageProps,
36
+ source
37
+ },
38
+ sourceKey
39
+ ) : null
40
+ ] }),
41
+ status ? /* @__PURE__ */ jsx(View, { style: styles.status }) : null
42
+ ] });
58
43
  });
59
44
  const AvatarImageLayer = memo(function AvatarImageLayer2({
60
45
  imageProps,
@@ -78,7 +63,6 @@ const AvatarImageLayer = memo(function AvatarImageLayer2({
78
63
  {
79
64
  resizeMode: "cover",
80
65
  ...imageProps,
81
- accessible: false,
82
66
  onError: handleError,
83
67
  source,
84
68
  style: imageStyle
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/atoms/avatar.tsx"],"sourcesContent":["import type { ImageProps } from \"react-native\";\nimport { memo, useCallback, useMemo, useState } from \"react\";\nimport { Image, StyleSheet, Text } from \"react-native\";\n\nimport type { AppTheme } from \"@impulse-ui-native/theme\";\nimport { useStyleProps, useThemedStyles } from \"@impulse-ui-native/theme\";\n\nimport type { AvatarProps } from \"../../types\";\nimport { View } from \"./view\";\n\nexport const Avatar = memo(function Avatar({\n accessibilityLabel,\n accessible,\n fallback,\n imageProps,\n initials,\n role,\n size = \"medium\",\n source,\n status,\n statusColor,\n style,\n variant = \"filled\",\n ...props\n}: AvatarProps) {\n const extractedStyleProps = useStyleProps(props);\n const styles = useThemedStyles(\n themedStyles,\n { size, status, statusColor, variant },\n [size, status, statusColor, variant],\n );\n const resolvedAccessible = accessible ?? Boolean(accessibilityLabel);\n const resolvedRole = role ?? (resolvedAccessible ? \"img\" : \"none\");\n const sourceKey = useMemo(() => JSON.stringify(source), [source]);\n\n const containerStyle = useMemo(\n () => [styles.container, extractedStyleProps, style],\n [extractedStyleProps, style, styles.container],\n );\n\n return (\n <View\n {...props}\n accessibilityLabel={accessibilityLabel}\n accessible={resolvedAccessible}\n role={resolvedRole}\n style={containerStyle}\n >\n <View style={styles.content}>\n {fallback ??\n (initials ? <Text style={styles.initials}>{initials}</Text> : null)}\n\n {source ? (\n <AvatarImageLayer\n key={sourceKey}\n imageProps={imageProps}\n source={source}\n />\n ) : null}\n </View>\n\n {status ? <View accessible={false} style={styles.status} /> : null}\n </View>\n );\n});\n\ninterface AvatarImageLayerProps {\n imageProps: AvatarProps[\"imageProps\"];\n source: NonNullable<AvatarProps[\"source\"]>;\n}\n\nconst AvatarImageLayer = memo(function AvatarImageLayer({\n imageProps,\n source,\n}: AvatarImageLayerProps) {\n const [hasError, setHasError] = useState(false);\n\n const handleError = useCallback<NonNullable<ImageProps[\"onError\"]>>(\n (event) => {\n setHasError(true);\n imageProps?.onError?.(event);\n },\n [imageProps],\n );\n\n const imageStyle = useMemo(\n () => [staticStyles.image, imageProps?.style],\n [imageProps?.style],\n );\n\n if (hasError) return null;\n\n return (\n <Image\n resizeMode=\"cover\"\n {...imageProps}\n accessible={false}\n onError={handleError}\n source={source}\n style={imageStyle}\n />\n );\n});\n\ninterface AvatarThemeProps {\n size: NonNullable<AvatarProps[\"size\"]>;\n status: AvatarProps[\"status\"];\n statusColor: AvatarProps[\"statusColor\"];\n variant: NonNullable<AvatarProps[\"variant\"]>;\n}\n\nfunction themedStyles(theme: AppTheme, props: AvatarThemeProps) {\n const { size, status, statusColor, variant } = props;\n const avatarTokens = theme.components.avatar;\n const sizeTokens = avatarTokens.sizes[size];\n const variantTokens = avatarTokens.variants[variant];\n\n return StyleSheet.create({\n container: {\n flexShrink: 0,\n height: sizeTokens.size,\n position: \"relative\",\n width: sizeTokens.size,\n },\n content: {\n alignItems: \"center\",\n backgroundColor: variantTokens.backgroundColor,\n borderColor: variantTokens.borderColor,\n borderRadius: sizeTokens.size / 2,\n borderWidth: avatarTokens.borderWidth,\n height: \"100%\",\n justifyContent: \"center\",\n overflow: \"hidden\",\n width: \"100%\",\n },\n initials: {\n color: variantTokens.color,\n fontFamily: avatarTokens.fontFamily,\n fontSize: sizeTokens.fontSize,\n textAlign: \"center\",\n },\n status: {\n backgroundColor:\n statusColor ?? (status ? avatarTokens.statusColors[status] : undefined),\n borderColor: avatarTokens.statusBorderColor,\n borderRadius: sizeTokens.statusSize / 2,\n borderWidth: sizeTokens.statusBorderWidth,\n bottom: 0,\n height: sizeTokens.statusSize,\n position: \"absolute\",\n right: 0,\n width: sizeTokens.statusSize,\n },\n });\n}\n\nconst staticStyles = StyleSheet.create({\n image: {\n bottom: 0,\n height: \"100%\",\n left: 0,\n position: \"absolute\",\n right: 0,\n top: 0,\n width: \"100%\",\n },\n});\n"],"mappings":"AAgDM,SAEgB,KAFhB;AA/CN,SAAS,MAAM,aAAa,SAAS,gBAAgB;AACrD,SAAS,OAAO,YAAY,YAAY;AAGxC,SAAS,eAAe,uBAAuB;AAG/C,SAAS,YAAY;AAEd,MAAM,SAAS,KAAK,SAASA,QAAO;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV,GAAG;AACL,GAAgB;AACd,QAAM,sBAAsB,cAAc,KAAK;AAC/C,QAAM,SAAS;AAAA,IACb;AAAA,IACA,EAAE,MAAM,QAAQ,aAAa,QAAQ;AAAA,IACrC,CAAC,MAAM,QAAQ,aAAa,OAAO;AAAA,EACrC;AACA,QAAM,qBAAqB,cAAc,QAAQ,kBAAkB;AACnE,QAAM,eAAe,SAAS,qBAAqB,QAAQ;AAC3D,QAAM,YAAY,QAAQ,MAAM,KAAK,UAAU,MAAM,GAAG,CAAC,MAAM,CAAC;AAEhE,QAAM,iBAAiB;AAAA,IACrB,MAAM,CAAC,OAAO,WAAW,qBAAqB,KAAK;AAAA,IACnD,CAAC,qBAAqB,OAAO,OAAO,SAAS;AAAA,EAC/C;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA,YAAY;AAAA,MACZ,MAAM;AAAA,MACN,OAAO;AAAA,MAEP;AAAA,6BAAC,QAAK,OAAO,OAAO,SACjB;AAAA,uBACE,WAAW,oBAAC,QAAK,OAAO,OAAO,UAAW,oBAAS,IAAU;AAAA,UAE/D,SACC;AAAA,YA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gBAAgB;AAAA,MAChB,UAAU;AAAA,MACV,OAAO;AAAA,IACT;AAAA,IACA,UAAU;AAAA,MACR,OAAO,cAAc;AAAA,MACrB,YAAY,aAAa;AAAA,MACzB,UAAU,WAAW;AAAA,MACrB,WAAW;AAAA,IACb;AAAA,IACA,QAAQ;AAAA,MACN,iBACE,gBAAgB,SAAS,aAAa,aAAa,MAAM,IAAI;AAAA,MAC/D,aAAa,aAAa;AAAA,MAC1B,cAAc,WAAW,aAAa;AAAA,MACtC,aAAa,WAAW;AAAA,MACxB,QAAQ;AAAA,MACR,QAAQ,WAAW;AAAA,MACnB,UAAU;AAAA,MACV,OAAO;AAAA,MACP,OAAO,WAAW;AAAA,IACpB;AAAA,EACF,CAAC;AACH;AAEA,MAAM,eAAe,WAAW,OAAO;AAAA,EACrC,OAAO;AAAA,IACL,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,UAAU;AAAA,IACV,OAAO;AAAA,IACP,KAAK;AAAA,IACL,OAAO;AAAA,EACT;AACF,CAAC;","names":["Avatar","AvatarImageLayer"]}
1
+ {"version":3,"sources":["../../../src/components/atoms/avatar.tsx"],"sourcesContent":["import type { ImageProps } from \"react-native\";\nimport { memo, useCallback, useMemo, useState } from \"react\";\nimport { Image, StyleSheet, Text } from \"react-native\";\n\nimport type { AppTheme } from \"@impulse-ui-native/theme\";\nimport { useStyleProps, useThemedStyles } from \"@impulse-ui-native/theme\";\n\nimport type { AvatarProps } from \"../../types\";\nimport { View } from \"./view\";\n\nexport const Avatar = memo(function Avatar({\n fallback,\n imageProps,\n initials,\n size = \"medium\",\n source,\n status,\n statusColor,\n style,\n variant = \"filled\",\n ...props\n}: AvatarProps) {\n const extractedStyleProps = useStyleProps(props);\n const styles = useThemedStyles(\n themedStyles,\n { size, status, statusColor, variant },\n [size, status, statusColor, variant],\n );\n const sourceKey = useMemo(() => JSON.stringify(source), [source]);\n\n const containerStyle = useMemo(\n () => [styles.container, extractedStyleProps, style],\n [extractedStyleProps, style, styles.container],\n );\n\n return (\n <View {...props} style={containerStyle}>\n <View style={styles.content}>\n {fallback ??\n (initials ? <Text style={styles.initials}>{initials}</Text> : null)}\n\n {source ? (\n <AvatarImageLayer\n key={sourceKey}\n imageProps={imageProps}\n source={source}\n />\n ) : null}\n </View>\n\n {status ? <View style={styles.status} /> : null}\n </View>\n );\n});\n\ninterface AvatarImageLayerProps {\n imageProps: AvatarProps[\"imageProps\"];\n source: NonNullable<AvatarProps[\"source\"]>;\n}\n\nconst AvatarImageLayer = memo(function AvatarImageLayer({\n imageProps,\n source,\n}: AvatarImageLayerProps) {\n const [hasError, setHasError] = useState(false);\n\n const handleError = useCallback<NonNullable<ImageProps[\"onError\"]>>(\n (event) => {\n setHasError(true);\n imageProps?.onError?.(event);\n },\n [imageProps],\n );\n\n const imageStyle = useMemo(\n () => [staticStyles.image, imageProps?.style],\n [imageProps?.style],\n );\n\n if (hasError) return null;\n\n return (\n <Image\n resizeMode=\"cover\"\n {...imageProps}\n onError={handleError}\n source={source}\n style={imageStyle}\n />\n );\n});\n\ninterface AvatarThemeProps {\n size: NonNullable<AvatarProps[\"size\"]>;\n status: AvatarProps[\"status\"];\n statusColor: AvatarProps[\"statusColor\"];\n variant: NonNullable<AvatarProps[\"variant\"]>;\n}\n\nfunction themedStyles(theme: AppTheme, props: AvatarThemeProps) {\n const { size, status, statusColor, variant } = props;\n const avatarTokens = theme.components.avatar;\n const sizeTokens = avatarTokens.sizes[size];\n const variantTokens = avatarTokens.variants[variant];\n\n return StyleSheet.create({\n container: {\n flexShrink: 0,\n height: sizeTokens.size,\n position: \"relative\",\n width: sizeTokens.size,\n },\n content: {\n alignItems: \"center\",\n backgroundColor: variantTokens.backgroundColor,\n borderColor: variantTokens.borderColor,\n borderRadius: sizeTokens.size / 2,\n borderWidth: avatarTokens.borderWidth,\n height: \"100%\",\n justifyContent: \"center\",\n overflow: \"hidden\",\n width: \"100%\",\n },\n initials: {\n color: variantTokens.color,\n fontFamily: avatarTokens.fontFamily,\n fontSize: sizeTokens.fontSize,\n textAlign: \"center\",\n },\n status: {\n backgroundColor:\n statusColor ?? (status ? avatarTokens.statusColors[status] : undefined),\n borderColor: avatarTokens.statusBorderColor,\n borderRadius: sizeTokens.statusSize / 2,\n borderWidth: sizeTokens.statusBorderWidth,\n bottom: 0,\n height: sizeTokens.statusSize,\n position: \"absolute\",\n right: 0,\n width: sizeTokens.statusSize,\n },\n });\n}\n\nconst staticStyles = StyleSheet.create({\n image: {\n bottom: 0,\n height: \"100%\",\n left: 0,\n position: \"absolute\",\n right: 0,\n top: 0,\n width: \"100%\",\n },\n});\n"],"mappings":"AAqCM,SAEgB,KAFhB;AApCN,SAAS,MAAM,aAAa,SAAS,gBAAgB;AACrD,SAAS,OAAO,YAAY,YAAY;AAGxC,SAAS,eAAe,uBAAuB;AAG/C,SAAS,YAAY;AAEd,MAAM,SAAS,KAAK,SAASA,QAAO;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV,GAAG;AACL,GAAgB;AACd,QAAM,sBAAsB,cAAc,KAAK;AAC/C,QAAM,SAAS;AAAA,IACb;AAAA,IACA,EAAE,MAAM,QAAQ,aAAa,QAAQ;AAAA,IACrC,CAAC,MAAM,QAAQ,aAAa,OAAO;AAAA,EACrC;AACA,QAAM,YAAY,QAAQ,MAAM,KAAK,UAAU,MAAM,GAAG,CAAC,MAAM,CAAC;AAEhE,QAAM,iBAAiB;AAAA,IACrB,MAAM,CAAC,OAAO,WAAW,qBAAqB,KAAK;AAAA,IACnD,CAAC,qBAAqB,OAAO,OAAO,SAAS;AAAA,EAC/C;AAEA,SACE,qBAAC,QAAM,GAAG,OAAO,OAAO,gBACtB;AAAA,yBAAC,QAAK,OAAO,OAAO,SACjB;AAAA,mBACE,WAAW,oBAAC,QAAK,OAAO,OAAO,UAAW,oBAAS,IAAU;AAAA,MAE/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;AAAA,MACV,OAAO;AAAA,IACT;AAAA,IACA,UAAU;AAAA,MACR,OAAO,cAAc;AAAA,MACrB,YAAY,aAAa;AAAA,MACzB,UAAU,WAAW;AAAA,MACrB,WAAW;AAAA,IACb;AAAA,IACA,QAAQ;AAAA,MACN,iBACE,gBAAgB,SAAS,aAAa,aAAa,MAAM,IAAI;AAAA,MAC/D,aAAa,aAAa;AAAA,MAC1B,cAAc,WAAW,aAAa;AAAA,MACtC,aAAa,WAAW;AAAA,MACxB,QAAQ;AAAA,MACR,QAAQ,WAAW;AAAA,MACnB,UAAU;AAAA,MACV,OAAO;AAAA,MACP,OAAO,WAAW;AAAA,IACpB;AAAA,EACF,CAAC;AACH;AAEA,MAAM,eAAe,WAAW,OAAO;AAAA,EACrC,OAAO;AAAA,IACL,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,UAAU;AAAA,IACV,OAAO;AAAA,IACP,KAAK;AAAA,IACL,OAAO;AAAA,EACT;AACF,CAAC;","names":["Avatar","AvatarImageLayer"]}
@@ -9,6 +9,6 @@ import '../../../types/spinner.types.mjs';
9
9
  import '../../../types/button.types.mjs';
10
10
  import '../../../types/view.types.mjs';
11
11
 
12
- declare const BadgeRoot: react.MemoExoticComponent<({ accessible, accessibilityLabel, backgroundColor, children, color, Prefix, PrefixIcon, onPressPrefix, onPressSuffix, role, size, style, Suffix, SuffixIcon, tone, variant, ...props }: BadgeProps) => react_jsx_runtime.JSX.Element>;
12
+ declare const BadgeRoot: react.MemoExoticComponent<({ backgroundColor, children, color, Prefix, PrefixIcon, onPressPrefix, onPressSuffix, size, style, Suffix, SuffixIcon, tone, variant, ...props }: BadgeProps) => react_jsx_runtime.JSX.Element>;
13
13
 
14
14
  export { BadgeRoot };
@@ -9,8 +9,6 @@ import {
9
9
  import { View } from "../view";
10
10
  import { BadgeAddon } from "./addon";
11
11
  const BadgeRoot = memo(function BadgeRoot2({
12
- accessible,
13
- accessibilityLabel,
14
12
  backgroundColor,
15
13
  children,
16
14
  color,
@@ -18,7 +16,6 @@ const BadgeRoot = memo(function BadgeRoot2({
18
16
  PrefixIcon,
19
17
  onPressPrefix,
20
18
  onPressSuffix,
21
- role,
22
19
  size = "medium",
23
20
  style,
24
21
  Suffix,
@@ -41,41 +38,31 @@ const BadgeRoot = memo(function BadgeRoot2({
41
38
  [extractedStyleProps, style, styles.container]
42
39
  );
43
40
  const affixColor = typeof styles.label.color === "string" ? styles.label.color : void 0;
44
- return /* @__PURE__ */ jsxs(
45
- View,
46
- {
47
- ...props,
48
- accessibilityLabel,
49
- accessible: accessible ?? Boolean(accessibilityLabel),
50
- role,
51
- style: containerStyle,
52
- children: [
53
- /* @__PURE__ */ jsx(
54
- BadgeAddon,
55
- {
56
- Content: Prefix,
57
- IconComponent: PrefixIcon,
58
- color: affixColor,
59
- hitSlop: badgeTokens.addonHitSlop,
60
- iconSize: sizeTokens.iconSize,
61
- onPress: onPressPrefix
62
- }
63
- ),
64
- typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: styles.label, children }) : children,
65
- /* @__PURE__ */ jsx(
66
- BadgeAddon,
67
- {
68
- Content: Suffix,
69
- IconComponent: SuffixIcon,
70
- color: affixColor,
71
- hitSlop: badgeTokens.addonHitSlop,
72
- iconSize: sizeTokens.iconSize,
73
- onPress: onPressSuffix
74
- }
75
- )
76
- ]
77
- }
78
- );
41
+ return /* @__PURE__ */ jsxs(View, { ...props, style: containerStyle, children: [
42
+ /* @__PURE__ */ jsx(
43
+ BadgeAddon,
44
+ {
45
+ Content: Prefix,
46
+ IconComponent: PrefixIcon,
47
+ color: affixColor,
48
+ hitSlop: badgeTokens.addonHitSlop,
49
+ iconSize: sizeTokens.iconSize,
50
+ onPress: onPressPrefix
51
+ }
52
+ ),
53
+ typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: styles.label, children }) : children,
54
+ /* @__PURE__ */ jsx(
55
+ BadgeAddon,
56
+ {
57
+ Content: Suffix,
58
+ IconComponent: SuffixIcon,
59
+ color: affixColor,
60
+ hitSlop: badgeTokens.addonHitSlop,
61
+ iconSize: sizeTokens.iconSize,
62
+ onPress: onPressSuffix
63
+ }
64
+ )
65
+ ] });
79
66
  });
80
67
  function themedStyles(theme, props) {
81
68
  const { backgroundColor, color, size, tone, variant } = props;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/badge/root.tsx"],"sourcesContent":["import { memo, useMemo } from \"react\";\nimport { StyleSheet, Text } from \"react-native\";\n\nimport type { AppTheme } from \"@impulse-ui-native/theme\";\nimport {\n useComponentsTokens,\n useStyleProps,\n useThemedStyles,\n} from \"@impulse-ui-native/theme\";\n\nimport type { BadgeProps, BadgeThemeProps } from \"../../../types\";\nimport { View } from \"../view\";\nimport { BadgeAddon } from \"./addon\";\n\nexport const BadgeRoot = memo(function BadgeRoot({\n accessible,\n accessibilityLabel,\n backgroundColor,\n children,\n color,\n Prefix,\n PrefixIcon,\n onPressPrefix,\n onPressSuffix,\n role,\n size = \"medium\",\n style,\n Suffix,\n SuffixIcon,\n tone = \"primary\",\n variant = \"filled\",\n ...props\n}: BadgeProps) {\n const tokens = useComponentsTokens();\n const badgeTokens = tokens.badge;\n const sizeTokens = badgeTokens.sizes[size];\n const extractedStyleProps = useStyleProps(props);\n const styles = useThemedStyles(\n themedStyles,\n { backgroundColor, color, size, tone, variant },\n [backgroundColor, color, size, tone, variant],\n );\n\n const containerStyle = useMemo(\n () => [styles.container, extractedStyleProps, style],\n [extractedStyleProps, style, styles.container],\n );\n const affixColor =\n typeof styles.label.color === \"string\" ? styles.label.color : undefined;\n\n return (\n <View\n {...props}\n accessibilityLabel={accessibilityLabel}\n accessible={accessible ?? Boolean(accessibilityLabel)}\n role={role}\n style={containerStyle}\n >\n <BadgeAddon\n Content={Prefix}\n IconComponent={PrefixIcon}\n color={affixColor}\n hitSlop={badgeTokens.addonHitSlop}\n iconSize={sizeTokens.iconSize}\n onPress={onPressPrefix}\n />\n\n {typeof children === \"string\" || typeof children === \"number\" ? (\n <Text numberOfLines={1} style={styles.label}>\n {children}\n </Text>\n ) : (\n children\n )}\n\n <BadgeAddon\n Content={Suffix}\n IconComponent={SuffixIcon}\n color={affixColor}\n hitSlop={badgeTokens.addonHitSlop}\n iconSize={sizeTokens.iconSize}\n onPress={onPressSuffix}\n />\n </View>\n );\n});\n\nfunction themedStyles(theme: AppTheme, props: BadgeThemeProps) {\n const { backgroundColor, color, size, tone, variant } = props;\n\n const badgeTokens = theme.components.badge;\n const sizeTokens = badgeTokens.sizes[size];\n const variantTokens = badgeTokens.colors[tone][variant];\n\n return StyleSheet.create({\n container: {\n alignItems: \"center\",\n alignSelf: \"flex-start\",\n flexDirection: \"row\",\n flexShrink: 0,\n justifyContent: \"center\",\n\n borderRadius: badgeTokens.borderRadius,\n borderWidth: badgeTokens.borderWidth,\n gap: badgeTokens.gap,\n height: sizeTokens.height,\n minWidth: sizeTokens.minWidth,\n paddingHorizontal: sizeTokens.paddingHorizontal,\n\n backgroundColor: backgroundColor ?? variantTokens.backgroundColor,\n borderColor: variantTokens.borderColor,\n },\n\n label: {\n textAlign: \"center\",\n\n fontFamily: badgeTokens.fontFamily,\n fontSize: sizeTokens.fontSize,\n lineHeight: sizeTokens.lineHeight,\n\n color: color ?? variantTokens.color,\n },\n });\n}\n"],"mappings":"AAmDI,SAOE,KAPF;AAnDJ,SAAS,MAAM,eAAe;AAC9B,SAAS,YAAY,YAAY;AAGjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAAS,YAAY;AACrB,SAAS,kBAAkB;AAEpB,MAAM,YAAY,KAAK,SAASA,WAAU;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,E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AAY,MAAM,IAAI;AACzC,QAAM,gBAAgB,YAAY,OAAO,IAAI,EAAE,OAAO;AAEtD,SAAO,WAAW,OAAO;AAAA,IACvB,WAAW;AAAA,MACT,YAAY;AAAA,MACZ,WAAW;AAAA,MACX,eAAe;AAAA,MACf,YAAY;AAAA,MACZ,gBAAgB;AAAA,MAEhB,cAAc,YAAY;AAAA,MAC1B,aAAa,YAAY;AAAA,MACzB,KAAK,YAAY;AAAA,MACjB,QAAQ,WAAW;AAAA,MACnB,UAAU,WAAW;AAAA,MACrB,mBAAmB,WAAW;AAAA,MAE9B,iBAAiB,mBAAmB,cAAc;AAAA,MAClD,aAAa,cAAc;AAAA,IAC7B;AAAA,IAEA,OAAO;AAAA,MACL,WAAW;AAAA,MAEX,YAAY,YAAY;AAAA,MACxB,UAAU,WAAW;AAAA,MACrB,YAAY,WAAW;AAAA,MAEvB,OAAO,SAAS,cAAc;AAAA,IAChC;AAAA,EACF,CAAC;AACH;","names":["BadgeRoot"]}
1
+ {"version":3,"sources":["../../../../src/components/atoms/badge/root.tsx"],"sourcesContent":["import { memo, useMemo } from \"react\";\nimport { StyleSheet, Text } from \"react-native\";\n\nimport type { AppTheme } from \"@impulse-ui-native/theme\";\nimport {\n useComponentsTokens,\n useStyleProps,\n useThemedStyles,\n} from \"@impulse-ui-native/theme\";\n\nimport type { BadgeProps, BadgeThemeProps } from \"../../../types\";\nimport { View } from \"../view\";\nimport { BadgeAddon } from \"./addon\";\n\nexport const BadgeRoot = memo(function BadgeRoot({\n backgroundColor,\n children,\n color,\n Prefix,\n PrefixIcon,\n onPressPrefix,\n onPressSuffix,\n size = \"medium\",\n style,\n Suffix,\n SuffixIcon,\n tone = \"primary\",\n variant = \"filled\",\n ...props\n}: BadgeProps) {\n const tokens = useComponentsTokens();\n const badgeTokens = tokens.badge;\n const sizeTokens = badgeTokens.sizes[size];\n const extractedStyleProps = useStyleProps(props);\n const styles = useThemedStyles(\n themedStyles,\n { backgroundColor, color, size, tone, variant },\n [backgroundColor, color, size, tone, variant],\n );\n\n const containerStyle = useMemo(\n () => [styles.container, extractedStyleProps, style],\n [extractedStyleProps, style, styles.container],\n );\n const affixColor =\n typeof styles.label.color === \"string\" ? styles.label.color : undefined;\n\n return (\n <View {...props} style={containerStyle}>\n <BadgeAddon\n Content={Prefix}\n IconComponent={PrefixIcon}\n color={affixColor}\n hitSlop={badgeTokens.addonHitSlop}\n iconSize={sizeTokens.iconSize}\n onPress={onPressPrefix}\n />\n\n {typeof children === \"string\" || typeof children === \"number\" ? (\n <Text numberOfLines={1} style={styles.label}>\n {children}\n </Text>\n ) : (\n children\n )}\n\n <BadgeAddon\n Content={Suffix}\n IconComponent={SuffixIcon}\n color={affixColor}\n hitSlop={badgeTokens.addonHitSlop}\n iconSize={sizeTokens.iconSize}\n onPress={onPressSuffix}\n />\n </View>\n );\n});\n\nfunction themedStyles(theme: AppTheme, props: BadgeThemeProps) {\n const { backgroundColor, color, size, tone, variant } = props;\n\n const badgeTokens = theme.components.badge;\n const sizeTokens = badgeTokens.sizes[size];\n const variantTokens = badgeTokens.colors[tone][variant];\n\n return StyleSheet.create({\n container: {\n alignItems: \"center\",\n alignSelf: \"flex-start\",\n flexDirection: \"row\",\n flexShrink: 0,\n justifyContent: \"center\",\n\n borderRadius: badgeTokens.borderRadius,\n borderWidth: badgeTokens.borderWidth,\n gap: badgeTokens.gap,\n height: sizeTokens.height,\n minWidth: sizeTokens.minWidth,\n paddingHorizontal: sizeTokens.paddingHorizontal,\n\n backgroundColor: backgroundColor ?? variantTokens.backgroundColor,\n borderColor: variantTokens.borderColor,\n },\n\n label: {\n textAlign: \"center\",\n\n fontFamily: badgeTokens.fontFamily,\n fontSize: sizeTokens.fontSize,\n lineHeight: sizeTokens.lineHeight,\n\n color: color ?? variantTokens.color,\n },\n });\n}\n"],"mappings":"AAgDI,SACE,KADF;AAhDJ,SAAS,MAAM,eAAe;AAC9B,SAAS,YAAY,YAAY;AAGjC;AAAA,EACE;AAAA,EACA;AAAA,E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C;AAED,SAAS,aAAa,OAAiB,OAAwB;AAC7D,QAAM,EAAE,iBAAiB,OAAO,MAAM,MAAM,QAAQ,IAAI;AAExD,QAAM,cAAc,MAAM,WAAW;AACrC,QAAM,aAAa,YAAY,MAAM,IAAI;AACzC,QAAM,gBAAgB,YAAY,OAAO,IAAI,EAAE,OAAO;AAEtD,SAAO,WAAW,OAAO;AAAA,IACvB,WAAW;AAAA,MACT,YAAY;AAAA,MACZ,WAAW;AAAA,MACX,eAAe;AAAA,MACf,YAAY;AAAA,MACZ,gBAAgB;AAAA,MAEhB,cAAc,YAAY;AAAA,MAC1B,aAAa,YAAY;AAAA,MACzB,KAAK,YAAY;AAAA,MACjB,QAAQ,WAAW;AAAA,MACnB,UAAU,WAAW;AAAA,MACrB,mBAAmB,WAAW;AAAA,MAE9B,iBAAiB,mBAAmB,cAAc;AAAA,MAClD,aAAa,cAAc;AAAA,IAC7B;AAAA,IAEA,OAAO;AAAA,MACL,WAAW;AAAA,MAEX,YAAY,YAAY;AAAA,MACxB,UAAU,WAAW;AAAA,MACrB,YAAY,WAAW;AAAA,MAEvB,OAAO,SAAS,cAAc;AAAA,IAChC;AAAA,EACF,CAAC;AACH;","names":["BadgeRoot"]}
@@ -5,6 +5,6 @@ import { ButtonProps } from '../../types/button.types.mjs';
5
5
  import 'react-native';
6
6
  import '@impulse-ui-native/theme';
7
7
 
8
- declare const Button: react.MemoExoticComponent<({ accessibilityState, size, variant, disabled, loading, children, style, ...props }: PropsWithChildren<ButtonProps>) => react_jsx_runtime.JSX.Element>;
8
+ declare const Button: react.MemoExoticComponent<({ size, variant, disabled, loading, children, style, ...props }: PropsWithChildren<ButtonProps>) => react_jsx_runtime.JSX.Element>;
9
9
 
10
10
  export { Button };
@@ -1,12 +1,14 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { memo, useMemo } from "react";
3
3
  import { StyleSheet } from "react-native";
4
- import { useThemedStyles } from "@impulse-ui-native/theme";
4
+ import {
5
+ getActionStateTokens,
6
+ useThemedStyles
7
+ } from "@impulse-ui-native/theme";
5
8
  import { Pressable } from "./pressable";
6
9
  import { Spinner } from "./spinner";
7
10
  import { Typography } from "./typography";
8
11
  const Button = memo(function Button2({
9
- accessibilityState,
10
12
  size = "medium",
11
13
  variant = "filled",
12
14
  disabled,
@@ -15,46 +17,35 @@ const Button = memo(function Button2({
15
17
  style,
16
18
  ...props
17
19
  }) {
18
- const styles = useThemedStyles(themedStyles, { size, variant, disabled }, [
19
- size,
20
- variant,
21
- disabled
22
- ]);
23
- const interactionDisabled = disabled === true || loading;
24
- const resolvedAccessibilityState = useMemo(
25
- () => ({
26
- ...accessibilityState,
27
- busy: loading,
28
- disabled: interactionDisabled
29
- }),
30
- [accessibilityState, interactionDisabled, loading]
20
+ const styles = useThemedStyles(
21
+ themedStyles,
22
+ { size, variant, disabled, loading },
23
+ [size, variant, disabled, loading]
31
24
  );
25
+ const interactionDisabled = disabled === true || loading;
32
26
  const buttonStyles = useMemo(
33
27
  () => [styles.button, style],
34
28
  [styles.button, style]
35
29
  );
36
30
  const content = useMemo(() => {
37
31
  if (loading) {
38
- return /* @__PURE__ */ jsx(Spinner, { accessible: false, color: styles.text.color, size });
32
+ return /* @__PURE__ */ jsx(Spinner, { color: styles.text.color, size });
39
33
  }
40
34
  return typeof children === "string" ? /* @__PURE__ */ jsx(Typography.Master, { style: styles.text, children }) : children;
41
35
  }, [children, loading, size, styles.text]);
42
- return /* @__PURE__ */ jsx(
43
- Pressable,
44
- {
45
- ...props,
46
- accessibilityState: resolvedAccessibilityState,
47
- disabled: interactionDisabled,
48
- style: buttonStyles,
49
- children: content
50
- }
51
- );
36
+ return /* @__PURE__ */ jsx(Pressable, { ...props, disabled: interactionDisabled, style: buttonStyles, children: content });
52
37
  });
53
38
  function themedStyles(theme, props) {
54
- const { size, variant, disabled } = props;
39
+ const { size, variant, disabled, loading } = props;
55
40
  const buttonTokens = theme.components.button;
56
41
  const sizeTokens = buttonTokens.sizes[size];
57
- const variantTokens = buttonTokens.variants[variant];
42
+ const appearanceTokens = getActionStateTokens(
43
+ buttonTokens.variants[variant],
44
+ {
45
+ disabled,
46
+ loading
47
+ }
48
+ );
58
49
  return StyleSheet.create({
59
50
  button: {
60
51
  alignItems: "center",
@@ -64,14 +55,14 @@ function themedStyles(theme, props) {
64
55
  paddingHorizontal: sizeTokens.paddingHorizontal,
65
56
  borderWidth: buttonTokens.borderWidth,
66
57
  borderRadius: buttonTokens.borderRadius,
67
- borderColor: disabled ? variantTokens.disabledBorderColor : variantTokens.borderColor,
68
- backgroundColor: disabled ? variantTokens.disabledBackgroundColor : variantTokens.backgroundColor
58
+ borderColor: appearanceTokens.borderColor,
59
+ backgroundColor: appearanceTokens.backgroundColor
69
60
  },
70
61
  text: {
71
62
  width: "100%",
72
63
  textAlign: "center",
73
64
  fontSize: sizeTokens.fontSize,
74
- color: disabled ? variantTokens.disabledColor : variantTokens.color
65
+ color: appearanceTokens.color
75
66
  }
76
67
  });
77
68
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/atoms/button.tsx"],"sourcesContent":["import type { AccessibilityState } from \"react-native\";\nimport { memo, PropsWithChildren, useMemo } from \"react\";\nimport { StyleSheet } from \"react-native\";\n\nimport { AppTheme, useThemedStyles } from \"@impulse-ui-native/theme\";\n\nimport { ButtonProps, ButtonThemeProps } from \"../../types\";\nimport { Pressable } from \"./pressable\";\nimport { Spinner } from \"./spinner\";\nimport { Typography } from \"./typography\";\n\nexport const Button = memo(function Button({\n accessibilityState,\n size = \"medium\",\n variant = \"filled\",\n disabled,\n loading = false,\n children,\n style,\n ...props\n}: PropsWithChildren<ButtonProps>) {\n const styles = useThemedStyles(themedStyles, { size, variant, disabled }, [\n size,\n variant,\n disabled,\n ]);\n\n const interactionDisabled = disabled === true || loading;\n\n const resolvedAccessibilityState = useMemo<AccessibilityState>(\n () => ({\n ...accessibilityState,\n busy: loading,\n disabled: interactionDisabled,\n }),\n [accessibilityState, interactionDisabled, loading],\n );\n\n const buttonStyles = useMemo(\n () => [styles.button, style],\n [styles.button, style],\n );\n\n const content = useMemo(() => {\n if (loading) {\n return (\n <Spinner accessible={false} color={styles.text.color} size={size} />\n );\n }\n\n return typeof children === \"string\" ? (\n <Typography.Master style={styles.text}>{children}</Typography.Master>\n ) : (\n children\n );\n }, [children, loading, size, styles.text]);\n\n return (\n <Pressable\n {...props}\n accessibilityState={resolvedAccessibilityState}\n disabled={interactionDisabled}\n style={buttonStyles}\n >\n {content}\n </Pressable>\n );\n});\n\nfunction themedStyles(theme: AppTheme, props: ButtonThemeProps) {\n const { size, variant, disabled } = props;\n\n const buttonTokens = theme.components.button;\n const sizeTokens = buttonTokens.sizes[size];\n const variantTokens = buttonTokens.variants[variant];\n\n return StyleSheet.create({\n button: {\n alignItems: \"center\",\n justifyContent: \"center\",\n\n height: sizeTokens.height,\n paddingVertical: sizeTokens.paddingVertical,\n paddingHorizontal: sizeTokens.paddingHorizontal,\n\n borderWidth: buttonTokens.borderWidth,\n borderRadius: buttonTokens.borderRadius,\n\n borderColor: disabled\n ? variantTokens.disabledBorderColor\n : variantTokens.borderColor,\n\n backgroundColor: disabled\n ? variantTokens.disabledBackgroundColor\n : variantTokens.backgroundColor,\n },\n\n text: {\n width: \"100%\",\n textAlign: \"center\",\n\n fontSize: sizeTokens.fontSize,\n\n color: disabled ? variantTokens.disabledColor : variantTokens.color,\n },\n });\n}\n"],"mappings":"AA8CQ;AA7CR,SAAS,MAAyB,eAAe;AACjD,SAAS,kBAAkB;AAE3B,SAAmB,uBAAuB;AAG1C,SAAS,iBAAiB;AAC1B,SAAS,eAAe;AACxB,SAAS,kBAAkB;AAEpB,MAAM,SAAS,KAAK,SAASA,QAAO;AAAA,EACzC;AAAA,EACA,OAAO;AAAA,EACP,UAAU;AAAA,EACV;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAmC;AACjC,QAAM,SAAS,gBAAgB,cAAc,EAAE,MAAM,SAAS,SAAS,GAA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WACb,cAAc,0BACd,cAAc;AAAA,IACpB;AAAA,IAEA,MAAM;AAAA,MACJ,OAAO;AAAA,MACP,WAAW;AAAA,MAEX,UAAU,WAAW;AAAA,MAErB,OAAO,WAAW,cAAc,gBAAgB,cAAc;AAAA,IAChE;AAAA,EACF,CAAC;AACH;","names":["Button"]}
1
+ {"version":3,"sources":["../../../src/components/atoms/button.tsx"],"sourcesContent":["import { memo, PropsWithChildren, useMemo } from \"react\";\nimport { StyleSheet } from \"react-native\";\n\nimport {\n AppTheme,\n getActionStateTokens,\n useThemedStyles,\n} from \"@impulse-ui-native/theme\";\n\nimport { ButtonProps, ButtonThemeProps } from \"../../types\";\nimport { Pressable } from \"./pressable\";\nimport { Spinner } from \"./spinner\";\nimport { Typography } from \"./typography\";\n\nexport const Button = memo(function Button({\n size = \"medium\",\n variant = \"filled\",\n disabled,\n loading = false,\n children,\n style,\n ...props\n}: PropsWithChildren<ButtonProps>) {\n const styles = useThemedStyles(\n themedStyles,\n { size, variant, disabled, loading },\n [size, variant, disabled, loading],\n );\n\n const interactionDisabled = disabled === true || loading;\n\n const buttonStyles = useMemo(\n () => [styles.button, style],\n [styles.button, style],\n );\n\n const content = useMemo(() => {\n if (loading) {\n return <Spinner color={styles.text.color} size={size} />;\n }\n\n return typeof children === \"string\" ? (\n <Typography.Master style={styles.text}>{children}</Typography.Master>\n ) : (\n children\n );\n }, [children, loading, size, styles.text]);\n\n return (\n <Pressable {...props} disabled={interactionDisabled} style={buttonStyles}>\n {content}\n </Pressable>\n );\n});\n\nfunction themedStyles(theme: AppTheme, props: ButtonThemeProps) {\n const { size, variant, disabled, loading } = props;\n\n const buttonTokens = theme.components.button;\n const sizeTokens = buttonTokens.sizes[size];\n const appearanceTokens = getActionStateTokens(\n buttonTokens.variants[variant],\n {\n disabled,\n loading,\n },\n );\n\n return StyleSheet.create({\n button: {\n alignItems: \"center\",\n justifyContent: \"center\",\n\n height: sizeTokens.height,\n paddingVertical: sizeTokens.paddingVertical,\n paddingHorizontal: sizeTokens.paddingHorizontal,\n\n borderWidth: buttonTokens.borderWidth,\n borderRadius: buttonTokens.borderRadius,\n\n borderColor: appearanceTokens.borderColor,\n backgroundColor: appearanceTokens.backgroundColor,\n },\n\n text: {\n width: \"100%\",\n textAlign: \"center\",\n\n fontSize: sizeTokens.fontSize,\n\n color: appearanceTokens.color,\n },\n });\n}\n"],"mappings":"AAsCa;AAtCb,SAAS,MAAyB,eAAe;AACjD,SAAS,kBAAkB;AAE3B;AAAA,EAEE;AAAA,EACA;AAAA,OACK;AAGP,SAAS,iBAAiB;AAC1B,SAAS,eAAe;AACxB,SAAS,kBAAkB;AAEpB,MAAM,SAAS,KAAK,SAASA,QAAO;AAAA,EACzC,OAAO;AAAA,EACP,UAAU;AAAA,EACV;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAmC;AACjC,QAAM,SAAS;AAAA,IACb;AAAA,IACA,EAAE,MAAM,SAAS,UAAU,QAAQ;AAAA,IACnC,CAAC,MAAM,SAAS,UAAU,OAAO;AAAA,EACnC;AAEA,QAAM,sBAAsB,aAAa,QAAQ;AAEjD,QAAM,eAAe;AAAA,IACnB,MAAM,CAAC,OAAO,QAAQ,KAAK;AAAA,IAC3B,CAAC,OAAO,QAAQ,KAAK;AAAA,EACvB;AAEA,QAAM,UAAU,QAAQ,MAAM;AAC5B,QAAI,SAAS;AACX,aAAO,oBAAC,WAAQ,OAAO,OAAO,KAAK,OAAO,MAAY;AAAA,IACxD;AAEA,WAAO,OAAO,aAAa,WACzB,oBAAC,WAAW,QAAX,EAAkB,OAAO,OAAO,MAAO,UAAS,IAEjD;AAAA,EAEJ,GAAG,CAAC,UAAU,SAAS,MAAM,OAAO,IAAI,CAAC;AAEzC,SACE,oBAAC,aAAW,GAAG,OAAO,UAAU,qBAAqB,OAAO,cACzD,mBACH;AAEJ,CAAC;AAED,SAAS,aAAa,OAAiB,OAAyB;AAC9D,QAAM,EAAE,MAAM,SAAS,UAAU,QAAQ,IAAI;AAE7C,QAAM,eAAe,MAAM,WAAW;AACtC,QAAM,aAAa,aAAa,MAAM,IAAI;AAC1C,QAAM,mBAAmB;AAAA,IACvB,aAAa,SAAS,OAAO;AAAA,IAC7B;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO;AAAA,IACvB,QAAQ;AAAA,MACN,YAAY;AAAA,MACZ,gBAAgB;AAAA,MAEhB,QAAQ,WAAW;AAAA,MACnB,iBAAiB,WAAW;AAAA,MAC5B,mBAAmB,WAAW;AAAA,MAE9B,aAAa,aAAa;AAAA,MAC1B,cAAc,aAAa;AAAA,MAE3B,aAAa,iBAAiB;AAAA,MAC9B,iBAAiB,iBAAiB;AAAA,IACpC;AAAA,IAEA,MAAM;AAAA,MACJ,OAAO;AAAA,MACP,WAAW;AAAA,MAEX,UAAU,WAAW;AAAA,MAErB,OAAO,iBAAiB;AAAA,IAC1B;AAAA,EACF,CAAC;AACH;","names":["Button"]}
@@ -52,7 +52,7 @@ const ProgressCircle = memo(function ProgressCircle2({
52
52
  () => [circumference, circumference],
53
53
  [circumference]
54
54
  );
55
- return /* @__PURE__ */ jsxs(Svg, { accessible: false, height: width, width, children: [
55
+ return /* @__PURE__ */ jsxs(Svg, { height: width, width, children: [
56
56
  /* @__PURE__ */ jsx(
57
57
  Circle,
58
58
  {
@@ -104,7 +104,7 @@ const CircularIndeterminateIndicator = memo(
104
104
  () => [circumference * 0.25, circumference * 0.75],
105
105
  [circumference]
106
106
  );
107
- return /* @__PURE__ */ jsx(Animated.View, { style: animatedStyle, children: /* @__PURE__ */ jsxs(Svg, { accessible: false, height: width, width, children: [
107
+ return /* @__PURE__ */ jsx(Animated.View, { style: animatedStyle, children: /* @__PURE__ */ jsxs(Svg, { height: width, width, children: [
108
108
  /* @__PURE__ */ jsx(
109
109
  Circle,
110
110
  {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/atoms/circular-progress.tsx"],"sourcesContent":["import type { ColorValue, ViewProps } from \"react-native\";\nimport { memo, useMemo } from \"react\";\nimport { Animated, StyleSheet, View } from \"react-native\";\nimport Svg, { Circle, G } from \"react-native-svg\";\n\nimport { useIndeterminateProgressAnimation } from \"../../hooks/use-indeterminate-progress-animation.hook\";\n\ninterface CircularProgressProps extends ViewProps {\n animationDuration: number;\n fraction: number;\n indicatorColor: ColorValue;\n indeterminate: boolean;\n strokeWidth: number;\n trackColor: ColorValue;\n width: number;\n}\n\nexport const CircularProgress = memo(function CircularProgress({\n animationDuration,\n fraction,\n indicatorColor,\n indeterminate,\n strokeWidth,\n style,\n trackColor,\n width,\n ...props\n}: CircularProgressProps) {\n const rootStyle = useMemo(\n () => [styles.root, { height: width, width }, style],\n [style, width],\n );\n\n return (\n <View {...props} style={rootStyle}>\n {indeterminate ? (\n <CircularIndeterminateIndicator\n animationDuration={animationDuration}\n color={indicatorColor}\n strokeWidth={strokeWidth}\n trackColor={trackColor}\n width={width}\n />\n ) : (\n <ProgressCircle\n color={indicatorColor}\n fraction={fraction}\n strokeWidth={strokeWidth}\n trackColor={trackColor}\n width={width}\n />\n )}\n </View>\n );\n});\n\ninterface ProgressCircleProps {\n color: ColorValue;\n fraction: number;\n strokeWidth: number;\n trackColor: ColorValue;\n width: number;\n}\n\nconst ProgressCircle = memo(function ProgressCircle({\n color,\n fraction,\n strokeWidth,\n trackColor,\n width,\n}: ProgressCircleProps) {\n const center = width / 2;\n const radius = (width - strokeWidth) / 2;\n const circumference = 2 * Math.PI * radius;\n const strokeDasharray = useMemo(\n () => [circumference, circumference],\n [circumference],\n );\n\n return (\n <Svg accessible={false} height={width} width={width}>\n <Circle\n cx={center}\n cy={center}\n fill=\"none\"\n r={radius}\n stroke={trackColor}\n strokeWidth={strokeWidth}\n />\n <G origin={`${center}, ${center}`} rotation={-90}>\n <Circle\n cx={center}\n cy={center}\n fill=\"none\"\n r={radius}\n stroke={color}\n strokeDasharray={strokeDasharray}\n strokeDashoffset={circumference * (1 - fraction)}\n strokeLinecap={fraction === 0 ? \"butt\" : \"round\"}\n strokeWidth={strokeWidth}\n />\n </G>\n </Svg>\n );\n});\n\ninterface CircularIndeterminateIndicatorProps {\n animationDuration: number;\n color: ColorValue;\n strokeWidth: number;\n trackColor: ColorValue;\n width: number;\n}\n\nconst CircularIndeterminateIndicator = memo(\n function CircularIndeterminateIndicator({\n animationDuration,\n color,\n strokeWidth,\n trackColor,\n width,\n }: CircularIndeterminateIndicatorProps) {\n const progress = useIndeterminateProgressAnimation(animationDuration);\n const rotation = progress.interpolate({\n inputRange: [0, 1],\n outputRange: [\"0deg\", \"360deg\"],\n });\n const center = width / 2;\n const radius = (width - strokeWidth) / 2;\n const circumference = 2 * Math.PI * radius;\n const animatedStyle = useMemo(\n () => ({ transform: [{ rotate: rotation }] }),\n [rotation],\n );\n const strokeDasharray = useMemo(\n () => [circumference * 0.25, circumference * 0.75],\n [circumference],\n );\n\n return (\n <Animated.View style={animatedStyle}>\n <Svg accessible={false} height={width} width={width}>\n <Circle\n cx={center}\n cy={center}\n fill=\"none\"\n r={radius}\n stroke={trackColor}\n strokeWidth={strokeWidth}\n />\n <Circle\n cx={center}\n cy={center}\n fill=\"none\"\n r={radius}\n stroke={color}\n strokeDasharray={strokeDasharray}\n strokeLinecap=\"round\"\n strokeWidth={strokeWidth}\n />\n </Svg>\n </Animated.View>\n );\n },\n);\n\nconst styles = StyleSheet.create({\n root: {\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n});\n"],"mappings":"AAoCQ,cA4CJ,YA5CI;AAnCR,SAAS,MAAM,eAAe;AAC9B,SAAS,UAAU,YAAY,YAAY;AAC3C,OAAO,OAAO,QAAQ,SAAS;AAE/B,SAAS,yCAAyC;AAY3C,MAAM,mBAAmB,KAAK,SAASA,kBAAiB;AAAA,EAC7D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAA0B;AACxB,QAAM,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SAASC,gCAA+B;AAAA,IACtC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,GAAwC;AACtC,UAAM,WAAW,kCAAkC,iBAAiB;AACpE,UAAM,WAAW,SAAS,YAAY;AAAA,MACpC,YAAY,CAAC,GAAG,CAAC;AAAA,MACjB,aAAa,CAAC,QAAQ,QAAQ;AAAA,IAChC,CAAC;AACD,UAAM,SAAS,QAAQ;AACvB,UAAM,UAAU,QAAQ,eAAe;AACvC,UAAM,gBAAgB,IAAI,KAAK,KAAK;AACpC,UAAM,gBAAgB;AAAA,MACpB,OAAO,EAAE,WAAW,CAAC,EAAE,QAAQ,SAAS,CAAC,EAAE;AAAA,MAC3C,CAAC,QAAQ;AAAA,IACX;AACA,UAAM,kBAAkB;AAAA,MACtB,MAAM,CAAC,gBAAgB,MAAM,gBAAgB,IAAI;AAAA,MACjD,CAAC,aAAa;AAAA,IAChB;AAEA,WACE,oBAAC,SAAS,MAAT,EAAc,OAAO,eACpB,+BAAC,OAAI,YAAY,OAAO,QAAQ,OAAO,OACrC;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,IAAI;AAAA,UACJ,IAAI;AAAA,UACJ,MAAK;AAAA,UACL,GAAG;AAAA,UACH,QAAQ;AAAA,UACR;AAAA;AAAA,MACF;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,IAAI;AAAA,UACJ,IAAI;AAAA,UACJ,MAAK;AAAA,UACL,GAAG;AAAA,UACH,QAAQ;AAAA,UACR;AAAA,UACA,eAAc;AAAA,UACd;AAAA;AAAA,MACF;AAAA,OACF,GACF;AAAA,EAEJ;AACF;AAEA,MAAM,SAAS,WAAW,OAAO;AAAA,EAC/B,MAAM;AAAA,IACJ,YAAY;AAAA,IACZ,gBAAgB;AAAA,EAClB;AACF,CAAC;","names":["CircularProgress","ProgressCircle","CircularIndeterminateIndicator"]}
1
+ {"version":3,"sources":["../../../src/components/atoms/circular-progress.tsx"],"sourcesContent":["import type { ColorValue, ViewProps } from \"react-native\";\nimport { memo, useMemo } from \"react\";\nimport { Animated, StyleSheet, View } from \"react-native\";\nimport Svg, { Circle, G } from \"react-native-svg\";\n\nimport { useIndeterminateProgressAnimation } from \"../../hooks/use-indeterminate-progress-animation.hook\";\n\ninterface CircularProgressProps extends ViewProps {\n animationDuration: number;\n fraction: number;\n indicatorColor: ColorValue;\n indeterminate: boolean;\n strokeWidth: number;\n trackColor: ColorValue;\n width: number;\n}\n\nexport const CircularProgress = memo(function CircularProgress({\n animationDuration,\n fraction,\n indicatorColor,\n indeterminate,\n strokeWidth,\n style,\n trackColor,\n width,\n ...props\n}: CircularProgressProps) {\n const rootStyle = useMemo(\n () => [styles.root, { height: width, width }, style],\n [style, width],\n );\n\n return (\n <View {...props} style={rootStyle}>\n {indeterminate ? (\n <CircularIndeterminateIndicator\n animationDuration={animationDuration}\n color={indicatorColor}\n strokeWidth={strokeWidth}\n trackColor={trackColor}\n width={width}\n />\n ) : (\n <ProgressCircle\n color={indicatorColor}\n fraction={fraction}\n strokeWidth={strokeWidth}\n trackColor={trackColor}\n width={width}\n />\n )}\n </View>\n );\n});\n\ninterface ProgressCircleProps {\n color: ColorValue;\n fraction: number;\n strokeWidth: number;\n trackColor: ColorValue;\n width: number;\n}\n\nconst ProgressCircle = memo(function ProgressCircle({\n color,\n fraction,\n strokeWidth,\n trackColor,\n width,\n}: ProgressCircleProps) {\n const center = width / 2;\n const radius = (width - strokeWidth) / 2;\n const circumference = 2 * Math.PI * radius;\n const strokeDasharray = useMemo(\n () => [circumference, circumference],\n [circumference],\n );\n\n return (\n <Svg height={width} width={width}>\n <Circle\n cx={center}\n cy={center}\n fill=\"none\"\n r={radius}\n stroke={trackColor}\n strokeWidth={strokeWidth}\n />\n <G origin={`${center}, ${center}`} rotation={-90}>\n <Circle\n cx={center}\n cy={center}\n fill=\"none\"\n r={radius}\n stroke={color}\n strokeDasharray={strokeDasharray}\n strokeDashoffset={circumference * (1 - fraction)}\n strokeLinecap={fraction === 0 ? \"butt\" : \"round\"}\n strokeWidth={strokeWidth}\n />\n </G>\n </Svg>\n );\n});\n\ninterface CircularIndeterminateIndicatorProps {\n animationDuration: number;\n color: ColorValue;\n strokeWidth: number;\n trackColor: ColorValue;\n width: number;\n}\n\nconst CircularIndeterminateIndicator = memo(\n function CircularIndeterminateIndicator({\n animationDuration,\n color,\n strokeWidth,\n trackColor,\n width,\n }: CircularIndeterminateIndicatorProps) {\n const progress = useIndeterminateProgressAnimation(animationDuration);\n const rotation = progress.interpolate({\n inputRange: [0, 1],\n outputRange: [\"0deg\", \"360deg\"],\n });\n const center = width / 2;\n const radius = (width - strokeWidth) / 2;\n const circumference = 2 * Math.PI * radius;\n const animatedStyle = useMemo(\n () => ({ transform: [{ rotate: rotation }] }),\n [rotation],\n );\n const strokeDasharray = useMemo(\n () => [circumference * 0.25, circumference * 0.75],\n [circumference],\n );\n\n return (\n <Animated.View style={animatedStyle}>\n <Svg height={width} width={width}>\n <Circle\n cx={center}\n cy={center}\n fill=\"none\"\n r={radius}\n stroke={trackColor}\n strokeWidth={strokeWidth}\n />\n <Circle\n cx={center}\n cy={center}\n fill=\"none\"\n r={radius}\n stroke={color}\n strokeDasharray={strokeDasharray}\n strokeLinecap=\"round\"\n strokeWidth={strokeWidth}\n />\n </Svg>\n </Animated.View>\n );\n },\n);\n\nconst styles = StyleSheet.create({\n root: {\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n});\n"],"mappings":"AAoCQ,cA4CJ,YA5CI;AAnCR,SAAS,MAAM,eAAe;AAC9B,SAAS,UAAU,YAAY,YAAY;AAC3C,OAAO,OAAO,QAAQ,SAAS;AAE/B,SAAS,yCAAyC;AAY3C,MAAM,mBAAmB,KAAK,SAASA,kBAAiB;AAAA,EAC7D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAA0B;AACxB,QAAM,YAAY;AAAA,IAChB,MAAM,CAAC,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,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,GAAwC;AACtC,UAAM,WAAW,kCAAkC,iBAAiB;AACpE,UAAM,WAAW,SAAS,YAAY;AAAA,MACpC,YAAY,CAAC,GAAG,CAAC;AAAA,MACjB,aAAa,CAAC,QAAQ,QAAQ;AAAA,IAChC,CAAC;AACD,UAAM,SAAS,QAAQ;AACvB,UAAM,UAAU,QAAQ,eAAe;AACvC,UAAM,gBAAgB,IAAI,KAAK,KAAK;AACpC,UAAM,gBAAgB;AAAA,MACpB,OAAO,EAAE,WAAW,CAAC,EAAE,QAAQ,SAAS,CAAC,EAAE;AAAA,MAC3C,CAAC,QAAQ;AAAA,IACX;AACA,UAAM,kBAAkB;AAAA,MACtB,MAAM,CAAC,gBAAgB,MAAM,gBAAgB,IAAI;AAAA,MACjD,CAAC,aAAa;AAAA,IAChB;AAEA,WACE,oBAAC,SAAS,MAAT,EAAc,OAAO,eACpB,+BAAC,OAAI,QAAQ,OAAO,OAClB;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,IAAI;AAAA,UACJ,IAAI;AAAA,UACJ,MAAK;AAAA,UACL,GAAG;AAAA,UACH,QAAQ;AAAA,UACR;AAAA;AAAA,MACF;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,IAAI;AAAA,UACJ,IAAI;AAAA,UACJ,MAAK;AAAA,UACL,GAAG;AAAA,UACH,QAAQ;AAAA,UACR;AAAA,UACA,eAAc;AAAA,UACd;AAAA;AAAA,MACF;AAAA,OACF,GACF;AAAA,EAEJ;AACF;AAEA,MAAM,SAAS,WAAW,OAAO;AAAA,EAC/B,MAAM;AAAA,IACJ,YAAY;AAAA,IACZ,gBAAgB;AAAA,EAClB;AACF,CAAC;","names":["CircularProgress","ProgressCircle","CircularIndeterminateIndicator"]}
@@ -5,6 +5,6 @@ import 'react-native';
5
5
  import '@impulse-ui-native/theme';
6
6
  import '../../types/view.types.mjs';
7
7
 
8
- declare const Divider: react.MemoExoticComponent<({ accessible, color, inset, orientation, role, style, tone, ...props }: DividerProps) => react_jsx_runtime.JSX.Element>;
8
+ declare const Divider: react.MemoExoticComponent<({ color, inset, orientation, style, tone, ...props }: DividerProps) => react_jsx_runtime.JSX.Element>;
9
9
 
10
10
  export { Divider };
@@ -1,14 +1,16 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { memo, useMemo } from "react";
3
3
  import { StyleSheet } from "react-native";
4
- import { useStyleProps, useThemedStyles } from "@impulse-ui-native/theme";
4
+ import {
5
+ getDividerTokens,
6
+ useStyleProps,
7
+ useThemedStyles
8
+ } from "@impulse-ui-native/theme";
5
9
  import { View } from "./view";
6
10
  const Divider = memo(function Divider2({
7
- accessible = true,
8
11
  color,
9
12
  inset = "none",
10
13
  orientation = "horizontal",
11
- role = "separator",
12
14
  style,
13
15
  tone = "subtle",
14
16
  ...props
@@ -23,24 +25,26 @@ const Divider = memo(function Divider2({
23
25
  () => [styles.divider, extractedStyleProps, style],
24
26
  [extractedStyleProps, style, styles.divider]
25
27
  );
26
- return /* @__PURE__ */ jsx(View, { ...props, accessible, role, style: dividerStyle });
28
+ return /* @__PURE__ */ jsx(View, { ...props, style: dividerStyle });
27
29
  });
28
30
  function themedStyles(theme, props) {
29
31
  const { color, inset, orientation, tone } = props;
30
- const dividerTokens = theme.components.divider;
31
- const insetStart = inset === "start" || inset === "both";
32
- const insetEnd = inset === "end" || inset === "both";
32
+ const dividerTokens = getDividerTokens(theme.components.divider, {
33
+ inset,
34
+ orientation,
35
+ tone
36
+ });
33
37
  return StyleSheet.create({
34
38
  divider: {
35
39
  alignSelf: "stretch",
36
40
  flexShrink: 0,
37
- height: orientation === "horizontal" ? dividerTokens.thickness : void 0,
38
- marginBottom: orientation === "vertical" && insetEnd ? dividerTokens.inset : 0,
39
- marginEnd: orientation === "horizontal" && insetEnd ? dividerTokens.inset : 0,
40
- marginStart: orientation === "horizontal" && insetStart ? dividerTokens.inset : 0,
41
- marginTop: orientation === "vertical" && insetStart ? dividerTokens.inset : 0,
42
- width: orientation === "vertical" ? dividerTokens.thickness : void 0,
43
- backgroundColor: color ?? dividerTokens.colors[tone]
41
+ height: dividerTokens.height,
42
+ marginBottom: dividerTokens.marginBottom,
43
+ marginEnd: dividerTokens.marginEnd,
44
+ marginStart: dividerTokens.marginStart,
45
+ marginTop: dividerTokens.marginTop,
46
+ width: dividerTokens.width,
47
+ backgroundColor: color ?? dividerTokens.backgroundColor
44
48
  }
45
49
  });
46
50
  }