cpk-ui 0.5.4 → 0.7.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.
- package/README.md +80 -147
- package/components/modals/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/components/modals/AlertDialog/AlertDialog.js +14 -7
- package/components/modals/Snackbar/Snackbar.d.ts.map +1 -1
- package/components/modals/Snackbar/Snackbar.js +20 -17
- package/components/uis/Accordion/AccordionItem.d.ts.map +1 -1
- package/components/uis/Accordion/AccordionItem.js +41 -17
- package/components/uis/Button/Button.d.ts +2 -1
- package/components/uis/Button/Button.d.ts.map +1 -1
- package/components/uis/Button/Button.js +11 -11
- package/components/uis/Card/Card.d.ts +2 -1
- package/components/uis/Card/Card.d.ts.map +1 -1
- package/components/uis/Card/Card.js +12 -3
- package/components/uis/Checkbox/Checkbox.d.ts +2 -1
- package/components/uis/Checkbox/Checkbox.d.ts.map +1 -1
- package/components/uis/Checkbox/Checkbox.js +2 -2
- package/components/uis/CustomPressable/CustomPressable.d.ts.map +1 -1
- package/components/uis/CustomPressable/CustomPressable.js +6 -6
- package/components/uis/EditText/EditText.d.ts +1 -0
- package/components/uis/EditText/EditText.d.ts.map +1 -1
- package/components/uis/EditText/EditText.js +18 -13
- package/components/uis/Fab/Fab.d.ts +2 -2
- package/components/uis/Fab/Fab.d.ts.map +1 -1
- package/components/uis/Fab/Fab.js +22 -4
- package/components/uis/Icon/Icon.d.ts.map +1 -1
- package/components/uis/Icon/Icon.js +6 -3
- package/components/uis/IconButton/IconButton.d.ts +2 -1
- package/components/uis/IconButton/IconButton.d.ts.map +1 -1
- package/components/uis/IconButton/IconButton.js +44 -42
- package/components/uis/LoadingIndicator/LoadingIndicator.d.ts +2 -1
- package/components/uis/LoadingIndicator/LoadingIndicator.d.ts.map +1 -1
- package/components/uis/LoadingIndicator/LoadingIndicator.js +4 -4
- package/components/uis/RadioGroup/RadioButton.d.ts +2 -1
- package/components/uis/RadioGroup/RadioButton.d.ts.map +1 -1
- package/components/uis/RadioGroup/RadioButton.js +2 -2
- package/components/uis/RadioGroup/RadioGroup.d.ts.map +1 -1
- package/components/uis/RadioGroup/RadioGroup.js +16 -3
- package/components/uis/Rating/Rating.d.ts.map +1 -1
- package/components/uis/Rating/Rating.js +23 -19
- package/components/uis/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/components/uis/SegmentedControl/SegmentedControl.js +1 -1
- package/components/uis/StatusbarBrightness/StatusBarBrightness.d.ts +2 -2
- package/components/uis/StatusbarBrightness/StatusBarBrightness.d.ts.map +1 -1
- package/components/uis/StatusbarBrightness/StatusBarBrightness.js +1 -1
- package/components/uis/SwitchToggle/SwitchToggle.d.ts +2 -1
- package/components/uis/SwitchToggle/SwitchToggle.d.ts.map +1 -1
- package/components/uis/SwitchToggle/SwitchToggle.js +2 -2
- package/hooks/useHoverState.d.ts +8 -0
- package/hooks/useHoverState.d.ts.map +1 -0
- package/hooks/useHoverState.js +16 -0
- package/package.json +18 -6
- package/providers/ThemeProvider.d.ts.map +1 -1
- package/providers/ThemeProvider.js +0 -1
- package/providers/index.d.ts.map +1 -1
- package/providers/index.js +3 -2
- package/components/uis/Icon/selection.json +0 -1
- package/src/components/common/ErrorBoundary/ErrorBoundary.tsx +0 -75
- package/src/components/modals/AlertDialog/AlertDialog.stories.tsx +0 -216
- package/src/components/modals/AlertDialog/AlertDialog.test.tsx +0 -251
- package/src/components/modals/AlertDialog/AlertDialog.tsx +0 -356
- package/src/components/modals/Snackbar/Snackbar.stories.tsx +0 -182
- package/src/components/modals/Snackbar/Snackbar.test.tsx +0 -319
- package/src/components/modals/Snackbar/Snackbar.tsx +0 -260
- package/src/components/modals/Snackbar/const.ts +0 -4
- package/src/components/uis/Accordion/Accordion.stories.tsx +0 -167
- package/src/components/uis/Accordion/Accordion.test.tsx +0 -272
- package/src/components/uis/Accordion/Accordion.tsx +0 -109
- package/src/components/uis/Accordion/AccordionItem.tsx +0 -306
- package/src/components/uis/Button/Button.stories.tsx +0 -218
- package/src/components/uis/Button/Button.test.tsx +0 -620
- package/src/components/uis/Button/Button.tsx +0 -436
- package/src/components/uis/Card/Card.test.tsx +0 -146
- package/src/components/uis/Card/Card.tsx +0 -102
- package/src/components/uis/Checkbox/Checkbox.stories.tsx +0 -216
- package/src/components/uis/Checkbox/Checkbox.test.tsx +0 -173
- package/src/components/uis/Checkbox/Checkbox.tsx +0 -220
- package/src/components/uis/CustomPressable/CustomPressable.tsx +0 -48
- package/src/components/uis/EditText/EditText.stories.tsx +0 -124
- package/src/components/uis/EditText/EditText.test.tsx +0 -477
- package/src/components/uis/EditText/EditText.tsx +0 -590
- package/src/components/uis/Fab/Fab.stories.tsx +0 -133
- package/src/components/uis/Fab/Fab.test.tsx +0 -110
- package/src/components/uis/Fab/Fab.tsx +0 -168
- package/src/components/uis/Hr/Hr.test.tsx +0 -26
- package/src/components/uis/Hr/Hr.tsx +0 -19
- package/src/components/uis/Icon/Icon.stories.tsx +0 -98
- package/src/components/uis/Icon/Icon.test.tsx +0 -49
- package/src/components/uis/Icon/Icon.tsx +0 -3819
- package/src/components/uis/IconButton/IconButton.test.tsx +0 -165
- package/src/components/uis/IconButton/IconButton.tsx +0 -275
- package/src/components/uis/LoadingIndicator/LoadingIndicator.tsx +0 -126
- package/src/components/uis/LoadingIndicator/LodingIndicator.stories.tsx +0 -81
- package/src/components/uis/PinchZoom/PinchZoom.stories.tsx +0 -266
- package/src/components/uis/PinchZoom/PinchZoom.test.tsx +0 -113
- package/src/components/uis/PinchZoom/PinchZoom.tsx +0 -424
- package/src/components/uis/RadioGroup/RadioButton.tsx +0 -188
- package/src/components/uis/RadioGroup/RadioGroup.stories.tsx +0 -188
- package/src/components/uis/RadioGroup/RadioGroup.test.tsx +0 -287
- package/src/components/uis/RadioGroup/RadioGroup.tsx +0 -109
- package/src/components/uis/Rating/Rating.test.tsx +0 -98
- package/src/components/uis/Rating/Rating.tsx +0 -200
- package/src/components/uis/SegmentedControl/SegmentedControl.stories.tsx +0 -546
- package/src/components/uis/SegmentedControl/SegmentedControl.test.tsx +0 -274
- package/src/components/uis/SegmentedControl/SegmentedControl.tsx +0 -229
- package/src/components/uis/StatusbarBrightness/StatusBarBrightness.test.tsx +0 -41
- package/src/components/uis/StatusbarBrightness/StatusBarBrightness.tsx +0 -26
- package/src/components/uis/Styled/StyledComponents.tsx +0 -217
- package/src/components/uis/SwitchToggle/SwitchToggle.stories.tsx +0 -75
- package/src/components/uis/SwitchToggle/SwitchToggle.test.tsx +0 -105
- package/src/components/uis/SwitchToggle/SwitchToggle.tsx +0 -305
- package/src/components/uis/Typography/Typography.stories.tsx +0 -149
- package/src/components/uis/Typography/Typography.test.tsx +0 -58
- package/src/components/uis/Typography/Typography.tsx +0 -386
- package/src/hooks/index.ts +0 -2
- package/src/hooks/useAnimations.ts +0 -71
- package/src/hooks/useDebouncedColorScheme.tsx +0 -30
- package/src/hooks/useOptimizedStyles.ts +0 -22
- package/src/hooks/usePerformance.ts +0 -93
- package/src/index.tsx +0 -38
- package/src/providers/ThemeProvider.tsx +0 -177
- package/src/providers/index.tsx +0 -130
- package/src/test/testUtils.tsx +0 -101
- package/src/types/common.ts +0 -77
- package/src/types/index.ts +0 -1
- package/src/types/kstyled.d.ts +0 -6
- package/src/utils/accessibility.ts +0 -110
- package/src/utils/colors.ts +0 -151
- package/src/utils/createCtx.tsx +0 -26
- package/src/utils/guards.ts +0 -93
- package/src/utils/index.ts +0 -2
- package/src/utils/performanceTest.ts +0 -174
- package/src/utils/platform.ts +0 -69
- package/src/utils/theme.ts +0 -38
- package/test/testUtils.d.ts +0 -113
- package/test/testUtils.d.ts.map +0 -1
- package/test/testUtils.js +0 -65
|
@@ -10,16 +10,29 @@ const Container = styled.View `
|
|
|
10
10
|
`;
|
|
11
11
|
const Content = styled.View `
|
|
12
12
|
flex-direction: row;
|
|
13
|
+
flex-wrap: wrap;
|
|
13
14
|
`;
|
|
14
15
|
function RadioGroupContainer({ title, data, selectedValue, selectValue, style, styles, type, size = 'medium', disabled = false, labels, labelPosition, radioType, }) {
|
|
15
16
|
// Memoize title spacer to avoid re-creating View
|
|
16
|
-
const titleSpacer = useMemo(() => title ? _jsx(View, { style: { height: 8 } }) : null, [title]);
|
|
17
|
+
const titleSpacer = useMemo(() => (title ? _jsx(View, { style: { height: 8 } }) : null), [title]);
|
|
17
18
|
// Memoize radio buttons to prevent unnecessary re-renders
|
|
18
19
|
const radioButtons = useMemo(() => data.map((datum, i) => {
|
|
19
20
|
const handlePress = () => !disabled && selectValue?.(datum);
|
|
20
21
|
return (_jsx(RadioButtonComp, { testID: `radio-${i}`, ...radioType, label: labels?.[i] || '', labelPosition: labelPosition, onPress: handlePress, selected: selectedValue === datum, style: styles?.radio, styles: styles?.radioStyles, type: type, size: size, disabled: disabled }, `radio-${i}`));
|
|
21
|
-
}), [
|
|
22
|
-
|
|
22
|
+
}), [
|
|
23
|
+
data,
|
|
24
|
+
selectedValue,
|
|
25
|
+
selectValue,
|
|
26
|
+
labels,
|
|
27
|
+
labelPosition,
|
|
28
|
+
radioType,
|
|
29
|
+
styles?.radio,
|
|
30
|
+
styles?.radioStyles,
|
|
31
|
+
type,
|
|
32
|
+
size,
|
|
33
|
+
disabled,
|
|
34
|
+
]);
|
|
35
|
+
return (_jsxs(Container, { style: style, children: [title ? (_jsx(Typography.Heading3, { style: styles?.title, children: title })) : null, titleSpacer, _jsx(Content, { style: styles?.container, testID: "radio-group-content", children: radioButtons })] }));
|
|
23
36
|
}
|
|
24
37
|
// Export memoized component for better performance
|
|
25
38
|
export const RadioGroup = React.memo(RadioGroupContainer);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Rating.d.ts","sourceRoot":"","sources":["../../../../src/components/uis/Rating/Rating.tsx"],"names":[],"mappings":"AACA,OAAc,EAAiC,KAAK,YAAY,EAAC,MAAM,OAAO,CAAC;AAC/E,OAAO,KAAK,EAAC,SAAS,EAAE,SAAS,EAAC,MAAM,cAAc,CAAC;AAiBvD,KAAK,MA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CAAC;AAEnE,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACtC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAgB,MAAM,CAAC,EACrB,MAAM,EACN,KAAK,EACL,MAAM,EACN,aAAiB,EACjB,IAAe,EACf,QAAiB,EACjB,cAAc,EACd,SAAwB,EACxB,eAAsB,EACtB,QAAgB,EAChB,KAAK,GACN,EAAE,WAAW,GAAG,YAAY,CAiK5B;wBAEoC,OAAO,MAAM;AAAlD,wBAAmD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
// React import is needed for expo-web
|
|
3
3
|
import React, { useCallback, useMemo, useState } from 'react';
|
|
4
4
|
import { Pressable, View } from 'react-native';
|
|
@@ -30,30 +30,34 @@ export function Rating({ testID, style, styles, initialRating = 0, size = 'mediu
|
|
|
30
30
|
], [direction, style]);
|
|
31
31
|
const starContainerStyles = useMemo(() => [
|
|
32
32
|
css `
|
|
33
|
-
width: ${
|
|
33
|
+
width: ${iconSize}px;
|
|
34
34
|
`,
|
|
35
35
|
styles?.starContainer,
|
|
36
|
-
], [
|
|
37
|
-
const handlePress = useCallback((newRating
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
if (onRatingUpdate) {
|
|
41
|
-
onRatingUpdate(convertedRating);
|
|
42
|
-
}
|
|
36
|
+
], [iconSize, styles?.starContainer]);
|
|
37
|
+
const handlePress = useCallback((newRating) => {
|
|
38
|
+
setRating(newRating);
|
|
39
|
+
onRatingUpdate?.(newRating);
|
|
43
40
|
}, [onRatingUpdate]);
|
|
44
|
-
const renderStarIcon = useCallback(({ key, position
|
|
41
|
+
const renderStarIcon = useCallback(({ key, position }) => {
|
|
45
42
|
const filled = rating >= position + (allowHalfRating ? 0.5 : 0);
|
|
46
43
|
const iconName = filled ? `${iconPrefix}Fill` : `${iconPrefix}`;
|
|
47
44
|
const halfFilled = rating >= position && rating < position + (allowHalfRating ? 0.5 : 0);
|
|
48
|
-
return (_jsxs(StarContainer, { style: starContainerStyles, testID: testID, children: [halfFilled && allowHalfRating ? (_jsxs(View, { style: { position: 'absolute' }, children: [_jsx(Icon, { color: color, name: `${iconPrefix}`, size: iconSize, style: { position: 'absolute' } }), _jsx(Icon, { color: color, name: `${iconPrefix}HalfFill`, size: iconSize })] })) : (_jsx(Icon, { color: color, name: iconName, size: iconSize, style: { position: 'absolute' } })), _jsx(Pressable, { accessibilityRole: "button", disabled: disabled, onPress: () => handlePress(position
|
|
49
|
-
|
|
45
|
+
return (_jsxs(StarContainer, { style: starContainerStyles, testID: testID, children: [halfFilled && allowHalfRating ? (_jsxs(View, { style: { position: 'absolute' }, children: [_jsx(Icon, { color: color, name: `${iconPrefix}`, size: iconSize, style: { position: 'absolute' } }), _jsx(Icon, { color: color, name: `${iconPrefix}HalfFill`, size: iconSize })] })) : (_jsx(Icon, { color: color, name: iconName, size: iconSize, style: { position: 'absolute' } })), allowHalfRating ? (_jsxs(_Fragment, { children: [_jsx(Pressable, { accessibilityLabel: `Rate ${position} out of 5`, accessibilityRole: "button", accessibilityState: { disabled, selected: rating === position }, "aria-disabled": disabled, "aria-pressed": rating === position, disabled: disabled, onPress: () => handlePress(position), children: _jsx(View, { style: {
|
|
46
|
+
width: iconSize / 2,
|
|
47
|
+
height: iconSize,
|
|
48
|
+
backgroundColor: 'transparent',
|
|
49
|
+
} }) }), _jsx(Pressable, { accessibilityLabel: `Rate ${position + 0.5} out of 5`, accessibilityRole: "button", accessibilityState: {
|
|
50
|
+
disabled,
|
|
51
|
+
selected: rating === position + 0.5,
|
|
52
|
+
}, "aria-disabled": disabled, "aria-pressed": rating === position + 0.5, disabled: disabled, onPress: () => handlePress(position + 0.5), children: _jsx(View, { style: {
|
|
53
|
+
width: iconSize / 2,
|
|
54
|
+
height: iconSize,
|
|
55
|
+
backgroundColor: 'transparent',
|
|
56
|
+
} }) })] })) : (_jsx(Pressable, { accessibilityLabel: `Rate ${position} out of 5`, accessibilityRole: "button", accessibilityState: { disabled, selected: rating === position }, "aria-disabled": disabled, "aria-pressed": rating === position, disabled: disabled, onPress: () => handlePress(position), children: _jsx(View, { style: {
|
|
57
|
+
width: iconSize,
|
|
50
58
|
height: iconSize,
|
|
51
59
|
backgroundColor: 'transparent',
|
|
52
|
-
} }) })
|
|
53
|
-
width: iconSize / 2,
|
|
54
|
-
height: iconSize,
|
|
55
|
-
backgroundColor: 'transparent',
|
|
56
|
-
} }) })] }, key));
|
|
60
|
+
} }) }))] }, key));
|
|
57
61
|
}, [
|
|
58
62
|
rating,
|
|
59
63
|
allowHalfRating,
|
|
@@ -61,7 +65,7 @@ export function Rating({ testID, style, styles, initialRating = 0, size = 'mediu
|
|
|
61
65
|
starContainerStyles,
|
|
62
66
|
testID,
|
|
63
67
|
color,
|
|
64
|
-
|
|
68
|
+
iconSize,
|
|
65
69
|
disabled,
|
|
66
70
|
handlePress,
|
|
67
71
|
]);
|
|
@@ -69,6 +73,6 @@ export function Rating({ testID, style, styles, initialRating = 0, size = 'mediu
|
|
|
69
73
|
const position = index + (allowHalfRating ? 0.5 : 1);
|
|
70
74
|
return renderStarIcon({ key: `${_}-${index}`, position });
|
|
71
75
|
}), [allowHalfRating, renderStarIcon]);
|
|
72
|
-
return
|
|
76
|
+
return _jsx(Container, { style: containerStyles, children: stars });
|
|
73
77
|
}
|
|
74
78
|
export default React.memo(Rating);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControl.d.ts","sourceRoot":"","sources":["../../../../src/components/uis/SegmentedControl/SegmentedControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAuB,KAAK,YAAY,EAAC,MAAM,OAAO,CAAC;AACrE,OAAO,KAAK,EAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAC,MAAM,cAAc,CAAC;AAQlE,MAAM,MAAM,wBAAwB,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;AAC7E,MAAM,MAAM,yBAAyB,GACjC,SAAS,GACT,WAAW,GACX,SAAS,GACT,QAAQ,GACR,SAAS,GACT,MAAM,GACN,OAAO,CAAC;AAEZ,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,GAAG,YAAY,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,eAAe,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACvC,IAAI,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC5B,YAAY,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,oBAAoB,EAAE,CAAC;IAC/B,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IACjD,KAAK,CAAC,EAAE,yBAAyB,CAAC;IAClC,IAAI,CAAC,EAAE,wBAAwB,CAAC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AA6EF,iBAAS,yBAAyB,CAAC,EACjC,MAAM,EACN,MAAM,EACN,aAAa,EACb,aAAa,EACb,KAAiB,EACjB,IAAe,EACf,QAAgB,EAChB,KAAK,EACL,MAAM,EACN,YAAgB,GACjB,EAAE,qBAAqB,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"SegmentedControl.d.ts","sourceRoot":"","sources":["../../../../src/components/uis/SegmentedControl/SegmentedControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAuB,KAAK,YAAY,EAAC,MAAM,OAAO,CAAC;AACrE,OAAO,KAAK,EAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAC,MAAM,cAAc,CAAC;AAQlE,MAAM,MAAM,wBAAwB,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;AAC7E,MAAM,MAAM,yBAAyB,GACjC,SAAS,GACT,WAAW,GACX,SAAS,GACT,QAAQ,GACR,SAAS,GACT,MAAM,GACN,OAAO,CAAC;AAEZ,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,GAAG,YAAY,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,eAAe,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACvC,IAAI,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC5B,YAAY,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,oBAAoB,EAAE,CAAC;IAC/B,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IACjD,KAAK,CAAC,EAAE,yBAAyB,CAAC;IAClC,IAAI,CAAC,EAAE,wBAAwB,CAAC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AA6EF,iBAAS,yBAAyB,CAAC,EACjC,MAAM,EACN,MAAM,EACN,aAAa,EACb,aAAa,EACb,KAAiB,EACjB,IAAe,EACf,QAAgB,EAChB,KAAK,EACL,MAAM,EACN,YAAgB,GACjB,EAAE,qBAAqB,GAAG,YAAY,CA+FtC;AAGD,eAAO,MAAM,gBAAgB,6DAE5B,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -86,7 +86,7 @@ function SegmentedControlContainer({ testID, values, selectedValue, onValueChang
|
|
|
86
86
|
const isSelected = selectedValue === item.value;
|
|
87
87
|
const isFirst = index === 0;
|
|
88
88
|
const isLast = index === values.length - 1;
|
|
89
|
-
return (_jsx(TouchableOpacity, { testID: `segment-${index}`, activeOpacity: 0.7, disabled: disabled, onPress: () => handlePress(item.value), style: [
|
|
89
|
+
return (_jsx(TouchableOpacity, { testID: `segment-${index}`, accessibilityLabel: typeof item.text === 'string' ? item.text : undefined, accessibilityRole: "button", accessibilityState: { selected: isSelected }, "aria-disabled": disabled, "aria-pressed": isSelected, activeOpacity: 0.7, disabled: disabled, onPress: () => handlePress(item.value), style: [
|
|
90
90
|
compositeStyles.segment,
|
|
91
91
|
isSelected && compositeStyles.selectedSegment,
|
|
92
92
|
{
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
2
|
import type { StatusBarStyle } from 'react-native';
|
|
3
|
-
type StatusBarBrightnessProps = {
|
|
3
|
+
export type StatusBarBrightnessProps = {
|
|
4
4
|
type?: StatusBarStyle;
|
|
5
5
|
};
|
|
6
|
-
declare function StatusBarBrightness({ type }: StatusBarBrightnessProps): ReactElement;
|
|
6
|
+
export declare function StatusBarBrightness({ type, }: StatusBarBrightnessProps): ReactElement;
|
|
7
7
|
declare const _default: typeof StatusBarBrightness;
|
|
8
8
|
export default _default;
|
|
9
9
|
//# sourceMappingURL=StatusBarBrightness.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusBarBrightness.d.ts","sourceRoot":"","sources":["../../../../src/components/uis/StatusbarBrightness/StatusBarBrightness.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAU,KAAK,YAAY,EAAC,MAAM,OAAO,CAAC;AACxD,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,cAAc,CAAC;AAIjD,
|
|
1
|
+
{"version":3,"file":"StatusBarBrightness.d.ts","sourceRoot":"","sources":["../../../../src/components/uis/StatusbarBrightness/StatusBarBrightness.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAU,KAAK,YAAY,EAAC,MAAM,OAAO,CAAC;AACxD,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,cAAc,CAAC;AAIjD,MAAM,MAAM,wBAAwB,GAAG;IACrC,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,EAClC,IAAI,GACL,EAAE,wBAAwB,GAAG,YAAY,CAazC;wBAGiD,OAAO,mBAAmB;AAA5E,wBAA6E"}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
3
|
import { StatusBar } from 'react-native';
|
|
4
4
|
import { useTheme } from '../../../providers/ThemeProvider';
|
|
5
|
-
function StatusBarBrightness({ type }) {
|
|
5
|
+
export function StatusBarBrightness({ type, }) {
|
|
6
6
|
const { themeType } = useTheme();
|
|
7
7
|
// Memoize status bar color calculation
|
|
8
8
|
const statusColor = useMemo(() => {
|
|
@@ -22,8 +22,9 @@ type Props = {
|
|
|
22
22
|
onElement?: any;
|
|
23
23
|
offElement?: any;
|
|
24
24
|
onPress?: () => void;
|
|
25
|
+
accessibilityLabel?: string;
|
|
25
26
|
};
|
|
26
|
-
export declare function SwitchToggle({ testID, isOn, style, styles, duration, onElement, size, offElement, onPress, }: Props): ReactElement;
|
|
27
|
+
export declare function SwitchToggle({ testID, isOn, style, styles, duration, onElement, size, offElement, onPress, accessibilityLabel, }: Props): ReactElement;
|
|
27
28
|
declare const _default: typeof SwitchToggle;
|
|
28
29
|
export default _default;
|
|
29
30
|
//# sourceMappingURL=SwitchToggle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwitchToggle.d.ts","sourceRoot":"","sources":["../../../../src/components/uis/SwitchToggle/SwitchToggle.tsx"],"names":[],"mappings":"AAAA,OAAc,EAA4C,KAAK,YAAY,EAAC,MAAM,OAAO,CAAC;AAC1F,OAAO,KAAK,EAAC,SAAS,EAAE,SAAS,EAAC,MAAM,cAAc,CAAC;AAQvD,KAAK,MAAM,GAAG;IACZ,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,kBAAkB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC1C,mBAAmB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC3C,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,MAAM,CAAC,EAAE,SA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CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;AAEzE,KAAK,KAAK,GAAG;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,oBAAoB,CAAC;IAC5B,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,GAAG,CAAC;IAChB,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AA+CF,wBAAgB,YAAY,CAAC,EAC3B,MAAM,EACN,IAAI,EACJ,KAAK,EACL,MAAM,EACN,QAAc,EACd,SAAS,EACT,IAAe,EACf,UAAU,EACV,OAAO,EACP,kBAAkB,GACnB,EAAE,KAAK,GAAG,YAAY,CAsNtB;wBAG0C,OAAO,YAAY;AAA9D,wBAA+D"}
|
|
@@ -43,7 +43,7 @@ const largeCircle = {
|
|
|
43
43
|
height: 32,
|
|
44
44
|
borderRadius: 16,
|
|
45
45
|
};
|
|
46
|
-
export function SwitchToggle({ testID, isOn, style, styles, duration = 300, onElement, size = 'medium', offElement, onPress, }) {
|
|
46
|
+
export function SwitchToggle({ testID, isOn, style, styles, duration = 300, onElement, size = 'medium', offElement, onPress, accessibilityLabel, }) {
|
|
47
47
|
const { theme } = useTheme();
|
|
48
48
|
// Memoize size-based configurations
|
|
49
49
|
const sizeConfig = useMemo(() => {
|
|
@@ -181,7 +181,7 @@ export function SwitchToggle({ testID, isOn, style, styles, duration = 300, onEl
|
|
|
181
181
|
}),
|
|
182
182
|
},
|
|
183
183
|
], [switchStyles, padding, animXValue]);
|
|
184
|
-
return (_jsx(TouchableOpacity, { accessibilityRole: "switch", activeOpacity: 0.8, onPress: onPress, style: style, testID: testID, children: _jsxs(AnimatedContainer, { style: containerStyles, children: [isOn ? OnElement : OffElement, CircleButton] }) }));
|
|
184
|
+
return (_jsx(TouchableOpacity, { accessibilityLabel: accessibilityLabel, accessibilityRole: "switch", accessibilityState: { checked: isOn }, "aria-checked": isOn, activeOpacity: 0.8, onPress: onPress, style: style, testID: testID, children: _jsxs(AnimatedContainer, { style: containerStyles, children: [isOn ? OnElement : OffElement, CircleButton] }) }));
|
|
185
185
|
}
|
|
186
186
|
// Export memoized component for better performance
|
|
187
187
|
export default React.memo(SwitchToggle);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ViewProps } from 'react-native';
|
|
2
|
+
type HoverProps = Pick<ViewProps, 'onPointerEnter' | 'onPointerLeave'>;
|
|
3
|
+
export declare function useHoverState(): {
|
|
4
|
+
hovered: boolean;
|
|
5
|
+
hoverProps: HoverProps;
|
|
6
|
+
};
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=useHoverState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useHoverState.d.ts","sourceRoot":"","sources":["../../src/hooks/useHoverState.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,KAAK,SAAS,EAAC,MAAM,cAAc,CAAC;AAEtD,KAAK,UAAU,GAAG,IAAI,CAAC,SAAS,EAAE,gBAAgB,GAAG,gBAAgB,CAAC,CAAC;AAEvE,wBAAgB,aAAa,IAAI;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,UAAU,CAAC;CACxB,CAeA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useCallback, useState } from 'react';
|
|
2
|
+
import { Platform } from 'react-native';
|
|
3
|
+
export function useHoverState() {
|
|
4
|
+
const [hovered, setHovered] = useState(false);
|
|
5
|
+
const handlePointerEnter = useCallback(() => setHovered(true), []);
|
|
6
|
+
const handlePointerLeave = useCallback(() => setHovered(false), []);
|
|
7
|
+
return {
|
|
8
|
+
hovered,
|
|
9
|
+
hoverProps: Platform?.OS === 'web'
|
|
10
|
+
? {
|
|
11
|
+
onPointerEnter: handlePointerEnter,
|
|
12
|
+
onPointerLeave: handlePointerLeave,
|
|
13
|
+
}
|
|
14
|
+
: {},
|
|
15
|
+
};
|
|
16
|
+
}
|
package/package.json
CHANGED
|
@@ -1,28 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cpk-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"main": "index",
|
|
5
5
|
"react-native": "index",
|
|
6
6
|
"module": "index",
|
|
7
7
|
"source": "index",
|
|
8
8
|
"types": "index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"components",
|
|
11
|
+
"hooks",
|
|
12
|
+
"providers",
|
|
13
|
+
"types",
|
|
14
|
+
"utils",
|
|
15
|
+
"index.js",
|
|
16
|
+
"index.d.ts",
|
|
17
|
+
"index.d.ts.map",
|
|
18
|
+
"react-native.config.cjs",
|
|
19
|
+
"README.md"
|
|
20
|
+
],
|
|
9
21
|
"author": "hyochan",
|
|
10
22
|
"license": "MIT",
|
|
11
23
|
"scripts": {
|
|
12
|
-
"pack": "
|
|
13
|
-
"
|
|
24
|
+
"pack": "npm pack --dry-run",
|
|
25
|
+
"prepublishOnly": "node ../scripts/assert-ci-publish.js"
|
|
14
26
|
},
|
|
15
27
|
"repository": {
|
|
16
28
|
"type": "git",
|
|
17
|
-
"url": "https://github.com/crossplatformkorea/cpk-ui"
|
|
29
|
+
"url": "git+https://github.com/crossplatformkorea/cpk-ui.git"
|
|
18
30
|
},
|
|
19
31
|
"bugs": {
|
|
20
32
|
"url": "https://github.com/crossplatformkorea/cpk-ui/issues"
|
|
21
33
|
},
|
|
22
34
|
"homepage": "https://github.com/crossplatformkorea/cpk-ui#readme",
|
|
23
35
|
"peerDependencies": {
|
|
24
|
-
"kstyled": "
|
|
25
|
-
"babel-plugin-kstyled": "
|
|
36
|
+
"kstyled": "^0.4.1",
|
|
37
|
+
"babel-plugin-kstyled": "^0.4.1",
|
|
26
38
|
"react": ">=16.9",
|
|
27
39
|
"react-native": ">=0.58",
|
|
28
40
|
"react-native-gesture-handler": "*",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../src/providers/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAE3B,OAAc,EAAsB,KAAK,YAAY,EAAC,MAAM,OAAO,CAAC;AACpE,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AAGlD,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,SAAS,CAAC;AAE1C,OAAO,KAAK,EAAC,QAAQ,EAAE,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAKzD,KAAK,oBAAoB,GAAG,cAAc,GAAG,eAAe,CAAC;AAC7D,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAEzC,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,EAAE,eAAe,CAAC;IAC3B,KAAK,EAAE;QACL,UAAU,EAAE,OAAO,CAAC;QACpB,QAAQ,EAAE,OAAO,CAAC;QAClB,QAAQ,EAAE,OAAO,CAAC;QAClB,SAAS,EAAE,OAAO,CAAC;KACpB,CAAC;IACF,KAAK,EAAE,YAAY,GAAG,QAAQ,CAAC;IAC/B,eAAe,EAAE,CAAC,SAAS,CAAC,EAAE,eAAe,KAAK,IAAI,CAAC;CACxD,CAAC;AAEF,QAAA,MAAO,MAAM,oBAA0C,CAAC;AAExD,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,WAAW,CAAC,EA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AgB,aAAa,CAAC,EAC5B,QAAQ,EACR,gBAAgB,EAChB,WAAgB,EAChB,oBAAqC,GACtC,EAAE,UAAU,GAAG,YAAY,CAqE3B;AAED,OAAO,EAAC,MAAM,IAAI,QAAQ,EAAC,CAAC"}
|
|
@@ -61,7 +61,6 @@ const genTheme = (type, themeParam) => {
|
|
|
61
61
|
};
|
|
62
62
|
};
|
|
63
63
|
export function ThemeProvider({ children, initialThemeType, customTheme = {}, responsiveDesignMode = 'mobile-first', }) {
|
|
64
|
-
console.log('🎨 ThemeProvider rendered with initialThemeType:', initialThemeType);
|
|
65
64
|
const isPortrait = useMediaQuery({ orientation: 'portrait' });
|
|
66
65
|
const isMobile = useMediaQuery(responsiveDesignMode === 'mobile-first'
|
|
67
66
|
? { minWidth: 0 }
|
package/providers/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAgC,KAAK,YAAY,EAAC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAgC,KAAK,YAAY,EAAC,MAAM,OAAO,CAAC;AAO9E,OAAO,EACL,YAAY,EACZ,UAAU,EAGX,MAAM,iBAAiB,CAAC;AACzB,OAAiB,EACf,eAAe,EACf,eAAe,EAChB,MAAM,wCAAwC,CAAC;AAChD,OAAoB,EAClB,kBAAkB,EACnB,MAAM,8CAA8C,CAAC;AAGtD,MAAM,MAAM,SAAS,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC;AAClD,MAAM,MAAM,WAAW,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;AAEhD,MAAM,MAAM,UAAU,GAAG;IACvB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,eAAe,CAAC;IAC1B,WAAW,EAAE,kBAAkB,CAAC;CACjC,GAAG,YAAY,CAAC;AAEjB,QAAA,MAAO,MAAM,kBAAqC,CAAC;AA+EnD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,WAAW,CAAC,EAAE,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IAC3C,cAAc,CAAC,EAAE,eAAe,CAAC;IACjC,QAAQ,EAAE,YAAY,CAAC;CACxB,CAAC;AAEF,iBAAS,oBAAoB,CAAC,KAAK,EAAE,gBAAgB,GAAG,YAAY,CAUnE;AAED,OAAO,EAAC,MAAM,IAAI,MAAM,EAAE,oBAAoB,IAAI,WAAW,EAAC,CAAC"}
|
package/providers/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useRef } from 'react';
|
|
3
3
|
import { View } from 'react-native';
|
|
4
|
+
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
4
5
|
import { css } from 'kstyled';
|
|
5
6
|
import { useFonts } from 'expo-font';
|
|
6
7
|
import createCtx from '../utils/createCtx';
|
|
@@ -9,7 +10,7 @@ import Snackbar from '../components/modals/Snackbar/Snackbar';
|
|
|
9
10
|
import AlertDialog from '../components/modals/AlertDialog/AlertDialog';
|
|
10
11
|
import { LoadingIndicator } from '../components/uis/LoadingIndicator/LoadingIndicator';
|
|
11
12
|
const [useCtx, Provider] = createCtx();
|
|
12
|
-
function AppProvider({ children
|
|
13
|
+
function AppProvider({ children }) {
|
|
13
14
|
const [assetLoaded] = useFonts({
|
|
14
15
|
cpk: require('../components/uis/Icon/cpk.ttf'),
|
|
15
16
|
'Pretendard-Bold': require('../components/uis/Icon/Pretendard-Bold.otf'),
|
|
@@ -57,6 +58,6 @@ function AppProvider({ children, }) {
|
|
|
57
58
|
}
|
|
58
59
|
function CpkWithThemeProvider(props) {
|
|
59
60
|
const { themeConfig } = props;
|
|
60
|
-
return (_jsx(ThemeProvider, { ...themeConfig, children: _jsx(AppProvider, { ...props }) }));
|
|
61
|
+
return (_jsx(ThemeProvider, { ...themeConfig, children: _jsx(SafeAreaProvider, { children: _jsx(AppProvider, { ...props }) }) }));
|
|
61
62
|
}
|
|
62
63
|
export { useCtx as useCPK, CpkWithThemeProvider as CpkProvider };
|