@hzblj/kara-components 0.8.0 → 0.10.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/CHANGELOG.md +60 -26
- package/README.md +8 -8
- package/lib/module/atoms/color-picker/color-picker.android.js +32 -5
- package/lib/module/atoms/color-picker/color-picker.android.js.map +1 -1
- package/lib/module/atoms/icon-button/icon-button.ios.js +17 -4
- package/lib/module/atoms/icon-button/icon-button.ios.js.map +1 -1
- package/lib/module/atoms/pressable/pressable.js +45 -22
- package/lib/module/atoms/pressable/pressable.js.map +1 -1
- package/lib/module/atoms/progress/progress.ios.js +10 -4
- package/lib/module/atoms/progress/progress.ios.js.map +1 -1
- package/lib/module/atoms/surface/surface.ios.js +3 -0
- package/lib/module/atoms/surface/surface.ios.js.map +1 -1
- package/lib/module/atoms/text-field/text-field.android.js +19 -4
- package/lib/module/atoms/text-field/text-field.android.js.map +1 -1
- package/lib/module/atoms/text-field/text-field.ios.js +7 -2
- package/lib/module/atoms/text-field/text-field.ios.js.map +1 -1
- package/lib/typescript/atoms/activity-indicator/activity-indicator.types.d.ts +1 -1
- package/lib/typescript/atoms/avatar/avatar.types.d.ts +2 -2
- package/lib/typescript/atoms/badge/badge.types.d.ts +1 -1
- package/lib/typescript/atoms/blur-view/blur-view.types.d.ts +6 -6
- package/lib/typescript/atoms/button/button.types.d.ts +7 -7
- package/lib/typescript/atoms/card/card.types.d.ts +1 -1
- package/lib/typescript/atoms/checkbox/checkbox.types.d.ts +2 -2
- package/lib/typescript/atoms/chip/chip.types.d.ts +1 -1
- package/lib/typescript/atoms/color-picker/color-picker.types.d.ts +4 -3
- package/lib/typescript/atoms/date-picker/date-picker.types.d.ts +4 -4
- package/lib/typescript/atoms/divider/divider.types.d.ts +2 -2
- package/lib/typescript/atoms/fab/fab.types.d.ts +2 -2
- package/lib/typescript/atoms/glass-view/glass-view.types.d.ts +5 -5
- package/lib/typescript/atoms/h-stack/h-stack.types.d.ts +3 -3
- package/lib/typescript/atoms/icon/icon.types.d.ts +4 -4
- package/lib/typescript/atoms/icon-button/icon-button.types.d.ts +7 -3
- package/lib/typescript/atoms/island/island.types.d.ts +4 -4
- package/lib/typescript/atoms/list/list.types.d.ts +5 -5
- package/lib/typescript/atoms/picker/picker.types.d.ts +1 -1
- package/lib/typescript/atoms/pressable/pressable.types.d.ts +21 -5
- package/lib/typescript/atoms/progress/progress.types.d.ts +2 -2
- package/lib/typescript/atoms/rn-flat-list/rn-flat-list.types.d.ts +2 -2
- package/lib/typescript/atoms/rn-icon/rn-icon.types.d.ts +1 -1
- package/lib/typescript/atoms/rn-scroll-view/rn-scroll-view.types.d.ts +2 -2
- package/lib/typescript/atoms/rn-section-list/rn-section-list.types.d.ts +2 -2
- package/lib/typescript/atoms/rn-text/rn-text.types.d.ts +2 -2
- package/lib/typescript/atoms/rn-view/rn-view.types.d.ts +3 -3
- package/lib/typescript/atoms/scroll-view/scroll-view.types.d.ts +3 -3
- package/lib/typescript/atoms/segmented-control/segmented-control.types.d.ts +3 -3
- package/lib/typescript/atoms/skeleton/skeleton.types.d.ts +2 -2
- package/lib/typescript/atoms/spacer/spacer.types.d.ts +1 -1
- package/lib/typescript/atoms/surface/surface.types.d.ts +2 -2
- package/lib/typescript/atoms/switch/switch.types.d.ts +1 -1
- package/lib/typescript/atoms/text/text.types.d.ts +1 -1
- package/lib/typescript/atoms/text-field/text-field.types.d.ts +8 -4
- package/lib/typescript/atoms/v-stack/v-stack.types.d.ts +1 -1
- package/lib/typescript/atoms/z-stack/z-stack.types.d.ts +1 -1
- package/lib/typescript/glyph/glyph-button.types.d.ts +1 -1
- package/lib/typescript/glyph/glyph.types.d.ts +1 -1
- package/lib/typescript/molecules/collapsible/collapsible.types.d.ts +1 -1
- package/lib/typescript/molecules/empty-state/empty-state.types.d.ts +1 -1
- package/lib/typescript/molecules/label/label.types.d.ts +1 -1
- package/lib/typescript/molecules/labeled-content/labeled-content.types.d.ts +2 -2
- package/lib/typescript/molecules/list-item/list-item.types.d.ts +2 -2
- package/lib/typescript/molecules/navigation-bar/navigation-bar.types.d.ts +8 -8
- package/lib/typescript/molecules/pager/pager.types.d.ts +2 -2
- package/lib/typescript/molecules/radio-group/radio-group.types.d.ts +2 -2
- package/lib/typescript/molecules/rn-list-item/rn-list-item.types.d.ts +1 -1
- package/lib/typescript/molecules/rn-tooltip/rn-tooltip.types.d.ts +7 -7
- package/lib/typescript/molecules/scroll-edge-container/scroll-edge-container.types.d.ts +3 -3
- package/lib/typescript/molecules/search-bar/search-bar.types.d.ts +2 -2
- package/lib/typescript/molecules/stepper/stepper.types.d.ts +2 -2
- package/lib/typescript/molecules/tooltip/tooltip.types.d.ts +6 -6
- package/lib/typescript/organisms/action-sheet/action-sheet.types.d.ts +3 -3
- package/lib/typescript/organisms/alert/alert.types.d.ts +3 -3
- package/lib/typescript/organisms/context-menu/context-menu.types.d.ts +9 -9
- package/lib/typescript/organisms/fab-menu/fab-menu.types.d.ts +5 -5
- package/lib/typescript/organisms/form/form.types.d.ts +1 -1
- package/lib/typescript/organisms/menu/menu.types.d.ts +2 -2
- package/lib/typescript/organisms/sheet/sheet.types.d.ts +12 -12
- package/lib/typescript/organisms/snackbar/snackbar.types.d.ts +1 -1
- package/lib/typescript/organisms/swipe-actions/swipe-actions.types.d.ts +5 -5
- package/lib/typescript/templates/screen/screen.types.d.ts +2 -2
- package/package.json +4 -4
- package/src/atoms/activity-indicator/activity-indicator.types.ts +1 -1
- package/src/atoms/avatar/avatar.types.ts +2 -2
- package/src/atoms/badge/badge.types.ts +1 -1
- package/src/atoms/blur-view/blur-view.types.ts +6 -6
- package/src/atoms/button/button.types.ts +7 -7
- package/src/atoms/card/card.types.ts +1 -1
- package/src/atoms/checkbox/checkbox.types.ts +2 -2
- package/src/atoms/chip/chip.types.ts +1 -1
- package/src/atoms/color-picker/color-picker.android.tsx +26 -6
- package/src/atoms/color-picker/color-picker.types.ts +4 -3
- package/src/atoms/date-picker/date-picker.types.ts +4 -4
- package/src/atoms/divider/divider.types.ts +2 -2
- package/src/atoms/fab/fab.types.ts +2 -2
- package/src/atoms/glass-view/glass-view.types.ts +5 -5
- package/src/atoms/h-stack/h-stack.types.ts +3 -3
- package/src/atoms/icon/icon.types.ts +4 -4
- package/src/atoms/icon-button/icon-button.ios.tsx +12 -2
- package/src/atoms/icon-button/icon-button.types.ts +7 -3
- package/src/atoms/island/island.types.ts +4 -4
- package/src/atoms/list/list.types.ts +5 -5
- package/src/atoms/picker/picker.types.ts +1 -1
- package/src/atoms/pressable/pressable.tsx +39 -18
- package/src/atoms/pressable/pressable.types.ts +22 -5
- package/src/atoms/progress/progress.ios.tsx +14 -5
- package/src/atoms/progress/progress.types.ts +2 -2
- package/src/atoms/rn-flat-list/rn-flat-list.types.ts +2 -2
- package/src/atoms/rn-icon/rn-icon.types.ts +1 -1
- package/src/atoms/rn-scroll-view/rn-scroll-view.types.ts +2 -2
- package/src/atoms/rn-section-list/rn-section-list.types.ts +2 -2
- package/src/atoms/rn-text/rn-text.types.ts +2 -2
- package/src/atoms/rn-view/rn-view.types.ts +3 -3
- package/src/atoms/scroll-view/scroll-view.types.ts +3 -3
- package/src/atoms/segmented-control/segmented-control.types.ts +3 -3
- package/src/atoms/skeleton/skeleton.types.ts +2 -2
- package/src/atoms/spacer/spacer.types.ts +1 -1
- package/src/atoms/surface/surface.ios.tsx +2 -1
- package/src/atoms/surface/surface.types.ts +2 -2
- package/src/atoms/switch/switch.types.ts +1 -1
- package/src/atoms/text/text.types.ts +1 -1
- package/src/atoms/text-field/text-field.android.tsx +19 -3
- package/src/atoms/text-field/text-field.ios.tsx +7 -1
- package/src/atoms/text-field/text-field.types.ts +8 -4
- package/src/atoms/v-stack/v-stack.types.ts +1 -1
- package/src/atoms/z-stack/z-stack.types.ts +1 -1
- package/src/glyph/glyph-button.types.ts +1 -1
- package/src/glyph/glyph.types.ts +1 -1
- package/src/molecules/collapsible/collapsible.types.ts +1 -1
- package/src/molecules/empty-state/empty-state.types.ts +1 -1
- package/src/molecules/label/label.types.ts +1 -1
- package/src/molecules/labeled-content/labeled-content.types.ts +2 -2
- package/src/molecules/list-item/list-item.types.ts +2 -2
- package/src/molecules/navigation-bar/navigation-bar.types.ts +8 -8
- package/src/molecules/pager/pager.types.ts +2 -2
- package/src/molecules/radio-group/radio-group.types.ts +2 -2
- package/src/molecules/rn-list-item/rn-list-item.types.ts +1 -1
- package/src/molecules/rn-tooltip/rn-tooltip.types.ts +7 -7
- package/src/molecules/scroll-edge-container/scroll-edge-container.types.ts +3 -3
- package/src/molecules/search-bar/search-bar.types.ts +2 -2
- package/src/molecules/stepper/stepper.types.ts +2 -2
- package/src/molecules/tooltip/tooltip.types.ts +6 -6
- package/src/organisms/action-sheet/action-sheet.types.ts +3 -3
- package/src/organisms/alert/alert.types.ts +3 -3
- package/src/organisms/context-menu/context-menu.types.ts +9 -9
- package/src/organisms/fab-menu/fab-menu.types.ts +5 -5
- package/src/organisms/form/form.types.ts +1 -1
- package/src/organisms/menu/menu.types.ts +2 -2
- package/src/organisms/sheet/sheet.types.ts +12 -12
- package/src/organisms/snackbar/snackbar.types.ts +1 -1
- package/src/organisms/swipe-actions/swipe-actions.types.ts +5 -5
- package/src/templates/screen/screen.types.ts +2 -2
- package/lib/module/platform-support.js +0 -19
- package/lib/module/platform-support.js.map +0 -1
- package/lib/typescript/platform-support.d.ts +0 -8
- package/src/platform-support.ts +0 -20
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Column","Text","ComposeText","OutlinedTextField","useNativeState","useSxModifiers","useAppTheme","useHostGuard","jsx","_jsx","jsxs","_jsxs","TextField","defaultValue","disabled","error","label","multiline","onChangeText","secure","theme","value","modifiers","wide","verticalArrangement","spacedBy","children","color","colorString","style","typography","labelMedium","enabled","isError","onValueChange","singleLine","textStyle","fontFamily","body","fontWeight","visualTransformation"],"sourceRoot":"../../../../src","sources":["atoms/text-field/text-field.android.tsx"],"mappings":";;AAAA,SAAQA,MAAM,EAAEC,IAAI,IAAIC,WAAW,EAAEC,iBAAiB,EAAEC,cAAc,QAAO,0BAA0B;AACvG,SAAQC,cAAc,QAAO,gBAAgB;AAC7C,SAAQC,WAAW,QAAO,mBAAmB;AAC7C,SAAQC,YAAY,QAAO,uBAAoB;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAG/C,OAAO,MAAMC,SAA6B,GAAGA,CAAC;EAC5CC,YAAY,GAAG,EAAE;EACjBC,QAAQ,GAAG,KAAK;EAChBC,KAAK,GAAG,KAAK;EACbC,KAAK;EACLC,SAAS,GAAG,KAAK;EACjBC,YAAY;EACZC,MAAM,GAAG;AACK,CAAC,KAAK;EACpBZ,YAAY,CAAC,WAAW,CAAC;EACzB,MAAMa,KAAK,
|
|
1
|
+
{"version":3,"names":["Column","Text","ComposeText","OutlinedTextField","useNativeState","useSxModifiers","useAppTheme","Glyph","useHostGuard","jsx","_jsx","jsxs","_jsxs","TextField","defaultValue","disabled","error","label","multiline","onChangeText","secure","theme","value","modifiers","wide","invalid","Boolean","message","undefined","verticalArrangement","spacedBy","children","color","colorString","style","typography","labelMedium","enabled","isError","onValueChange","singleLine","textStyle","fontFamily","body","fontWeight","visualTransformation","TrailingIcon","name","SupportingText","footnote"],"sourceRoot":"../../../../src","sources":["atoms/text-field/text-field.android.tsx"],"mappings":";;AAAA,SAAQA,MAAM,EAAEC,IAAI,IAAIC,WAAW,EAAEC,iBAAiB,EAAEC,cAAc,QAAO,0BAA0B;AACvG,SAAQC,cAAc,QAAO,gBAAgB;AAC7C,SAAQC,WAAW,QAAO,mBAAmB;AAC7C,SAAQC,KAAK,QAAO,sBAAa;AACjC,SAAQC,YAAY,QAAO,uBAAoB;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAG/C,OAAO,MAAMC,SAA6B,GAAGA,CAAC;EAC5CC,YAAY,GAAG,EAAE;EACjBC,QAAQ,GAAG,KAAK;EAChBC,KAAK,GAAG,KAAK;EACbC,KAAK;EACLC,SAAS,GAAG,KAAK;EACjBC,YAAY;EACZC,MAAM,GAAG;AACK,CAAC,KAAK;EACpBZ,YAAY,CAAC,WAAW,CAAC;EACzB,MAAMa,KAAK,GAAGf,WAAW,CAAC,CAAC;EAC3B,MAAMgB,KAAK,GAAGlB,cAAc,CAACU,YAAY,CAAC;EAC1C,MAAMS,SAAS,GAAGlB,cAAc,CAAC;IAACmB,IAAI,EAAE;EAAI,CAAC,CAAC;EAC9C,MAAMC,OAAO,GAAGC,OAAO,CAACV,KAAK,CAAC;EAC9B,MAAMW,OAAO,GAAG,OAAOX,KAAK,KAAK,QAAQ,IAAIA,KAAK,GAAGA,KAAK,GAAGY,SAAS;EAEtE,oBACEhB,KAAA,CAACZ,MAAM;IAAC6B,mBAAmB,EAAE;MAACC,QAAQ,EAAE;IAAC,CAAE;IAAAC,QAAA,GACxCd,KAAK,gBACJP,IAAA,CAACR,WAAW;MACV8B,KAAK,EAAEX,KAAK,CAACY,WAAW,CAACR,OAAO,GAAG,qBAAqB,GAAG,mBAAmB,CAAE;MAChFS,KAAK,EAAEb,KAAK,CAACc,UAAU,CAACC,WAAY;MAAAL,QAAA,EAEnCd;IAAK,CACK,CAAC,GACZ,IAAI,eACRL,KAAA,CAACT,iBAAiB;MAChBkC,OAAO,EAAE,CAACtB,QAAS;MACnBuB,OAAO,EAAEb,OAAQ;MACjBF,SAAS,EAAEA,SAAU;MACrBgB,aAAa,EAAEpB,YAAa;MAC5BqB,UAAU,EAAE,CAACtB,SAAU;MACvBuB,SAAS,EAAE;QACTT,KAAK,EAAEX,KAAK,CAACY,WAAW,CAAC,iBAAiB,CAAC;QAC3CS,UAAU,EAAErB,KAAK,CAACc,UAAU,CAACQ,IAAI,CAACD,UAAU;QAC5CE,UAAU,EAAEvB,KAAK,CAACc,UAAU,CAACQ,IAAI,CAACC;MACpC,CAAE;MACFtB,KAAK,EAAEA,KAAM;MACbuB,oBAAoB,EAAEzB,MAAM,GAAG,UAAU,GAAG,MAAO;MAAAW,QAAA,GAElDN,OAAO,gBACNf,IAAA,CAACP,iBAAiB,CAAC2C,YAAY;QAAAf,QAAA,eAC7BrB,IAAA,CAACH,KAAK;UAACyB,KAAK,EAAC,qBAAqB;UAACe,IAAI,EAAC;QAAO,CAAE;MAAC,CACpB,CAAC,GAC/B,IAAI,EACPpB,OAAO,gBACNjB,IAAA,CAACP,iBAAiB,CAAC6C,cAAc;QAAAjB,QAAA,eAC/BrB,IAAA,CAACR,WAAW;UAAC8B,KAAK,EAAEX,KAAK,CAACY,WAAW,CAAC,qBAAqB,CAAE;UAACC,KAAK,EAAEb,KAAK,CAACc,UAAU,CAACc,QAAS;UAAAlB,QAAA,EAC5FJ;QAAO,CACG;MAAC,CACkB,CAAC,GACjC,IAAI;IAAA,CACS,CAAC;EAAA,CACd,CAAC;AAEb,CAAC","ignoreList":[]}
|
|
@@ -48,7 +48,8 @@ export const TextField = ({
|
|
|
48
48
|
}) => {
|
|
49
49
|
useHostGuard('TextField');
|
|
50
50
|
const text = useNativeState(defaultValue);
|
|
51
|
-
const tone = TONE[toneOf(disabled, error)];
|
|
51
|
+
const tone = TONE[toneOf(disabled, Boolean(error))];
|
|
52
|
+
const message = tone === TONE.error && typeof error === 'string' && error ? error : undefined;
|
|
52
53
|
const sxModifiers = useSxModifiers({
|
|
53
54
|
bg: tone.bg,
|
|
54
55
|
borderColor: tone.border,
|
|
@@ -83,7 +84,11 @@ export const TextField = ({
|
|
|
83
84
|
onTextChange: onChangeText,
|
|
84
85
|
testID: testID,
|
|
85
86
|
text: text
|
|
86
|
-
})
|
|
87
|
+
}), message ? /*#__PURE__*/_jsx(Text, {
|
|
88
|
+
color: "content.destructive",
|
|
89
|
+
variant: "footnote",
|
|
90
|
+
children: message
|
|
91
|
+
}) : null]
|
|
87
92
|
});
|
|
88
93
|
};
|
|
89
94
|
//# sourceMappingURL=text-field.ios.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SecureField","TextField","SwiftUITextField","useNativeState","VStack","disabled","disabledModifier","textFieldStyle","useSxModifiers","spacing","useMemo","useHostGuard","Text","jsx","_jsx","jsxs","_jsxs","TONE","default","bg","border","label","error","toneOf","defaultValue","multiline","onChangeText","secure","testID","text","tone","sxModifiers","borderColor","borderRadius","borderWidth","px","py","wide","modifiers","list","push","alignment","s4","children","color","variant","onTextChange","axis"],"sourceRoot":"../../../../src","sources":["atoms/text-field/text-field.ios.tsx"],"mappings":";;AAAA,SAAQA,WAAW,EAAEC,SAAS,IAAIC,gBAAgB,EAAEC,cAAc,EAAEC,MAAM,QAAO,mBAAmB;AACpG,SAAQC,QAAQ,IAAIC,gBAAgB,EAAEC,cAAc,QAAO,6BAA6B;AACxF,SAAQC,cAAc,QAAO,gBAAgB;AAC7C,SAAyBC,OAAO,QAAO,mBAAmB;AAC1D,SAAQC,OAAO,QAAO,OAAO;AAC7B,SAAQC,YAAY,QAAO,uBAAoB;AAC/C,SAAQC,IAAI,QAAO,kBAAS;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAW5B,MAAMC,IAAI,GAAG;EACXC,OAAO,EAAE;IAACC,EAAE,EAAE,iBAAiB;IAAEC,MAAM,EAAE,wBAAwB;IAAEC,KAAK,EAAE;EAAmB,CAAC;EAC9FhB,QAAQ,EAAE;IAACc,EAAE,EAAE,eAAe;IAAEC,MAAM,EAAE,gBAAgB;IAAEC,KAAK,EAAE;EAAoB,CAAC;EACtFC,KAAK,EAAE;IAACH,EAAE,EAAE,iBAAiB;IAAEC,MAAM,EAAE,oBAAoB;IAAEC,KAAK,EAAE;EAAqB;AAC3F,CAAuD;;AAEvD;AACA;AACA;AACA;AACA,MAAME,MAAM,GAAGA,CAAClB,QAAiB,EAAEiB,KAAc,KAAgB;EAC/D,IAAIjB,QAAQ,EAAE;IACZ,OAAO,UAAU;EACnB;EAEA,OAAOiB,KAAK,GAAG,OAAO,GAAG,SAAS;AACpC,CAAC;AAED,OAAO,MAAMrB,SAA6B,GAAGA,CAAC;EAC5CuB,YAAY,GAAG,EAAE;EACjBnB,QAAQ,GAAG,KAAK;EAChBiB,KAAK,GAAG,KAAK;EACbD,KAAK;EACLI,SAAS,GAAG,KAAK;EACjBC,YAAY;EACZC,MAAM,GAAG,KAAK;EACdC;AACc,CAAC,KAAK;EACpBjB,YAAY,CAAC,WAAW,CAAC;EACzB,MAAMkB,IAAI,GAAG1B,cAAc,CAACqB,YAAY,CAAC;EACzC,MAAMM,IAAI,GAAGb,IAAI,CAACM,MAAM,CAAClB,QAAQ,
|
|
1
|
+
{"version":3,"names":["SecureField","TextField","SwiftUITextField","useNativeState","VStack","disabled","disabledModifier","textFieldStyle","useSxModifiers","spacing","useMemo","useHostGuard","Text","jsx","_jsx","jsxs","_jsxs","TONE","default","bg","border","label","error","toneOf","defaultValue","multiline","onChangeText","secure","testID","text","tone","Boolean","message","undefined","sxModifiers","borderColor","borderRadius","borderWidth","px","py","wide","modifiers","list","push","alignment","s4","children","color","variant","onTextChange","axis"],"sourceRoot":"../../../../src","sources":["atoms/text-field/text-field.ios.tsx"],"mappings":"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","ignoreList":[]}
|
|
@@ -2,7 +2,7 @@ import type { ColorToken } from '@hzblj/kara-theme';
|
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
export type ActivityIndicatorSize = 'large' | 'small';
|
|
4
4
|
/**
|
|
5
|
-
* That something is loading, for as long as it takes
|
|
5
|
+
* That something is loading, for as long as it takes: UIKit's spinner on iOS, Material 3's expressive
|
|
6
6
|
* `LoadingIndicator` on Android, its shapes morphing as it turns. A React Native view on iOS and a host of its own on
|
|
7
7
|
* Android, so it renders anywhere. For how far along something is, use `Progress`.
|
|
8
8
|
*/
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { ImageSourcePropType } from 'react-native';
|
|
3
3
|
export type AvatarSize = 'lg' | 'md' | 'sm';
|
|
4
|
-
/** A round avatar: the image in `source`, or `initials` without one. The React Native tier
|
|
4
|
+
/** A round avatar: the image in `source`, or `initials` without one. The React Native tier: it needs no host. */
|
|
5
5
|
export type AvatarProps = {
|
|
6
6
|
/** Shown in place of the image when there is no `source`. */
|
|
7
7
|
initials?: string;
|
|
8
|
-
/** The diameter
|
|
8
|
+
/** The diameter: `sm` is `s24`, `md` `s40`, `lg` `s64`. `md` by default. */
|
|
9
9
|
size?: AvatarSize;
|
|
10
10
|
/** The image, cropped to the circle. */
|
|
11
11
|
source?: ImageSourcePropType;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
export type BadgeTone = 'accent' | 'destructive' | 'neutral' | 'success';
|
|
3
|
-
/** A small status label in a capsule
|
|
3
|
+
/** A small status label in a capsule: a SwiftUI `HStack` in the tone's fill on iOS, Material's `Badge` on Android. */
|
|
4
4
|
export type BadgeProps = {
|
|
5
5
|
/** The text inside. */
|
|
6
6
|
label: string;
|
|
@@ -3,16 +3,16 @@ import type { ResponsiveViewSx } from '@hzblj/kara-sx';
|
|
|
3
3
|
import type { ReactNode } from 'react';
|
|
4
4
|
export type { BlurMaterial, BlurVibrancy } from '@hzblj/kara-native/swift-ui';
|
|
5
5
|
/**
|
|
6
|
-
* One of the system's materials
|
|
6
|
+
* One of the system's materials (what sheets, bars, menus and HUDs are made of) behind React Native content, in
|
|
7
7
|
* SwiftUI's five thicknesses. iOS: UIKit's `system*Material` blur, with optional vibrancy for the content. Android:
|
|
8
|
-
* what lies behind, blurred and saturated (Android 12+), under a Material tonal surface as thick as the material
|
|
9
|
-
* `surface` at `ultraThin` up to `surfaceContainerHighest` at `ultraThick
|
|
8
|
+
* what lies behind, blurred and saturated (Android 12+), under a Material tonal surface as thick as the material
|
|
9
|
+
* (`surface` at `ultraThin` up to `surfaceContainerHighest` at `ultraThick`); below Android 12 the surface alone. The
|
|
10
10
|
* React Native tier: it needs no host, so it suits a list cell. Shape it with `borderRadius`; it clips its children.
|
|
11
11
|
*/
|
|
12
12
|
export type BlurViewProps = ResponsiveViewSx & {
|
|
13
13
|
/**
|
|
14
|
-
* Pins the material to light or dark whatever the app's appearance
|
|
15
|
-
* the app theme. Android draws the opposite appearance with Material's inverse surface.
|
|
14
|
+
* Pins the material to light or dark whatever the app's appearance (a dark HUD over a light screen). Unset, it
|
|
15
|
+
* follows the app theme. Android draws the opposite appearance with Material's inverse surface.
|
|
16
16
|
*/
|
|
17
17
|
appearance?: 'dark' | 'light';
|
|
18
18
|
/** React Native content, over the material. */
|
|
@@ -22,7 +22,7 @@ export type BlurViewProps = ResponsiveViewSx & {
|
|
|
22
22
|
/** Test identifier, forwarded to the view. */
|
|
23
23
|
testID?: string;
|
|
24
24
|
/**
|
|
25
|
-
* iOS: draws the children vibrant at this level, the way iOS draws its own labels and fills on a material
|
|
25
|
+
* iOS: draws the children vibrant at this level, the way iOS draws its own labels and fills on a material. Their
|
|
26
26
|
* colour becomes the material's vibrant one and their alpha the mask. Android has no vibrancy: the children keep
|
|
27
27
|
* their colours there.
|
|
28
28
|
*/
|
|
@@ -2,23 +2,23 @@ import type { ColorToken } from '@hzblj/kara-theme';
|
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
export type ButtonVariant = 'accent' | 'destructive' | 'glass' | 'secondary';
|
|
4
4
|
/**
|
|
5
|
-
* SwiftUI `ButtonStyle`. iOS only
|
|
5
|
+
* SwiftUI `ButtonStyle`. iOS only: Compose has no equivalent, so Android ignores it and keeps
|
|
6
6
|
* rendering the variant's tokens.
|
|
7
7
|
*/
|
|
8
8
|
export type ButtonStyleName = 'automatic' | 'bordered' | 'borderedProminent' | 'borderless' | 'glass' | 'glassProminent' | 'plain';
|
|
9
9
|
/**
|
|
10
|
-
* SwiftUI `ControlSize`. iOS only, and it has no `automatic` member
|
|
10
|
+
* SwiftUI `ControlSize`. iOS only, and it has no `automatic` member: leave it unset to inherit
|
|
11
11
|
* whatever the surrounding SwiftUI environment provides.
|
|
12
12
|
*/
|
|
13
13
|
export type ButtonControlSize = 'extraLarge' | 'large' | 'mini' | 'regular' | 'small';
|
|
14
|
-
/** A text button
|
|
14
|
+
/** A text button: SwiftUI `Button` on iOS, Material's filled button (outlined for `glass`) on Android. */
|
|
15
15
|
export type ButtonProps = {
|
|
16
16
|
/**
|
|
17
|
-
* Replaces the style the variant picks
|
|
18
|
-
* `secondary`, `glass` for `glass`. iOS only
|
|
17
|
+
* Replaces the style the variant picks: `borderedProminent` for `accent` and `destructive`, `bordered` for
|
|
18
|
+
* `secondary`, `glass` for `glass`. iOS only. Android ignores it.
|
|
19
19
|
*/
|
|
20
20
|
buttonStyle?: ButtonStyleName;
|
|
21
|
-
/** SwiftUI's control size. `large` by default. iOS only
|
|
21
|
+
/** SwiftUI's control size. `large` by default. iOS only. Android ignores it. */
|
|
22
22
|
controlSize?: ButtonControlSize;
|
|
23
23
|
/** Draws the button in its disabled colours and stops it responding to presses. */
|
|
24
24
|
disabled?: boolean;
|
|
@@ -31,7 +31,7 @@ export type ButtonProps = {
|
|
|
31
31
|
/**
|
|
32
32
|
* Overrides the variant's own tint. A prominent style takes it as the fill and picks a contrasting
|
|
33
33
|
* label. `glass` has to reach the material through `glassEffect` instead, so tinting one costs it
|
|
34
|
-
* the stock `.glass` style
|
|
34
|
+
* the stock `.glass` style (see the iOS implementation).
|
|
35
35
|
*/
|
|
36
36
|
tint?: ColorToken;
|
|
37
37
|
/** The look. `accent` by default. Material has no glass, so on Android `glass` is an outlined button. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ResponsiveSx } from '@hzblj/kara-sx';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
/**
|
|
4
|
-
* A raised container
|
|
4
|
+
* A raised container: SwiftUI `VStack` / Compose `Column` on `surface.primary`, with a large radius, `s16` padding and
|
|
5
5
|
* the `card` shadow. Any `sx` prop overrides its default.
|
|
6
6
|
*/
|
|
7
7
|
export type CardProps = ResponsiveSx & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
/** Material's `Checkbox` on Android. iOS has none, so there it is a SwiftUI `Toggle
|
|
2
|
+
/** Material's `Checkbox` on Android. iOS has none, so there it is a SwiftUI `Toggle`, the same switch as `Switch`. */
|
|
3
3
|
export type CheckboxProps = {
|
|
4
4
|
/** Dims the control and ignores taps. */
|
|
5
5
|
disabled?: boolean;
|
|
@@ -7,7 +7,7 @@ export type CheckboxProps = {
|
|
|
7
7
|
label?: string;
|
|
8
8
|
/** Called with the new value when the user toggles it. */
|
|
9
9
|
onValueChange?: (value: boolean) => void;
|
|
10
|
-
/** Whether it is checked. Controlled
|
|
10
|
+
/** Whether it is checked. Controlled: update it from `onValueChange`. */
|
|
11
11
|
value: boolean;
|
|
12
12
|
};
|
|
13
13
|
export type CheckboxComponent = (props: CheckboxProps) => ReactNode;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
/** A filter pill on a `Pressable`, not a native control
|
|
2
|
+
/** A filter pill on a `Pressable`, not a native control. It belongs to the React Native tier, so it needs no host. */
|
|
3
3
|
export type ChipProps = {
|
|
4
4
|
/** The text in the pill. */
|
|
5
5
|
label: string;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* A row with a label and a colour well that opens a picker: SwiftUI's `ColorPicker` on iOS. Compose ships none, so on
|
|
4
|
+
* Android it is kara's own, in the same shape: a well with a rainbow ring, and a sheet with a grid of swatches, a
|
|
5
|
+
* spectrum and RGB sliders.
|
|
5
6
|
*/
|
|
6
7
|
export type ColorPickerProps = {
|
|
7
|
-
/** Text beside the colour well. */
|
|
8
|
+
/** Text beside the colour well, and the Android sheet's title. */
|
|
8
9
|
label?: string;
|
|
9
10
|
/** Called with the colour the user picks. */
|
|
10
11
|
onValueChange?: (color: string) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
export type DatePickerMode = 'date' | 'datetime' | 'time';
|
|
3
3
|
/**
|
|
4
|
-
* A date or time picker
|
|
4
|
+
* A date or time picker: SwiftUI's compact `DatePicker` on iOS, a field that opens Material's picker dialog on a tap
|
|
5
5
|
* on Android. The React Native tier: it brings its own host and sizes itself to the value, so it sits in a row beside
|
|
6
6
|
* its label like a `Text`.
|
|
7
7
|
*/
|
|
@@ -15,11 +15,11 @@ export type DatePickerProps = {
|
|
|
15
15
|
* `value`'s time of day.
|
|
16
16
|
*/
|
|
17
17
|
mode?: DatePickerMode;
|
|
18
|
-
/** Called with the new date
|
|
18
|
+
/** Called with the new date: on iOS as it changes, on Android when the dialog is confirmed. */
|
|
19
19
|
onValueChange?: (date: Date) => void;
|
|
20
|
-
/** Test identifier
|
|
20
|
+
/** Test identifier, on the native picker on iOS and on the tappable field on Android. */
|
|
21
21
|
testID?: string;
|
|
22
|
-
/** The selected date. Controlled
|
|
22
|
+
/** The selected date. Controlled: update it from `onValueChange`. */
|
|
23
23
|
value: Date;
|
|
24
24
|
};
|
|
25
25
|
export type DatePickerComponent = (props: DatePickerProps) => ReactNode;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { ColorToken } from '@hzblj/kara-theme';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
|
-
/** A horizontal hairline
|
|
3
|
+
/** A horizontal hairline: SwiftUI `Divider` / Compose `HorizontalDivider`. */
|
|
4
4
|
export type DividerProps = {
|
|
5
5
|
/** The line's colour. `border.tertiary` by default. */
|
|
6
6
|
color?: ColorToken;
|
|
7
|
-
/** Test identifier, forwarded to the native view on iOS
|
|
7
|
+
/** Test identifier, forwarded to the native view on iOS. Android ignores it. */
|
|
8
8
|
testID?: string;
|
|
9
9
|
};
|
|
10
10
|
export type DividerComponent = (props: DividerProps) => ReactNode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { IconName } from '../icon';
|
|
3
3
|
/**
|
|
4
|
-
* A floating action button
|
|
4
|
+
* A floating action button: Material's `FloatingActionButton` on Android, a 56pt accent circle (a plain SwiftUI
|
|
5
5
|
* `Button`) on iOS. It renders inline; pinning it to a corner is up to the screen.
|
|
6
6
|
*/
|
|
7
7
|
export type FabProps = {
|
|
@@ -9,7 +9,7 @@ export type FabProps = {
|
|
|
9
9
|
name: IconName;
|
|
10
10
|
/** Called when the button is pressed. */
|
|
11
11
|
onPress?: () => void;
|
|
12
|
-
/** Test identifier, forwarded to the native view on iOS
|
|
12
|
+
/** Test identifier, forwarded to the native view on iOS. Android ignores it. */
|
|
13
13
|
testID?: string;
|
|
14
14
|
};
|
|
15
15
|
export type FabComponent = (props: FabProps) => ReactNode;
|
|
@@ -2,13 +2,13 @@ import type { ResponsiveViewSx } from '@hzblj/kara-sx';
|
|
|
2
2
|
import type { ColorToken } from '@hzblj/kara-theme';
|
|
3
3
|
import type { ReactNode } from 'react';
|
|
4
4
|
/**
|
|
5
|
-
* Glass around a React Native subtree, shaped as a capsule
|
|
6
|
-
* Liquid Glass. Android: frosted glass
|
|
7
|
-
* (or `tint`) and a hairline. iOS before 26 has no Liquid Glass and draws a capsule of `tint` instead, or
|
|
8
|
-
* buttons' translucent fill (`btn.bg.glass.base`) when there is none.
|
|
5
|
+
* Glass around a React Native subtree, shaped as a capsule. It belongs to the React Native tier, so it needs no host.
|
|
6
|
+
* iOS 26: Liquid Glass. Android: frosted glass, made of what lies behind, blurred on Android 12+, under a translucent
|
|
7
|
+
* tonal surface (or `tint`) and a hairline. iOS before 26 has no Liquid Glass and draws a capsule of `tint` instead, or
|
|
8
|
+
* of the glass buttons' translucent fill (`btn.bg.glass.base`) when there is none.
|
|
9
9
|
*
|
|
10
10
|
* On Android each glass re-records what lies behind it before every frame: a few buttons cost nothing, but keep it out
|
|
11
|
-
* of the cells of a long list
|
|
11
|
+
* of the cells of a long list. A plain `tint` reads as well there.
|
|
12
12
|
*/
|
|
13
13
|
export type GlassViewProps = ResponsiveViewSx & {
|
|
14
14
|
/** React Native views. Give them `pointerEvents="none"` when `interactive`, so the press reaches the `Pressable`. */
|
|
@@ -2,13 +2,13 @@ import type { ResponsiveSx } from '@hzblj/kara-sx';
|
|
|
2
2
|
import type { SpaceSize } from '@hzblj/kara-theme';
|
|
3
3
|
import type { ReactNode } from 'react';
|
|
4
4
|
export type HStackAlign = 'center' | 'end' | 'start';
|
|
5
|
-
/** A horizontal stack
|
|
5
|
+
/** A horizontal stack: SwiftUI `HStack` / Compose `Row`. */
|
|
6
6
|
export type HStackProps = ResponsiveSx & {
|
|
7
|
-
/** How the children line up vertically
|
|
7
|
+
/** How the children line up vertically: `start` is the top, `end` the bottom. `start` by default. */
|
|
8
8
|
align?: HStackAlign;
|
|
9
9
|
/** Native views, laid out from the leading edge. */
|
|
10
10
|
children?: ReactNode;
|
|
11
|
-
/** Makes the stack pressable
|
|
11
|
+
/** Makes the stack pressable: a tap gesture on iOS, a `clickable` with Material's ripple on Android. */
|
|
12
12
|
onPress?: () => void;
|
|
13
13
|
/** The gap between children. Unset, SwiftUI puts its default spacing between them and Compose none. */
|
|
14
14
|
spacing?: SpaceSize;
|
|
@@ -11,12 +11,12 @@ declare global {
|
|
|
11
11
|
}
|
|
12
12
|
type DeclaredIconName = keyof KaraIcons & string;
|
|
13
13
|
/**
|
|
14
|
-
* One of the app's icons. Once the plugin has written `kara-icons.d.ts` only those names type-check
|
|
14
|
+
* One of the app's icons. Once the plugin has written `kara-icons.d.ts` only those names type-check: an icon removed
|
|
15
15
|
* from the folder fails at every call site. Before that, any string, so a project can adopt icons gradually.
|
|
16
16
|
*/
|
|
17
17
|
export type IconName = [DeclaredIconName] extends [never] ? string : DeclaredIconName;
|
|
18
18
|
/**
|
|
19
|
-
* One of the app's icons, in a host
|
|
19
|
+
* One of the app's icons, in a host: SwiftUI `Image` from the asset catalog on iOS, Material's `Icon` with the vector
|
|
20
20
|
* drawable on Android. `RnIcon` draws the same asset outside one.
|
|
21
21
|
*/
|
|
22
22
|
export type IconProps = {
|
|
@@ -24,11 +24,11 @@ export type IconProps = {
|
|
|
24
24
|
accessibilityLabel?: string;
|
|
25
25
|
/** The icon's tint. `content.primary` by default. */
|
|
26
26
|
color?: ColorToken;
|
|
27
|
-
/** Which of the app's icons
|
|
27
|
+
/** Which of the app's icons, a key of `KaraIcons`. */
|
|
28
28
|
name: IconName;
|
|
29
29
|
/** Its width and height, a spacing token. `s24` by default. */
|
|
30
30
|
size?: SpaceSize;
|
|
31
|
-
/** Test identifier, forwarded to the native view on iOS
|
|
31
|
+
/** Test identifier, forwarded to the native view on iOS. Android ignores it. */
|
|
32
32
|
testID?: string;
|
|
33
33
|
};
|
|
34
34
|
export type IconComponent = (props: IconProps) => ReactNode;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { IconName } from '../icon';
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* A button that is just an icon: a plain SwiftUI `Button` on iOS, Material's `IconButton` on Android. The icon sits
|
|
5
|
+
* centred in a tap target the size each platform asks for, 44pt on iOS and 48dp on Android, so a row of them spaces
|
|
6
|
+
* itself the same way on both.
|
|
7
|
+
*/
|
|
4
8
|
export type IconButtonProps = {
|
|
5
|
-
/**
|
|
9
|
+
/** Dims the icon (iOS's own disabled look, `btn.content.disabled` on Android) and stops the button responding. */
|
|
6
10
|
disabled?: boolean;
|
|
7
11
|
/** The icon, one of the app's. */
|
|
8
12
|
name: IconName;
|
|
9
13
|
/** Called when the button is pressed. */
|
|
10
14
|
onPress?: () => void;
|
|
11
|
-
/** Test identifier, forwarded to the native view on iOS
|
|
15
|
+
/** Test identifier, forwarded to the native view on iOS. Android ignores it. */
|
|
12
16
|
testID?: string;
|
|
13
17
|
};
|
|
14
18
|
export type IconButtonComponent = (props: IconButtonProps) => ReactNode;
|
|
@@ -2,7 +2,7 @@ import type { ResponsiveViewSx } from '@hzblj/kara-sx';
|
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
import type { StyleProp, ViewStyle } from 'react-native';
|
|
4
4
|
/**
|
|
5
|
-
* A host for native atoms in a React Native layout
|
|
5
|
+
* A host for native atoms in a React Native layout: the SwiftUI / Compose `Host` an `@expo/ui` tree mounts into. It
|
|
6
6
|
* sits in that layout like a `Box`, and takes `Box`'s `sx` props for it: `h`, `flex`, margins.
|
|
7
7
|
*/
|
|
8
8
|
export type IslandProps = ResponsiveViewSx & {
|
|
@@ -14,15 +14,15 @@ export type IslandProps = ResponsiveViewSx & {
|
|
|
14
14
|
* width maps to `fixedSize(horizontal: true)`, so the native side ignores the proposed width and
|
|
15
15
|
* resolves a `wide` stack's ideal width as unbounded.
|
|
16
16
|
*
|
|
17
|
-
* Turn it off
|
|
17
|
+
* Turn it off (and give the island an explicit height, `h`) when the subtree contains an
|
|
18
18
|
* `RnView`: that host drives its SwiftUI frame from the child's Yoga-laid-out bounds while this one
|
|
19
19
|
* writes its measured size back into the Yoga style, and the two together spin a layout loop that
|
|
20
20
|
* hangs the main thread as soon as the views lay out on screen.
|
|
21
21
|
*/
|
|
22
22
|
matchContents?: boolean;
|
|
23
|
-
/** A React Native style for the host view, merged over the `sx` props
|
|
23
|
+
/** A React Native style for the host view, merged over the `sx` props, for what they cannot say. */
|
|
24
24
|
style?: StyleProp<ViewStyle>;
|
|
25
|
-
/** Test identifier, forwarded to the host view on iOS
|
|
25
|
+
/** Test identifier, forwarded to the host view on iOS. Android ignores it. */
|
|
26
26
|
testID?: string;
|
|
27
27
|
};
|
|
28
28
|
export type IslandComponent = (props: IslandProps) => ReactNode;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* A scrolling list
|
|
3
|
+
* A scrolling list: SwiftUI `List`, Compose `LazyColumn`. It has no height of its own, so it needs one from outside:
|
|
4
4
|
* a `Screen`, or an `Island` with `matchContents={false}` and a height. In an island that sizes itself to its content
|
|
5
5
|
* Compose measures it against an infinite height and throws ("Vertically scrollable component was measured with an
|
|
6
6
|
* infinity maximum height"); SwiftUI shows nothing. For a handful of rows that should not scroll, use a `VStack`.
|
|
7
7
|
*
|
|
8
|
-
* Rows are separated for you
|
|
8
|
+
* Rows are separated for you (SwiftUI's own separators, a `Divider` between rows on Android), so a `Divider` among
|
|
9
9
|
* the children is one too many: on iOS it becomes an empty row of its own.
|
|
10
10
|
*/
|
|
11
11
|
export type ListProps = {
|
|
12
|
-
/** The rows
|
|
12
|
+
/** The rows: native views, one row each. */
|
|
13
13
|
children: ReactNode;
|
|
14
14
|
/**
|
|
15
|
-
* Enables pull-to-refresh. Async on purpose
|
|
15
|
+
* Enables pull-to-refresh. Async on purpose (see `ScrollViewProps.onRefresh`): the spinner runs
|
|
16
16
|
* until the promise settles, so neither platform needs a `refreshing` flag kept in sync by hand.
|
|
17
17
|
*/
|
|
18
18
|
onRefresh?: () => Promise<void>;
|
|
19
|
-
/** Test identifier, forwarded to the native view on iOS
|
|
19
|
+
/** Test identifier, forwarded to the native view on iOS. Android ignores it. */
|
|
20
20
|
testID?: string;
|
|
21
21
|
};
|
|
22
22
|
export type ListComponent = (props: ListProps) => ReactNode;
|
|
@@ -7,7 +7,7 @@ export type PickerOption = {
|
|
|
7
7
|
value: string;
|
|
8
8
|
};
|
|
9
9
|
/**
|
|
10
|
-
* A single choice from a list
|
|
10
|
+
* A single choice from a list: a SwiftUI wheel picker on iOS, Material's exposed dropdown on Android. It brings its
|
|
11
11
|
* own host, so it renders outside `Screen` and `Island` as well.
|
|
12
12
|
*/
|
|
13
13
|
export type PickerProps = {
|
|
@@ -1,21 +1,37 @@
|
|
|
1
1
|
import type { ResponsiveViewSx } from '@hzblj/kara-sx';
|
|
2
|
+
import type { OpacitySize } from '@hzblj/kara-theme';
|
|
2
3
|
import type { ReactNode } from 'react';
|
|
3
4
|
import type { Haptic } from '../../haptics';
|
|
5
|
+
/** How the content answers a press: it springs down, it dims, or it stays still. */
|
|
6
|
+
export type PressEffect = 'none' | 'opacity' | 'scale';
|
|
4
7
|
/**
|
|
5
|
-
* React Native's `Pressable`, styled through `sx` like a `Box`, taking touches 8 points past its edges.
|
|
6
|
-
*
|
|
7
|
-
* pressable's shape
|
|
8
|
-
*
|
|
8
|
+
* React Native's `Pressable`, styled through `sx` like a `Box`, taking touches 8 points past its edges. Each platform
|
|
9
|
+
* presses its own way by default: iOS springs the content down to 96%, Android draws Material's ripple over it,
|
|
10
|
+
* clipped to the pressable's shape. `pressEffect` picks the same answer on both, and Android keeps its ripple on top
|
|
11
|
+
* unless `ripple` is off. Give it the `borderRadius` of what it wraps (`full` around a `GlassView`). The React Native
|
|
12
|
+
* tier: it needs no host.
|
|
9
13
|
*/
|
|
10
14
|
export type PressableProps = ResponsiveViewSx & {
|
|
11
15
|
/** The pressable content. */
|
|
12
16
|
children?: ReactNode;
|
|
13
|
-
/** Ignores presses
|
|
17
|
+
/** Ignores presses: no `onPress`, no haptic, no press effect or ripple. */
|
|
14
18
|
disabled?: boolean;
|
|
15
19
|
/** Played on press. `true` is a `light` impact; a name picks the haptic, e.g. `selection` for a choice. */
|
|
16
20
|
haptic?: boolean | Haptic;
|
|
17
21
|
/** Called when the press is released, after the `haptic` plays. */
|
|
18
22
|
onPress?: () => void;
|
|
23
|
+
/**
|
|
24
|
+
* How the content answers while it is held. `scale` springs it down to `pressedScale`, `opacity` dims it to
|
|
25
|
+
* `pressedOpacity`, `none` leaves it still. `scale` on iOS and `none` on Android by default, where the ripple is the
|
|
26
|
+
* press.
|
|
27
|
+
*/
|
|
28
|
+
pressEffect?: PressEffect;
|
|
29
|
+
/** What `opacity` dims to, an opacity token. `o60` by default. */
|
|
30
|
+
pressedOpacity?: OpacitySize;
|
|
31
|
+
/** What `scale` springs down to. `0.96` by default. */
|
|
32
|
+
pressedScale?: number;
|
|
33
|
+
/** Android's ripple: Material's pressed state layer over the content, clipped to the shape. On by default. iOS has none. */
|
|
34
|
+
ripple?: boolean;
|
|
19
35
|
/** Test identifier, forwarded to the view. */
|
|
20
36
|
testID?: string;
|
|
21
37
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* A progress bar or ring, tinted `fill.accent.primary
|
|
4
|
-
* `LinearProgressIndicator` and `CircularProgressIndicator`.
|
|
3
|
+
* A progress bar or ring, tinted `fill.accent.primary`: SwiftUI `ProgressView` (a capacity `Gauge` for a ring with a
|
|
4
|
+
* value, which `ProgressView` cannot draw on iOS) / Compose's `LinearProgressIndicator` and `CircularProgressIndicator`.
|
|
5
5
|
*/
|
|
6
6
|
export type ProgressProps = {
|
|
7
7
|
/** A circular indicator instead of a bar. Off by default. */
|
|
@@ -2,10 +2,10 @@ import type { ResponsiveViewSx } from '@hzblj/kara-sx';
|
|
|
2
2
|
import type { FlatListProps as RNFlatListProps } from 'react-native';
|
|
3
3
|
/**
|
|
4
4
|
* Top-level `sx` styles the viewport; `content` styles the scrolling content container, so padding and
|
|
5
|
-
* gap belong there
|
|
5
|
+
* gap belong there (the same split as `RnScrollView`). `removeClippedSubviews` is off unless you turn it on:
|
|
6
6
|
* Android's default would detach a row's host before it has measured itself, and the row would stay empty.
|
|
7
7
|
*/
|
|
8
8
|
export type RnFlatListProps<TItem> = ResponsiveViewSx & Omit<RNFlatListProps<TItem>, 'contentContainerStyle' | 'style'> & {
|
|
9
|
-
/** Styles the scrolling content container
|
|
9
|
+
/** Styles the scrolling content container; padding and gap belong here. */
|
|
10
10
|
content?: ResponsiveViewSx;
|
|
11
11
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { IconProps } from '../icon';
|
|
3
|
-
/** The same contract as `Icon`, for the React Native tier
|
|
3
|
+
/** The same contract as `Icon`, for the React Native tier: anywhere, no `Screen` or `Island` needed. */
|
|
4
4
|
export type RnIconProps = IconProps;
|
|
5
5
|
export type RnIconComponent = (props: RnIconProps) => ReactNode;
|
|
@@ -3,7 +3,7 @@ import type { ReactNode } from 'react';
|
|
|
3
3
|
import type { ScrollViewProps as RNScrollViewProps } from 'react-native';
|
|
4
4
|
import type { ScrollViewAxis } from '../scroll-view';
|
|
5
5
|
/**
|
|
6
|
-
* React Native tier scroll container
|
|
6
|
+
* React Native tier scroll container, the sibling of `RnView`/`RnText`. Use it when the
|
|
7
7
|
* subtree is React Native and native atoms are embedded through `Island`. For a screen that
|
|
8
8
|
* is native all the way down, reach for the `ScrollView` atom instead.
|
|
9
9
|
*
|
|
@@ -15,7 +15,7 @@ export type RnScrollViewProps = ResponsiveViewSx & Omit<RNScrollViewProps, 'cont
|
|
|
15
15
|
axis?: ScrollViewAxis;
|
|
16
16
|
/** The scrolling content. */
|
|
17
17
|
children?: ReactNode;
|
|
18
|
-
/** Styles the scrolling content container
|
|
18
|
+
/** Styles the scrolling content container; padding and gap belong here. */
|
|
19
19
|
content?: ResponsiveViewSx;
|
|
20
20
|
/** Shows the scroll indicators. On by default. */
|
|
21
21
|
showsIndicators?: boolean;
|
|
@@ -2,10 +2,10 @@ import type { ResponsiveViewSx } from '@hzblj/kara-sx';
|
|
|
2
2
|
import type { DefaultSectionT, SectionListProps as RNSectionListProps } from 'react-native';
|
|
3
3
|
/**
|
|
4
4
|
* Top-level `sx` styles the viewport; `content` styles the scrolling content container, so padding and
|
|
5
|
-
* gap belong there
|
|
5
|
+
* gap belong there (the same split as `RnScrollView` and `RnFlatList`). `removeClippedSubviews` is off unless
|
|
6
6
|
* you turn it on, as in `RnFlatList`: Android's default would leave rows with hosts in them empty.
|
|
7
7
|
*/
|
|
8
8
|
export type RnSectionListProps<TItem, TSection = DefaultSectionT> = ResponsiveViewSx & Omit<RNSectionListProps<TItem, TSection>, 'contentContainerStyle' | 'style'> & {
|
|
9
|
-
/** Styles the scrolling content container
|
|
9
|
+
/** Styles the scrolling content container; padding and gap belong here. */
|
|
10
10
|
content?: ResponsiveViewSx;
|
|
11
11
|
};
|
|
@@ -3,8 +3,8 @@ import type { ColorToken, TextVariant } from '@hzblj/kara-theme';
|
|
|
3
3
|
import type { ReactNode } from 'react';
|
|
4
4
|
import type { TextProps as RNTextProps } from 'react-native';
|
|
5
5
|
/**
|
|
6
|
-
* React Native's `Text` in a theme typography variant
|
|
7
|
-
* `Box`'s `sx` surface for its own box
|
|
6
|
+
* React Native's `Text` in a theme typography variant: the React Native tier, for text outside a native host. It takes
|
|
7
|
+
* `Box`'s `sx` surface for its own box (margins, flex, padding, a background), all but `align`, which here aligns the
|
|
8
8
|
* lines.
|
|
9
9
|
*/
|
|
10
10
|
export type RnTextProps = Omit<RNTextProps, 'style'> & Omit<ResponsiveViewSx, 'align'> & {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
-
/** Carries a React Native view into a SwiftUI or Compose tree
|
|
2
|
+
/** Carries a React Native view into a SwiftUI or Compose tree: `@expo/ui`'s `RNHostView` on both platforms. */
|
|
3
3
|
export type RnViewProps = {
|
|
4
4
|
/**
|
|
5
5
|
* A single React Native *view*. It may not contain React Native text: a bare string becomes a
|
|
6
6
|
* `RawText` node, which has no component view, so mounting it across the SwiftUI host boundary
|
|
7
7
|
* fails the `RCTComponentViewFactory` assertion and takes the whole app down. `@expo/ui` states
|
|
8
|
-
* the rule itself in `ListItem.ios.tsx`
|
|
8
|
+
* the rule itself in `ListItem.ios.tsx` ("SwiftUI hosts can't render bare strings") and wraps
|
|
9
9
|
* every raw string in a SwiftUI `Text` before it reaches a host. Do the same: use the `Text` atom
|
|
10
10
|
* inside the host, and keep `RnText` outside it.
|
|
11
11
|
*/
|
|
@@ -15,7 +15,7 @@ export type RnViewProps = {
|
|
|
15
15
|
* intrinsic size and would otherwise stretch to fill the SwiftUI parent.
|
|
16
16
|
*/
|
|
17
17
|
matchContents?: boolean;
|
|
18
|
-
/** Not forwarded on either platform
|
|
18
|
+
/** Not forwarded on either platform: give the child its own `testID`. */
|
|
19
19
|
testID?: string;
|
|
20
20
|
};
|
|
21
21
|
export type RnViewComponent = (props: RnViewProps) => ReactNode;
|
|
@@ -3,7 +3,7 @@ import type { SpaceSize } from '@hzblj/kara-theme';
|
|
|
3
3
|
import type { ReactNode } from 'react';
|
|
4
4
|
export type ScrollViewAxis = 'horizontal' | 'vertical';
|
|
5
5
|
/**
|
|
6
|
-
* The `sx` props style the scrolling *content* container, not the viewport
|
|
6
|
+
* The `sx` props style the scrolling *content* container, not the viewport: `p` behaves
|
|
7
7
|
* like React Native's `contentContainerStyle` padding and scrolls with the content.
|
|
8
8
|
*/
|
|
9
9
|
export type ScrollViewProps = ResponsiveSx & {
|
|
@@ -13,13 +13,13 @@ export type ScrollViewProps = ResponsiveSx & {
|
|
|
13
13
|
children?: ReactNode;
|
|
14
14
|
/**
|
|
15
15
|
* Enables pull-to-refresh. Async on purpose: the spinner runs until the promise settles, which is
|
|
16
|
-
* what SwiftUI's `refreshable` expects and what Compose's controlled indicator is driven from
|
|
16
|
+
* what SwiftUI's `refreshable` expects and what Compose's controlled indicator is driven from, so
|
|
17
17
|
* neither platform needs a separate `refreshing` flag to be kept in sync by the caller.
|
|
18
18
|
*
|
|
19
19
|
* Only a vertical scroll view can be pulled; on a horizontal one both platforms ignore it.
|
|
20
20
|
*/
|
|
21
21
|
onRefresh?: () => Promise<void>;
|
|
22
|
-
/** iOS only
|
|
22
|
+
/** iOS only: Compose exposes no indicator toggle, so Android always shows the native one. */
|
|
23
23
|
showsIndicators?: boolean;
|
|
24
24
|
/** The space between children. */
|
|
25
25
|
spacing?: SpaceSize;
|