cpk-ui 0.5.5 → 0.8.0-beta.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 (175) hide show
  1. package/README.md +80 -147
  2. package/components/modals/AlertDialog/AlertDialog.d.ts.map +1 -1
  3. package/components/modals/AlertDialog/AlertDialog.js +14 -7
  4. package/components/modals/Snackbar/Snackbar.d.ts.map +1 -1
  5. package/components/modals/Snackbar/Snackbar.js +20 -17
  6. package/components/uis/Accordion/AccordionItem.d.ts.map +1 -1
  7. package/components/uis/Accordion/AccordionItem.js +41 -17
  8. package/components/uis/Button/Button.d.ts.map +1 -1
  9. package/components/uis/Button/Button.js +10 -10
  10. package/components/uis/Calendar/Calendar.d.ts +6 -0
  11. package/components/uis/Calendar/Calendar.d.ts.map +1 -0
  12. package/components/uis/Calendar/Calendar.js +482 -0
  13. package/components/uis/Calendar/CalendarDay.d.ts +21 -0
  14. package/components/uis/Calendar/CalendarDay.d.ts.map +1 -0
  15. package/components/uis/Calendar/CalendarDay.js +172 -0
  16. package/components/uis/Calendar/CalendarHeader.d.ts +22 -0
  17. package/components/uis/Calendar/CalendarHeader.d.ts.map +1 -0
  18. package/components/uis/Calendar/CalendarHeader.js +40 -0
  19. package/components/uis/Calendar/CalendarPage.d.ts +46 -0
  20. package/components/uis/Calendar/CalendarPage.d.ts.map +1 -0
  21. package/components/uis/Calendar/CalendarPage.js +34 -0
  22. package/components/uis/Calendar/CalendarPager.d.ts +11 -0
  23. package/components/uis/Calendar/CalendarPager.d.ts.map +1 -0
  24. package/components/uis/Calendar/CalendarPager.js +115 -0
  25. package/components/uis/Calendar/CalendarPager.web.d.ts +11 -0
  26. package/components/uis/Calendar/CalendarPager.web.d.ts.map +1 -0
  27. package/components/uis/Calendar/CalendarPager.web.js +72 -0
  28. package/components/uis/Calendar/CalendarWeekRow.d.ts +20 -0
  29. package/components/uis/Calendar/CalendarWeekRow.d.ts.map +1 -0
  30. package/components/uis/Calendar/CalendarWeekRow.js +64 -0
  31. package/components/uis/Calendar/CalendarWeekdayRow.d.ts +24 -0
  32. package/components/uis/Calendar/CalendarWeekdayRow.d.ts.map +1 -0
  33. package/components/uis/Calendar/CalendarWeekdayRow.js +45 -0
  34. package/components/uis/Calendar/intl.d.ts +18 -0
  35. package/components/uis/Calendar/intl.d.ts.map +1 -0
  36. package/components/uis/Calendar/intl.js +146 -0
  37. package/components/uis/Calendar/palette.d.ts +10 -0
  38. package/components/uis/Calendar/palette.d.ts.map +1 -0
  39. package/components/uis/Calendar/palette.js +93 -0
  40. package/components/uis/Calendar/types.d.ts +286 -0
  41. package/components/uis/Calendar/types.d.ts.map +1 -0
  42. package/components/uis/Calendar/types.js +1 -0
  43. package/components/uis/Calendar/useCalendarState.d.ts +66 -0
  44. package/components/uis/Calendar/useCalendarState.d.ts.map +1 -0
  45. package/components/uis/Calendar/useCalendarState.js +211 -0
  46. package/components/uis/Calendar/utils.d.ts +114 -0
  47. package/components/uis/Calendar/utils.d.ts.map +1 -0
  48. package/components/uis/Calendar/utils.js +429 -0
  49. package/components/uis/Card/Card.d.ts +2 -1
  50. package/components/uis/Card/Card.d.ts.map +1 -1
  51. package/components/uis/Card/Card.js +12 -3
  52. package/components/uis/Checkbox/Checkbox.d.ts.map +1 -1
  53. package/components/uis/Checkbox/Checkbox.js +1 -1
  54. package/components/uis/CustomPressable/CustomPressable.d.ts.map +1 -1
  55. package/components/uis/CustomPressable/CustomPressable.js +6 -6
  56. package/components/uis/EditText/EditText.d.ts.map +1 -1
  57. package/components/uis/EditText/EditText.js +17 -12
  58. package/components/uis/Fab/Fab.d.ts +2 -2
  59. package/components/uis/Fab/Fab.d.ts.map +1 -1
  60. package/components/uis/Fab/Fab.js +22 -4
  61. package/components/uis/Icon/Icon.d.ts.map +1 -1
  62. package/components/uis/Icon/Icon.js +6 -3
  63. package/components/uis/IconButton/IconButton.d.ts.map +1 -1
  64. package/components/uis/IconButton/IconButton.js +43 -41
  65. package/components/uis/LoadingIndicator/LoadingIndicator.d.ts +2 -1
  66. package/components/uis/LoadingIndicator/LoadingIndicator.d.ts.map +1 -1
  67. package/components/uis/LoadingIndicator/LoadingIndicator.js +4 -4
  68. package/components/uis/ParallaxHeader/ParallaxHeader.d.ts +44 -0
  69. package/components/uis/ParallaxHeader/ParallaxHeader.d.ts.map +1 -0
  70. package/components/uis/ParallaxHeader/ParallaxHeader.js +142 -0
  71. package/components/uis/RadioGroup/RadioButton.d.ts.map +1 -1
  72. package/components/uis/RadioGroup/RadioButton.js +1 -1
  73. package/components/uis/RadioGroup/RadioGroup.d.ts.map +1 -1
  74. package/components/uis/RadioGroup/RadioGroup.js +16 -3
  75. package/components/uis/Rating/Rating.d.ts.map +1 -1
  76. package/components/uis/Rating/Rating.js +23 -19
  77. package/components/uis/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  78. package/components/uis/SegmentedControl/SegmentedControl.js +1 -1
  79. package/components/uis/StatusbarBrightness/StatusBarBrightness.d.ts +2 -2
  80. package/components/uis/StatusbarBrightness/StatusBarBrightness.d.ts.map +1 -1
  81. package/components/uis/StatusbarBrightness/StatusBarBrightness.js +1 -1
  82. package/components/uis/SwitchToggle/SwitchToggle.d.ts.map +1 -1
  83. package/components/uis/SwitchToggle/SwitchToggle.js +1 -1
  84. package/hooks/useHoverState.d.ts +8 -0
  85. package/hooks/useHoverState.d.ts.map +1 -0
  86. package/hooks/useHoverState.js +16 -0
  87. package/index.d.ts +2 -0
  88. package/index.d.ts.map +1 -1
  89. package/index.js +2 -0
  90. package/package.json +19 -6
  91. package/providers/ThemeProvider.d.ts.map +1 -1
  92. package/providers/ThemeProvider.js +0 -1
  93. package/providers/index.d.ts.map +1 -1
  94. package/providers/index.js +3 -2
  95. package/components/uis/Icon/selection.json +0 -1
  96. package/src/components/common/ErrorBoundary/ErrorBoundary.tsx +0 -75
  97. package/src/components/modals/AlertDialog/AlertDialog.stories.tsx +0 -216
  98. package/src/components/modals/AlertDialog/AlertDialog.test.tsx +0 -251
  99. package/src/components/modals/AlertDialog/AlertDialog.tsx +0 -356
  100. package/src/components/modals/Snackbar/Snackbar.stories.tsx +0 -182
  101. package/src/components/modals/Snackbar/Snackbar.test.tsx +0 -319
  102. package/src/components/modals/Snackbar/Snackbar.tsx +0 -260
  103. package/src/components/modals/Snackbar/const.ts +0 -4
  104. package/src/components/uis/Accordion/Accordion.stories.tsx +0 -167
  105. package/src/components/uis/Accordion/Accordion.test.tsx +0 -272
  106. package/src/components/uis/Accordion/Accordion.tsx +0 -109
  107. package/src/components/uis/Accordion/AccordionItem.tsx +0 -306
  108. package/src/components/uis/Button/Button.stories.tsx +0 -218
  109. package/src/components/uis/Button/Button.test.tsx +0 -694
  110. package/src/components/uis/Button/Button.tsx +0 -440
  111. package/src/components/uis/Card/Card.test.tsx +0 -146
  112. package/src/components/uis/Card/Card.tsx +0 -102
  113. package/src/components/uis/Checkbox/Checkbox.stories.tsx +0 -216
  114. package/src/components/uis/Checkbox/Checkbox.test.tsx +0 -267
  115. package/src/components/uis/Checkbox/Checkbox.tsx +0 -225
  116. package/src/components/uis/CustomPressable/CustomPressable.tsx +0 -48
  117. package/src/components/uis/EditText/EditText.stories.tsx +0 -124
  118. package/src/components/uis/EditText/EditText.test.tsx +0 -477
  119. package/src/components/uis/EditText/EditText.tsx +0 -593
  120. package/src/components/uis/Fab/Fab.stories.tsx +0 -133
  121. package/src/components/uis/Fab/Fab.test.tsx +0 -110
  122. package/src/components/uis/Fab/Fab.tsx +0 -168
  123. package/src/components/uis/Hr/Hr.test.tsx +0 -26
  124. package/src/components/uis/Hr/Hr.tsx +0 -19
  125. package/src/components/uis/Icon/Icon.stories.tsx +0 -98
  126. package/src/components/uis/Icon/Icon.test.tsx +0 -49
  127. package/src/components/uis/Icon/Icon.tsx +0 -3819
  128. package/src/components/uis/IconButton/IconButton.test.tsx +0 -204
  129. package/src/components/uis/IconButton/IconButton.tsx +0 -279
  130. package/src/components/uis/LoadingIndicator/LoadingIndicator.tsx +0 -126
  131. package/src/components/uis/LoadingIndicator/LodingIndicator.stories.tsx +0 -81
  132. package/src/components/uis/PinchZoom/PinchZoom.stories.tsx +0 -266
  133. package/src/components/uis/PinchZoom/PinchZoom.test.tsx +0 -113
  134. package/src/components/uis/PinchZoom/PinchZoom.tsx +0 -424
  135. package/src/components/uis/RadioGroup/RadioButton.tsx +0 -193
  136. package/src/components/uis/RadioGroup/RadioGroup.stories.tsx +0 -188
  137. package/src/components/uis/RadioGroup/RadioGroup.test.tsx +0 -354
  138. package/src/components/uis/RadioGroup/RadioGroup.tsx +0 -109
  139. package/src/components/uis/Rating/Rating.test.tsx +0 -98
  140. package/src/components/uis/Rating/Rating.tsx +0 -200
  141. package/src/components/uis/SegmentedControl/SegmentedControl.stories.tsx +0 -546
  142. package/src/components/uis/SegmentedControl/SegmentedControl.test.tsx +0 -274
  143. package/src/components/uis/SegmentedControl/SegmentedControl.tsx +0 -232
  144. package/src/components/uis/StatusbarBrightness/StatusBarBrightness.test.tsx +0 -41
  145. package/src/components/uis/StatusbarBrightness/StatusBarBrightness.tsx +0 -26
  146. package/src/components/uis/Styled/StyledComponents.tsx +0 -217
  147. package/src/components/uis/SwitchToggle/SwitchToggle.stories.tsx +0 -75
  148. package/src/components/uis/SwitchToggle/SwitchToggle.test.tsx +0 -149
  149. package/src/components/uis/SwitchToggle/SwitchToggle.tsx +0 -309
  150. package/src/components/uis/Typography/Typography.stories.tsx +0 -149
  151. package/src/components/uis/Typography/Typography.test.tsx +0 -58
  152. package/src/components/uis/Typography/Typography.tsx +0 -386
  153. package/src/hooks/index.ts +0 -2
  154. package/src/hooks/useAnimations.ts +0 -71
  155. package/src/hooks/useDebouncedColorScheme.tsx +0 -30
  156. package/src/hooks/useOptimizedStyles.ts +0 -22
  157. package/src/hooks/usePerformance.ts +0 -93
  158. package/src/index.tsx +0 -38
  159. package/src/providers/ThemeProvider.tsx +0 -177
  160. package/src/providers/index.tsx +0 -130
  161. package/src/test/testUtils.tsx +0 -101
  162. package/src/types/common.ts +0 -77
  163. package/src/types/index.ts +0 -1
  164. package/src/types/kstyled.d.ts +0 -6
  165. package/src/utils/accessibility.ts +0 -110
  166. package/src/utils/colors.ts +0 -151
  167. package/src/utils/createCtx.tsx +0 -26
  168. package/src/utils/guards.ts +0 -93
  169. package/src/utils/index.ts +0 -2
  170. package/src/utils/performanceTest.ts +0 -174
  171. package/src/utils/platform.ts +0 -69
  172. package/src/utils/theme.ts +0 -38
  173. package/test/testUtils.d.ts +0 -113
  174. package/test/testUtils.d.ts.map +0 -1
  175. package/test/testUtils.js +0 -65
