@bacon-pos/ui 0.10.0 → 0.15.1
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/lib/commonjs/components/Alert/Alert.js +137 -0
- package/lib/commonjs/components/Alert/Alert.js.map +1 -0
- package/lib/commonjs/components/Alert/Alert.stories.js +104 -0
- package/lib/commonjs/components/Alert/Alert.stories.js.map +1 -0
- package/lib/commonjs/components/Alert/Alert.test.js +62 -0
- package/lib/commonjs/components/Alert/Alert.test.js.map +1 -0
- package/lib/commonjs/components/Alert/index.js +13 -0
- package/lib/commonjs/components/Alert/index.js.map +1 -0
- package/lib/commonjs/components/CodeInput/CodeInput.js +28 -9
- package/lib/commonjs/components/CodeInput/CodeInput.js.map +1 -1
- package/lib/commonjs/components/CodeInput/CodeInput.stories.js +28 -1
- package/lib/commonjs/components/CodeInput/CodeInput.stories.js.map +1 -1
- package/lib/commonjs/components/CodeInput/CodeInput.test.js +16 -0
- package/lib/commonjs/components/CodeInput/CodeInput.test.js.map +1 -1
- package/lib/commonjs/components/Dialog/Dialog.js +116 -71
- package/lib/commonjs/components/Dialog/Dialog.js.map +1 -1
- package/lib/commonjs/components/Dialog/StepDialog.js +111 -0
- package/lib/commonjs/components/Dialog/StepDialog.js.map +1 -0
- package/lib/commonjs/components/Dialog/StepDialog.stories.js +157 -0
- package/lib/commonjs/components/Dialog/StepDialog.stories.js.map +1 -0
- package/lib/commonjs/components/Dialog/StepDialog.test.js +118 -0
- package/lib/commonjs/components/Dialog/StepDialog.test.js.map +1 -0
- package/lib/commonjs/components/Dialog/index.js +7 -0
- package/lib/commonjs/components/Dialog/index.js.map +1 -1
- package/lib/commonjs/components/Icon/icons.generated.js +9 -1
- package/lib/commonjs/components/Icon/icons.generated.js.map +1 -1
- package/lib/commonjs/components/List/List.js +45 -0
- package/lib/commonjs/components/List/List.js.map +1 -0
- package/lib/commonjs/components/List/List.stories.js +215 -0
- package/lib/commonjs/components/List/List.stories.js.map +1 -0
- package/lib/commonjs/components/List/List.test.js +94 -0
- package/lib/commonjs/components/List/List.test.js.map +1 -0
- package/lib/commonjs/components/List/ListItem.js +210 -0
- package/lib/commonjs/components/List/ListItem.js.map +1 -0
- package/lib/commonjs/components/List/index.js +20 -0
- package/lib/commonjs/components/List/index.js.map +1 -0
- package/lib/commonjs/components/Menu/Menu.js +11 -3
- package/lib/commonjs/components/Menu/Menu.js.map +1 -1
- package/lib/commonjs/components/ProgressBar/ProgressBar.js +4 -3
- package/lib/commonjs/components/ProgressBar/ProgressBar.js.map +1 -1
- package/lib/commonjs/components/Sidebar/Sidebar.js +20 -3
- package/lib/commonjs/components/Sidebar/Sidebar.js.map +1 -1
- package/lib/commonjs/components/Sidebar/Sidebar.stories.js +17 -1
- package/lib/commonjs/components/Sidebar/Sidebar.stories.js.map +1 -1
- package/lib/commonjs/components/StatTile/StatTile.js +94 -0
- package/lib/commonjs/components/StatTile/StatTile.js.map +1 -0
- package/lib/commonjs/components/StatTile/StatTile.stories.js +100 -0
- package/lib/commonjs/components/StatTile/StatTile.stories.js.map +1 -0
- package/lib/commonjs/components/StatTile/StatTile.test.js +49 -0
- package/lib/commonjs/components/StatTile/StatTile.test.js.map +1 -0
- package/lib/commonjs/components/StatTile/index.js +13 -0
- package/lib/commonjs/components/StatTile/index.js.map +1 -0
- package/lib/commonjs/components/Table/Table.js +69 -6
- package/lib/commonjs/components/Table/Table.js.map +1 -1
- package/lib/commonjs/components/Table/Table.stories.js +118 -1
- package/lib/commonjs/components/Table/Table.stories.js.map +1 -1
- package/lib/commonjs/components/Table/Table.test.js +58 -0
- package/lib/commonjs/components/Table/Table.test.js.map +1 -1
- package/lib/commonjs/components/_internal/ModalHostContext.js +21 -0
- package/lib/commonjs/components/_internal/ModalHostContext.js.map +1 -0
- package/lib/commonjs/components/index.js +64 -31
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/module/components/Alert/Alert.js +133 -0
- package/lib/module/components/Alert/Alert.js.map +1 -0
- package/lib/module/components/Alert/Alert.stories.js +100 -0
- package/lib/module/components/Alert/Alert.stories.js.map +1 -0
- package/lib/module/components/Alert/Alert.test.js +62 -0
- package/lib/module/components/Alert/Alert.test.js.map +1 -0
- package/lib/module/components/Alert/index.js +4 -0
- package/lib/module/components/Alert/index.js.map +1 -0
- package/lib/module/components/CodeInput/CodeInput.js +28 -9
- package/lib/module/components/CodeInput/CodeInput.js.map +1 -1
- package/lib/module/components/CodeInput/CodeInput.stories.js +27 -0
- package/lib/module/components/CodeInput/CodeInput.stories.js.map +1 -1
- package/lib/module/components/CodeInput/CodeInput.test.js +16 -0
- package/lib/module/components/CodeInput/CodeInput.test.js.map +1 -1
- package/lib/module/components/Dialog/Dialog.js +116 -71
- package/lib/module/components/Dialog/Dialog.js.map +1 -1
- package/lib/module/components/Dialog/StepDialog.js +107 -0
- package/lib/module/components/Dialog/StepDialog.js.map +1 -0
- package/lib/module/components/Dialog/StepDialog.stories.js +153 -0
- package/lib/module/components/Dialog/StepDialog.stories.js.map +1 -0
- package/lib/module/components/Dialog/StepDialog.test.js +117 -0
- package/lib/module/components/Dialog/StepDialog.test.js.map +1 -0
- package/lib/module/components/Dialog/index.js +1 -0
- package/lib/module/components/Dialog/index.js.map +1 -1
- package/lib/module/components/Icon/icons.generated.js +9 -1
- package/lib/module/components/Icon/icons.generated.js.map +1 -1
- package/lib/module/components/List/List.js +41 -0
- package/lib/module/components/List/List.js.map +1 -0
- package/lib/module/components/List/List.stories.js +211 -0
- package/lib/module/components/List/List.stories.js.map +1 -0
- package/lib/module/components/List/List.test.js +94 -0
- package/lib/module/components/List/List.test.js.map +1 -0
- package/lib/module/components/List/ListItem.js +206 -0
- package/lib/module/components/List/ListItem.js.map +1 -0
- package/lib/module/components/List/index.js +5 -0
- package/lib/module/components/List/index.js.map +1 -0
- package/lib/module/components/Menu/Menu.js +12 -4
- package/lib/module/components/Menu/Menu.js.map +1 -1
- package/lib/module/components/ProgressBar/ProgressBar.js +4 -3
- package/lib/module/components/ProgressBar/ProgressBar.js.map +1 -1
- package/lib/module/components/Sidebar/Sidebar.js +20 -3
- package/lib/module/components/Sidebar/Sidebar.js.map +1 -1
- package/lib/module/components/Sidebar/Sidebar.stories.js +16 -0
- package/lib/module/components/Sidebar/Sidebar.stories.js.map +1 -1
- package/lib/module/components/StatTile/StatTile.js +90 -0
- package/lib/module/components/StatTile/StatTile.js.map +1 -0
- package/lib/module/components/StatTile/StatTile.stories.js +96 -0
- package/lib/module/components/StatTile/StatTile.stories.js.map +1 -0
- package/lib/module/components/StatTile/StatTile.test.js +49 -0
- package/lib/module/components/StatTile/StatTile.test.js.map +1 -0
- package/lib/module/components/StatTile/index.js +4 -0
- package/lib/module/components/StatTile/index.js.map +1 -0
- package/lib/module/components/Table/Table.js +70 -7
- package/lib/module/components/Table/Table.js.map +1 -1
- package/lib/module/components/Table/Table.stories.js +117 -0
- package/lib/module/components/Table/Table.stories.js.map +1 -1
- package/lib/module/components/Table/Table.test.js +58 -0
- package/lib/module/components/Table/Table.test.js.map +1 -1
- package/lib/module/components/_internal/ModalHostContext.js +17 -0
- package/lib/module/components/_internal/ModalHostContext.js.map +1 -0
- package/lib/module/components/index.js +3 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/typescript/commonjs/components/Alert/Alert.d.ts +41 -0
- package/lib/typescript/commonjs/components/Alert/Alert.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Alert/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Alert/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/CodeInput/CodeInput.d.ts +5 -1
- package/lib/typescript/commonjs/components/CodeInput/CodeInput.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/Dialog/Dialog.d.ts +13 -1
- package/lib/typescript/commonjs/components/Dialog/Dialog.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/Dialog/StepDialog.d.ts +63 -0
- package/lib/typescript/commonjs/components/Dialog/StepDialog.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Dialog/index.d.ts +1 -0
- package/lib/typescript/commonjs/components/Dialog/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/Icon/icons.generated.d.ts +8 -0
- package/lib/typescript/commonjs/components/Icon/icons.generated.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/List/List.d.ts +22 -0
- package/lib/typescript/commonjs/components/List/List.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/List/ListItem.d.ts +61 -0
- package/lib/typescript/commonjs/components/List/ListItem.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/List/index.d.ts +5 -0
- package/lib/typescript/commonjs/components/List/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Menu/Menu.d.ts +4 -2
- package/lib/typescript/commonjs/components/Menu/Menu.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/ProgressBar/ProgressBar.d.ts +3 -1
- package/lib/typescript/commonjs/components/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/Sidebar/Sidebar.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/StatTile/StatTile.d.ts +31 -0
- package/lib/typescript/commonjs/components/StatTile/StatTile.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/StatTile/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/StatTile/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Table/Table.d.ts +25 -3
- package/lib/typescript/commonjs/components/Table/Table.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/_internal/ModalHostContext.d.ts +11 -0
- package/lib/typescript/commonjs/components/_internal/ModalHostContext.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/index.d.ts.map +1 -1
- package/lib/typescript/module/components/Alert/Alert.d.ts +41 -0
- package/lib/typescript/module/components/Alert/Alert.d.ts.map +1 -0
- package/lib/typescript/module/components/Alert/index.d.ts +3 -0
- package/lib/typescript/module/components/Alert/index.d.ts.map +1 -0
- package/lib/typescript/module/components/CodeInput/CodeInput.d.ts +5 -1
- package/lib/typescript/module/components/CodeInput/CodeInput.d.ts.map +1 -1
- package/lib/typescript/module/components/Dialog/Dialog.d.ts +13 -1
- package/lib/typescript/module/components/Dialog/Dialog.d.ts.map +1 -1
- package/lib/typescript/module/components/Dialog/StepDialog.d.ts +63 -0
- package/lib/typescript/module/components/Dialog/StepDialog.d.ts.map +1 -0
- package/lib/typescript/module/components/Dialog/index.d.ts +1 -0
- package/lib/typescript/module/components/Dialog/index.d.ts.map +1 -1
- package/lib/typescript/module/components/Icon/icons.generated.d.ts +8 -0
- package/lib/typescript/module/components/Icon/icons.generated.d.ts.map +1 -1
- package/lib/typescript/module/components/List/List.d.ts +22 -0
- package/lib/typescript/module/components/List/List.d.ts.map +1 -0
- package/lib/typescript/module/components/List/ListItem.d.ts +61 -0
- package/lib/typescript/module/components/List/ListItem.d.ts.map +1 -0
- package/lib/typescript/module/components/List/index.d.ts +5 -0
- package/lib/typescript/module/components/List/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Menu/Menu.d.ts +4 -2
- package/lib/typescript/module/components/Menu/Menu.d.ts.map +1 -1
- package/lib/typescript/module/components/ProgressBar/ProgressBar.d.ts +3 -1
- package/lib/typescript/module/components/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/lib/typescript/module/components/Sidebar/Sidebar.d.ts.map +1 -1
- package/lib/typescript/module/components/StatTile/StatTile.d.ts +31 -0
- package/lib/typescript/module/components/StatTile/StatTile.d.ts.map +1 -0
- package/lib/typescript/module/components/StatTile/index.d.ts +3 -0
- package/lib/typescript/module/components/StatTile/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Table/Table.d.ts +25 -3
- package/lib/typescript/module/components/Table/Table.d.ts.map +1 -1
- package/lib/typescript/module/components/_internal/ModalHostContext.d.ts +11 -0
- package/lib/typescript/module/components/_internal/ModalHostContext.d.ts.map +1 -0
- package/lib/typescript/module/components/index.d.ts +3 -0
- package/lib/typescript/module/components/index.d.ts.map +1 -1
- package/package.json +16 -14
- package/src/components/Alert/Alert.tsx +132 -0
- package/src/components/Alert/index.ts +2 -0
- package/src/components/CodeInput/CodeInput.tsx +46 -14
- package/src/components/Dialog/Dialog.tsx +92 -31
- package/src/components/Dialog/StepDialog.tsx +173 -0
- package/src/components/Dialog/index.ts +1 -0
- package/src/components/Icon/icons.generated.ts +9 -1
- package/src/components/List/List.tsx +45 -0
- package/src/components/List/ListItem.tsx +214 -0
- package/src/components/List/index.ts +4 -0
- package/src/components/Menu/Menu.tsx +15 -6
- package/src/components/ProgressBar/ProgressBar.tsx +6 -3
- package/src/components/Sidebar/Sidebar.tsx +18 -10
- package/src/components/StatTile/StatTile.tsx +98 -0
- package/src/components/StatTile/index.ts +2 -0
- package/src/components/Table/Table.tsx +93 -8
- package/src/components/_internal/ModalHostContext.tsx +15 -0
- package/src/components/index.ts +3 -0
|
@@ -20,6 +20,8 @@ export interface ProgressBarProps {
|
|
|
20
20
|
trackColor?: string;
|
|
21
21
|
/** Track border color. Defaults to `border.default`. */
|
|
22
22
|
borderColor?: string;
|
|
23
|
+
/** Draw the track border (and inner inset). Set false for a flat, thin bar. Defaults to true. */
|
|
24
|
+
bordered?: boolean;
|
|
23
25
|
/** Animate width changes. Defaults to true. */
|
|
24
26
|
animated?: boolean;
|
|
25
27
|
/** Override the container style. */
|
|
@@ -33,5 +35,5 @@ export interface ProgressBarProps {
|
|
|
33
35
|
* row underneath shows a customizable `label` (default "Downloading...") on the
|
|
34
36
|
* left and the percentage on the right. Colors, height and width are tokens/props.
|
|
35
37
|
*/
|
|
36
|
-
export declare function ProgressBar({ progress, label, showSupporting, showValue, formatValue, height, width, color, trackColor, borderColor, animated, style, accessibilityLabel, }: ProgressBarProps): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export declare function ProgressBar({ progress, label, showSupporting, showValue, formatValue, height, width, color, trackColor, borderColor, bordered, animated, style, accessibilityLabel, }: ProgressBarProps): import("react/jsx-runtime").JSX.Element;
|
|
37
39
|
//# sourceMappingURL=ProgressBar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.d.ts","sourceRoot":"","sources":["../../../../../src/components/ProgressBar/ProgressBar.tsx"],"names":[],"mappings":"AACA,OAAO,EAA0B,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAItF,MAAM,WAAW,gBAAgB;IAC/B,iFAAiF;IACjF,QAAQ,EAAE,MAAM,CAAC;IACjB,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uEAAuE;IACvE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,0DAA0D;IAC1D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,sDAAsD;IACtD,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;IAC3C,0CAA0C;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yDAAyD;IACzD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oCAAoC;IACpC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,gDAAgD;IAChD,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAID;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,KAAwB,EACxB,cAAqB,EACrB,SAAgB,EAChB,WAAW,EACX,MAAW,EACX,KAAK,EACL,KAAK,EACL,UAAU,EACV,WAAW,EACX,QAAe,EACf,KAAK,EACL,kBAAkB,GACnB,EAAE,gBAAgB,2CA8ElB"}
|
|
1
|
+
{"version":3,"file":"ProgressBar.d.ts","sourceRoot":"","sources":["../../../../../src/components/ProgressBar/ProgressBar.tsx"],"names":[],"mappings":"AACA,OAAO,EAA0B,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAItF,MAAM,WAAW,gBAAgB;IAC/B,iFAAiF;IACjF,QAAQ,EAAE,MAAM,CAAC;IACjB,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uEAAuE;IACvE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,0DAA0D;IAC1D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,sDAAsD;IACtD,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;IAC3C,0CAA0C;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yDAAyD;IACzD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iGAAiG;IACjG,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oCAAoC;IACpC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,gDAAgD;IAChD,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAID;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,KAAwB,EACxB,cAAqB,EACrB,SAAgB,EAChB,WAAW,EACX,MAAW,EACX,KAAK,EACL,KAAK,EACL,UAAU,EACV,WAAW,EACX,QAAe,EACf,QAAe,EACf,KAAK,EACL,kBAAkB,GACnB,EAAE,gBAAgB,2CA8ElB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sidebar.d.ts","sourceRoot":"","sources":["../../../../../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A0C;IAC1C,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAEjC,iDAAiD;IACjD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,8CAA8C;IAC9C,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,kEAAkE;IAClE,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,yDAAyD;IACzD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,iEAAiE;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,+CAA+C;IAC/C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gDAAgD;IAChD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,4DAA4D;IAC5D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oCAAoC;IACpC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAgGD;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,EACtB,KAAU,EACV,SAAS,EACT,gBAAgB,EAChB,QAAQ,EACR,SAAS,EAAE,aAAa,EACxB,gBAAwB,EACxB,iBAAiB,EACjB,UAAiB,EACjB,IAAI,EACJ,MAAM,EACN,aAAmB,EACnB,cAAoB,EACpB,cAAc,EACd,KAAK,GACN,EAAE,YAAY,2CAgJd"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
import type { IconName } from '../Icon/icons.generated';
|
|
4
|
+
export interface StatTileProps {
|
|
5
|
+
/** Small label above the value. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** The value — a string/number, or a node for custom formatting/color. */
|
|
8
|
+
value: ReactNode;
|
|
9
|
+
/** Optional leading icon. */
|
|
10
|
+
icon?: IconName;
|
|
11
|
+
/** Fixed width. Omit to fill the parent (works in a flex/grid row of tiles). */
|
|
12
|
+
width?: number;
|
|
13
|
+
/** Make the tile pressable. */
|
|
14
|
+
onPress?: () => void;
|
|
15
|
+
/** Tile background. Defaults to `background.subtle`. */
|
|
16
|
+
backgroundColor?: string;
|
|
17
|
+
/** Label color. Defaults to `secondary`. */
|
|
18
|
+
labelColor?: string;
|
|
19
|
+
/** Value color (when `value` is text). Defaults to `primary`. */
|
|
20
|
+
valueColor?: string;
|
|
21
|
+
/** Override the container style. */
|
|
22
|
+
style?: StyleProp<ViewStyle>;
|
|
23
|
+
accessibilityLabel?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* StatTile — a compact KPI card: a small label over a prominent value (Figma
|
|
27
|
+
* "info card"). Fills its parent by default (so a row/grid of tiles sizes evenly)
|
|
28
|
+
* or takes a fixed `width`. `value` accepts a node for custom color/formatting.
|
|
29
|
+
*/
|
|
30
|
+
export declare function StatTile({ label, value, icon, width, onPress, backgroundColor, labelColor, valueColor, style, accessibilityLabel, }: StatTileProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
//# sourceMappingURL=StatTile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatTile.d.ts","sourceRoot":"","sources":["../../../../../src/components/StatTile/StatTile.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAmB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAG/E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAGxD,MAAM,WAAW,aAAa;IAC5B,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,KAAK,EAAE,SAAS,CAAC;IACjB,6BAA6B;IAC7B,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,gFAAgF;IAChF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,wDAAwD;IACxD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,4CAA4C;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iEAAiE;IACjE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oCAAoC;IACpC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,EACvB,KAAK,EACL,KAAK,EACL,IAAI,EACJ,KAAK,EACL,OAAO,EACP,eAAe,EACf,UAAU,EACV,UAAU,EACV,KAAK,EACL,kBAAkB,GACnB,EAAE,aAAa,2CAoDf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/StatTile/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
import type { IconName } from '../Icon/icons.generated';
|
|
3
4
|
export type ColumnAlign = 'left' | 'center' | 'right';
|
|
5
|
+
/** A structured row action (inline icon, or a row in the overflow "More" menu). */
|
|
6
|
+
export interface TableAction {
|
|
7
|
+
key: string;
|
|
8
|
+
label: string;
|
|
9
|
+
icon: IconName;
|
|
10
|
+
onPress?: () => void;
|
|
11
|
+
/** Render in the error color (red icon inline, red row in the menu). */
|
|
12
|
+
destructive?: boolean;
|
|
13
|
+
/** Dim and block the action. */
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/** Icon color override (ignored when `destructive`). */
|
|
16
|
+
color?: string;
|
|
17
|
+
}
|
|
4
18
|
export type SortDirection = 'asc' | 'desc';
|
|
5
19
|
export interface TableSort {
|
|
6
20
|
key: string;
|
|
@@ -41,9 +55,17 @@ export interface TableProps<T> {
|
|
|
41
55
|
expandedKeys?: string[];
|
|
42
56
|
defaultExpandedKeys?: string[];
|
|
43
57
|
onExpandedChange?: (keys: string[]) => void;
|
|
44
|
-
/** Trailing per-row actions (e.g.
|
|
58
|
+
/** Trailing per-row actions, free-form (e.g. custom buttons) — mutually exclusive with `expandable`. */
|
|
45
59
|
renderActions?: (row: T, index: number) => ReactNode;
|
|
46
|
-
/**
|
|
60
|
+
/** Structured per-row actions: the first `maxInlineActions` render as inline icons, the rest collapse into a "More" menu. */
|
|
61
|
+
actions?: (row: T, index: number) => TableAction[];
|
|
62
|
+
/** How many actions render inline before overflowing into the More menu. Defaults to 2. */
|
|
63
|
+
maxInlineActions?: number;
|
|
64
|
+
/** Icon for the overflow menu trigger. Defaults to `more`. */
|
|
65
|
+
moreIcon?: IconName;
|
|
66
|
+
/** Width of the overflow More menu. */
|
|
67
|
+
actionsMenuWidth?: number;
|
|
68
|
+
/** Width reserved for the actions column. Defaults to fit the actions. */
|
|
47
69
|
actionsWidth?: number;
|
|
48
70
|
/** Row selection via checkboxes. */
|
|
49
71
|
selectable?: boolean;
|
|
@@ -81,5 +103,5 @@ export interface TableProps<T> {
|
|
|
81
103
|
* with an elegant scrolling body (`maxHeight`), loading and empty states, and a
|
|
82
104
|
* card fallback below `mobileBreakpoint`.
|
|
83
105
|
*/
|
|
84
|
-
export declare function Table<T>({ columns, data, keyExtractor, onRowPress, expandable, renderExpanded, expansionMode, expandedKeys, defaultExpandedKeys, onExpandedChange, renderActions, actionsWidth, selectable, selectedKeys, defaultSelectedKeys, onSelectionChange, sort, defaultSort, onSortChange, rounded, maxHeight, scrollbarColor, loading, loadingVariant, loadingText, skeletonRows, empty, mobileBreakpoint, style, }: TableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
106
|
+
export declare function Table<T>({ columns, data, keyExtractor, onRowPress, expandable, renderExpanded, expansionMode, expandedKeys, defaultExpandedKeys, onExpandedChange, renderActions, actions, maxInlineActions, moreIcon, actionsMenuWidth, actionsWidth, selectable, selectedKeys, defaultSelectedKeys, onSelectionChange, sort, defaultSort, onSortChange, rounded, maxHeight, scrollbarColor, loading, loadingVariant, loadingText, skeletonRows, empty, mobileBreakpoint, style, }: TableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
85
107
|
//# sourceMappingURL=Table.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../../../src/components/Table/Table.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC7E,OAAO,EAOL,KAAK,SAAS,EAEd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../../../src/components/Table/Table.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC7E,OAAO,EAOL,KAAK,SAAS,EAEd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAKtB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAMxD,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEtD,mFAAmF;AACnF,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,wEAAwE;IACxE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC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AU,CAAC;IACxC,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,8CAA8C;IAC9C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qDAAqD;IACrD,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB,8EAA8E;IAC9E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAeD;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,EACvB,OAAO,EACP,IAAI,EACJ,YAAY,EACZ,UAAU,EACV,UAAkB,EAClB,cAAc,EACd,aAAwB,EACxB,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,EACb,OAAO,EACP,gBAAoB,EACpB,QAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,UAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,IAAI,EACJ,WAAW,EACX,YAAY,EACZ,OAAc,EACd,SAAS,EACT,cAAc,EACd,OAAe,EACf,cAA0B,EAC1B,WAA4B,EAC5B,YAAgB,EAChB,KAAK,EACL,gBAAsB,EACtB,KAAK,GACN,EAAE,UAAU,CAAC,CAAC,CAAC,2CAwcf"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* True when the subtree is rendered inside a full-screen (statusBarTranslucent)
|
|
3
|
+
* Modal host — e.g. `Dialog`, or a `Menu` overlay. Anchored menus use this to
|
|
4
|
+
* skip the status-bar coordinate compensation: inside such a host, a trigger
|
|
5
|
+
* measured with `measureInWindow` is already in full-screen coordinates that
|
|
6
|
+
* match the menu's own Modal, so adding the status bar height would push the
|
|
7
|
+
* menu down (a visible gap). Outside a host, the compensation is still applied.
|
|
8
|
+
*/
|
|
9
|
+
export declare const ModalHostContext: import("react").Context<boolean>;
|
|
10
|
+
export declare function useInsideModalHost(): boolean;
|
|
11
|
+
//# sourceMappingURL=ModalHostContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalHostContext.d.ts","sourceRoot":"","sources":["../../../../../src/components/_internal/ModalHostContext.tsx"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,kCAAuB,CAAC;AAErD,wBAAgB,kBAAkB,IAAI,OAAO,CAE5C"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from './Alert';
|
|
1
2
|
export * from './Avatar';
|
|
2
3
|
export * from './Badge';
|
|
3
4
|
export * from './brand';
|
|
@@ -15,6 +16,7 @@ export * from './IconButton';
|
|
|
15
16
|
export * from './Input';
|
|
16
17
|
export * from './Keypad';
|
|
17
18
|
export * from './LinkButton';
|
|
19
|
+
export * from './List';
|
|
18
20
|
export * from './Menu';
|
|
19
21
|
export * from './ProductCard';
|
|
20
22
|
export * from './ProgressBar';
|
|
@@ -23,6 +25,7 @@ export * from './Radio';
|
|
|
23
25
|
export * from './Select';
|
|
24
26
|
export * from './Sidebar';
|
|
25
27
|
export * from './Spinner';
|
|
28
|
+
export * from './StatTile';
|
|
26
29
|
export * from './Surface';
|
|
27
30
|
export * from './Switch';
|
|
28
31
|
export * from './Table';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,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AAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAE3B,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bacon-pos/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.1",
|
|
4
4
|
"description": "Bacon POS design system — React Native component library",
|
|
5
5
|
"main": "./lib/commonjs/index.js",
|
|
6
6
|
"module": "./lib/module/index.js",
|
|
@@ -28,6 +28,19 @@
|
|
|
28
28
|
"!**/*.stories.tsx"
|
|
29
29
|
],
|
|
30
30
|
"sideEffects": false,
|
|
31
|
+
"scripts": {
|
|
32
|
+
"clean": "del-cli lib",
|
|
33
|
+
"build": "bob build",
|
|
34
|
+
"prepare": "bob build",
|
|
35
|
+
"typecheck": "tsc --noEmit",
|
|
36
|
+
"gen:icons": "node scripts/generate-icons.mjs",
|
|
37
|
+
"gen:graphics": "node scripts/generate-graphics.mjs",
|
|
38
|
+
"test": "jest",
|
|
39
|
+
"storybook": "storybook dev -p 6006",
|
|
40
|
+
"build-storybook": "storybook build",
|
|
41
|
+
"release": "changeset publish",
|
|
42
|
+
"version": "changeset version"
|
|
43
|
+
},
|
|
31
44
|
"keywords": [
|
|
32
45
|
"react-native",
|
|
33
46
|
"expo",
|
|
@@ -99,16 +112,5 @@
|
|
|
99
112
|
"typescript"
|
|
100
113
|
]
|
|
101
114
|
},
|
|
102
|
-
"
|
|
103
|
-
|
|
104
|
-
"build": "bob build",
|
|
105
|
-
"typecheck": "tsc --noEmit",
|
|
106
|
-
"gen:icons": "node scripts/generate-icons.mjs",
|
|
107
|
-
"gen:graphics": "node scripts/generate-graphics.mjs",
|
|
108
|
-
"test": "jest",
|
|
109
|
-
"storybook": "storybook dev -p 6006",
|
|
110
|
-
"build-storybook": "storybook build",
|
|
111
|
-
"release": "changeset publish",
|
|
112
|
-
"version": "changeset version"
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
+
"packageManager": "pnpm@10.12.1+sha512.f0dda8580f0ee9481c5c79a1d927b9164f2c478e90992ad268bbb2465a736984391d6333d2c327913578b2804af33474ca554ba29c04a8b13060a717675ae3ac"
|
|
116
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { Pressable, View, type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
import { useTheme, type Theme } from '../../theme';
|
|
4
|
+
import { palette } from '../../theme/palette';
|
|
5
|
+
import { Icon } from '../Icon/Icon';
|
|
6
|
+
import type { IconName } from '../Icon/icons.generated';
|
|
7
|
+
import { Text } from '../Text/Text';
|
|
8
|
+
|
|
9
|
+
export type AlertStatus = 'info' | 'warning' | 'success' | 'destructive';
|
|
10
|
+
|
|
11
|
+
export interface AlertProps {
|
|
12
|
+
/** Color/status. Defaults to `info`. */
|
|
13
|
+
status?: AlertStatus;
|
|
14
|
+
/** Optional bold title line above the message. */
|
|
15
|
+
title?: string;
|
|
16
|
+
/** Message text. Alternatively pass `children`. */
|
|
17
|
+
message?: string;
|
|
18
|
+
/** Message content (overrides `message`). */
|
|
19
|
+
children?: ReactNode;
|
|
20
|
+
/** Leading icon. Defaults to `info` (as in the design). */
|
|
21
|
+
icon?: IconName;
|
|
22
|
+
/** Hide the leading icon. */
|
|
23
|
+
showIcon?: boolean;
|
|
24
|
+
/** Vertical alignment of the icon vs the text. Defaults to `center`. */
|
|
25
|
+
iconAlign?: 'top' | 'center';
|
|
26
|
+
/** Trailing content (e.g. a link/button). */
|
|
27
|
+
action?: ReactNode;
|
|
28
|
+
/** Show a close (×) button and call this on press. */
|
|
29
|
+
onClose?: () => void;
|
|
30
|
+
/** Background override (for a custom status). */
|
|
31
|
+
backgroundColor?: string;
|
|
32
|
+
/** Foreground (text/icon) override. */
|
|
33
|
+
color?: string;
|
|
34
|
+
/** Fixed width. Omit to fill the parent. */
|
|
35
|
+
width?: number;
|
|
36
|
+
/** Override the container style. */
|
|
37
|
+
style?: StyleProp<ViewStyle>;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function statusColors(theme: Theme, status: AlertStatus): { bg: string; fg: string } {
|
|
41
|
+
switch (status) {
|
|
42
|
+
case 'warning':
|
|
43
|
+
return { bg: theme.colors.feedback.warningSubtle, fg: palette.warning[600] };
|
|
44
|
+
case 'success':
|
|
45
|
+
return { bg: theme.colors.feedback.successSubtle, fg: theme.colors.feedback.success };
|
|
46
|
+
case 'destructive':
|
|
47
|
+
return { bg: theme.colors.feedback.errorSubtle, fg: theme.colors.feedback.error };
|
|
48
|
+
case 'info':
|
|
49
|
+
default:
|
|
50
|
+
return { bg: theme.colors.background.subtle, fg: palette.neutral[500] };
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Alert — an inline banner in four statuses (info / warning / success /
|
|
56
|
+
* destructive), each a subtle tinted surface with a matching icon and text
|
|
57
|
+
* (Figma "Alert"). Fills its parent by default (text wraps to any width) or takes
|
|
58
|
+
* a fixed `width`. Supports an optional title, a trailing action and a close
|
|
59
|
+
* button; colors are overridable for custom statuses.
|
|
60
|
+
*/
|
|
61
|
+
export function Alert({
|
|
62
|
+
status = 'info',
|
|
63
|
+
title,
|
|
64
|
+
message,
|
|
65
|
+
children,
|
|
66
|
+
icon = 'info',
|
|
67
|
+
showIcon = true,
|
|
68
|
+
iconAlign = 'center',
|
|
69
|
+
action,
|
|
70
|
+
onClose,
|
|
71
|
+
backgroundColor,
|
|
72
|
+
color,
|
|
73
|
+
width,
|
|
74
|
+
style,
|
|
75
|
+
}: AlertProps) {
|
|
76
|
+
const theme = useTheme();
|
|
77
|
+
const { bg, fg } = statusColors(theme, status);
|
|
78
|
+
const foreground = color ?? fg;
|
|
79
|
+
const background = backgroundColor ?? bg;
|
|
80
|
+
|
|
81
|
+
return (
|
|
82
|
+
<View
|
|
83
|
+
accessibilityRole="alert"
|
|
84
|
+
style={[
|
|
85
|
+
{
|
|
86
|
+
flexDirection: 'row',
|
|
87
|
+
alignItems: 'flex-start',
|
|
88
|
+
gap: 16,
|
|
89
|
+
paddingVertical: 20,
|
|
90
|
+
paddingHorizontal: 16,
|
|
91
|
+
borderRadius: theme.radii.lg,
|
|
92
|
+
backgroundColor: background,
|
|
93
|
+
...(width != null ? { width } : { alignSelf: 'stretch' }),
|
|
94
|
+
},
|
|
95
|
+
style,
|
|
96
|
+
]}
|
|
97
|
+
>
|
|
98
|
+
{showIcon ? (
|
|
99
|
+
<View style={{ width: 24, height: 24, flexShrink: 0, alignSelf: iconAlign === 'center' ? 'center' : 'flex-start' }}>
|
|
100
|
+
<Icon name={icon} size={24} color={foreground} />
|
|
101
|
+
</View>
|
|
102
|
+
) : null}
|
|
103
|
+
|
|
104
|
+
<View style={{ flex: 1, minWidth: 0, gap: 2 }}>
|
|
105
|
+
{title ? (
|
|
106
|
+
<Text variant="bodyLarge" weight="semibold" color={foreground}>
|
|
107
|
+
{title}
|
|
108
|
+
</Text>
|
|
109
|
+
) : null}
|
|
110
|
+
{children ?? (message ? (
|
|
111
|
+
<Text variant="bodyLarge" color={foreground}>
|
|
112
|
+
{message}
|
|
113
|
+
</Text>
|
|
114
|
+
) : null)}
|
|
115
|
+
</View>
|
|
116
|
+
|
|
117
|
+
{action ? <View style={{ flexShrink: 0 }}>{action}</View> : null}
|
|
118
|
+
|
|
119
|
+
{onClose ? (
|
|
120
|
+
<Pressable
|
|
121
|
+
onPress={onClose}
|
|
122
|
+
hitSlop={8}
|
|
123
|
+
accessibilityRole="button"
|
|
124
|
+
accessibilityLabel="Dismiss"
|
|
125
|
+
style={{ width: 24, height: 24, flexShrink: 0, alignItems: 'center', justifyContent: 'center' }}
|
|
126
|
+
>
|
|
127
|
+
<Icon name="close" size={20} color={foreground} />
|
|
128
|
+
</Pressable>
|
|
129
|
+
) : null}
|
|
130
|
+
</View>
|
|
131
|
+
);
|
|
132
|
+
}
|
|
@@ -30,6 +30,10 @@ export interface CodeInputProps {
|
|
|
30
30
|
disabled?: boolean;
|
|
31
31
|
/** Focus on mount. */
|
|
32
32
|
autoFocus?: boolean;
|
|
33
|
+
/** Mark the field invalid — turns the cells red. Pass a string to show it as a message below. */
|
|
34
|
+
error?: boolean | string;
|
|
35
|
+
/** Helper/message text below the cells. Replaced by the error message when `error` is a string. */
|
|
36
|
+
helperText?: string;
|
|
33
37
|
/** Show an eye toggle to reveal/hide the entered digits. */
|
|
34
38
|
revealable?: boolean;
|
|
35
39
|
/** Controlled reveal state. Omit for uncontrolled (toggled by the eye). */
|
|
@@ -52,21 +56,28 @@ function Cell({
|
|
|
52
56
|
filled,
|
|
53
57
|
revealed,
|
|
54
58
|
disabled,
|
|
59
|
+
error,
|
|
55
60
|
theme,
|
|
56
61
|
}: {
|
|
57
62
|
char: string;
|
|
58
63
|
filled: boolean;
|
|
59
64
|
revealed: boolean;
|
|
60
65
|
disabled: boolean;
|
|
66
|
+
error: boolean;
|
|
61
67
|
theme: Theme;
|
|
62
68
|
}) {
|
|
69
|
+
const errorColor = theme.colors.feedback.error;
|
|
63
70
|
return (
|
|
64
71
|
<View
|
|
65
72
|
testID="code-input-cell"
|
|
66
73
|
style={{ width: 20, height: 20, alignItems: 'center', justifyContent: 'center' }}
|
|
67
74
|
>
|
|
68
75
|
{revealed && filled ? (
|
|
69
|
-
<Text
|
|
76
|
+
<Text
|
|
77
|
+
variant="bodyMedium"
|
|
78
|
+
weight="medium"
|
|
79
|
+
color={disabled ? 'tertiary' : error ? errorColor : 'primary'}
|
|
80
|
+
>
|
|
70
81
|
{char}
|
|
71
82
|
</Text>
|
|
72
83
|
) : (
|
|
@@ -76,8 +87,16 @@ function Cell({
|
|
|
76
87
|
height: 20,
|
|
77
88
|
borderRadius: 10,
|
|
78
89
|
borderWidth: 1.5,
|
|
79
|
-
backgroundColor: filled
|
|
80
|
-
|
|
90
|
+
backgroundColor: filled
|
|
91
|
+
? error
|
|
92
|
+
? errorColor
|
|
93
|
+
: theme.colors.text.primary
|
|
94
|
+
: theme.colors.background.default,
|
|
95
|
+
borderColor: error
|
|
96
|
+
? errorColor
|
|
97
|
+
: filled
|
|
98
|
+
? theme.colors.text.primary
|
|
99
|
+
: theme.colors.border.strong,
|
|
81
100
|
opacity: disabled ? 0.5 : 1,
|
|
82
101
|
}}
|
|
83
102
|
/>
|
|
@@ -100,6 +119,8 @@ export function CodeInput({
|
|
|
100
119
|
onComplete,
|
|
101
120
|
disabled = false,
|
|
102
121
|
autoFocus = false,
|
|
122
|
+
error,
|
|
123
|
+
helperText,
|
|
103
124
|
revealable = false,
|
|
104
125
|
revealed: revealedProp,
|
|
105
126
|
onRevealChange,
|
|
@@ -114,6 +135,8 @@ export function CodeInput({
|
|
|
114
135
|
const [internalRevealed, setInternalRevealed] = useState(false);
|
|
115
136
|
const revealed = revealedProp ?? internalRevealed;
|
|
116
137
|
const filled = Math.min(value.length, length);
|
|
138
|
+
const hasError = Boolean(error);
|
|
139
|
+
const message = typeof error === 'string' ? error : helperText;
|
|
117
140
|
|
|
118
141
|
const handleChange = (text: string) => {
|
|
119
142
|
const digits = text.replace(/[^0-9]/g, '').slice(0, length);
|
|
@@ -141,6 +164,7 @@ export function CodeInput({
|
|
|
141
164
|
filled={i < filled}
|
|
142
165
|
revealed={revealed}
|
|
143
166
|
disabled={disabled}
|
|
167
|
+
error={hasError}
|
|
144
168
|
theme={theme}
|
|
145
169
|
/>
|
|
146
170
|
))}
|
|
@@ -180,21 +204,29 @@ export function CodeInput({
|
|
|
180
204
|
const eyeFirst = revealPosition === 'top' || revealPosition === 'left';
|
|
181
205
|
|
|
182
206
|
return (
|
|
183
|
-
<View
|
|
184
|
-
|
|
185
|
-
{
|
|
207
|
+
<View style={[{ alignSelf: 'flex-start' }, style]}>
|
|
208
|
+
<View
|
|
209
|
+
style={{
|
|
186
210
|
flexDirection: vertical ? 'column' : 'row',
|
|
187
211
|
alignItems: 'center',
|
|
188
212
|
gap: 12,
|
|
189
|
-
alignSelf: 'flex-start',
|
|
190
213
|
paddingVertical: 8,
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
214
|
+
}}
|
|
215
|
+
>
|
|
216
|
+
{eyeFirst ? eyeToggle : null}
|
|
217
|
+
{cells}
|
|
218
|
+
{eyeFirst ? null : eyeToggle}
|
|
219
|
+
</View>
|
|
220
|
+
|
|
221
|
+
{message ? (
|
|
222
|
+
<Text
|
|
223
|
+
variant="bodySmall"
|
|
224
|
+
color={hasError ? theme.colors.feedback.error : 'tertiary'}
|
|
225
|
+
style={{ marginTop: 4, marginLeft: 8 }}
|
|
226
|
+
>
|
|
227
|
+
{message}
|
|
228
|
+
</Text>
|
|
229
|
+
) : null}
|
|
198
230
|
</View>
|
|
199
231
|
);
|
|
200
232
|
}
|