@idealyst/components 1.2.30 → 1.2.31

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.
@@ -29,7 +29,7 @@ export const SwitchExamples: React.FC = () => {
29
29
  <Text typography="h5">Basic Switch</Text>
30
30
  <Switch
31
31
  checked={basicChecked}
32
- onCheckedChange={setBasicChecked}
32
+ onChange={setBasicChecked}
33
33
  />
34
34
  </View>
35
35
 
@@ -37,7 +37,7 @@ export const SwitchExamples: React.FC = () => {
37
37
  <Text typography="h5">With Label</Text>
38
38
  <Switch
39
39
  checked={labelledChecked}
40
- onCheckedChange={setLabelledChecked}
40
+ onChange={setLabelledChecked}
41
41
  label="Enable notifications"
42
42
  />
43
43
  </View>
@@ -46,7 +46,7 @@ export const SwitchExamples: React.FC = () => {
46
46
  <Text typography="h5">Label Position</Text>
47
47
  <Switch
48
48
  checked={labelledChecked}
49
- onCheckedChange={setLabelledChecked}
49
+ onChange={setLabelledChecked}
50
50
  label="Left label"
51
51
  labelPosition="left"
52
52
  />
@@ -57,13 +57,13 @@ export const SwitchExamples: React.FC = () => {
57
57
  <View gap="sm">
58
58
  <Switch
59
59
  checked={basicChecked}
60
- onCheckedChange={setBasicChecked}
60
+ onChange={setBasicChecked}
61
61
  size="sm"
62
62
  label="Small"
63
63
  />
64
64
  <Switch
65
65
  checked={basicChecked}
66
- onCheckedChange={setBasicChecked}
66
+ onChange={setBasicChecked}
67
67
  size="md"
68
68
  label="Medium (default)"
69
69
  />
@@ -81,31 +81,31 @@ export const SwitchExamples: React.FC = () => {
81
81
  <View gap="sm">
82
82
  <Switch
83
83
  checked={intentChecked.primary}
84
- onCheckedChange={(checked) => setIntentChecked(prev => ({ ...prev, primary: checked }))}
84
+ onChange={(checked) => setIntentChecked(prev => ({ ...prev, primary: checked }))}
85
85
  intent="primary"
86
86
  label="Primary"
87
87
  />
88
88
  <Switch
89
89
  checked={intentChecked.success}
90
- onCheckedChange={(checked) => setIntentChecked(prev => ({ ...prev, success: checked }))}
90
+ onChange={(checked) => setIntentChecked(prev => ({ ...prev, success: checked }))}
91
91
  intent="success"
92
92
  label="Success"
93
93
  />
94
94
  <Switch
95
95
  checked={intentChecked.error}
96
- onCheckedChange={(checked) => setIntentChecked(prev => ({ ...prev, error: checked }))}
96
+ onChange={(checked) => setIntentChecked(prev => ({ ...prev, error: checked }))}
97
97
  intent="danger"
98
98
  label="Error"
99
99
  />
100
100
  <Switch
101
101
  checked={intentChecked.warning}
102
- onCheckedChange={(checked) => setIntentChecked(prev => ({ ...prev, warning: checked }))}
102
+ onChange={(checked) => setIntentChecked(prev => ({ ...prev, warning: checked }))}
103
103
  intent="warning"
104
104
  label="Warning"
105
105
  />
106
106
  <Switch
107
107
  checked={intentChecked.neutral}
108
- onCheckedChange={(checked) => setIntentChecked(prev => ({ ...prev, neutral: checked }))}
108
+ onChange={(checked) => setIntentChecked(prev => ({ ...prev, neutral: checked }))}
109
109
  intent="neutral"
110
110
  label="Neutral"
111
111
  />
@@ -117,32 +117,32 @@ export const SwitchExamples: React.FC = () => {
117
117
  <View gap="sm">
118
118
  <Switch
119
119
  checked={iconChecked.basic}
120
- onCheckedChange={(checked) => setIconChecked(prev => ({ ...prev, basic: checked }))}
121
- enabledIcon="check"
122
- disabledIcon="close"
120
+ onChange={(checked) => setIconChecked(prev => ({ ...prev, basic: checked }))}
121
+ onIcon="check"
122
+ offIcon="close"
123
123
  label="On/Off"
124
124
  />
125
125
  <Switch
126
126
  checked={iconChecked.notifications}
127
- onCheckedChange={(checked) => setIconChecked(prev => ({ ...prev, notifications: checked }))}
128
- enabledIcon="bell"
129
- disabledIcon="bell-off"
127
+ onChange={(checked) => setIconChecked(prev => ({ ...prev, notifications: checked }))}
128
+ onIcon="bell"
129
+ offIcon="bell-off"
130
130
  intent="success"
131
131
  label="Notifications"
132
132
  />
133
133
  <Switch
134
134
  checked={iconChecked.visibility}
135
- onCheckedChange={(checked) => setIconChecked(prev => ({ ...prev, visibility: checked }))}
136
- enabledIcon="eye"
137
- disabledIcon="eye-off"
135
+ onChange={(checked) => setIconChecked(prev => ({ ...prev, visibility: checked }))}
136
+ onIcon="eye"
137
+ offIcon="eye-off"
138
138
  intent="primary"
139
139
  label="Visibility"
140
140
  />
141
141
  <Switch
142
142
  checked={iconChecked.volume}
143
- onCheckedChange={(checked) => setIconChecked(prev => ({ ...prev, volume: checked }))}
144
- enabledIcon="volume-high"
145
- disabledIcon="volume-off"
143
+ onChange={(checked) => setIconChecked(prev => ({ ...prev, volume: checked }))}
144
+ onIcon="volume-high"
145
+ offIcon="volume-off"
146
146
  intent="warning"
147
147
  label="Sound"
148
148
  size="lg"
@@ -150,8 +150,8 @@ export const SwitchExamples: React.FC = () => {
150
150
  <Switch
151
151
  checked={iconChecked.wifi}
152
152
  onCheckedChange={(checked) => setIconChecked(prev => ({ ...prev, wifi: checked }))}
153
- enabledIcon="wifi"
154
- disabledIcon="wifi-off"
153
+ onIcon="wifi"
154
+ offIcon="wifi-off"
155
155
  intent="danger"
156
156
  label="WiFi Connection"
157
157
  size="sm"
@@ -1,3 +1,4 @@
1
+ export { ActivityIndicatorExamples } from './ActivityIndicatorExamples';
1
2
  export { ButtonExamples } from './ButtonExamples';
2
3
  export { TextExamples } from './TextExamples';
3
4
  export { ViewExamples } from './ViewExamples';
@@ -37,6 +37,17 @@ export type ButtonStyleableElements = {
37
37
  text: ElementStyle;
38
38
  icon: ElementStyle;
39
39
  iconContainer: ElementStyle;
40
+ spinner: ElementStyle;
41
+ };
42
+
43
+ /**
44
+ * IconButton styleable elements.
45
+ * @see IconButtonStylesheet in @idealyst/theme/components/icon-button
46
+ */
47
+ export type IconButtonStyleableElements = {
48
+ button: ElementStyle;
49
+ icon: ElementStyle;
50
+ spinner: ElementStyle;
40
51
  };
41
52
 
42
53
  /**
@@ -456,6 +467,7 @@ export interface ComponentStyleExtensions {}
456
467
  */
457
468
  interface BuiltInComponentStyleElements {
458
469
  Button: ButtonStyleableElements;
470
+ IconButton: IconButtonStyleableElements;
459
471
  Card: CardStyleableElements;
460
472
  TextInput: TextInputStyleableElements;
461
473
  /** @deprecated Use TextInput instead */
@@ -1,6 +1,9 @@
1
1
  export { default as Button } from './Button';
2
2
  export * from './Button/types';
3
3
 
4
+ export { default as IconButton } from './IconButton';
5
+ export * from './IconButton/types';
6
+
4
7
  export { default as Text } from './Text';
5
8
  export * from './Text/types';
6
9
 
@@ -108,6 +111,7 @@ export { default as Platform } from './Platform';
108
111
  export * from './Platform/types';
109
112
 
110
113
  export type { ButtonProps } from './Button/types';
114
+ export type { IconButtonProps } from './IconButton/types';
111
115
  export type { TextProps } from './Text/types';
112
116
  export type { ViewProps } from './View/types';
113
117
  export type { InputProps } from './Input/types';
package/src/index.ts CHANGED
@@ -6,6 +6,9 @@ import useMergeRefs from './hooks/useMergeRefs';
6
6
  export { default as Button } from './Button';
7
7
  export * from './Button/types';
8
8
 
9
+ export { default as IconButton } from './IconButton';
10
+ export * from './IconButton/types';
11
+
9
12
  export { default as Text } from './Text';
10
13
  export * from './Text/types';
11
14
 
@@ -119,6 +122,7 @@ export { default as Platform } from './Platform';
119
122
  export * from './Platform/types';
120
123
 
121
124
  export type { ButtonProps } from './Button/types';
125
+ export type { IconButtonProps } from './IconButton/types';
122
126
  export type { TextProps } from './Text/types';
123
127
  export type { ViewProps } from './View/types';
124
128
  export type { LinkProps } from './Link/types';