package/README.md CHANGED
@@ -1,190 +1,123 @@
1
1
  # cpk-ui
2
2
 
3
- React Native UI components for [Expo](https://expo.dev).
4
-
5
- [![Npm Version](http://img.shields.io/npm/v/cpk-ui.svg?style=flat-square)](https://npmjs.org/package/cpk-ui)
6
- [![Downloads](http://img.shields.io/npm/dm/cpk-ui.svg?style=flat-square)](https://npmjs.org/package/cpk-ui)
3
+ [![npm version](https://img.shields.io/npm/v/cpk-ui.svg?style=flat-square)](https://www.npmjs.com/package/cpk-ui)
7
4
  [![CI](https://github.com/crossplatformkorea/cpk-ui/actions/workflows/ci.yml/badge.svg)](https://github.com/crossplatformkorea/cpk-ui/actions/workflows/ci.yml)
8
- [![codecov](https://codecov.io/gh/crossplatformkorea/cpk-ui/graph/badge.svg?token=LWZI4U369L)](https://codecov.io/gh/crossplatformkorea/cpk-ui)
9
- [![Publish](https://github.com/crossplatformkorea/cpk-ui/actions/workflows/publish.yml/badge.svg)](https://github.com/crossplatformkorea/cpk-ui/actions/workflows/publish.yml)
10
- [![Sponsor](https://opencollective.com/crossplatformkorea/tiers/badge.svg?style=shield)](https://opencollective.com/crossplatformkorea/tiers/badge.svg)
11
-
12
- <img src="https://github.com/user-attachments/assets/c31ac1c2-cc0e-4f13-a542-c35045c266cd" width="320"/>
13
-
14
- ## Demo
15
-
16
- Check out [ui.crossplatformkorea.com](https://ui.crossplatformkorea.com)
17
-
18
- ## Introduction
19
-
20
- `cpk-ui` is a foundational design system and UI components library managed by Cross-Platform Korea. It is built using our preferred technologies, including [kstyled](https://hyodotdev.github.io/kstyled), [typescript](https://www.typescriptlang.org/), [jest](https://jestjs.io), [react-native-testing-library](https://github.com/callstack/react-native-testing-library), [expo](https://expo.io), and [storybook](https://storybook.js.org).
5
+ [![Storybook](https://img.shields.io/badge/storybook-live-ff4785?style=flat-square)](https://ui.crossplatformkorea.com)
6
+ [![license](https://img.shields.io/npm/l/cpk-ui.svg?style=flat-square)](./LICENSE)
21
7
 
22
- ### Philosophy
8
+ React Native components with one API across iOS, Android, and web. cpk-ui is
9
+ maintained by Cross Platform Korea and uses
10
+ [kstyled](https://crossplatformkorea.github.io/kstyled) for typed,
11
+ compile-time-aware styling.
23
12
 
24
- `cpk-ui` aims to provide user-friendly, lightweight, and adaptable UI components. It emphasizes customizable `theme` variations and a responsive layout to enhance developer experience.
13
+ `cpk-ui@0.8.0-beta.0` pairs with `kstyled@0.4.1`. Keep the runtime and Babel plugin on
14
+ the same kstyled version.
25
15
 
26
- ### Performance
16
+ ## Install
27
17
 
28
- `cpk-ui` is optimized for React Native performance using React's built-in optimization features:
18
+ ### Expo
29
19
 
30
- - **React.memo**: All components are wrapped to prevent unnecessary re-renders
31
- - **useCallback**: Event handlers are memoized for stable references
32
- - **useMemo**: Expensive calculations and styles are memoized
33
- - **110+ tests passing**: Comprehensive test coverage ensures reliability
34
- - **Zero breaking changes**: All optimizations maintain API compatibility
35
-
36
- For detailed performance information, see our [Performance Guide](docs/PERFORMANCE.md).
37
-
38
- ### Installation
39
-
40
- #### For Expo
41
-
42
- ```sh
43
- expo install cpk-ui kstyled @expo/vector-icons react-native-gesture-handler react-native-svg expo-screen-orientation @expo/match-media expo-haptics
44
-
45
- # Install dev dependencies
46
- npm install -D babel-plugin-kstyled
20
+ ```bash
21
+ npx expo install cpk-ui@0.8.0-beta.0 kstyled@0.4.1 @expo/vector-icons \
22
+ react-native-gesture-handler react-native-svg expo-screen-orientation \
23
+ react-native-reanimated @expo/match-media expo-haptics
24
+ bun add --dev babel-plugin-kstyled@0.4.1
47
25
  ```
48
26
 
49
- #### For React Native CLI
27
+ ### React Native CLI
50
28
 
51
- ```sh
52
- # Using yarn
53
- yarn add cpk-ui kstyled @expo/vector-icons react-native-gesture-handler react-native-svg expo-screen-orientation @expo/match-media
54
- yarn add -D babel-plugin-kstyled
29
+ Install Expo modules first, then add the same runtime dependencies:
55
30
 
56
- # Install expo modules
31
+ ```bash
57
32
  npx install-expo-modules@latest
33
+ bun add cpk-ui@0.8.0-beta.0 kstyled@0.4.1 @expo/vector-icons \
34
+ react-native-gesture-handler react-native-svg expo-screen-orientation \
35
+ react-native-reanimated @expo/match-media expo-haptics
36
+ bun add --dev babel-plugin-kstyled@0.4.1
58
37
  ```
59
38
 
60
- #### Configure Babel
61
-
62
- Add `babel-plugin-kstyled` to your `babel.config.js`:
39
+ Configure kstyled before plugins that must run last:
63
40
 
64
- ```javascript
41
+ ```js title="babel.config.js"
65
42
  module.exports = {
66
43
  presets: ['babel-preset-expo'],
67
- plugins: ['babel-plugin-kstyled'],
44
+ plugins: [
45
+ ['babel-plugin-kstyled', {strict: true}],
46
+ 'react-native-reanimated/plugin',
47
+ ],
68
48
  };
69
49
  ```
70
50
 
71
- ### Usage
72
-
73
- We focus on supporting `iOS`, `Android`, and `web` platforms, enabling [expo](https://expo.io) users to write efficient and reliable cross-platform code. For more insights into the project’s direction, refer to the [cpk-ui strategy](https://github.com/hyochan/cpk-ui/issues).
74
-
75
- ```tsx
76
- import {CpkProvider} from 'cpk-ui';
77
-
78
- <CpkProvider>
79
- <App />
80
- </CpkProvider>;
81
- ```
82
-
83
- ## Theming
84
-
85
- > The embedded `theme` module functionality provides the ability to create `light` and `dark` themes.
86
-
87
- ### Customizing Theme
88
-
89
- #### 1. Define colors for `light` and `dark` theme
90
-
91
- The `light` and `dark` theme color definitions are provided as examples above. They are objects that contain color properties for different UI components and states.
92
-
93
- #### 2. Integrating with `CpkProvider`
94
-
95
- When integrating with `CpkProvider`, you will provide your defined light and dark themes as the custom theme:
96
-
97
- ```tsx
98
- <CpkProvider customTheme={{light, dark}}>
99
- <App />
100
- </CpkProvider>
101
- ```
102
-
103
- ### Fonts
51
+ ## Provider
104
52
 
105
- `cpk-ui` uses [Pretendard](https://github.com/orioncactus/pretendard) as its default font. The fonts are automatically installed with `cpk-ui`, but you must confirm they are loaded using `assetLoaded` from `useCPK`.
53
+ Wrap the application once near the root:
106
54
 
107
55
  ```tsx
108
- import {useCPK} from 'cpk-ui';
109
-
110
- const {assetLoaded} = useCPK();
56
+ import {CpkProvider, useCPK} from 'cpk-ui';
111
57
 
112
- if (!assetLoaded) {
113
- return <Loading />;
58
+ export function Root() {
59
+ return (
60
+ <CpkProvider>
61
+ <App />
62
+ </CpkProvider>
63
+ );
114
64
  }
115
65
 
116
- return <Main />;
117
- ```
118
-
119
- ### Icons
120
-
121
- Integrate [Phosphoricons](https://phosphoricons.com) easily using the `Icon` component.
122
-
123
- ```tsx
124
- import {Icon} from 'cpk-ui';
125
-
126
- <Icon name="..." color="#AAA" size={32} />;
127
- ```
128
-
129
- ### Installing Fonts (Recommended)
130
-
131
- `cpk-ui` uses [Pretendard](https://github.com/orioncactus/pretendard) as its default font. The font families include `Pretendard`, `Pretendard-Bold`, and `Pretendard-Thin`. From version `0.2.1`, these fonts are automatically installed when you add `cpk-ui`. However, it is important to ensure that the fonts are loaded properly using `assetLoaded` from the `CpkProvider`.
132
-
133
- ```tsx
134
- import {useCPK} from 'cpk-ui';
135
-
136
- const {assetLoaded} = useCPK();
66
+ function App() {
67
+ const {assetLoaded} = useCPK();
137
68
 
138
- if (!assetLoaded) {
139
- // Render loading state
140
- return ...;
69
+ if (!assetLoaded) return null;
70
+ return <Main />;
141
71
  }
142
-
143
- return <Main/>
144
72
  ```
145
73
 
146
- ### Compatibility
74
+ `CpkProvider` loads the bundled Pretendard font families and supplies light or
75
+ dark theme tokens. Applications that provide product-specific tokens can pass
76
+ `customTheme={{light, dark}}`.
147
77
 
148
- | Package | Version |
149
- | :----------------: | :-----: |
150
- | react | >=16.13 |
151
- | react-native | >=0.58 |
152
- | kstyled | >=0.1.0 |
153
- | @expo/vector-icons | \* |
78
+ ## Component Surface
154
79
 
155
- ### Troubleshooting
80
+ | Area | Components |
81
+ | ---------------- | -------------------------------------------------------------------------------- |
82
+ | Actions | Button, CustomPressable, Fab, IconButton |
83
+ | Inputs | Calendar, Checkbox, EditText, RadioGroup, Rating, SegmentedControl, SwitchToggle |
84
+ | Feedback | AlertDialog, ErrorBoundary, LoadingIndicator, Snackbar |
85
+ | Display | Accordion, Card, Hr, Icon, ParallaxHeader, Typography |
86
+ | Media and system | PinchZoom, StatusBarBrightness |
156
87
 
157
- #### Resolving Issues with "cpk-ui" on Expo Web
88
+ Each public component has automated tests and Storybook coverage for its main
89
+ states. Use the [live Storybook](https://ui.crossplatformkorea.com) to inspect
90
+ controls, responsive behavior, accessibility results, and source examples.
158
91
 
159
- If you encounter errors when using "cpk-ui" with expo-web, follow these steps to configure webpack:
92
+ ## Release Matrix
160
93
 
161
- 1. **Install `@expo/webpack-config`**
94
+ The 0.8.0 beta is verified with Expo 54, React Native 0.81, React 19,
95
+ kstyled 0.4, and React Native Web 0.21. This is the release validation matrix,
96
+ not a claim that every consumer must use those exact React or React Native
97
+ versions.
162
98
 
163
- ```sh
164
- yarn add @expo/webpack-config
165
- ```
99
+ ## Quality Gates
166
100
 
167
- 2. **Configure Webpack**
101
+ ```bash
102
+ bun run test:all
103
+ bun run build
104
+ bun run e2e-smoke
105
+ bun run storybook:build
106
+ bun run pack:dry
107
+ ```
168
108
 
169
- Create a `webpack.config.js` file in your project root and add the following configuration:
109
+ The npm publish guard rejects local publishing. Releases run only from the
110
+ main-branch GitHub Actions publish workflow with provenance.
170
111
 
171
- ```javascript
172
- const createExpoWebpackConfigAsync = require('@expo/webpack-config');
112
+ ## Documentation
173
113
 
174
- module.exports = async function (env, argv) {
175
- const config = await createExpoWebpackConfigAsync(
176
- {
177
- ...env,
178
- babel: {
179
- dangerouslyAddModulePathsToTranspile: ['cpk-ui'],
180
- },
181
- },
182
- argv,
183
- );
184
- return config;
185
- };
186
- ```
114
+ - [Storybook](https://ui.crossplatformkorea.com)
115
+ - [0.8.0 beta release notes](./docs/releases/0.8.0-beta.0.md)
116
+ - [0.7 engineering notes](./docs/blog/2026-07-11-cpk-ui-0.7.0.md)
117
+ - [Performance guide](./docs/PERFORMANCE.md)
118
+ - [Changelog](./CHANGELOG.md)
119
+ - [Contributing](./CONTRIBUTING.md)
187
120
 
188
- ### Contributing
121
+ ## License
189
122
 
190
- Read the [Contributing Guide](./CONTRIBUTING.md) before submitting pull requests. Thank you to everyone contributing to this project!
123
+ MIT
@@ -1 +1 @@
1
- {"version":3,"file":"AlertDialog.d.ts","sourceRoot":"","sources":["../../../../src/components/modals/AlertDialog/AlertDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAQZ,KAAK,YAAY,EAClB,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAC,MAAM,cAAc,CAAC;AA6DlE,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;AAExE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACjC,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACtC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,aAAa,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACrC,IAAI,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC5B,eAAe,CAAC,EAAE,SAAS,CAAC,SAAS,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,CAAC;IACrC,IAAI,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC5B,eAAe,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;IAC9B,IAAI,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,IAAI,CAAC,EAAE,mBAAmB,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,CAAC,kBAAkB,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACpD,KAAK,IAAI,IAAI,CAAC;CACf,CAAC;;AAqSF,wBAEE"}
@@ -131,10 +131,12 @@ function AlertDialog({ style }, ref) {
131
131
  ? `rgba(0,0,0,${backdropOpacity})`
132
132
  : `rgba(255,255,255,${backdropOpacity})`, [themeType, backdropOpacity]);
133
133
  // Memoize shadow styles
134
- const shadowStyles = useMemo(() => Platform.OS !== 'web' ? {
135
- shadowOffset: { width: 0, height: 4 },
136
- shadowColor: theme.text.basic,
137
- } : {}, [theme.text.basic]);
134
+ const shadowStyles = useMemo(() => Platform.OS !== 'web'
135
+ ? {
136
+ shadowOffset: { width: 0, height: 4 },
137
+ shadowColor: theme.text.basic,
138
+ }
139
+ : {}, [theme.text.basic]);
138
140
  // Memoize container styles
139
141
  const containerStyles = useMemo(() => StyleSheet.flatten([shadowStyles, styles?.container]), [shadowStyles, styles?.container]);
140
142
  // Memoize backdrop press handler
@@ -158,10 +160,15 @@ function AlertDialog({ style }, ref) {
158
160
  },
159
161
  })) })) : null, [actions, sizeConfig.actionMarginTop, styles?.actionContainer]);
160
162
  // Memoize close button content
161
- const closeButtonContent = useMemo(() => showCloseButton ? (_jsx(Button, { onPress: handleCloseButtonPress, borderRadius: 24, text: _jsx(Icon, { color: theme.text.basic, name: "X", size: sizeConfig.iconSize }), type: "text" })) : null, [showCloseButton, handleCloseButtonPress, sizeConfig.iconSize, theme.text.basic]);
163
+ const closeButtonContent = useMemo(() => showCloseButton ? (_jsx(Button, { accessibilityLabel: "Close dialog", onPress: handleCloseButtonPress, borderRadius: 24, text: _jsx(Icon, { color: theme.text.basic, name: "X", size: sizeConfig.iconSize }), type: "text" })) : null, [
164
+ showCloseButton,
165
+ handleCloseButtonPress,
166
+ sizeConfig.iconSize,
167
+ theme.text.basic,
168
+ ]);
162
169
  const AlertDialogContent = useMemo(() => (_jsxs(Container, { style: css `
163
- background-color: ${backdropColor};
164
- `, children: [_jsx(TouchableWithoutFeedback, { onPress: closeOnTouchOutside ? handleCloseButtonPress : undefined, children: _jsx(View, { style: StyleSheet.absoluteFill }) }), _jsxs(AlertDialogContainer, { "$size": size, accessibilityRole: "alert", accessibilityLabel: typeof title === 'string' ? title : 'Alert dialog', style: containerStyles, children: [_jsxs(TitleRow, { style: styles?.titleContainer, children: [titleContent, closeButtonContent] }), _jsx(BodyRow, { "$marginTop": sizeConfig.bodyMarginTop, "$marginBottom": sizeConfig.bodyMarginBottom, style: styles?.bodyContainer, children: bodyContent }), actionsContent] })] })), [
170
+ background-color: ${backdropColor};
171
+ `, children: [_jsx(TouchableWithoutFeedback, { onPress: closeOnTouchOutside ? handleCloseButtonPress : undefined, children: _jsx(View, { style: StyleSheet.absoluteFill }) }), _jsxs(AlertDialogContainer, { "$size": size, accessibilityRole: "alert", accessibilityLabel: typeof title === 'string' ? title : 'Alert dialog', style: containerStyles, children: [_jsxs(TitleRow, { style: styles?.titleContainer, children: [titleContent, closeButtonContent] }), _jsx(BodyRow, { "$marginTop": sizeConfig.bodyMarginTop, "$marginBottom": sizeConfig.bodyMarginBottom, style: styles?.bodyContainer, children: bodyContent }), actionsContent] })] })), [
165
172
  backdropColor,
166
173
  closeOnTouchOutside,
167
174
  handleCloseButtonPress,
@@ -1 +1 @@
1
- {"version":3,"file":"Snackbar.d.ts","sourceRoot":"","sources":["../../../../src/components/modals/Snackbar/Snackbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2F,MAAM,OAAO,CAAC;AAChH,OAAO,KAAK,EAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAC,MAAM,cAAc,CAAC;AAIlE,OAAO,EAAC,aAAa,EAAC,MAAM,SAAS,CAAC;AACtC,OAAO,EAAS,eAAe,EAAC,MAAM,yBAAyB,CAAC;AAKhE,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;AAqCrE,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACjC,IAAI,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC5B,eAAe,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACvC,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,aAAa,GAAG,MAAM,CAAC;IAC/B,IAAI,CAAC,EAAE,gBAAgB,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,CAAC,eAAe,CAAC,EAAE,eAAe,GAAG,IAAI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F,wBAAgF"}
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import React, { forwardRef, useImperativeHandle, useState, useCallback, useMemo } from 'react';
3
- import { Modal, Platform, SafeAreaView, StyleSheet, View } from 'react-native';
2
+ import React, { forwardRef, useImperativeHandle, useState, useCallback, useMemo, } from 'react';
3
+ import { Modal, Platform, StyleSheet, View } from 'react-native';
4
+ import { SafeAreaView } from 'react-native-safe-area-context';
4
5
  import { styled, css } from 'kstyled';
5
6
  import { SnackbarTimer } from './const';
6
7
  import { Button } from '../../uis/Button/Button';
@@ -70,7 +71,7 @@ function Snackbar({ style }, ref) {
70
71
  open: handleOpen,
71
72
  close: handleClose,
72
73
  }), [handleOpen, handleClose]);
73
- const { text, styles, actionText, color = 'primary', size = 'medium' } = options ?? {};
74
+ const { text, styles, actionText, color = 'primary', size = 'medium', } = options ?? {};
74
75
  // Calculate sizes based on size prop
75
76
  const sizeConfig = useMemo(() => {
76
77
  if (typeof size === 'number') {
@@ -98,25 +99,27 @@ function Snackbar({ style }, ref) {
98
99
  }
99
100
  }, [size]);
100
101
  // Memoize shadow styles
101
- const shadowStyles = useMemo(() => Platform.OS !== 'web' ? {
102
- shadowOffset: { width: 0, height: 4 },
103
- shadowColor: theme.text.basic,
104
- } : {}, [theme.text.basic]);
102
+ const shadowStyles = useMemo(() => Platform.OS !== 'web'
103
+ ? {
104
+ shadowOffset: { width: 0, height: 4 },
105
+ shadowColor: theme.text.basic,
106
+ }
107
+ : {}, [theme.text.basic]);
105
108
  // Memoize container styles
106
109
  const containerStyles = useMemo(() => StyleSheet.flatten([shadowStyles, styles?.container]), [shadowStyles, styles?.container]);
107
110
  // Memoize text styles
108
111
  const textStyles = useMemo(() => StyleSheet.flatten([
109
112
  css `
110
- color: ${theme.button[color].text};
111
- font-size: ${sizeConfig.fontSize}px;
112
- `,
113
+ color: ${theme.button[color].text};
114
+ font-size: ${sizeConfig.fontSize}px;
115
+ `,
113
116
  styles?.text,
114
117
  ]), [theme.button, color, sizeConfig.fontSize, styles?.text]);
115
118
  // Memoize action text styles
116
119
  const actionTextStyles = useMemo(() => StyleSheet.flatten([
117
120
  css `
118
- color: ${theme.button[color].text};
119
- `,
121
+ color: ${theme.button[color].text};
122
+ `,
120
123
  styles?.actionText,
121
124
  ]), [theme.button, color, styles?.actionText]);
122
125
  // Memoize action button handler
@@ -124,14 +127,14 @@ function Snackbar({ style }, ref) {
124
127
  // Memoize modal styles
125
128
  const modalStyles = useMemo(() => [
126
129
  css `
127
- flex: 1;
128
- align-self: stretch;
129
- `,
130
+ flex: 1;
131
+ align-self: stretch;
132
+ `,
130
133
  style,
131
134
  ], [style]);
132
- const SnackbarContent = useMemo(() => (_jsx(Container, { children: _jsxs(SnackbarContainer, { "$color": color, "$size": size, style: containerStyles, children: [_jsx(SnackbarText, { "$color": color, "$size": size, style: textStyles, children: text }), _jsx(ActionContainer, { style: styles?.actionContainer, children: actionText ? (_jsx(Button, { onPress: handleActionPress, styles: {
135
+ const SnackbarContent = useMemo(() => (_jsx(Container, { children: _jsxs(SnackbarContainer, { "$color": color, "$size": size, accessibilityLabel: text, accessibilityLiveRegion: "polite", accessibilityRole: "alert", style: containerStyles, testID: "snackbar-container", children: [_jsx(SnackbarText, { "$color": color, "$size": size, style: textStyles, children: text }), _jsx(ActionContainer, { style: styles?.actionContainer, children: actionText ? (_jsx(Button, { accessibilityLabel: actionText, onPress: handleActionPress, styles: {
133
136
  text: actionTextStyles,
134
- }, text: actionText, type: "text" })) : (_jsx(Button, { onPress: handleActionPress, text: _jsx(Icon, { color: theme.button[color].text, name: "X", size: sizeConfig.iconSize }), type: "text" })) })] }) })), [
137
+ }, text: actionText, type: "text" })) : (_jsx(Button, { accessibilityLabel: "Dismiss notification", onPress: handleActionPress, text: _jsx(Icon, { color: theme.button[color].text, name: "X", size: sizeConfig.iconSize }), type: "text" })) })] }) })), [
135
138
  color,
136
139
  size,
137
140
  containerStyles,
@@ -1 +1 @@
1
- {"version":3,"file":"AccordionItem.d.ts","sourceRoot":"","sources":["../../../../src/components/uis/Accordion/AccordionItem.tsx"],"names":[],"mappings":"AACA,OAAc,EAAoD,KAAK,YAAY,EAAC,MAAM,OAAO,CAAC;AAQlG,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,aAAa,CAAC;AA+DpD,MAAM,MAAM,qBAAqB,CAAC,CAAC,EAAE,CAAC,IAAI;IACxC,KAAK,EAAE,CAAC,CAAC;IACT,KAAK,EAAE,CAAC,EAAE,CAAC;CACZ,CAAC;AAEF,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG;IACpE,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,qBAAqB,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,qBAAqB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CAC3E,CAAC;AAEF,wBAAgB,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,EAClC,MAAM,EACN,IAAI,EAAE,IAAI,EACV,IAAe,EACf,aAAoB,EACpB,eAAsB,EACtB,YAAkB,EAClB,aAAiB,EACjB,aAAa,EACb,qBAAqB,EACrB,WAAW,EACX,WAAW,EACX,UAAU,EACV,MAAM,GACP,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,YAAY,CA8M5B;wBAG2C,OAAO,aAAa;AAAhE,wBAAiE"}
1
+ {"version":3,"file":"AccordionItem.d.ts","sourceRoot":"","sources":["../../../../src/components/uis/Accordion/AccordionItem.tsx"],"names":[],"mappings":"AACA,OAAc,EAMZ,KAAK,YAAY,EAClB,MAAM,OAAO,CAAC;AAQf,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,aAAa,CAAC;AA+DpD,MAAM,MAAM,qBAAqB,CAAC,CAAC,EAAE,CAAC,IAAI;IACxC,KAAK,EAAE,CAAC,CAAC;IACT,KAAK,EAAE,CAAC,EAAE,CAAC;CACZ,CAAC;AAEF,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG;IACpE,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,qBAAqB,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,qBAAqB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CAC3E,CAAC;AAEF,wBAAgB,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,EAClC,MAAM,EACN,IAAI,EAAE,IAAI,EACV,IAAe,EACf,aAAoB,EACpB,eAAsB,EACtB,YAAkB,EAClB,aAAiB,EACjB,aAAa,EACb,qBAAqB,EACrB,WAAW,EACX,WAAW,EACX,UAAU,EACV,MAAM,GACP,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,YAAY,CAmR5B;wBAG2C,OAAO,aAAa;AAAhE,wBAAiE"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  // Caveat: Expo web needs React to be imported
3
- import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
3
+ import React, { useCallback, useEffect, useMemo, useRef, useState, } from 'react';
4
4
  import { Animated, Easing, TouchableOpacity, View } from 'react-native';
5
5
  import { styled, css } from 'kstyled';
6
6
  import { Icon } from '../Icon/Icon';
@@ -75,8 +75,12 @@ export function AccordionItem({ testID, data: data, size = 'medium', shouldAnima
75
75
  // Calculate icon size based on accordion size
76
76
  const iconSize = typeof size === 'number'
77
77
  ? size * 0.7
78
- : size === 'small' ? 12 : size === 'large' ? 16 : 14;
79
- const defaultToggleElement = _jsx(StyledIcon, { name: "CaretDown", "$size": size, size: iconSize });
78
+ : size === 'small'
79
+ ? 12
80
+ : size === 'large'
81
+ ? 16
82
+ : 14;
83
+ const defaultToggleElement = (_jsx(StyledIcon, { name: "CaretDown", "$size": size, size: iconSize }));
80
84
  const dropDownAnimValueRef = useRef(new Animated.Value(0));
81
85
  const rotateAnimValueRef = useRef(new Animated.Value(0));
82
86
  const fadeItemAnim = useRef(new Animated.Value(0)).current;
@@ -124,12 +128,18 @@ export function AccordionItem({ testID, data: data, size = 'medium', shouldAnima
124
128
  // Calculate margin based on size
125
129
  const toggleMargin = typeof size === 'number'
126
130
  ? size * 0.6
127
- : size === 'small' ? 10 : size === 'large' ? 14 : 12;
131
+ : size === 'small'
132
+ ? 10
133
+ : size === 'large'
134
+ ? 14
135
+ : 12;
128
136
  // Memoize toggle element container
129
137
  const toggleElContainer = useMemo(() => (_jsx(Animated.View, { style: [
130
138
  css `
131
- margin-right: ${toggleElementPosition === 'left' ? toggleMargin : 0}px;
132
- `,
139
+ margin-right: ${toggleElementPosition === 'left'
140
+ ? toggleMargin
141
+ : 0}px;
142
+ `,
133
143
  {
134
144
  transform: [
135
145
  {
@@ -141,22 +151,28 @@ export function AccordionItem({ testID, data: data, size = 'medium', shouldAnima
141
151
  ],
142
152
  },
143
153
  styles?.toggleElement,
144
- ], children: toggleElement || defaultToggleElement })), [toggleElement, defaultToggleElement, toggleElementPosition, toggleMargin, styles?.toggleElement]);
154
+ ], children: toggleElement || defaultToggleElement })), [
155
+ toggleElement,
156
+ defaultToggleElement,
157
+ toggleElementPosition,
158
+ toggleMargin,
159
+ styles?.toggleElement,
160
+ ]);
145
161
  // Memoize container styles
146
162
  const containerStyles = useMemo(() => [
147
163
  css `
148
- background-color: transparent;
149
- overflow: hidden;
150
- flex-direction: column-reverse;
151
- `,
164
+ background-color: transparent;
165
+ overflow: hidden;
166
+ flex-direction: column-reverse;
167
+ `,
152
168
  styles?.container,
153
169
  ], [styles?.container]);
154
170
  const titleContainerStyles = useMemo(() => [
155
171
  css `
156
- justify-content: ${toggleElementPosition === 'right'
172
+ justify-content: ${toggleElementPosition === 'right'
157
173
  ? 'space-between'
158
174
  : 'flex-start'};
159
- `,
175
+ `,
160
176
  styles?.titleContainer,
161
177
  ], [toggleElementPosition, styles?.titleContainer]);
162
178
  // Memoize animated styles
@@ -172,14 +188,22 @@ export function AccordionItem({ testID, data: data, size = 'medium', shouldAnima
172
188
  // Calculate font sizes based on size prop
173
189
  const titleFontSize = typeof size === 'number'
174
190
  ? size
175
- : size === 'small' ? 14 : size === 'large' ? 18 : 16;
191
+ : size === 'small'
192
+ ? 14
193
+ : size === 'large'
194
+ ? 18
195
+ : 16;
176
196
  const itemFontSize = typeof size === 'number'
177
197
  ? size * 0.875
178
- : size === 'small' ? 12 : size === 'large' ? 16 : 14;
179
- return (_jsxs(Animated.View, { style: containerStyles, children: [_jsx(View, { onLayout: handleLayout, style: css `
198
+ : size === 'small'
199
+ ? 12
200
+ : size === 'large'
201
+ ? 16
202
+ : 14;
203
+ return (_jsxs(Animated.View, { style: containerStyles, children: [_jsx(View, { accessibilityElementsHidden: true, "aria-hidden": true, importantForAccessibility: "no-hide-descendants", onLayout: handleLayout, style: css `
180
204
  position: absolute;
181
205
  opacity: 0;
182
- `, children: data.items.map((body, index) => (_jsx(ItemTouch, { activeOpacity: activeOpacity, onPress: () => handleItemPress(body), "$size": size, children: typeof body === 'string' && !renderItem ? (_jsx(Typography.Body3, { style: [{ fontSize: itemFontSize }, styles?.itemText], children: body })) : (renderItem?.(body)) }, `body-${index}`))) }), _jsx(Animated.View, { accessibilityState: { expanded: !collapsed }, style: animatedItemStyles, testID: `body-${testID}`, children: data.items.map((body, index) => (_jsx(ItemTouch, { activeOpacity: activeOpacity, onPress: () => handleItemPress(body), style: styles?.itemContainer, "$size": size, children: typeof body === 'string' && !renderItem ? (_jsx(Typography.Body3, { style: [{ fontSize: itemFontSize }, styles?.itemText], children: body })) : (renderItem?.(body)) }, `body-${index}`))) }), _jsxs(TitleTouch, { activeOpacity: activeOpacity, onPress: handleToggle, accessibilityRole: "button", accessibilityLabel: typeof data.title === 'string' ? data.title : 'Accordion section', accessibilityState: { expanded: !collapsed }, accessibilityHint: collapsed ? 'Double tap to expand' : 'Double tap to collapse', style: titleContainerStyles, testID: `title-${testID}`, "$size": size, children: [toggleElementPosition === 'left' ? toggleElContainer : null, typeof data.title === 'string' && !renderTitle ? (_jsx(Typography.Heading4, { style: [{ fontSize: titleFontSize }, styles?.titleText], children: data.title })) : (renderTitle?.(data.title)), toggleElementPosition === 'right' ? toggleElContainer : null] })] }));
206
+ `, testID: `measure-body-${testID}`, children: data.items.map((body, index) => (_jsx(ItemTouch, { accessible: false, activeOpacity: activeOpacity, disabled: true, onPress: () => handleItemPress(body), "$size": size, children: typeof body === 'string' && !renderItem ? (_jsx(Typography.Body3, { style: [{ fontSize: itemFontSize }, styles?.itemText], children: body })) : (renderItem?.(body)) }, `body-${index}`))) }), _jsx(Animated.View, { accessibilityElementsHidden: collapsed, accessibilityState: { expanded: !collapsed }, "aria-hidden": collapsed, importantForAccessibility: collapsed ? 'no-hide-descendants' : 'auto', style: animatedItemStyles, testID: `body-${testID}`, children: data.items.map((body, index) => (_jsx(ItemTouch, { activeOpacity: activeOpacity, disabled: collapsed, onPress: () => handleItemPress(body), style: styles?.itemContainer, "$size": size, children: typeof body === 'string' && !renderItem ? (_jsx(Typography.Body3, { style: [{ fontSize: itemFontSize }, styles?.itemText], children: body })) : (renderItem?.(body)) }, `body-${index}`))) }), _jsxs(TitleTouch, { activeOpacity: activeOpacity, "aria-expanded": !collapsed, onPress: handleToggle, accessibilityRole: "button", accessibilityLabel: typeof data.title === 'string' ? data.title : 'Accordion section', accessibilityState: { expanded: !collapsed }, accessibilityHint: collapsed ? 'Double tap to expand' : 'Double tap to collapse', style: titleContainerStyles, testID: `title-${testID}`, "$size": size, children: [toggleElementPosition === 'left' ? toggleElContainer : null, typeof data.title === 'string' && !renderTitle ? (_jsx(Typography.Heading4, { style: [{ fontSize: titleFontSize }, styles?.titleText], children: data.title })) : (renderTitle?.(data.title)), toggleElementPosition === 'right' ? toggleElContainer : null] })] }));
183
207
  }
184
208
  // Export memoized component for better performance
185
209
  export default React.memo(AccordionItem);
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/components/uis/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAc,EAA+B,KAAK,YAAY,EAAC,MAAM,OAAO,CAAC;AAC7E,OAAO,KAAK,EACV,MAAM,EACN,SAAS,EACT,SAAS,EACT,uBAAuB,EACvB,SAAS,EACV,MAAM,cAAc,CAAC;AAUtB,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AAExC,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC;AACvD,MAAM,MAAM,eAAe,GACvB,SAAS,GACT,WAAW,GACX,SAAS,GACT,QAAQ,GACR,SAAS,GACT,MAAM,GACN,OAAO,CAAC;AACZ,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;AAEnE,MAAM,MAAM,KAAK,GAAG;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,YAAY,CAAC;IAC9B,IAAI,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,UAAU,CAAC,EAAE,YAAY,CAAC;IAC1B,KAAK,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,GAAG,SAAS,CAAC,CAAC,CAAC;IAC/D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,uB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OAAO,CACtC,CAAC;IACF,OAAO,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAC7C,cAAc,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC;IAC7C,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,KAAK,MAAM,GAAG;IACZ,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACjC,OAAO,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC/B,OAAO,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC/B,IAAI,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC5B,QAAQ,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAChC,YAAY,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACpC,OAAO,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAChC,CAAC;AAgKF,wBAAgB,MAAM,CAAC,EACrB,MAAM,EACN,IAAc,EACd,KAAiB,EACjB,IAAe,EACf,QAAQ,EACR,OAAe,EACf,cAAc,EACd,IAAI,EACJ,YAAY,EACZ,UAAU,EACV,KAAK,EACL,MAAM,EACN,OAAO,EACP,aAAmB,EACnB,uBAAuB,EACvB,YAAgB,EAChB,YAAY,EACZ,OAAgD,EAChD,cAAc,EACd,kBAAkB,GACnB,EAAE,KAAK,GAAG,YAAY,CAsMtB;wBAGoC,OAAO,MAAM;AAAlD,wBAAmD"}
@@ -1,13 +1,13 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import React, { useCallback, useMemo, useRef } from 'react';
3
- import { Platform, TouchableHighlight, View } from 'react-native';
4
- import { useHover } from 'react-native-web-hooks';
2
+ import React, { useCallback, useMemo } from 'react';
3
+ import { TouchableHighlight, View } from 'react-native';
5
4
  import { styled, css } from 'kstyled';
6
5
  import { useTheme } from '../../../providers/ThemeProvider';
7
6
  import { cloneElemWithDefaultColors } from '../../../utils/guards';
8
7
  import { LoadingIndicator } from '../LoadingIndicator/LoadingIndicator';
9
8
  import { Typography } from '../Typography/Typography';
10
9
  import * as Haptics from 'expo-haptics';
10
+ import { useHoverState } from '../../../hooks/useHoverState';
11
11
  const ButtonContainer = styled.View `
12
12
  align-self: stretch;
13
13
  flex-direction: row;
@@ -115,8 +115,7 @@ const useButtonState = ({ disabled, onPress, loading, }) => {
115
115
  }), [disabled, onPress, loading]);
116
116
  };
117
117
  export function Button({ testID, type = 'solid', color = 'primary', size = 'medium', disabled, loading = false, loadingElement, text, startElement, endElement, style, styles, onPress, activeOpacity = 0.8, touchableHighlightProps, borderRadius = 4, loadingColor, hitSlop = { top: 8, bottom: 8, left: 8, right: 8 }, hapticFeedback, accessibilityLabel, }) {
118
- const ref = useRef(null);
119
- const hovered = useHover(ref);
118
+ const { hovered, hoverProps } = useHoverState();
120
119
  const { theme } = useTheme();
121
120
  const { innerDisabled } = useButtonState({ disabled, onPress, loading });
122
121
  // Memoize styles calculation
@@ -183,7 +182,7 @@ export function Button({ testID, type = 'solid', color = 'primary', size = 'medi
183
182
  `,
184
183
  innerDisabled && compositeStyles.disabled,
185
184
  !!borderRadius && { borderRadius },
186
- ], testID: loading ? 'loading-view' : 'button-container', "$type": type, children: [_jsx(View, { style: compositeStyles.content, children: children }), _jsx(View, { style: compositeStyles.loading, children: loadingView })] })), [
185
+ ], testID: loading ? 'loading-view' : 'button-container', "$type": type, children: [_jsx(View, { style: compositeStyles.content, children: children }), _jsx(View, { style: compositeStyles.loading, children: loading ? loadingView : null })] })), [
187
186
  innerDisabled,
188
187
  size,
189
188
  compositeStyles.container,
@@ -209,10 +208,11 @@ export function Button({ testID, type = 'solid', color = 'primary', size = 'medi
209
208
  border-radius: ${borderRadius}px;
210
209
  `,
211
210
  ], [style, borderRadius]);
212
- return (_jsx(TouchableHighlight, { accessibilityLabel: accessibilityLabel ?? (typeof text === 'string' ? text : undefined), accessibilityRole: "button", activeOpacity: activeOpacity, delayPressIn: 30, disabled: innerDisabled || loading || !onPress, hitSlop: hitSlop, onPress: handlePress, ref: Platform.select({
213
- web: ref,
214
- default: undefined,
215
- }), style: buttonStyles, testID: testID, underlayColor: type === 'text' ? 'transparent' : theme.role.underlay, ...touchableHighlightProps, children: renderContainer({
211
+ return (_jsx(TouchableHighlight, { accessibilityLabel: accessibilityLabel ?? (typeof text === 'string' ? text : undefined), accessibilityRole: "button", "aria-busy": loading, "aria-disabled": innerDisabled || loading || !onPress, activeOpacity: activeOpacity, delayPressIn: 30, disabled: innerDisabled || loading || !onPress, hitSlop: hitSlop, onPress: handlePress, style: buttonStyles, testID: testID, underlayColor: type === 'text' ? 'transparent' : theme.role.underlay, ...touchableHighlightProps, accessibilityState: {
212
+ ...touchableHighlightProps?.accessibilityState,
213
+ busy: loading,
214
+ disabled: innerDisabled || loading || !onPress,
215
+ }, ...hoverProps, children: renderContainer({
216
216
  children: ChildView,
217
217
  loadingView: LoadingView,
218
218
  }) }));
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import type { CalendarProps, CalendarRef } from './types';
3
+ export declare const Calendar: React.NamedExoticComponent<CalendarProps & React.RefAttributes<CalendarRef>>;
4
+ export default Calendar;
5
+ export * from './types';
6
+ //# sourceMappingURL=Calendar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../../../../src/components/uis/Calendar/Calendar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAWN,MAAM,OAAO,CAAC;AAuBf,OAAO,KAAK,EASV,aAAa,EACb,WAAW,EAIZ,MAAM,SAAS,CAAC;AAw3BjB,eAAO,MAAM,QAAQ,8EAA4C,CAAC;AAElE,eAAe,QAAQ,CAAC;AAExB,cAAc,SAAS,CAAC"}