@oxy.so/bloom 4.16.1 → 4.18.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/docs/adoption-matrix.mdx +15 -15
- package/docs/app-shell.mdx +3 -2
- package/docs/breadcrumb.mdx +11 -0
- package/docs/button-group.mdx +2 -1
- package/docs/button.mdx +24 -0
- package/docs/cart-panel.mdx +4 -2
- package/docs/checkout-summary.mdx +4 -0
- package/docs/chip.mdx +14 -1
- package/docs/dialog.mdx +5 -4
- package/docs/icons.mdx +53 -0
- package/docs/loading.mdx +11 -0
- package/docs/page-header.mdx +7 -0
- package/docs/price-breakdown.mdx +17 -0
- package/docs/rating.mdx +22 -0
- package/docs/stepper.mdx +25 -0
- package/docs/tabs.mdx +6 -0
- package/lib/commonjs/app-shell/AppShellEngine.js +9 -5
- package/lib/commonjs/app-shell/AppShellEngine.js.map +1 -1
- package/lib/commonjs/breadcrumb/Breadcrumb.js +36 -6
- package/lib/commonjs/breadcrumb/Breadcrumb.js.map +1 -1
- package/lib/commonjs/button/Button.js +7 -4
- package/lib/commonjs/button/Button.js.map +1 -1
- package/lib/commonjs/button/Button.web.js +21 -2
- package/lib/commonjs/button/Button.web.js.map +1 -1
- package/lib/commonjs/button-group/ButtonGroup.js +7 -4
- package/lib/commonjs/button-group/ButtonGroup.js.map +1 -1
- package/lib/commonjs/cart-panel/CartLine.js +32 -10
- package/lib/commonjs/cart-panel/CartLine.js.map +1 -1
- package/lib/commonjs/cart-panel/CartPanel.js +3 -0
- package/lib/commonjs/cart-panel/CartPanel.js.map +1 -1
- package/lib/commonjs/cart-panel/shared.js +2 -0
- package/lib/commonjs/cart-panel/shared.js.map +1 -1
- package/lib/commonjs/checkout-summary/CheckoutConfirm.js +11 -1
- package/lib/commonjs/checkout-summary/CheckoutConfirm.js.map +1 -1
- package/lib/commonjs/chip/Chip.js +3 -1
- package/lib/commonjs/chip/Chip.js.map +1 -1
- package/lib/commonjs/dialog/Dialog.js +15 -6
- package/lib/commonjs/dialog/Dialog.js.map +1 -1
- package/lib/commonjs/dialog/Dialog.web.js +11 -5
- package/lib/commonjs/dialog/Dialog.web.js.map +1 -1
- package/lib/commonjs/dialog/placement.js +18 -1
- package/lib/commonjs/dialog/placement.js.map +1 -1
- package/lib/commonjs/icons/index.js +8 -0
- package/lib/commonjs/icons/index.js.map +1 -1
- package/lib/commonjs/icons/render-icon.js +63 -0
- package/lib/commonjs/icons/render-icon.js.map +1 -0
- package/lib/commonjs/loading/Loading.js +7 -3
- package/lib/commonjs/loading/Loading.js.map +1 -1
- package/lib/commonjs/loading/Loading.web.js +7 -3
- package/lib/commonjs/loading/Loading.web.js.map +1 -1
- package/lib/commonjs/loading/LoadingBase.js +49 -2
- package/lib/commonjs/loading/LoadingBase.js.map +1 -1
- package/lib/commonjs/page-header/PageHeader.js +6 -1
- package/lib/commonjs/page-header/PageHeader.js.map +1 -1
- package/lib/commonjs/price-breakdown/PriceSummary.js +11 -1
- package/lib/commonjs/price-breakdown/PriceSummary.js.map +1 -1
- package/lib/commonjs/price-breakdown/PriceSummaryLine.js +13 -1
- package/lib/commonjs/price-breakdown/PriceSummaryLine.js.map +1 -1
- package/lib/commonjs/rating/Rating.js +90 -4
- package/lib/commonjs/rating/Rating.js.map +1 -1
- package/lib/commonjs/stepper/Stepper.js +18 -5
- package/lib/commonjs/stepper/Stepper.js.map +1 -1
- package/lib/commonjs/tabs/Tabs.js +8 -1
- package/lib/commonjs/tabs/Tabs.js.map +1 -1
- package/lib/module/app-shell/AppShellEngine.js +9 -5
- package/lib/module/app-shell/AppShellEngine.js.map +1 -1
- package/lib/module/breadcrumb/Breadcrumb.js +36 -6
- package/lib/module/breadcrumb/Breadcrumb.js.map +1 -1
- package/lib/module/button/Button.js +7 -4
- package/lib/module/button/Button.js.map +1 -1
- package/lib/module/button/Button.web.js +21 -2
- package/lib/module/button/Button.web.js.map +1 -1
- package/lib/module/button-group/ButtonGroup.js +7 -4
- package/lib/module/button-group/ButtonGroup.js.map +1 -1
- package/lib/module/cart-panel/CartLine.js +32 -10
- package/lib/module/cart-panel/CartLine.js.map +1 -1
- package/lib/module/cart-panel/CartPanel.js +3 -0
- package/lib/module/cart-panel/CartPanel.js.map +1 -1
- package/lib/module/cart-panel/shared.js +2 -0
- package/lib/module/cart-panel/shared.js.map +1 -1
- package/lib/module/checkout-summary/CheckoutConfirm.js +11 -1
- package/lib/module/checkout-summary/CheckoutConfirm.js.map +1 -1
- package/lib/module/chip/Chip.js +3 -1
- package/lib/module/chip/Chip.js.map +1 -1
- package/lib/module/dialog/Dialog.js +16 -7
- package/lib/module/dialog/Dialog.js.map +1 -1
- package/lib/module/dialog/Dialog.web.js +12 -6
- package/lib/module/dialog/Dialog.web.js.map +1 -1
- package/lib/module/dialog/placement.js +17 -1
- package/lib/module/dialog/placement.js.map +1 -1
- package/lib/module/icons/index.js +1 -0
- package/lib/module/icons/index.js.map +1 -1
- package/lib/module/icons/render-icon.js +59 -0
- package/lib/module/icons/render-icon.js.map +1 -0
- package/lib/module/loading/Loading.js +8 -4
- package/lib/module/loading/Loading.js.map +1 -1
- package/lib/module/loading/Loading.web.js +8 -4
- package/lib/module/loading/Loading.web.js.map +1 -1
- package/lib/module/loading/LoadingBase.js +49 -3
- package/lib/module/loading/LoadingBase.js.map +1 -1
- package/lib/module/page-header/PageHeader.js +6 -1
- package/lib/module/page-header/PageHeader.js.map +1 -1
- package/lib/module/price-breakdown/PriceSummary.js +11 -1
- package/lib/module/price-breakdown/PriceSummary.js.map +1 -1
- package/lib/module/price-breakdown/PriceSummaryLine.js +13 -1
- package/lib/module/price-breakdown/PriceSummaryLine.js.map +1 -1
- package/lib/module/rating/Rating.js +89 -4
- package/lib/module/rating/Rating.js.map +1 -1
- package/lib/module/stepper/Stepper.js +18 -5
- package/lib/module/stepper/Stepper.js.map +1 -1
- package/lib/module/tabs/Tabs.js +8 -1
- package/lib/module/tabs/Tabs.js.map +1 -1
- package/lib/typescript/commonjs/app-shell/AppShellEngine.d.ts.map +1 -1
- package/lib/typescript/commonjs/breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/lib/typescript/commonjs/breadcrumb/types.d.ts +7 -0
- package/lib/typescript/commonjs/breadcrumb/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/button/Button.d.ts.map +1 -1
- package/lib/typescript/commonjs/button/Button.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/button/types.d.ts +10 -0
- package/lib/typescript/commonjs/button/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/button-group/ButtonGroup.d.ts.map +1 -1
- package/lib/typescript/commonjs/button-group/types.d.ts +9 -0
- package/lib/typescript/commonjs/button-group/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/cart-panel/CartLine.d.ts +10 -5
- package/lib/typescript/commonjs/cart-panel/CartLine.d.ts.map +1 -1
- package/lib/typescript/commonjs/cart-panel/CartPanel.d.ts +1 -1
- package/lib/typescript/commonjs/cart-panel/CartPanel.d.ts.map +1 -1
- package/lib/typescript/commonjs/cart-panel/shared.d.ts +1 -1
- package/lib/typescript/commonjs/cart-panel/shared.d.ts.map +1 -1
- package/lib/typescript/commonjs/cart-panel/types.d.ts +18 -0
- package/lib/typescript/commonjs/cart-panel/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/checkout-summary/CheckoutConfirm.d.ts +4 -1
- package/lib/typescript/commonjs/checkout-summary/CheckoutConfirm.d.ts.map +1 -1
- package/lib/typescript/commonjs/checkout-summary/types.d.ts +6 -0
- package/lib/typescript/commonjs/checkout-summary/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/chip/Chip.d.ts.map +1 -1
- package/lib/typescript/commonjs/chip/types.d.ts +8 -6
- package/lib/typescript/commonjs/chip/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/Dialog.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/Dialog.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/placement.d.ts +13 -2
- package/lib/typescript/commonjs/dialog/placement.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/types.d.ts +3 -2
- package/lib/typescript/commonjs/dialog/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/index.d.ts +2 -0
- package/lib/typescript/commonjs/icons/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/render-icon.d.ts +55 -0
- package/lib/typescript/commonjs/icons/render-icon.d.ts.map +1 -0
- package/lib/typescript/commonjs/loading/Loading.d.ts.map +1 -1
- package/lib/typescript/commonjs/loading/Loading.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/loading/LoadingBase.d.ts +18 -0
- package/lib/typescript/commonjs/loading/LoadingBase.d.ts.map +1 -1
- package/lib/typescript/commonjs/loading/types.d.ts +11 -0
- package/lib/typescript/commonjs/loading/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/page-header/PageHeader.d.ts.map +1 -1
- package/lib/typescript/commonjs/price-breakdown/PriceSummary.d.ts.map +1 -1
- package/lib/typescript/commonjs/price-breakdown/PriceSummaryLine.d.ts +3 -1
- package/lib/typescript/commonjs/price-breakdown/PriceSummaryLine.d.ts.map +1 -1
- package/lib/typescript/commonjs/price-breakdown/types.d.ts +12 -0
- package/lib/typescript/commonjs/price-breakdown/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/rating/Rating.d.ts +3 -1
- package/lib/typescript/commonjs/rating/Rating.d.ts.map +1 -1
- package/lib/typescript/commonjs/rating/index.d.ts +1 -1
- package/lib/typescript/commonjs/rating/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/rating/types.d.ts +20 -0
- package/lib/typescript/commonjs/rating/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/stepper/Stepper.d.ts +1 -1
- package/lib/typescript/commonjs/stepper/Stepper.d.ts.map +1 -1
- package/lib/typescript/commonjs/stepper/types.d.ts +9 -0
- package/lib/typescript/commonjs/stepper/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/tabs/Tabs.d.ts.map +1 -1
- package/lib/typescript/module/app-shell/AppShellEngine.d.ts.map +1 -1
- package/lib/typescript/module/breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/lib/typescript/module/breadcrumb/types.d.ts +7 -0
- package/lib/typescript/module/breadcrumb/types.d.ts.map +1 -1
- package/lib/typescript/module/button/Button.d.ts.map +1 -1
- package/lib/typescript/module/button/Button.web.d.ts.map +1 -1
- package/lib/typescript/module/button/types.d.ts +10 -0
- package/lib/typescript/module/button/types.d.ts.map +1 -1
- package/lib/typescript/module/button-group/ButtonGroup.d.ts.map +1 -1
- package/lib/typescript/module/button-group/types.d.ts +9 -0
- package/lib/typescript/module/button-group/types.d.ts.map +1 -1
- package/lib/typescript/module/cart-panel/CartLine.d.ts +10 -5
- package/lib/typescript/module/cart-panel/CartLine.d.ts.map +1 -1
- package/lib/typescript/module/cart-panel/CartPanel.d.ts +1 -1
- package/lib/typescript/module/cart-panel/CartPanel.d.ts.map +1 -1
- package/lib/typescript/module/cart-panel/shared.d.ts +1 -1
- package/lib/typescript/module/cart-panel/shared.d.ts.map +1 -1
- package/lib/typescript/module/cart-panel/types.d.ts +18 -0
- package/lib/typescript/module/cart-panel/types.d.ts.map +1 -1
- package/lib/typescript/module/checkout-summary/CheckoutConfirm.d.ts +4 -1
- package/lib/typescript/module/checkout-summary/CheckoutConfirm.d.ts.map +1 -1
- package/lib/typescript/module/checkout-summary/types.d.ts +6 -0
- package/lib/typescript/module/checkout-summary/types.d.ts.map +1 -1
- package/lib/typescript/module/chip/Chip.d.ts.map +1 -1
- package/lib/typescript/module/chip/types.d.ts +8 -6
- package/lib/typescript/module/chip/types.d.ts.map +1 -1
- package/lib/typescript/module/dialog/Dialog.d.ts.map +1 -1
- package/lib/typescript/module/dialog/Dialog.web.d.ts.map +1 -1
- package/lib/typescript/module/dialog/placement.d.ts +13 -2
- package/lib/typescript/module/dialog/placement.d.ts.map +1 -1
- package/lib/typescript/module/dialog/types.d.ts +3 -2
- package/lib/typescript/module/dialog/types.d.ts.map +1 -1
- package/lib/typescript/module/icons/index.d.ts +2 -0
- package/lib/typescript/module/icons/index.d.ts.map +1 -1
- package/lib/typescript/module/icons/render-icon.d.ts +55 -0
- package/lib/typescript/module/icons/render-icon.d.ts.map +1 -0
- package/lib/typescript/module/loading/Loading.d.ts.map +1 -1
- package/lib/typescript/module/loading/Loading.web.d.ts.map +1 -1
- package/lib/typescript/module/loading/LoadingBase.d.ts +18 -0
- package/lib/typescript/module/loading/LoadingBase.d.ts.map +1 -1
- package/lib/typescript/module/loading/types.d.ts +11 -0
- package/lib/typescript/module/loading/types.d.ts.map +1 -1
- package/lib/typescript/module/page-header/PageHeader.d.ts.map +1 -1
- package/lib/typescript/module/price-breakdown/PriceSummary.d.ts.map +1 -1
- package/lib/typescript/module/price-breakdown/PriceSummaryLine.d.ts +3 -1
- package/lib/typescript/module/price-breakdown/PriceSummaryLine.d.ts.map +1 -1
- package/lib/typescript/module/price-breakdown/types.d.ts +12 -0
- package/lib/typescript/module/price-breakdown/types.d.ts.map +1 -1
- package/lib/typescript/module/rating/Rating.d.ts +3 -1
- package/lib/typescript/module/rating/Rating.d.ts.map +1 -1
- package/lib/typescript/module/rating/index.d.ts +1 -1
- package/lib/typescript/module/rating/index.d.ts.map +1 -1
- package/lib/typescript/module/rating/types.d.ts +20 -0
- package/lib/typescript/module/rating/types.d.ts.map +1 -1
- package/lib/typescript/module/stepper/Stepper.d.ts +1 -1
- package/lib/typescript/module/stepper/Stepper.d.ts.map +1 -1
- package/lib/typescript/module/stepper/types.d.ts +9 -0
- package/lib/typescript/module/stepper/types.d.ts.map +1 -1
- package/lib/typescript/module/tabs/Tabs.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/app-shell/AppShellEngine.tsx +9 -5
- package/src/breadcrumb/Breadcrumb.tsx +29 -4
- package/src/breadcrumb/types.ts +7 -0
- package/src/button/Button.tsx +15 -6
- package/src/button/Button.web.tsx +30 -3
- package/src/button/types.ts +10 -0
- package/src/button-group/ButtonGroup.tsx +15 -6
- package/src/button-group/types.ts +9 -0
- package/src/cart-panel/CartLine.tsx +30 -7
- package/src/cart-panel/CartPanel.tsx +3 -0
- package/src/cart-panel/shared.ts +11 -1
- package/src/cart-panel/types.ts +18 -0
- package/src/checkout-summary/CheckoutConfirm.tsx +9 -0
- package/src/checkout-summary/types.ts +6 -0
- package/src/chip/Chip.tsx +3 -1
- package/src/chip/types.ts +8 -6
- package/src/dialog/Dialog.tsx +19 -8
- package/src/dialog/Dialog.web.tsx +15 -7
- package/src/dialog/placement.ts +19 -2
- package/src/dialog/types.ts +3 -2
- package/src/icons/index.ts +2 -0
- package/src/icons/render-icon.tsx +65 -0
- package/src/loading/Loading.tsx +6 -2
- package/src/loading/Loading.web.tsx +6 -2
- package/src/loading/LoadingBase.tsx +55 -5
- package/src/loading/types.ts +11 -0
- package/src/page-header/PageHeader.tsx +6 -1
- package/src/price-breakdown/PriceSummary.tsx +10 -0
- package/src/price-breakdown/PriceSummaryLine.tsx +12 -0
- package/src/price-breakdown/types.ts +12 -0
- package/src/rating/Rating.tsx +87 -3
- package/src/rating/index.ts +1 -0
- package/src/rating/types.ts +21 -0
- package/src/stepper/Stepper.tsx +18 -5
- package/src/stepper/types.ts +9 -0
- package/src/tabs/Tabs.tsx +3 -0
|
@@ -3,6 +3,12 @@ import type { StyleProp, ViewStyle } from 'react-native';
|
|
|
3
3
|
export type RatingSize = 'small' | 'medium';
|
|
4
4
|
/** `parenthesis` draws "(128)"; `reviews` draws "· 128 reviews". */
|
|
5
5
|
export type RatingCountStyle = 'parenthesis' | 'reviews';
|
|
6
|
+
/**
|
|
7
|
+
* `compact` (default) is one star and the value; `stars` a full row of `max`
|
|
8
|
+
* stars (five) filled to the value — fractionally, so 4.3 fills the fifth star
|
|
9
|
+
* 30% — before the value.
|
|
10
|
+
*/
|
|
11
|
+
export type RatingVariant = 'compact' | 'stars';
|
|
6
12
|
export interface RatingProps {
|
|
7
13
|
/**
|
|
8
14
|
* The rating on a 5 scale. A number is drawn with up to two decimals (4.9,
|
|
@@ -20,6 +26,20 @@ export interface RatingProps {
|
|
|
20
26
|
newLabel?: string;
|
|
21
27
|
/** Default `medium`. */
|
|
22
28
|
size?: RatingSize;
|
|
29
|
+
/** Default `compact` — one star. `stars` draws a row of five, filled fractionally. */
|
|
30
|
+
variant?: RatingVariant;
|
|
31
|
+
/**
|
|
32
|
+
* Paints the star(s) and the value — and the count, unless `countColor` is
|
|
33
|
+
* given — e.g. white over a brand-coloured hero, where text-primary and
|
|
34
|
+
* text-secondary are illegible. Default: text-primary (count text-secondary).
|
|
35
|
+
*/
|
|
36
|
+
color?: string;
|
|
37
|
+
/** The filled star(s) alone, e.g. a gold star beside neutral text. Default `color`. */
|
|
38
|
+
starColor?: string;
|
|
39
|
+
/** The count alone. Default `color` when given, else text-secondary. */
|
|
40
|
+
countColor?: string;
|
|
41
|
+
/** `stars` variant: the unfilled part of each star. Default the theme's border colour. */
|
|
42
|
+
emptyStarColor?: string;
|
|
23
43
|
/**
|
|
24
44
|
* Overrides the composed accessible name ("Rated 4.92 out of 5, 128
|
|
25
45
|
* reviews"), which is English — pass a translated sentence here.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/rating/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,8FAA8F;AAC9F,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE5C,oEAAoE;AACpE,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG,SAAS,CAAC;AAEzD,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC/B,kEAAkE;IAClE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,6BAA6B;IAC7B,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,uGAAuG;IACvG,YAAY,CAAC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AAM,eAAe,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE3D,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,iFAAiF;IACjF,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,mCAAmC;IACnC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,wBAAwB;IACxB,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;;OAOG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;IACzD,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,yCAAyC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,wFAAwF;IACxF,KAAK,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { StepperProps } from './types';
|
|
3
|
-
declare function StepperComponent({ value, onValueChange, min, max, step, disabled: disabledProp, size, formatValue, accessibilityLabel, decrementLabel, incrementLabel, style, testID, }: StepperProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare function StepperComponent({ value, onValueChange, min, max, step, disabled: disabledProp, size, formatValue, accessibilityLabel, decrementLabel, incrementLabel, onRemove, removeLabel, style, testID, }: StepperProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export declare const Stepper: React.MemoExoticComponent<typeof StepperComponent>;
|
|
5
5
|
export {};
|
|
6
6
|
//# sourceMappingURL=Stepper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stepper.d.ts","sourceRoot":"","sources":["../../../../src/stepper/Stepper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Stepper.d.ts","sourceRoot":"","sources":["../../../../src/stepper/Stepper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqC,MAAM,OAAO,CAAC;AAe1D,OAAO,KAAK,EAAE,YAAY,EAAe,MAAM,SAAS,CAAC;AAmEzD,iBAAS,gBAAgB,CAAC,EACxB,KAAK,EACL,aAAa,EACb,GAAO,EACP,GAAG,EACH,IAAQ,EACR,QAAQ,EAAE,YAAoB,EAC9B,IAAe,EACf,WAAW,EACX,kBAAkB,EAClB,cAA2B,EAC3B,cAA2B,EAC3B,QAAQ,EACR,WAAsB,EACtB,KAAK,EACL,MAAM,GACP,EAAE,YAAY,2CAgJd;AAED,eAAO,MAAM,OAAO,oDAAyB,CAAC"}
|
|
@@ -36,6 +36,15 @@ export interface StepperProps {
|
|
|
36
36
|
decrementLabel?: string;
|
|
37
37
|
/** Name of the `+` button. Default `"Increase"`. */
|
|
38
38
|
incrementLabel?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Opt-in remove at the floor: at `min` the `−` button becomes a trash button
|
|
41
|
+
* that calls this instead of disabling (a basket line going from 1 to gone).
|
|
42
|
+
* Only the button removes — the keyboard and accessibility actions on the
|
|
43
|
+
* value still stop at `min`. Without it the stepper floors at `min`.
|
|
44
|
+
*/
|
|
45
|
+
onRemove?: () => void;
|
|
46
|
+
/** Name of the trash button drawn at `min` with `onRemove`. Default `"Remove"`. */
|
|
47
|
+
removeLabel?: string;
|
|
39
48
|
style?: StyleProp<ViewStyle>;
|
|
40
49
|
testID?: string;
|
|
41
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/stepper/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,qGAAqG;AACrG,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE7C,MAAM,WAAW,YAAY;IAC3B,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd,yFAAyF;IACzF,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,qEAAqE;IACrE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,6EAA6E;IAC7E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wBAAwB;IACxB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,wFAAwF;IACxF,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACxC;;;;OAIG;IACH;;;;;;OAMG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oDAAoD;IACpD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oDAAoD;IACpD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,YAAY,EAAE,oBAAoB,GA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C;IACjB,uBAAuB,EAAE,MAAM,CAAC;IAChC,uBAAuB,EAAE,MAAM,CAAC;IAChC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,SAA0B,GAAG,SAAS,CAyBjH;AAqGD;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;;;;;;;;;OAYG;IACH,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC1C;;;;;;;;;OASG;IACH,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;CACzC;AAyrBD,eAAO,MAAM,IAAI,iFAAyB,CAAC;AAG3C,eAAO,MAAM,WAAW,8CAAqB,CAAC;AAG9C,eAAO,MAAM,WAAW,8CAA0B,CAAC"}
|
package/package.json
CHANGED
|
@@ -538,7 +538,11 @@ const AppShellComponent: React.FC<AppShellEngineProps> = ({
|
|
|
538
538
|
// Plain navigation belongs to the viewport; only the reading surfaces are inset.
|
|
539
539
|
const documentPanelInset = feedRevealed ? 12 : compactPanel ? 0 : gutter;
|
|
540
540
|
const externalTopHeight = showTopBar ? topBarHeight : 0;
|
|
541
|
-
|
|
541
|
+
// A property of the NAVIGATION, not of who scrolls: native resolves every
|
|
542
|
+
// shell to container scroll, and gating this on `document` left native
|
|
543
|
+
// phones with an 8px frame around the reading panel that the same layout on
|
|
544
|
+
// the web does not draw.
|
|
545
|
+
const plainFrame = contentAligned && flowSidebar?.surface === 'plain' && !topBarNode;
|
|
542
546
|
const readingGap = Math.max(0, asideGap ?? columnGap);
|
|
543
547
|
const readingGroupWidth = contentWidth + (asideBeside ? asideWidth + readingGap : 0);
|
|
544
548
|
const centredBody = (
|
|
@@ -556,7 +560,7 @@ const AppShellComponent: React.FC<AppShellEngineProps> = ({
|
|
|
556
560
|
// grows the page, the aside is sticky). Bounded: they stretch.
|
|
557
561
|
alignItems: doc ? 'flex-start' : 'stretch',
|
|
558
562
|
...(contentAligned ? { flexGrow: compactPanel ? 1 : 0, flexBasis: compactPanel ? 'auto' : readingGroupWidth, maxWidth: compactPanel ? undefined : readingGroupWidth } : {}),
|
|
559
|
-
...(
|
|
563
|
+
...(plainFrame ? { paddingTop: compactPanel ? 0 : gutter, paddingBottom: compactPanel ? 0 : gutter } : {}),
|
|
560
564
|
},
|
|
561
565
|
fill,
|
|
562
566
|
]}
|
|
@@ -747,7 +751,7 @@ const AppShellComponent: React.FC<AppShellEngineProps> = ({
|
|
|
747
751
|
const navRegion =
|
|
748
752
|
navInFlow && flowSidebar ? (
|
|
749
753
|
doc ? (
|
|
750
|
-
<View testID={testID ? `${testID}-navigation` : undefined} style={stickyRail(dockedNav ||
|
|
754
|
+
<View testID={testID ? `${testID}-navigation` : undefined} style={stickyRail(dockedNav || plainFrame ? 0 : gutter)}>
|
|
751
755
|
<Sidebar {...flowSidebar} />
|
|
752
756
|
</View>
|
|
753
757
|
) : canvas && !dockedNav ? (
|
|
@@ -794,8 +798,8 @@ const AppShellComponent: React.FC<AppShellEngineProps> = ({
|
|
|
794
798
|
// shorthand to physical sides, and which of two declarations for one edge
|
|
795
799
|
// wins is then a matter of declaration order rather than intent.
|
|
796
800
|
...(dockedNav
|
|
797
|
-
? { paddingTop: 0, paddingBottom: 0, paddingInlineStart: 0, paddingInlineEnd: canvas ||
|
|
798
|
-
: { padding: canvas ||
|
|
801
|
+
? { paddingTop: 0, paddingBottom: 0, paddingInlineStart: 0, paddingInlineEnd: canvas || plainFrame ? 0 : gutter }
|
|
802
|
+
: { padding: canvas || plainFrame ? 0 : gutter }),
|
|
799
803
|
backgroundColor: background,
|
|
800
804
|
};
|
|
801
805
|
|
|
@@ -13,6 +13,7 @@ import { useTheme } from '../theme/use-theme';
|
|
|
13
13
|
import { Text } from '../typography/Typography';
|
|
14
14
|
import { borderRadius } from '../styles/tokens';
|
|
15
15
|
import { useInteractionState } from '../hooks/use-interaction-state';
|
|
16
|
+
import { useDirectionProps, useIsRtl } from '../hooks/use-is-rtl';
|
|
16
17
|
import { interactiveWebCss, useInteractiveWebCss } from '../styles/interactive-web-css';
|
|
17
18
|
import type { WebCssStyle } from '../styles/web-view-style';
|
|
18
19
|
import { BUTTON_TRANSITION_MS } from '../button/shared';
|
|
@@ -77,10 +78,19 @@ const BREADCRUMB_CSS = interactiveWebCss({
|
|
|
77
78
|
|
|
78
79
|
const IS_WEB = Platform.OS === 'web';
|
|
79
80
|
|
|
80
|
-
/**
|
|
81
|
-
|
|
81
|
+
/**
|
|
82
|
+
* `ChevronRightSmall`, path for path. It points the READING direction: the
|
|
83
|
+
* row mirrors in a right-to-left layout (flex order follows the direction on
|
|
84
|
+
* both platforms), so a fixed right-pointing chevron would point back at the
|
|
85
|
+
* crumb it came from. A glyph is a sign, not an inset — no logical style key
|
|
86
|
+
* can flip it — so it reads `useIsRtl()` and mirrors itself with `scaleX`.
|
|
87
|
+
*/
|
|
88
|
+
function Chevron({ color, rtl }: { color: string; rtl: boolean }) {
|
|
82
89
|
return (
|
|
83
|
-
<View
|
|
90
|
+
<View
|
|
91
|
+
aria-hidden
|
|
92
|
+
style={{ width: 12, height: 12, flexShrink: 0, ...(rtl ? { transform: [{ scaleX: -1 }] } : null) }}
|
|
93
|
+
>
|
|
84
94
|
<Svg width={12} height={12} viewBox="0 0 12 12" fill="none">
|
|
85
95
|
<Path
|
|
86
96
|
d="M4.5 3L7.14645 5.64645C7.34171 5.84171 7.34171 6.15829 7.14645 6.35355L4.5 9"
|
|
@@ -95,16 +105,31 @@ function Chevron({ color }: { color: string }) {
|
|
|
95
105
|
|
|
96
106
|
const BreadcrumbComponent: React.FC<BreadcrumbProps> = ({
|
|
97
107
|
children,
|
|
108
|
+
separator,
|
|
98
109
|
accessibilityLabel = 'Breadcrumb',
|
|
99
110
|
style,
|
|
100
111
|
testID,
|
|
101
112
|
}) => {
|
|
102
113
|
const theme = useTheme();
|
|
114
|
+
const rtl = useIsRtl();
|
|
115
|
+
const directionProps = useDirectionProps();
|
|
103
116
|
const palette = useMemo(() => resolveBreadcrumbPalette(theme), [theme]);
|
|
104
117
|
const items = Children.toArray(children).filter(isValidElement);
|
|
118
|
+
// A caller's separator is theirs to mirror (or not — a "/" needs nothing);
|
|
119
|
+
// it is hidden from assistive technology like the chevron, since the list
|
|
120
|
+
// structure already says where one crumb ends.
|
|
121
|
+
const between =
|
|
122
|
+
separator !== undefined ? (
|
|
123
|
+
<View aria-hidden style={{ flexShrink: 0, flexDirection: 'row', alignItems: 'center' }}>
|
|
124
|
+
{separator}
|
|
125
|
+
</View>
|
|
126
|
+
) : (
|
|
127
|
+
<Chevron color={palette.tertiary} rtl={rtl} />
|
|
128
|
+
);
|
|
105
129
|
|
|
106
130
|
return (
|
|
107
131
|
<View
|
|
132
|
+
{...directionProps}
|
|
108
133
|
role="navigation"
|
|
109
134
|
accessibilityLabel={accessibilityLabel}
|
|
110
135
|
testID={testID}
|
|
@@ -121,7 +146,7 @@ const BreadcrumbComponent: React.FC<BreadcrumbProps> = ({
|
|
|
121
146
|
>
|
|
122
147
|
{items.map((item, index) => (
|
|
123
148
|
<Fragment key={item.key ?? index}>
|
|
124
|
-
{index > 0 ?
|
|
149
|
+
{index > 0 ? between : null}
|
|
125
150
|
{item}
|
|
126
151
|
</Fragment>
|
|
127
152
|
))}
|
package/src/breadcrumb/types.ts
CHANGED
|
@@ -6,6 +6,13 @@ import type { ButtonIconComponent } from '../button/types';
|
|
|
6
6
|
export interface BreadcrumbProps {
|
|
7
7
|
/** `BreadcrumbItem` children. Chevron separators are inserted between them. */
|
|
8
8
|
children: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Replaces the chevron between items — e.g. `"/"` as a `Text`, or an icon.
|
|
11
|
+
* Hidden from assistive technology. The default chevron points the reading
|
|
12
|
+
* direction (it mirrors in a right-to-left layout); a custom separator is
|
|
13
|
+
* rendered as given.
|
|
14
|
+
*/
|
|
15
|
+
separator?: ReactNode;
|
|
9
16
|
/** Names the navigation landmark. Default `"Breadcrumb"`. */
|
|
10
17
|
accessibilityLabel?: string;
|
|
11
18
|
style?: StyleProp<ViewStyle>;
|
package/src/button/Button.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { LinkButtonProps } from './types';
|
|
2
2
|
import React, { useMemo, memo, type ComponentType } from 'react';
|
|
3
|
+
import { resolveIconSlot } from '../icons/render-icon';
|
|
3
4
|
import {
|
|
4
5
|
ActivityIndicator,
|
|
5
6
|
Linking,
|
|
@@ -175,6 +176,8 @@ const ButtonComponent: React.FC<ButtonProps> = ({
|
|
|
175
176
|
trailing,
|
|
176
177
|
leadingIcon: LeadingIcon,
|
|
177
178
|
trailingIcon: TrailingIcon,
|
|
179
|
+
renderLeadingIcon,
|
|
180
|
+
renderTrailingIcon,
|
|
178
181
|
iconOnly = false,
|
|
179
182
|
linkTone = 'primary',
|
|
180
183
|
underline,
|
|
@@ -298,9 +301,11 @@ const ButtonComponent: React.FC<ButtonProps> = ({
|
|
|
298
301
|
|
|
299
302
|
const content = (
|
|
300
303
|
<>
|
|
301
|
-
{
|
|
302
|
-
|
|
303
|
-
|
|
304
|
+
{resolveIconSlot(renderLeadingIcon, iconSize, paint.foreground, () =>
|
|
305
|
+
LeadingIcon ? (
|
|
306
|
+
<LeadingIcon width={iconSize} height={iconSize} fill={paint.foreground} />
|
|
307
|
+
) : null,
|
|
308
|
+
)}
|
|
304
309
|
{leading}
|
|
305
310
|
{iconNode}
|
|
306
311
|
{!isSquare && children != null && (
|
|
@@ -313,9 +318,13 @@ const ButtonComponent: React.FC<ButtonProps> = ({
|
|
|
313
318
|
</Text>
|
|
314
319
|
)}
|
|
315
320
|
{trailing}
|
|
316
|
-
{!isSquare
|
|
317
|
-
|
|
318
|
-
|
|
321
|
+
{!isSquare
|
|
322
|
+
? resolveIconSlot(renderTrailingIcon, iconSize, paint.foreground, () =>
|
|
323
|
+
TrailingIcon ? (
|
|
324
|
+
<TrailingIcon width={iconSize} height={iconSize} fill={paint.foreground} />
|
|
325
|
+
) : null,
|
|
326
|
+
)
|
|
327
|
+
: null}
|
|
319
328
|
</>
|
|
320
329
|
);
|
|
321
330
|
|
|
@@ -9,6 +9,7 @@ import React, {
|
|
|
9
9
|
type ReactElement,
|
|
10
10
|
} from 'react';
|
|
11
11
|
|
|
12
|
+
import { resolveIconSlot } from '../icons/render-icon';
|
|
12
13
|
import { useBloomAppearance } from '../appearance/context';
|
|
13
14
|
import { useTheme } from '../theme/use-theme';
|
|
14
15
|
import { SpinnerIcon } from '../loading/SpinnerIcon.web';
|
|
@@ -182,6 +183,8 @@ const ButtonWebComponent: React.FC<ButtonProps> = ({
|
|
|
182
183
|
trailing,
|
|
183
184
|
leadingIcon: LeadingIcon,
|
|
184
185
|
trailingIcon: TrailingIcon,
|
|
186
|
+
renderLeadingIcon,
|
|
187
|
+
renderTrailingIcon,
|
|
185
188
|
iconOnly = false,
|
|
186
189
|
linkTone = 'primary',
|
|
187
190
|
underline,
|
|
@@ -339,11 +342,29 @@ const ButtonWebComponent: React.FC<ButtonProps> = ({
|
|
|
339
342
|
const iconNode =
|
|
340
343
|
icon == null ? null : isIconComponent(icon) ? renderIcon(icon) : (icon as React.ReactNode);
|
|
341
344
|
|
|
345
|
+
// A caller-drawn glyph is handed `currentColor` rather than the resolved
|
|
346
|
+
// foreground, for the same reason the icon components above are: on web the
|
|
347
|
+
// state colours come from the stylesheet, so a glyph that inherits them needs
|
|
348
|
+
// no re-render when hover or press changes them. Native has no cascade and
|
|
349
|
+
// passes the resolved value.
|
|
350
|
+
const renderSlot = (render: typeof renderLeadingIcon, fallback: () => React.ReactNode) => (
|
|
351
|
+
<span
|
|
352
|
+
aria-hidden="true"
|
|
353
|
+
style={{ display: 'inline-flex', flexShrink: 0, width: iconSize, height: iconSize }}
|
|
354
|
+
>
|
|
355
|
+
{resolveIconSlot(render, iconSize, 'currentColor', fallback)}
|
|
356
|
+
</span>
|
|
357
|
+
);
|
|
358
|
+
|
|
342
359
|
const labelPadding = isLink ? 0 : geometry.labelPaddingHorizontal;
|
|
343
360
|
const hasLabel = !isSquare && children != null && children !== false;
|
|
344
361
|
const content = (
|
|
345
362
|
<>
|
|
346
|
-
{
|
|
363
|
+
{renderLeadingIcon
|
|
364
|
+
? renderSlot(renderLeadingIcon, () => null)
|
|
365
|
+
: LeadingIcon
|
|
366
|
+
? renderIcon(LeadingIcon)
|
|
367
|
+
: null}
|
|
347
368
|
{leading}
|
|
348
369
|
{iconNode}
|
|
349
370
|
{hasLabel &&
|
|
@@ -367,9 +388,15 @@ const ButtonWebComponent: React.FC<ButtonProps> = ({
|
|
|
367
388
|
) : (
|
|
368
389
|
children
|
|
369
390
|
))}
|
|
370
|
-
{isSquare && !LeadingIcon && !iconNode && children != null
|
|
391
|
+
{isSquare && !renderLeadingIcon && !LeadingIcon && !iconNode && children != null
|
|
392
|
+
? children
|
|
393
|
+
: null}
|
|
371
394
|
{trailing}
|
|
372
|
-
{!isSquare &&
|
|
395
|
+
{!isSquare && renderTrailingIcon
|
|
396
|
+
? renderSlot(renderTrailingIcon, () => null)
|
|
397
|
+
: !isSquare && TrailingIcon
|
|
398
|
+
? renderIcon(TrailingIcon)
|
|
399
|
+
: null}
|
|
373
400
|
</>
|
|
374
401
|
);
|
|
375
402
|
|
package/src/button/types.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { BloomAppearance, BloomTone, BloomSize } from '../appearance/types';
|
|
2
|
+
import type { BloomIconRenderer } from '../icons/render-icon';
|
|
2
3
|
import type { ComponentType, ReactNode } from 'react';
|
|
3
4
|
import type { GestureResponderEvent, StyleProp, ViewStyle, TextStyle } from 'react-native';
|
|
4
5
|
import type { WebAriaProps } from '../styles/styled-primitives';
|
|
@@ -173,6 +174,15 @@ export interface ButtonProps {
|
|
|
173
174
|
leadingIcon?: ButtonIconComponent;
|
|
174
175
|
/** Same as {@link ButtonProps.leadingIcon}, after the label. Ignored when `iconOnly`. */
|
|
175
176
|
trailingIcon?: ButtonIconComponent;
|
|
177
|
+
/**
|
|
178
|
+
* Draw the leading glyph yourself, handed the button's icon size and the
|
|
179
|
+
* foreground for the CURRENT state — for an app's own icon set, whose props
|
|
180
|
+
* Bloom's icon slot cannot name. Wins over `leadingIcon`, and is used for the
|
|
181
|
+
* glyph when `iconOnly`. See `icons/render-icon.tsx`.
|
|
182
|
+
*/
|
|
183
|
+
renderLeadingIcon?: BloomIconRenderer;
|
|
184
|
+
/** Same as {@link ButtonProps.renderLeadingIcon}, after the label. Ignored when `iconOnly`. */
|
|
185
|
+
renderTrailingIcon?: BloomIconRenderer;
|
|
176
186
|
/**
|
|
177
187
|
* Render a square icon-only button (24 / 32 / 36 / 44) from `leadingIcon` or
|
|
178
188
|
* `icon`. Name it with `accessibilityLabel` — there is no text to read.
|
|
@@ -3,6 +3,7 @@ import React, { Children, createContext, Fragment, isValidElement, memo, useCont
|
|
|
3
3
|
import { Platform, Pressable, View, type TextStyle } from 'react-native';
|
|
4
4
|
|
|
5
5
|
import { useInheritedControl } from '../control-surface';
|
|
6
|
+
import { resolveIconSlot } from '../icons/render-icon';
|
|
6
7
|
import { GlassIsland } from '../glass';
|
|
7
8
|
import { useTheme } from '../theme/use-theme';
|
|
8
9
|
import { Text } from '../typography/Typography';
|
|
@@ -271,6 +272,8 @@ const ButtonGroupItemComponent: React.FC<ButtonGroupItemProps> = ({
|
|
|
271
272
|
iconOnly = false,
|
|
272
273
|
leadingIcon: LeadingIcon,
|
|
273
274
|
trailingIcon: TrailingIcon,
|
|
275
|
+
renderLeadingIcon,
|
|
276
|
+
renderTrailingIcon,
|
|
274
277
|
accessibilityLabel,
|
|
275
278
|
accessibilityRole = 'button',
|
|
276
279
|
hitSlop,
|
|
@@ -355,9 +358,11 @@ const ButtonGroupItemComponent: React.FC<ButtonGroupItemProps> = ({
|
|
|
355
358
|
aria-haspopup={ariaHasPopup}
|
|
356
359
|
testID={testID}
|
|
357
360
|
>
|
|
358
|
-
{
|
|
359
|
-
|
|
360
|
-
|
|
361
|
+
{resolveIconSlot(renderLeadingIcon, geometry.iconSize, foreground, () =>
|
|
362
|
+
LeadingIcon ? (
|
|
363
|
+
<LeadingIcon width={geometry.iconSize} height={geometry.iconSize} fill={foreground} />
|
|
364
|
+
) : null,
|
|
365
|
+
)}
|
|
361
366
|
{!iconOnly && children != null ? (
|
|
362
367
|
typeof children === 'string' || typeof children === 'number' ? (
|
|
363
368
|
<Text variant="body-medium" numberOfLines={1} style={labelStyle}>
|
|
@@ -367,9 +372,13 @@ const ButtonGroupItemComponent: React.FC<ButtonGroupItemProps> = ({
|
|
|
367
372
|
children
|
|
368
373
|
)
|
|
369
374
|
) : null}
|
|
370
|
-
{!iconOnly
|
|
371
|
-
|
|
372
|
-
|
|
375
|
+
{!iconOnly
|
|
376
|
+
? resolveIconSlot(renderTrailingIcon, geometry.iconSize, foreground, () =>
|
|
377
|
+
TrailingIcon ? (
|
|
378
|
+
<TrailingIcon width={geometry.iconSize} height={geometry.iconSize} fill={foreground} />
|
|
379
|
+
) : null,
|
|
380
|
+
)
|
|
381
|
+
: null}
|
|
373
382
|
</Pressable>
|
|
374
383
|
);
|
|
375
384
|
};
|
|
@@ -2,6 +2,7 @@ import type { GestureResponderEvent, StyleProp, ViewStyle } from 'react-native';
|
|
|
2
2
|
|
|
3
3
|
import type { ControlMaterial } from '../control-surface/types';
|
|
4
4
|
import type { ButtonIconComponent } from '../button/types';
|
|
5
|
+
import type { BloomIconRenderer } from '../icons/render-icon';
|
|
5
6
|
import type { WebAriaProps } from '../styles/styled-primitives';
|
|
6
7
|
|
|
7
8
|
/** The two group sizes: 34px (`md`) and 30px (`sm`) items. */
|
|
@@ -67,6 +68,14 @@ export interface ButtonGroupItemProps {
|
|
|
67
68
|
leadingIcon?: ButtonIconComponent;
|
|
68
69
|
/** Icon component after the label. */
|
|
69
70
|
trailingIcon?: ButtonIconComponent;
|
|
71
|
+
/**
|
|
72
|
+
* Draw the leading glyph yourself, handed the item's size and the foreground
|
|
73
|
+
* for the CURRENT state — for an app's own icon set, whose props Bloom's icon
|
|
74
|
+
* slot cannot name. Wins over `leadingIcon`. See `icons/render-icon.tsx`.
|
|
75
|
+
*/
|
|
76
|
+
renderLeadingIcon?: BloomIconRenderer;
|
|
77
|
+
/** Same as {@link ButtonGroupItemProps.renderLeadingIcon}, after the label. */
|
|
78
|
+
renderTrailingIcon?: BloomIconRenderer;
|
|
70
79
|
accessibilityLabel?: string;
|
|
71
80
|
|
|
72
81
|
// ── The trigger contract ────────────────────────────────────────────────
|
|
@@ -21,12 +21,17 @@ import type { CartLineProps } from './types';
|
|
|
21
21
|
* leading the square photo (56; 44 compact), washed while it is sold out
|
|
22
22
|
* body the name; the chosen options on one quiet line; the note; then
|
|
23
23
|
* the quantity control and remove, side by side
|
|
24
|
-
* trailing the price, right-aligned, with an optional struck original
|
|
24
|
+
* trailing the price, right-aligned, with an optional struck original, and
|
|
25
|
+
* an optional `secondaryPrice` (a second currency) under it in the
|
|
26
|
+
* secondary colour
|
|
25
27
|
*
|
|
26
|
-
* THE STEPPER DOES NOT REMOVE. Its floor is 1, and removing is its
|
|
27
|
-
* with its own name — a stepper that deletes the line when you
|
|
28
|
-
* too often is a destructive action behind an arithmetic one
|
|
29
|
-
*
|
|
28
|
+
* BY DEFAULT THE STEPPER DOES NOT REMOVE. Its floor is 1, and removing is its
|
|
29
|
+
* own control with its own name — a stepper that deletes the line when you
|
|
30
|
+
* press `−` once too often is a destructive action behind an arithmetic one.
|
|
31
|
+
* `removeInStepper` opts into the storefront pattern instead: at 1 the `−`
|
|
32
|
+
* becomes a trash button NAMED as removal (`Stepper`'s `onRemove`), and the
|
|
33
|
+
* separate remove control is not drawn. A sold-out line keeps the separate
|
|
34
|
+
* control, because its stepper is disabled and could not remove anything.
|
|
30
35
|
*
|
|
31
36
|
* The row is never pressable, which is what lets the controls live in it: a
|
|
32
37
|
* pressable `Item` is a real `<button>` on web and a control inside one is
|
|
@@ -48,6 +53,7 @@ function CartLineComponent(props: CartLineProps) {
|
|
|
48
53
|
note,
|
|
49
54
|
price,
|
|
50
55
|
originalPrice,
|
|
56
|
+
secondaryPrice,
|
|
51
57
|
quantity,
|
|
52
58
|
photo,
|
|
53
59
|
photoVariant,
|
|
@@ -56,6 +62,7 @@ function CartLineComponent(props: CartLineProps) {
|
|
|
56
62
|
onQuantityChange,
|
|
57
63
|
onRemove,
|
|
58
64
|
removeLabel,
|
|
65
|
+
removeInStepper = false,
|
|
59
66
|
density = 'comfortable',
|
|
60
67
|
accessibilityLabel,
|
|
61
68
|
style,
|
|
@@ -68,6 +75,10 @@ function CartLineComponent(props: CartLineProps) {
|
|
|
68
75
|
const g = CART_GEOMETRY[density];
|
|
69
76
|
const compact = density === 'compact';
|
|
70
77
|
const chosen = optionsLine(options);
|
|
78
|
+
const removeName = removeLabel ?? `Remove ${name}`;
|
|
79
|
+
// The stepper carries removal only when it is live; a disabled stepper
|
|
80
|
+
// (sold out) cannot, and the line still needs its remove control.
|
|
81
|
+
const stepperRemoves = removeInStepper && onRemove !== undefined && onQuantityChange !== undefined && !unavailable;
|
|
71
82
|
|
|
72
83
|
return (
|
|
73
84
|
<Item
|
|
@@ -95,6 +106,16 @@ function CartLineComponent(props: CartLineProps) {
|
|
|
95
106
|
secondaryColor={paint.textSecondary}
|
|
96
107
|
testID={testID ? `${testID}-price` : undefined}
|
|
97
108
|
/>
|
|
109
|
+
{secondaryPrice ? (
|
|
110
|
+
<Text
|
|
111
|
+
variant={compact ? 'caption-1-regular' : 'body-2-regular'}
|
|
112
|
+
numberOfLines={1}
|
|
113
|
+
testID={testID ? `${testID}-secondary-price` : undefined}
|
|
114
|
+
style={{ color: paint.textSecondary, fontVariant: ['tabular-nums'] }}
|
|
115
|
+
>
|
|
116
|
+
{secondaryPrice}
|
|
117
|
+
</Text>
|
|
118
|
+
) : null}
|
|
98
119
|
</View>
|
|
99
120
|
}
|
|
100
121
|
style={style}
|
|
@@ -146,6 +167,8 @@ function CartLineComponent(props: CartLineProps) {
|
|
|
146
167
|
min={1}
|
|
147
168
|
disabled={unavailable}
|
|
148
169
|
onValueChange={onQuantityChange}
|
|
170
|
+
onRemove={stepperRemoves ? onRemove : undefined}
|
|
171
|
+
removeLabel={stepperRemoves ? removeName : undefined}
|
|
149
172
|
accessibilityLabel={name}
|
|
150
173
|
testID={testID ? `${testID}-stepper` : undefined}
|
|
151
174
|
/>
|
|
@@ -158,11 +181,11 @@ function CartLineComponent(props: CartLineProps) {
|
|
|
158
181
|
{`×${quantity}`}
|
|
159
182
|
</Text>
|
|
160
183
|
)}
|
|
161
|
-
{onRemove ? (
|
|
184
|
+
{onRemove && !stepperRemoves ? (
|
|
162
185
|
<GlyphButton
|
|
163
186
|
size={32}
|
|
164
187
|
icon={RiDeleteBinLine}
|
|
165
|
-
accessibilityLabel={
|
|
188
|
+
accessibilityLabel={removeName}
|
|
166
189
|
onPress={onRemove}
|
|
167
190
|
testID={testID ? `${testID}-remove` : undefined}
|
|
168
191
|
/>
|
|
@@ -187,6 +187,7 @@ function CartPanelComponent({
|
|
|
187
187
|
lines,
|
|
188
188
|
onLineQuantityChange,
|
|
189
189
|
onLineRemove,
|
|
190
|
+
removeInStepper = false,
|
|
190
191
|
minimumOrder,
|
|
191
192
|
tip,
|
|
192
193
|
promo,
|
|
@@ -239,6 +240,7 @@ function CartPanelComponent({
|
|
|
239
240
|
note={line.note}
|
|
240
241
|
price={line.price}
|
|
241
242
|
originalPrice={line.originalPrice}
|
|
243
|
+
secondaryPrice={line.secondaryPrice}
|
|
242
244
|
quantity={line.quantity}
|
|
243
245
|
photo={line.photo}
|
|
244
246
|
photoVariant={line.photoVariant}
|
|
@@ -251,6 +253,7 @@ function CartPanelComponent({
|
|
|
251
253
|
: undefined
|
|
252
254
|
}
|
|
253
255
|
onRemove={onLineRemove ? () => onLineRemove(line.id) : undefined}
|
|
256
|
+
removeInStepper={removeInStepper}
|
|
254
257
|
testID={testID ? `${testID}-line-${line.id}` : undefined}
|
|
255
258
|
/>
|
|
256
259
|
))}
|
package/src/cart-panel/shared.ts
CHANGED
|
@@ -45,7 +45,15 @@ export function optionsLine(options: ReadonlyArray<string> | undefined): string
|
|
|
45
45
|
export function composeCartLineName(
|
|
46
46
|
line: Pick<
|
|
47
47
|
CartLineEntry,
|
|
48
|
-
|
|
48
|
+
| 'name'
|
|
49
|
+
| 'options'
|
|
50
|
+
| 'note'
|
|
51
|
+
| 'quantity'
|
|
52
|
+
| 'price'
|
|
53
|
+
| 'originalPrice'
|
|
54
|
+
| 'secondaryPrice'
|
|
55
|
+
| 'unavailable'
|
|
56
|
+
| 'unavailableLabel'
|
|
49
57
|
>,
|
|
50
58
|
): string {
|
|
51
59
|
const parts: string[] = [line.name];
|
|
@@ -55,6 +63,8 @@ export function composeCartLineName(
|
|
|
55
63
|
parts.push(String(line.quantity));
|
|
56
64
|
if (line.originalPrice) parts.push(`${line.price}, originally ${line.originalPrice}`);
|
|
57
65
|
else parts.push(line.price);
|
|
66
|
+
// The second currency travels with the price it restates.
|
|
67
|
+
if (line.secondaryPrice) parts.push(line.secondaryPrice);
|
|
58
68
|
if (line.unavailable) parts.push(line.unavailableLabel ?? 'Sold out');
|
|
59
69
|
return parts.join(', ');
|
|
60
70
|
}
|
package/src/cart-panel/types.ts
CHANGED
|
@@ -26,6 +26,12 @@ export interface CartLineEntry {
|
|
|
26
26
|
price: string;
|
|
27
27
|
/** PRE-FORMATTED price before a discount, struck through BEFORE `price`. */
|
|
28
28
|
originalPrice?: string;
|
|
29
|
+
/**
|
|
30
|
+
* A second, PRE-FORMATTED rendering of `price` — the buyer's currency beside
|
|
31
|
+
* the shop's, `"≈ 12,00 €"` — drawn de-emphasised under it. The cart's
|
|
32
|
+
* spelling of `ListingPriceLine.secondary`; drawn as given, nothing converts.
|
|
33
|
+
*/
|
|
34
|
+
secondaryPrice?: string;
|
|
29
35
|
/** How many. Always at least 1 — a line with none of it is a line that was removed. */
|
|
30
36
|
quantity: number;
|
|
31
37
|
/** An absolute URL, or an id the app's `ImageResolver` turns into one. */
|
|
@@ -45,6 +51,13 @@ export interface CartLineProps extends Omit<CartLineEntry, 'id'> {
|
|
|
45
51
|
onRemove?: () => void;
|
|
46
52
|
/** Names the remove control, which draws no text. Default `"Remove <name>"`. */
|
|
47
53
|
removeLabel?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Moves removal INTO the stepper: at quantity 1 its `−` becomes a trash button
|
|
56
|
+
* named `removeLabel` that calls `onRemove`, and no separate remove control is
|
|
57
|
+
* drawn. Needs both `onQuantityChange` and `onRemove`; a sold-out line keeps
|
|
58
|
+
* the separate control. Default `false` — the stepper floors at 1.
|
|
59
|
+
*/
|
|
60
|
+
removeInStepper?: boolean;
|
|
48
61
|
/** Default `comfortable`. */
|
|
49
62
|
density?: CartDensity;
|
|
50
63
|
/** Replaces the composed name ("Ember flatbread, Large, Extra cheese, 2, €24.00"). */
|
|
@@ -151,6 +164,11 @@ export interface CartPanelProps {
|
|
|
151
164
|
onLineQuantityChange?: (id: string, quantity: number) => void;
|
|
152
165
|
/** With it every line draws a remove control. */
|
|
153
166
|
onLineRemove?: (id: string) => void;
|
|
167
|
+
/**
|
|
168
|
+
* Every line removes from its stepper at quantity 1 instead of drawing a
|
|
169
|
+
* separate remove control (`CartLine`'s `removeInStepper`). Default `false`.
|
|
170
|
+
*/
|
|
171
|
+
removeInStepper?: boolean;
|
|
154
172
|
|
|
155
173
|
/** The shortfall warning. Drawn above the totals, where the number it is about is. */
|
|
156
174
|
minimumOrder?: CartMinimumOrder;
|
|
@@ -15,6 +15,9 @@ import type { CheckoutConfirmProps } from './types';
|
|
|
15
15
|
* terms under it, and the state where it must not fire twice.
|
|
16
16
|
*
|
|
17
17
|
* button `Button` primary large, full width, "Place order · €24.80"
|
|
18
|
+
* second `secondaryAmount` ("≈ 12,00 €"), 8 under the button, the same
|
|
19
|
+
* centred secondary line as the terms — the button carries ONE
|
|
20
|
+
* amount, the one the charge is made in
|
|
18
21
|
* terms 12 under it; the centred secondary line every Bloom action card
|
|
19
22
|
* draws under its primary (`ActionCardNote`)
|
|
20
23
|
* footer 16 under the terms
|
|
@@ -44,6 +47,7 @@ import type { CheckoutConfirmProps } from './types';
|
|
|
44
47
|
function CheckoutConfirmComponent({
|
|
45
48
|
label = CHECKOUT_CONFIRM_LABEL,
|
|
46
49
|
amount,
|
|
50
|
+
secondaryAmount,
|
|
47
51
|
terms,
|
|
48
52
|
onConfirm,
|
|
49
53
|
disabled = false,
|
|
@@ -90,6 +94,11 @@ function CheckoutConfirmComponent({
|
|
|
90
94
|
>
|
|
91
95
|
{words}
|
|
92
96
|
</Button>
|
|
97
|
+
{secondaryAmount ? (
|
|
98
|
+
<ActionCardNote style={{ marginTop: 8 }} testID={id('secondary-amount')}>
|
|
99
|
+
{secondaryAmount}
|
|
100
|
+
</ActionCardNote>
|
|
101
|
+
) : null}
|
|
93
102
|
{terms != null ? (
|
|
94
103
|
<ActionCardNote style={{ marginTop: 12 }} testID={id('terms')}>
|
|
95
104
|
{terms}
|