@g9tm/lynxcontrols 2.5.4 → 2.5.6
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/catalog/cards/G9AppBar.md +2 -2
- package/catalog/cards/G9Avatar.md +2 -1
- package/catalog/cards/G9ChoiceList.md +1 -1
- package/catalog/cards/G9ConnectionBanner.md +4 -2
- package/catalog/cards/G9FlatTabBar.md +17 -0
- package/catalog/cards/G9IconSlot.md +1 -1
- package/catalog/cards/G9NumPad.md +5 -1
- package/catalog/cards/G9Photo.md +1 -1
- package/catalog/cards/G9PinEntry.md +2 -2
- package/catalog/cards/G9ProgressBar.md +1 -1
- package/catalog/cards/G9ScrollSpyBar.md +1 -1
- package/catalog/cards/G9Stepper.md +3 -3
- package/catalog/catalog.json +1342 -40
- package/catalog/index.md +4 -3
- package/dist/.tsbuildinfo +1 -1
- package/dist/anchor/context.d.ts +5 -0
- package/dist/anchor/context.d.ts.map +1 -1
- package/dist/anchor/context.jsx +2 -1
- package/dist/anchor/hooks.d.ts.map +1 -1
- package/dist/anchor/hooks.jsx +6 -1
- package/dist/anchor/index.d.ts +1 -1
- package/dist/anchor/index.d.ts.map +1 -1
- package/dist/anchor/index.jsx +1 -1
- package/dist/anchor/registry.d.ts +5 -0
- package/dist/anchor/registry.d.ts.map +1 -1
- package/dist/button/button.d.ts +4 -0
- package/dist/button/button.d.ts.map +1 -1
- package/dist/button/button.jsx +8 -2
- package/dist/button/icon-button.d.ts +2 -0
- package/dist/button/icon-button.d.ts.map +1 -1
- package/dist/button/icon-button.jsx +3 -1
- package/dist/display/display.css +1 -1
- package/dist/display/display.css.map +1 -1
- package/dist/display/figures.d.ts +13 -0
- package/dist/display/figures.d.ts.map +1 -1
- package/dist/display/figures.jsx +43 -12
- package/dist/display/motion-figures.d.ts +7 -0
- package/dist/display/motion-figures.d.ts.map +1 -1
- package/dist/display/motion-figures.jsx +14 -5
- package/dist/display/progress-bar.d.ts +5 -0
- package/dist/display/progress-bar.d.ts.map +1 -1
- package/dist/display/progress-bar.jsx +6 -2
- package/dist/display/shimmer.jsx +1 -1
- package/dist/effects/effects.css +6 -0
- package/dist/effects/effects.css.map +1 -1
- package/dist/effects/effects.d.ts +9 -0
- package/dist/effects/effects.d.ts.map +1 -1
- package/dist/effects/effects.jsx +47 -0
- package/dist/fields/editor.d.ts.map +1 -1
- package/dist/fields/editor.jsx +3 -0
- package/dist/fields/extra-entries.css +13 -0
- package/dist/fields/extra-entries.css.map +1 -1
- package/dist/fields/extra-entries.d.ts +25 -3
- package/dist/fields/extra-entries.d.ts.map +1 -1
- package/dist/fields/extra-entries.jsx +48 -9
- package/dist/fields/fields.css +18 -0
- package/dist/fields/fields.css.map +1 -1
- package/dist/fields/outlined-field.d.ts +10 -0
- package/dist/fields/outlined-field.d.ts.map +1 -1
- package/dist/fields/pin-entry.d.ts +21 -0
- package/dist/fields/pin-entry.d.ts.map +1 -1
- package/dist/fields/pin-entry.jsx +17 -8
- package/dist/fields/text-entry.jsx +1 -1
- package/dist/fields/use-text-input.d.ts +2 -0
- package/dist/fields/use-text-input.d.ts.map +1 -1
- package/dist/fields/use-text-input.jsx +3 -1
- package/dist/header/app-bar.d.ts +7 -1
- package/dist/header/app-bar.d.ts.map +1 -1
- package/dist/header/app-bar.jsx +13 -7
- package/dist/host/bottom-overlays.d.ts +11 -0
- package/dist/host/bottom-overlays.d.ts.map +1 -0
- package/dist/host/bottom-overlays.jsx +18 -0
- package/dist/host/context.d.ts +4 -0
- package/dist/host/context.d.ts.map +1 -0
- package/dist/host/context.jsx +3 -0
- package/dist/host/host.d.ts +3 -3
- package/dist/host/host.d.ts.map +1 -1
- package/dist/host/host.jsx +1 -1
- package/dist/icon/icon.css +0 -1
- package/dist/icon/icon.css.map +1 -1
- package/dist/icon/icon.d.ts.map +1 -1
- package/dist/icon/icon.jsx +2 -1
- package/dist/icon/slot.d.ts +2 -0
- package/dist/icon/slot.d.ts.map +1 -1
- package/dist/icon/slot.jsx +2 -0
- package/dist/layout/scroll-spy.d.ts +5 -0
- package/dist/layout/scroll-spy.d.ts.map +1 -1
- package/dist/layout/scroll-spy.jsx +17 -6
- package/dist/layout/scrollers.d.ts +5 -0
- package/dist/layout/scrollers.d.ts.map +1 -1
- package/dist/layout/scrollers.jsx +23 -3
- package/dist/list/index.d.ts +1 -1
- package/dist/list/index.d.ts.map +1 -1
- package/dist/list/index.jsx +1 -1
- package/dist/list/list.css +6 -0
- package/dist/list/list.css.map +1 -1
- package/dist/list/virtual-list.d.ts +52 -1
- package/dist/list/virtual-list.d.ts.map +1 -1
- package/dist/list/virtual-list.jsx +123 -18
- package/dist/provider/provider.css +1 -1
- package/dist/provider/provider.css.map +1 -1
- package/dist/range-slider/range-slider.css +14 -14
- package/dist/range-slider/range-slider.css.map +1 -1
- package/dist/range-slider/step-slider.jsx +8 -8
- package/dist/shell/shell.css +1 -0
- package/dist/shell/shell.css.map +1 -1
- package/dist/shell/shell.d.ts +14 -2
- package/dist/shell/shell.d.ts.map +1 -1
- package/dist/shell/shell.jsx +6 -5
- package/dist/survey/survey.css +56 -0
- package/dist/survey/survey.css.map +1 -1
- package/dist/survey/survey.d.ts +9 -0
- package/dist/survey/survey.d.ts.map +1 -1
- package/dist/survey/survey.jsx +43 -5
- package/dist/tab-bar/flat.d.ts +18 -0
- package/dist/tab-bar/flat.d.ts.map +1 -0
- package/dist/tab-bar/flat.jsx +110 -0
- package/dist/tab-bar/index.d.ts +1 -0
- package/dist/tab-bar/index.d.ts.map +1 -1
- package/dist/tab-bar/index.jsx +1 -0
- package/dist/tab-bar/metrics.d.ts +8 -2
- package/dist/tab-bar/metrics.d.ts.map +1 -1
- package/dist/tab-bar/metrics.jsx +12 -1
- package/dist/tab-bar/tab-bar.css +77 -0
- package/dist/tab-bar/tab-bar.css.map +1 -1
- package/dist/tab-bar/tab-bar.d.ts.map +1 -1
- package/dist/tab-bar/tab-bar.jsx +4 -0
- package/dist/tabs/tab-view.d.ts.map +1 -1
- package/dist/tabs/tab-view.jsx +10 -3
- package/dist/toast/service.d.ts.map +1 -1
- package/dist/toast/service.jsx +7 -0
- package/dist/toggle/chip-group.d.ts.map +1 -1
- package/dist/toggle/chip-group.jsx +2 -1
- package/dist/toggle/choice.d.ts +10 -0
- package/dist/toggle/choice.d.ts.map +1 -1
- package/dist/toggle/choice.jsx +14 -10
- package/package.json +2 -2
- package/skills/g9-lynx-app/references/catalog-index.md +1 -1
- package/skills/g9-lynx-app/references/components/barcode.md +3 -3
- package/skills/g9-lynx-app/references/components/charts.md +34 -28
- package/skills/g9-lynx-app/references/components/commerce.md +5 -4
- package/skills/g9-lynx-app/references/components/display-1.md +2 -1
- package/skills/g9-lynx-app/references/components/display-2.md +2 -2
- package/skills/g9-lynx-app/references/components/fields.md +7 -3
- package/skills/g9-lynx-app/references/components/header.md +2 -2
- package/skills/g9-lynx-app/references/components/icon.md +1 -1
- package/skills/g9-lynx-app/references/components/layout-1.md +1 -1
- package/skills/g9-lynx-app/references/components/shell.md +4 -2
- package/skills/g9-lynx-app/references/components/survey.md +1 -1
- package/skills/g9-lynx-app/references/components/tab-bar.md +18 -0
- package/skills/g9-lynx-app/references/components/toggle.md +3 -3
- package/skills/g9-lynx-app/references/provider-and-host.md +7 -0
package/dist/survey/survey.d.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import './survey.css';
|
|
2
2
|
import { type ReactNode } from '@lynx-js/react';
|
|
3
3
|
import { type G9ControlBaseProps } from '../base/control.js';
|
|
4
|
+
import { type G9Tone } from '../base/tone.js';
|
|
4
5
|
import { type G9IconInput } from '../icon/icon.js';
|
|
5
6
|
/** One choice. */
|
|
6
7
|
export interface G9ChoiceOption<K extends string = string> {
|
|
7
8
|
readonly key: K;
|
|
8
9
|
readonly label: string;
|
|
9
10
|
readonly description?: string;
|
|
11
|
+
/** The description's tone (a green «۲۰٪ ارزانتر», a busy slot's «+۱۵٬۰۰۰ تومان» in warning). Default secondary text. */
|
|
12
|
+
readonly descriptionTone?: G9Tone;
|
|
10
13
|
readonly icon?: G9IconInput;
|
|
11
14
|
/** An illustration above the label (Riskara scenario cards). */
|
|
12
15
|
readonly art?: ReactNode;
|
|
@@ -24,6 +27,12 @@ export interface G9ChoiceListProps<K extends string = string> extends G9ControlB
|
|
|
24
27
|
readonly max?: number;
|
|
25
28
|
/** Cards per row. Default 1. */
|
|
26
29
|
readonly columns?: number;
|
|
30
|
+
/**
|
|
31
|
+
* `'cards'` (default): rows of cards. `'row'`: one horizontally scrolling row of pills, label over description (a day
|
|
32
|
+
* picker: «فردا» over «۲۱ آبان»), the chosen one filled in the brand colour (ShopManager, 2.5.6). `columns` and `art`
|
|
33
|
+
* are not used in a row.
|
|
34
|
+
*/
|
|
35
|
+
readonly layout?: 'cards' | 'row';
|
|
27
36
|
/** Single choice only: called right after a pick (a questionnaire moving to the next question). */
|
|
28
37
|
readonly onPicked?: (key: K) => void;
|
|
29
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"survey.d.ts","sourceRoot":"","sources":["../../src/survey/survey.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"survey.d.ts","sourceRoot":"","sources":["../../src/survey/survey.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAAE,KAAK,kBAAkB,EAAkD,MAAM,iBAAiB,CAAC;AAC1G,OAAO,EAAE,KAAK,MAAM,EAAc,MAAM,cAAc,CAAC;AAEvD,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAKxD,kBAAkB;AAClB,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IACvD,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC;IAChB,QAAQ,CA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,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACpD,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,KAAK,IAAI,CAAC;IACjE,+CAA+C;IAC/C,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CAC7C;AAED,oFAAoF;AACpF,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,EACvC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAClC,GAAG,EAAE,CAAC,EACN,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACZ,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAKnB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,KAAK,EAAE,sBAAsB,CAAC,CAAC,CAAC,GAAG,SAAS,CAqExG"}
|
package/dist/survey/survey.jsx
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import "./survey.css";
|
|
2
2
|
import { formatNumber, g9Haptic } from "@g9tm/lynxcontrols-foundation";
|
|
3
3
|
import { memo } from "@lynx-js/react";
|
|
4
|
+
import { G9HorizontalStripContext } from "../anchor/context.jsx";
|
|
4
5
|
import { g9ChildId, g9IdProps, g9RowStyle, useG9Control } from "../base/control.jsx";
|
|
6
|
+
import { toneColors } from "../base/tone.jsx";
|
|
5
7
|
import { useControllableState } from "../base/use-controllable-state.jsx";
|
|
6
8
|
import { G9Icon } from "../icon/icon.jsx";
|
|
7
9
|
import { useG9Culture } from "../provider/hooks.jsx";
|
|
@@ -43,12 +45,19 @@ function G9ChoiceList(props) {
|
|
|
43
45
|
selectItem: (k)=>pick(k)
|
|
44
46
|
}
|
|
45
47
|
});
|
|
48
|
+
if ('row' === props.layout) return <scroll-view className={`${control.className} g9-choices--row`} {...control.idProps} style={control.rootStyle()} scroll-orientation="horizontal">
|
|
49
|
+
<view className="g9-choices__strip" style={g9RowStyle(control.direction)}>
|
|
50
|
+
<G9HorizontalStripContext.Provider value={true}>
|
|
51
|
+
{props.options.map((o)=><ChoicePill key={o.key} option={o} on={value.includes(o.key)} id={g9ChildId(props.id, o.key)} onTap={()=>pick(o.key)}/>)}
|
|
52
|
+
</G9HorizontalStripContext.Provider>
|
|
53
|
+
</view>
|
|
54
|
+
</scroll-view>;
|
|
46
55
|
const cols = Math.max(1, null != (_props_columns = props.columns) ? _props_columns : 1);
|
|
47
56
|
const rows = [];
|
|
48
57
|
for(let i = 0; i < props.options.length; i += cols)rows.push(props.options.slice(i, i + cols));
|
|
49
58
|
return <view className={control.className} {...control.idProps} style={control.rootStyle()}>
|
|
50
59
|
{rows.map((row, r)=><view key={r} className="g9-choices__row" style={g9RowStyle(control.direction)}>
|
|
51
|
-
{row.map((o)=><ChoiceCard key={o.key} option={o} on={value.includes(o.key)} multiple={true === props.multiple} id={g9ChildId(props.id, o.key)} onTap={()=>pick(o.key)}/>)}
|
|
60
|
+
{row.map((o)=><ChoiceCard key={o.key} option={o} on={value.includes(o.key)} multiple={true === props.multiple} id={g9ChildId(props.id, o.key)} dir={control.direction} onTap={()=>pick(o.key)}/>)}
|
|
52
61
|
{row.length < cols ? Array.from({
|
|
53
62
|
length: cols - row.length
|
|
54
63
|
}, (_, i)=><view key={`pad${i}`} className="g9-choices__pad"/>) : null}
|
|
@@ -56,13 +65,28 @@ function G9ChoiceList(props) {
|
|
|
56
65
|
</view>;
|
|
57
66
|
}
|
|
58
67
|
const ChoiceCard = memo(function(p) {
|
|
68
|
+
const align = {
|
|
69
|
+
textAlign: 'rtl' === p.dir ? 'right' : 'left'
|
|
70
|
+
};
|
|
59
71
|
return <view className={`g9-choice${p.on ? ' g9-choice--on' : ''}${p.option.disabled ? ' g9-choice--disabled' : ''}`} {...g9IdProps(p.id)} bindtap={p.onTap} accessibility-element={true} accessibility-traits="button" accessibility-label={p.option.label} accessibility-status={p.on ? 'selected' : ''}>
|
|
60
72
|
{p.option.art}
|
|
61
|
-
<view className="g9-choice__line">
|
|
73
|
+
<view className="g9-choice__line" style={g9RowStyle(p.dir)}>
|
|
62
74
|
{p.option.icon ? <G9Icon icon={p.option.icon} size={22} color={p.on ? 'var(--g9-primary)' : 'var(--g9-text-secondary)'}/> : null}
|
|
63
|
-
<view className="g9-choice__text"
|
|
64
|
-
|
|
65
|
-
|
|
75
|
+
<view className="g9-choice__text" style={{
|
|
76
|
+
direction: 'ltr',
|
|
77
|
+
alignItems: 'rtl' === p.dir ? 'flex-end' : 'flex-start'
|
|
78
|
+
}}>
|
|
79
|
+
<text className="g9-choice__label" style={align}>
|
|
80
|
+
{p.option.label}
|
|
81
|
+
</text>
|
|
82
|
+
{p.option.description ? <text className="g9-choice__description" style={{
|
|
83
|
+
...align,
|
|
84
|
+
...p.option.descriptionTone ? {
|
|
85
|
+
color: toneColors(p.option.descriptionTone, 'plain').foreground
|
|
86
|
+
} : {}
|
|
87
|
+
}}>
|
|
88
|
+
{p.option.description}
|
|
89
|
+
</text> : null}
|
|
66
90
|
</view>
|
|
67
91
|
<view className={`g9-choice__mark${p.multiple ? ' g9-choice__mark--square' : ''}${p.on ? ' g9-choice__mark--on' : ''}`}>
|
|
68
92
|
{p.on ? <G9Icon icon="check" size={14} color="var(--g9-on-primary)"/> : null}
|
|
@@ -70,6 +94,20 @@ const ChoiceCard = memo(function(p) {
|
|
|
70
94
|
</view>
|
|
71
95
|
</view>;
|
|
72
96
|
});
|
|
97
|
+
const ChoicePill = memo(function(p) {
|
|
98
|
+
const tone = p.option.descriptionTone && !p.on ? toneColors(p.option.descriptionTone, 'plain').foreground : null;
|
|
99
|
+
return <view className={`g9-choice-pill${p.on ? ' g9-choice-pill--on' : ''}${p.option.disabled ? ' g9-choice--disabled' : ''}`} {...g9IdProps(p.id)} bindtap={p.onTap} accessibility-element={true} accessibility-traits="button" accessibility-label={p.option.description ? `${p.option.label}, ${p.option.description}` : p.option.label} accessibility-status={p.on ? 'selected' : ''}>
|
|
100
|
+
{p.option.icon ? <G9Icon icon={p.option.icon} size={18} color={p.on ? 'var(--g9-on-primary)' : 'var(--g9-text-secondary)'}/> : null}
|
|
101
|
+
<text className={`g9-choice-pill__label${p.on ? ' g9-choice-pill__label--on' : ''}`}>{p.option.label}</text>
|
|
102
|
+
{p.option.description ? <text className={`g9-choice-pill__description${p.on ? " g9-choice-pill__description--on" : ''}`} {...tone ? {
|
|
103
|
+
style: {
|
|
104
|
+
color: tone
|
|
105
|
+
}
|
|
106
|
+
} : {}}>
|
|
107
|
+
{p.option.description}
|
|
108
|
+
</text> : null}
|
|
109
|
+
</view>;
|
|
110
|
+
});
|
|
73
111
|
function G9ScaleInput(props) {
|
|
74
112
|
var _props_min, _props_max, _props_defaultValue;
|
|
75
113
|
const culture = useG9Culture();
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ReactNode } from '@lynx-js/react';
|
|
2
|
+
import type { G9TabBarProps } from './tab-bar.js';
|
|
3
|
+
/** The flat bar's geometry (a host reserves `barHeight` under its content; the band above it is transparent). */
|
|
4
|
+
export declare const g9FlatTabBarMetrics: Readonly<{
|
|
5
|
+
band: 20;
|
|
6
|
+
barHeight: 76;
|
|
7
|
+
bottomPadding: 6;
|
|
8
|
+
sidePadding: 4;
|
|
9
|
+
pillWidth: 60;
|
|
10
|
+
pillHeight: 34;
|
|
11
|
+
iconSize: 22;
|
|
12
|
+
discSize: 64;
|
|
13
|
+
discRing: 4;
|
|
14
|
+
discIconSize: 28;
|
|
15
|
+
}>;
|
|
16
|
+
/** The flat style of {@link G9TabBar} (selected by `barStyle: 'flat'`). */
|
|
17
|
+
export declare function G9FlatTabBar(props: G9TabBarProps): ReactNode;
|
|
18
|
+
//# sourceMappingURL=flat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flat.d.ts","sourceRoot":"","sources":["../../src/tab-bar/flat.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAQhD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C,iHAAiH;AACjH,eAAO,MAAM,mBAAmB;;;;;;;;;;;EAW9B,CAAC;AAIH,2EAA2E;AAC3E,wBAAgB,YAAY,CAAC,KAAK,EAAE,aAAa,GAAG,SAAS,CAyG5D"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { g9Haptic } from "@g9tm/lynxcontrols-foundation";
|
|
2
|
+
import { g9RowStyle } from "../base/control.jsx";
|
|
3
|
+
import { useControllableState } from "../base/use-controllable-state.jsx";
|
|
4
|
+
import { G9Badge } from "../display/status.jsx";
|
|
5
|
+
import { G9Icon } from "../icon/icon.jsx";
|
|
6
|
+
import { useG9Diagnostics, useG9Direction, useG9SafeInsets } from "../provider/hooks.jsx";
|
|
7
|
+
import { resolveTabBarFabIndex } from "./model.jsx";
|
|
8
|
+
const g9FlatTabBarMetrics = Object.freeze({
|
|
9
|
+
band: 20,
|
|
10
|
+
barHeight: 76,
|
|
11
|
+
bottomPadding: 6,
|
|
12
|
+
sidePadding: 4,
|
|
13
|
+
pillWidth: 60,
|
|
14
|
+
pillHeight: 34,
|
|
15
|
+
iconSize: 22,
|
|
16
|
+
discSize: 64,
|
|
17
|
+
discRing: 4,
|
|
18
|
+
discIconSize: 28
|
|
19
|
+
});
|
|
20
|
+
const F = g9FlatTabBarMetrics;
|
|
21
|
+
function G9FlatTabBar(props) {
|
|
22
|
+
var _props_defaultSelectedIndex;
|
|
23
|
+
const items = props.items;
|
|
24
|
+
const insets = useG9SafeInsets();
|
|
25
|
+
const dir = useG9Direction();
|
|
26
|
+
const diagnostics = useG9Diagnostics();
|
|
27
|
+
const [selected, setSelected] = useControllableState({
|
|
28
|
+
value: props.selectedIndex,
|
|
29
|
+
defaultValue: null != (_props_defaultSelectedIndex = props.defaultSelectedIndex) ? _props_defaultSelectedIndex : 0,
|
|
30
|
+
onChange: props.onSelectedIndexChange,
|
|
31
|
+
name: 'G9TabBar.selectedIndex'
|
|
32
|
+
});
|
|
33
|
+
const fab = void 0 !== props.fabIndex ? resolveTabBarFabIndex(props.fabIndex, items.length) : -1;
|
|
34
|
+
const bottom = props.safeBottom ? insets.bottom : 0;
|
|
35
|
+
const tap = (index)=>{
|
|
36
|
+
const item = items[index];
|
|
37
|
+
if (index !== selected) {
|
|
38
|
+
g9Haptic('select');
|
|
39
|
+
setSelected(index);
|
|
40
|
+
}
|
|
41
|
+
const context = {
|
|
42
|
+
index,
|
|
43
|
+
item,
|
|
44
|
+
isSubMenuItem: false
|
|
45
|
+
};
|
|
46
|
+
try {
|
|
47
|
+
var _item_onClick, _props_onItemSelected;
|
|
48
|
+
null == (_item_onClick = item.onClick) || _item_onClick.call(item, context);
|
|
49
|
+
if (item.command && false !== item.canExecute) item.command(item.commandParameter);
|
|
50
|
+
null == (_props_onItemSelected = props.onItemSelected) || _props_onItemSelected.call(props, context);
|
|
51
|
+
} catch (error) {
|
|
52
|
+
diagnostics.log({
|
|
53
|
+
level: 'error',
|
|
54
|
+
message: 'G9TabBar: item handler failed.',
|
|
55
|
+
source: 'G9TabBar',
|
|
56
|
+
error
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
return <view className={`g9-tab-flat${props.className ? ` ${props.className}` : ''}`} style={{
|
|
61
|
+
height: `${F.band + F.barHeight + bottom}px`
|
|
62
|
+
}}>
|
|
63
|
+
<view className="g9-tab-flat__bar" style={{
|
|
64
|
+
...g9RowStyle(dir),
|
|
65
|
+
height: `${F.barHeight + bottom}px`,
|
|
66
|
+
paddingBottom: `${F.bottomPadding + bottom}px`,
|
|
67
|
+
paddingLeft: `${F.sidePadding}px`,
|
|
68
|
+
paddingRight: `${F.sidePadding}px`
|
|
69
|
+
}}>
|
|
70
|
+
{items.map((item, index)=>{
|
|
71
|
+
var _item_automationId, _item_text;
|
|
72
|
+
const on = index === selected;
|
|
73
|
+
const raised = index === fab;
|
|
74
|
+
const icon = on && item.selectedIcon || item.icon || 'check';
|
|
75
|
+
return <view key={null != (_item_automationId = item.automationId) ? _item_automationId : `${index}`} className="g9-tab-flat__item" {...item.automationId ? {
|
|
76
|
+
id: item.automationId
|
|
77
|
+
} : {}} bindtap={()=>tap(index)} accessibility-element={true} accessibility-traits="button" accessibility-label={null != (_item_text = item.text) ? _item_text : ''} accessibility-status={on ? 'selected' : ''}>
|
|
78
|
+
{raised ? <view className={`g9-tab-flat__disc${on ? ' g9-tab-flat__disc--on' : ''}`} style={{
|
|
79
|
+
width: `${F.discSize}px`,
|
|
80
|
+
height: `${F.discSize}px`,
|
|
81
|
+
borderRadius: `${F.discSize / 2}px`,
|
|
82
|
+
borderWidth: `${F.discRing}px`,
|
|
83
|
+
marginTop: `-${F.band + 8}px`
|
|
84
|
+
}}>
|
|
85
|
+
<G9Icon icon={icon} size={F.discIconSize} color="var(--g9-on-primary)"/>
|
|
86
|
+
</view> : <view className={`g9-tab-flat__pill${on ? ' g9-tab-flat__pill--on' : ''}`} style={{
|
|
87
|
+
width: `${F.pillWidth}px`,
|
|
88
|
+
height: `${F.pillHeight}px`,
|
|
89
|
+
borderRadius: `${F.pillHeight / 2}px`
|
|
90
|
+
}}>
|
|
91
|
+
<G9Icon icon={icon} size={F.iconSize} color={on ? 'var(--g9-primary)' : 'var(--g9-text-secondary)'}/>
|
|
92
|
+
{item.badge ? <view className={`g9-tab-flat__badge g9-tab-flat__badge--${dir}`}>
|
|
93
|
+
<G9Badge {...true === item.badge ? {
|
|
94
|
+
dot: true
|
|
95
|
+
} : {
|
|
96
|
+
value: item.badge
|
|
97
|
+
}}/>
|
|
98
|
+
</view> : null}
|
|
99
|
+
</view>}
|
|
100
|
+
{item.text ? <text className={`g9-tab-flat__label${on ? ' g9-tab-flat__label--on' : ''}`} text-maxline="1" style={raised ? {
|
|
101
|
+
marginTop: '6px'
|
|
102
|
+
} : {}}>
|
|
103
|
+
{item.text}
|
|
104
|
+
</text> : null}
|
|
105
|
+
</view>;
|
|
106
|
+
})}
|
|
107
|
+
</view>
|
|
108
|
+
</view>;
|
|
109
|
+
}
|
|
110
|
+
export { G9FlatTabBar, g9FlatTabBarMetrics };
|
package/dist/tab-bar/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { G9FlatTabBar, g9FlatTabBarMetrics } from './flat.js';
|
|
1
2
|
export { easeOutBackCss, type G9TabBarShadowRecipe, type G9TabBarStyle, type G9TabBarStyleMetrics, g9TabBarMetrics, g9TabBarStyleMetrics, } from './metrics.js';
|
|
2
3
|
export { centerOutwardRank, clampTabBarNotchCenter, estimateTextEm, fitLabelFontSize, type G9TabBarClickContext, type G9TabBarConfig, type G9TabBarEffect, type G9TabBarFabTappedEventArgs, type G9TabBarItem, type G9TabBarSelectionChangedEventArgs, type G9TabBarSlot, type G9TabBarState, type G9TabBarTransition, g9TabBarItem, initialTabBarState, overflowColumnLayout, reconcileTabBarState, resolveTabBarFabIndex, subMenuRowLayout, TAB_LABEL_MIN_FONT_SIZE, tabBarBackdropTap, tabBarChromePath, tabBarChromeSvg, tabBarFabCenterX, tabBarFabPlusSvg, tabBarFabShadowSvg, tabBarFabTap, tabBarHasOverflow, tabBarIndicatorSlot, tabBarItemTap, tabBarOverflowIndices, tabBarOverflowItemTap, tabBarOverflowSlot, tabBarOverflowTriggerTap, tabBarReservedHeight, tabBarSlotCenterX, tabBarSlots, tabBarSubMenuTap, } from './model.js';
|
|
3
4
|
export { G9TabBar, type G9TabBarProps } from './tab-bar.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tab-bar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,eAAe,EACf,oBAAoB,GACrB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,cAAc,EACd,gBAAgB,EAChB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,0BAA0B,EAC/B,KAAK,YAAY,EACjB,KAAK,iCAAiC,EACtC,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,YAAY,EACZ,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,EACvB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,wBAAwB,EACxB,oBAAoB,EACpB,iBAAiB,EACjB,WAAW,EACX,gBAAgB,GACjB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tab-bar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAC3D,OAAO,EACL,cAAc,EACd,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,eAAe,EACf,oBAAoB,GACrB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,cAAc,EACd,gBAAgB,EAChB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,0BAA0B,EAC/B,KAAK,YAAY,EACjB,KAAK,iCAAiC,EACtC,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,YAAY,EACZ,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,EACvB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,wBAAwB,EACxB,oBAAoB,EACpB,iBAAiB,EACjB,WAAW,EACX,gBAAgB,GACjB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/tab-bar/index.jsx
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { G9FlatTabBar, g9FlatTabBarMetrics } from "./flat.jsx";
|
|
1
2
|
export { easeOutBackCss, g9TabBarMetrics, g9TabBarStyleMetrics } from "./metrics.jsx";
|
|
2
3
|
export { TAB_LABEL_MIN_FONT_SIZE, centerOutwardRank, clampTabBarNotchCenter, estimateTextEm, fitLabelFontSize, g9TabBarItem, initialTabBarState, overflowColumnLayout, reconcileTabBarState, resolveTabBarFabIndex, subMenuRowLayout, tabBarBackdropTap, tabBarChromePath, tabBarChromeSvg, tabBarFabCenterX, tabBarFabPlusSvg, tabBarFabShadowSvg, tabBarFabTap, tabBarHasOverflow, tabBarIndicatorSlot, tabBarItemTap, tabBarOverflowIndices, tabBarOverflowItemTap, tabBarOverflowSlot, tabBarOverflowTriggerTap, tabBarReservedHeight, tabBarSlotCenterX, tabBarSlots, tabBarSubMenuTap } from "./model.jsx";
|
|
3
4
|
export { G9TabBar } from "./tab-bar.jsx";
|
|
@@ -119,8 +119,11 @@ export declare const g9TabBarMetrics: Readonly<{
|
|
|
119
119
|
* - `'sculpted'` («Bottom Navigation / Sculpted»): an opaque 68 px bar with 24 px corners and a soft shadow, a wide
|
|
120
120
|
* S-shouldered cradle, a flat 66 px primary disc sunk 9 px into the bar, and no pill: the selected item switches to
|
|
121
121
|
* its `selectedIcon` and the primary colour.
|
|
122
|
+
* - `'flat'` (2.5.6, ShopManager): full width and flush, a Surface fill under a 1 px line, a pill behind each selected
|
|
123
|
+
* item, and an optional raised centre disc that is a tab, not a menu (`G9TabBar` draws it with its own component;
|
|
124
|
+
* switching to or from it remounts the bar). Its geometry is `g9FlatTabBarMetrics`.
|
|
122
125
|
*/
|
|
123
|
-
export type G9TabBarStyle = 'classic' | 'sculpted';
|
|
126
|
+
export type G9TabBarStyle = 'classic' | 'sculpted' | 'flat';
|
|
124
127
|
/**
|
|
125
128
|
* The shadow painted under the bar and under the FAB disc (MAUI `G9TabBarShadowView`): the bar's own outline, notch
|
|
126
129
|
* included, filled black at `alpha`, blurred with a Gaussian of `blurSigma` (SVG `feGaussianBlur stdDeviation` is the
|
|
@@ -210,7 +213,10 @@ export declare const g9TabBarStyleMetrics: Readonly<{
|
|
|
210
213
|
sculpted: G9TabBarStyleMetrics;
|
|
211
214
|
/** Half the cradle's opening along the top edge in design px, before `cradleScale` (MAUI `CradleHalfWidth`). */
|
|
212
215
|
cradleHalfWidth: 57;
|
|
213
|
-
/**
|
|
216
|
+
/**
|
|
217
|
+
* The metrics of `style` (MAUI `G9TabBarStyleMetrics.For`). `'flat'` answers Classic's with the flat bar's height
|
|
218
|
+
* (76) and its 64 dp disc rising 20 dp: what a host reserves; anything else unknown is Classic.
|
|
219
|
+
*/
|
|
214
220
|
for: (style: G9TabBarStyle | null | undefined) => G9TabBarStyleMetrics;
|
|
215
221
|
}>;
|
|
216
222
|
/** The Sculpted cradle in design px from the notch centre (x) and the top edge (y); multiplied by `cradleScale`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../../src/tab-bar/metrics.ts"],"names":[],"mappings":"AAyBA,oGAAoG;AACpG,iBAAS,wBAAwB,CAAC,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAMlE;AAED,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BAAgB,EAAE,MAAM,GAAG,MAAM,CAAC;CAC5D;AAmCD;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB;;;IA4D/B,gHAAgH;;IAEhH;;;OAGG;iBACU,aAAa,GAAG,IAAI,GAAG,SAAS,KAAG,oBAAoB;EAMpE,CAAC;AAEH,oHAAoH;AACpH,eAAO,MAAM,kBAAkB;;;;;;;;;EAS7B,CAAC;AAEH,6GAA6G;AAC7G,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAIhD"}
|
package/dist/tab-bar/metrics.jsx
CHANGED
|
@@ -200,7 +200,7 @@ const g9TabBarStyleMetrics = Object.freeze({
|
|
|
200
200
|
})
|
|
201
201
|
}),
|
|
202
202
|
cradleHalfWidth,
|
|
203
|
-
for: (style)=>'sculpted' === style ? g9TabBarStyleMetrics.sculpted : g9TabBarStyleMetrics.classic
|
|
203
|
+
for: (style)=>'sculpted' === style ? g9TabBarStyleMetrics.sculpted : 'flat' === style ? FLAT_METRICS : g9TabBarStyleMetrics.classic
|
|
204
204
|
});
|
|
205
205
|
const tabBarCradleDesign = Object.freeze({
|
|
206
206
|
halfWidth: cradleHalfWidth,
|
|
@@ -216,4 +216,15 @@ function easeOutBackCss(c) {
|
|
|
216
216
|
const y1 = 1 + 0.329 * c;
|
|
217
217
|
return `cubic-bezier(0.34, ${y1.toFixed(2)}, 0.64, 1)`;
|
|
218
218
|
}
|
|
219
|
+
const FLAT_METRICS = Object.freeze({
|
|
220
|
+
...g9TabBarStyleMetrics.classic,
|
|
221
|
+
style: 'flat',
|
|
222
|
+
barHeight: 76,
|
|
223
|
+
barTopRadius: 0,
|
|
224
|
+
barBottomRadius: 0,
|
|
225
|
+
fabSize: 64,
|
|
226
|
+
fabInnerSize: 56,
|
|
227
|
+
fabProtrusionAboveBar: 20,
|
|
228
|
+
floatingHeadroom: 20
|
|
229
|
+
});
|
|
219
230
|
export { easeOutBackCss, g9TabBarMetrics, g9TabBarStyleMetrics, tabBarCradleDesign };
|
package/dist/tab-bar/tab-bar.css
CHANGED
|
@@ -267,5 +267,82 @@
|
|
|
267
267
|
left: -10px;
|
|
268
268
|
}
|
|
269
269
|
|
|
270
|
+
.g9-tab-flat {
|
|
271
|
+
flex-direction: column;
|
|
272
|
+
justify-content: flex-end;
|
|
273
|
+
width: 100%;
|
|
274
|
+
display: flex;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.g9-tab-flat__bar {
|
|
278
|
+
border-top-style: solid;
|
|
279
|
+
border-top-width: 1px;
|
|
280
|
+
border-top-color: var(--g9-outline-variant);
|
|
281
|
+
background-color: var(--g9-surface);
|
|
282
|
+
align-items: flex-start;
|
|
283
|
+
padding-top: 8px;
|
|
284
|
+
display: flex;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.g9-tab-flat__item {
|
|
288
|
+
flex-direction: column;
|
|
289
|
+
flex: 1 1 0;
|
|
290
|
+
align-items: center;
|
|
291
|
+
min-width: 0;
|
|
292
|
+
display: flex;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.g9-tab-flat__pill {
|
|
296
|
+
justify-content: center;
|
|
297
|
+
align-items: center;
|
|
298
|
+
display: flex;
|
|
299
|
+
position: relative;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.g9-tab-flat__pill--on {
|
|
303
|
+
background-color: var(--g9-primary-container);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.g9-tab-flat__badge {
|
|
307
|
+
position: absolute;
|
|
308
|
+
top: -2px;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.g9-tab-flat__badge--ltr {
|
|
312
|
+
right: 4px;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.g9-tab-flat__badge--rtl {
|
|
316
|
+
left: 4px;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.g9-tab-flat__disc {
|
|
320
|
+
border-style: solid;
|
|
321
|
+
border-color: var(--g9-surface);
|
|
322
|
+
background-color: var(--g9-primary);
|
|
323
|
+
justify-content: center;
|
|
324
|
+
align-items: center;
|
|
325
|
+
display: flex;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.g9-tab-flat__disc--on {
|
|
329
|
+
border-color: var(--g9-primary-container);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.g9-tab-flat__label {
|
|
333
|
+
font-size: 11px;
|
|
334
|
+
line-height: 14px;
|
|
335
|
+
font-family: var(--g9-font-text-500);
|
|
336
|
+
color: var(--g9-text-secondary);
|
|
337
|
+
margin-top: 4px;
|
|
338
|
+
font-weight: 500;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.g9-tab-flat__label--on {
|
|
342
|
+
font-family: var(--g9-font-text-700);
|
|
343
|
+
color: var(--g9-on-primary-container);
|
|
344
|
+
font-weight: 700;
|
|
345
|
+
}
|
|
346
|
+
|
|
270
347
|
|
|
271
348
|
/*# sourceMappingURL=tab-bar.css.map */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://./src/tab-bar/tab-bar.css"],"names":[],"mappings":"AAGA;EAFE,WAAW;EACX,kBAAkB;EAClB,iBAAiB;AACnB;;AAMA;EAHE,sBAAsB;EACtB,WAAW;EACX,aAAa;AACf;;AAMA;EAHE,kBAAkB;EAClB,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAMA;EAHE,YAAY;EACZ,kBAAkB;EAClB,YAAY;EACZ,UAAU;EACV,WAAW;AACb;;AAMA;EAHE,WAAW;EACX,YAAY;EACZ,kBAAkB;EAClB,MAAM;EACN,OAAO;AACT;;AAUA;EAPE,cAAc;EACd,mBAAmB;EACnB,aAAa;EACb,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAUA;EAPE,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAWA;EARE,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;AACT;;AAWA;E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B;EACvB,mBAAmB;EACnB,aAAa;EACb,kBAAkB;AACpB;;AAgBA;EAbE,mCAAmC;AACrC;;AAgBA;EAbE,6CAA6C;EAC7C,mBAAmB;EACnB,uBAAuB;EACvB,mBAAmB;EACnB,WAAW;EACX,YAAY;EACZ,aAAa;AACf;;AAgBA;EAbE,uBAAuB;EACvB,WAAW;EACX,YAAY;AACd;;AAgBA;EAbE,kBAAkB;EAClB,uBAAuB;EACvB,gCAAgC;EAChC,eAAe;AACjB;;AAkBA;EAfE,iBAAiB;AACnB;;AAmBA;EAhBE,uBAAuB;EACvB,eAAe;AACjB;;AAmBA;EAhBE,2CAA2C;AAC7C;;AAoBA;EAjBE,mCAAmC;AACrC;;AAwBA;EArBE,uBAAuB;EACvB,mBAAmB;EACnB,aAAa;EACb,kBAAkB;AACpB;;AAwBA;EArBE,kBAAkB;EAClB,SAAS;AACX;;AAyBA;EAtBE,YAAY;AACd;;AAyBA;EAtBE,WAAW;AACb","sourcesContent":["/* G9TabBar (MAUI G9TabBar): chrome with a notch, floating FAB, sub-menu row, overflow column. Classic: flat glass,\n no shadow. Sculpted (g9-tab-bar--sculpted): the shadow is painted inside the chrome and FAB SVGs, never box-shadow\n (plan/specs/02 §2). Sizes that differ per style are set inline from g9TabBarStyleMetrics. */\n.g9-tab-bar {\n position: relative;\n width: 100%;\n overflow: visible;\n}\n\n/* safeBottom: the band under the bar, as tall as the bottom safe inset (its padding inline) */\n.g9-tab-bar__safe {\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n\n.g9-tab-bar__backdrop {\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n}\n\n.g9-tab-bar__chrome {\n position: absolute;\n left: 14px;\n right: 14px;\n bottom: 14px;\n height: 62px;\n}\n\n.g9-tab-bar__chrome-flat,\n.g9-tab-bar__chrome-notched {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 62px;\n}\n\n/* The slots are placed by `order` (mirrored in RTL by the component), so the row itself is always laid out left to\n right: a browser inherits `direction: rtl` and mirrored the row a second time — the items stood reversed while the\n indicator stood at the right slot (LC-17, Lynx for Web). The native engines do not inherit it; this states it. */\n.g9-tab-bar__slots {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n display: flex;\n flex-direction: row;\n direction: ltr;\n}\n\n.g9-tab-bar__indicator-track {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n}\n\n/* one slot wide, moved by transform (tab-bar.tsx) */\n.g9-tab-bar__indicator-cell {\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n}\n\n.g9-tab-bar__indicator {\n position: absolute;\n left: 50%;\n width: 48px;\n height: 32px;\n margin-left: -24px;\n border-radius: 13px;\n background-color: var(--g9-primary-container);\n}\n\n/* indicatorMotion=\"spring\": the pill stretches on the way; two names so each move restarts the keyframe */\n.g9-tab-bar__indicator--stretch0 {\n animation-name: g9-tab-pill-stretch-a;\n animation-timing-function: ease-out;\n}\n\n.g9-tab-bar__indicator--stretch1 {\n animation-name: g9-tab-pill-stretch-b;\n animation-timing-function: ease-out;\n}\n\n@keyframes g9-tab-pill-stretch-a {\n 0% {\n transform: scaleX(1);\n }\n 35% {\n transform: scaleX(1.32);\n }\n 100% {\n transform: scaleX(1);\n }\n}\n\n@keyframes g9-tab-pill-stretch-b {\n 0% {\n transform: scaleX(1);\n }\n 35% {\n transform: scaleX(1.32);\n }\n 100% {\n transform: scaleX(1);\n }\n}\n\n/* Each slot is an equal share of the bar (its width, inline), as the indicator moves by. */\n.g9-tab-bar__slot {\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0 6px;\n}\n\n.g9-tab-bar__slot-body {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n}\n\n.g9-tab-bar__label {\n text-align: center;\n text-overflow: ellipsis;\n font-family: var(--g9-font-text);\n}\n\n/* The labels' twins, each measuring its label's real width: one row out of sight, no room limit, never touched. */\n.g9-tab-bar__measure {\n position: absolute;\n left: 0;\n top: 0;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n opacity: 0;\n}\n\n.g9-tab-bar__label--measure {\n white-space: nowrap;\n text-overflow: clip;\n}\n\n.g9-tab-bar__fab {\n position: absolute;\n width: 72px;\n height: 72px;\n border-radius: 36px;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: var(--g9-surface-container-high);\n border: 1px solid var(--g9-outline-variant);\n}\n\n.g9-tab-bar__fab-inner {\n width: 56px;\n height: 56px;\n border-radius: 28px;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: var(--g9-primary);\n}\n\n.g9-tab-bar__fab-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n/* The FAB disc's shadow: painted first, so the disc covers it; larger than the FAB box on every side. */\n.g9-tab-bar__fab-shadow {\n position: absolute;\n}\n\n/* Paint only: the chrome and shadow SVGs never take a touch (the Sculpted ones reach 14 px past their boxes, where a\n tap belongs to the backdrop or the page). Items, the FAB box and the backdrop handle every tap. */\n.g9-tab-bar__chrome-flat,\n.g9-tab-bar__chrome-notched,\n.g9-tab-bar__fab-shadow {\n pointer-events: none;\n}\n\n.g9-tab-bar__submenu {\n position: absolute;\n overflow: visible;\n}\n\n.g9-tab-bar__overflow {\n position: absolute;\n top: 0;\n bottom: 0;\n width: 56px;\n overflow: visible;\n}\n\n.g9-tab-bar__submenu-cell,\n.g9-tab-bar__overflow-item {\n position: absolute;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n border-radius: 18px;\n background-color: var(--g9-surface-container-high);\n border: 1px solid var(--g9-outline-variant);\n}\n\n.g9-tab-bar__overflow-item--selected {\n background-color: var(--g9-primary);\n}\n\n.g9-tab-bar__cell-accent {\n width: 44px;\n height: 44px;\n border-radius: 22px;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: var(--g9-primary-container);\n}\n\n.g9-tab-bar__overflow-item .g9-tab-bar__cell-accent {\n width: 32px;\n height: 32px;\n background-color: transparent;\n}\n\n.g9-tab-bar__cell-label {\n margin-top: 1px;\n text-align: center;\n text-overflow: ellipsis;\n font-family: var(--g9-font-text);\n}\n\n/* Sculpted (MAUI 1.4.0): the chrome and FAB SVGs carry their shadows past their boxes; the FAB box is a transparent\n tap target around the flat primary disc; menu cells use the opaque bar surface, sub-menu accents are solid primary. */\n.g9-tab-bar--sculpted .g9-tab-bar__chrome,\n.g9-tab-bar--sculpted .g9-tab-bar__fab {\n overflow: visible;\n}\n\n.g9-tab-bar--sculpted .g9-tab-bar__fab {\n background-color: transparent;\n border-width: 0;\n}\n\n.g9-tab-bar--sculpted .g9-tab-bar__submenu-cell,\n.g9-tab-bar--sculpted .g9-tab-bar__overflow-item {\n background-color: var(--g9-card-background);\n}\n\n.g9-tab-bar--sculpted .g9-tab-bar__overflow-item--selected {\n background-color: var(--g9-primary);\n}\n\n.g9-tab-bar--sculpted .g9-tab-bar__submenu-cell .g9-tab-bar__cell-accent {\n background-color: var(--g9-primary);\n}\n\n.g9-tab-bar__icon-box {\n display: flex;\n position: relative;\n align-items: center;\n justify-content: center;\n}\n\n.g9-tab-bar__badge {\n position: absolute;\n top: -5px;\n}\n\n/* the reading direction, explicit: Lynx does not inherit `direction`, so a logical property inside a page reads LTR */\n.g9-tab-bar__badge--ltr {\n right: -10px;\n}\n\n.g9-tab-bar__badge--rtl {\n left: -10px;\n}\n"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack://./src/tab-bar/tab-bar.css"],"names":[],"mappings":"AAGA;EAFE,WAAW;EACX,kBAAkB;EAClB,iBAAiB;AACnB;;AAMA;EAHE,sBAAsB;EACtB,WAAW;EACX,aAAa;AACf;;AAMA;EAHE,kBAAkB;EAClB,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAMA;EAHE,YAAY;EACZ,kBAAkB;EAClB,YAAY;EACZ,UAAU;EACV,WAAW;AACb;;AAMA;EAHE,WAAW;EACX,YAAY;EACZ,kBAAkB;EAClB,MAAM;EACN,OAAO;AACT;;AAUA;EAPE,c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;AA4BA;EAzBE,UAAU;AACZ;;AA4BA;EAzBE,SAAS;AACX;;AA4BA;EAzBE,mBAAmB;EACnB,+BAA+B;EAC/B,mCAAmC;EACnC,uBAAuB;EACvB,mBAAmB;EACnB,aAAa;AACf;;AA4BA;EAzBE,yCAAyC;AAC3C;;AA4BA;EAzBE,eAAe;EACf,iBAAiB;EACjB,oCAAoC;EACpC,+BAA+B;EAC/B,eAAe;EACf,gBAAgB;AAClB;;AA4BA;EAzBE,oCAAoC;EACpC,qCAAqC;EACrC,gBAAgB;AAClB","sourcesContent":["/* G9TabBar (MAUI G9TabBar): chrome with a notch, floating FAB, sub-menu row, overflow column. Classic: flat glass,\n no shadow. Sculpted (g9-tab-bar--sculpted): the shadow is painted inside the chrome and FAB SVGs, never box-shadow\n (plan/specs/02 §2). Sizes that differ per style are set inline from g9TabBarStyleMetrics. */\n.g9-tab-bar {\n position: relative;\n width: 100%;\n overflow: visible;\n}\n\n/* safeBottom: the band under the bar, as tall as the bottom safe inset (its padding inline) */\n.g9-tab-bar__safe {\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n\n.g9-tab-bar__backdrop {\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n}\n\n.g9-tab-bar__chrome {\n position: absolute;\n left: 14px;\n right: 14px;\n bottom: 14px;\n height: 62px;\n}\n\n.g9-tab-bar__chrome-flat,\n.g9-tab-bar__chrome-notched {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 62px;\n}\n\n/* The slots are placed by `order` (mirrored in RTL by the component), so the row itself is always laid out left to\n right: a browser inherits `direction: rtl` and mirrored the row a second time — the items stood reversed while the\n indicator stood at the right slot (LC-17, Lynx for Web). The native engines do not inherit it; this states it. */\n.g9-tab-bar__slots {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n display: flex;\n flex-direction: row;\n direction: ltr;\n}\n\n.g9-tab-bar__indicator-track {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n}\n\n/* one slot wide, moved by transform (tab-bar.tsx) */\n.g9-tab-bar__indicator-cell {\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n}\n\n.g9-tab-bar__indicator {\n position: absolute;\n left: 50%;\n width: 48px;\n height: 32px;\n margin-left: -24px;\n border-radius: 13px;\n background-color: var(--g9-primary-container);\n}\n\n/* indicatorMotion=\"spring\": the pill stretches on the way; two names so each move restarts the keyframe */\n.g9-tab-bar__indicator--stretch0 {\n animation-name: g9-tab-pill-stretch-a;\n animation-timing-function: ease-out;\n}\n\n.g9-tab-bar__indicator--stretch1 {\n animation-name: g9-tab-pill-stretch-b;\n animation-timing-function: ease-out;\n}\n\n@keyframes g9-tab-pill-stretch-a {\n 0% {\n transform: scaleX(1);\n }\n 35% {\n transform: scaleX(1.32);\n }\n 100% {\n transform: scaleX(1);\n }\n}\n\n@keyframes g9-tab-pill-stretch-b {\n 0% {\n transform: scaleX(1);\n }\n 35% {\n transform: scaleX(1.32);\n }\n 100% {\n transform: scaleX(1);\n }\n}\n\n/* Each slot is an equal share of the bar (its width, inline), as the indicator moves by. */\n.g9-tab-bar__slot {\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0 6px;\n}\n\n.g9-tab-bar__slot-body {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n}\n\n.g9-tab-bar__label {\n text-align: center;\n text-overflow: ellipsis;\n font-family: var(--g9-font-text);\n}\n\n/* The labels' twins, each measuring its label's real width: one row out of sight, no room limit, never touched. */\n.g9-tab-bar__measure {\n position: absolute;\n left: 0;\n top: 0;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n opacity: 0;\n}\n\n.g9-tab-bar__label--measure {\n white-space: nowrap;\n text-overflow: clip;\n}\n\n.g9-tab-bar__fab {\n position: absolute;\n width: 72px;\n height: 72px;\n border-radius: 36px;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: var(--g9-surface-container-high);\n border: 1px solid var(--g9-outline-variant);\n}\n\n.g9-tab-bar__fab-inner {\n width: 56px;\n height: 56px;\n border-radius: 28px;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: var(--g9-primary);\n}\n\n.g9-tab-bar__fab-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n/* The FAB disc's shadow: painted first, so the disc covers it; larger than the FAB box on every side. */\n.g9-tab-bar__fab-shadow {\n position: absolute;\n}\n\n/* Paint only: the chrome and shadow SVGs never take a touch (the Sculpted ones reach 14 px past their boxes, where a\n tap belongs to the backdrop or the page). Items, the FAB box and the backdrop handle every tap. */\n.g9-tab-bar__chrome-flat,\n.g9-tab-bar__chrome-notched,\n.g9-tab-bar__fab-shadow {\n pointer-events: none;\n}\n\n.g9-tab-bar__submenu {\n position: absolute;\n overflow: visible;\n}\n\n.g9-tab-bar__overflow {\n position: absolute;\n top: 0;\n bottom: 0;\n width: 56px;\n overflow: visible;\n}\n\n.g9-tab-bar__submenu-cell,\n.g9-tab-bar__overflow-item {\n position: absolute;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n border-radius: 18px;\n background-color: var(--g9-surface-container-high);\n border: 1px solid var(--g9-outline-variant);\n}\n\n.g9-tab-bar__overflow-item--selected {\n background-color: var(--g9-primary);\n}\n\n.g9-tab-bar__cell-accent {\n width: 44px;\n height: 44px;\n border-radius: 22px;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: var(--g9-primary-container);\n}\n\n.g9-tab-bar__overflow-item .g9-tab-bar__cell-accent {\n width: 32px;\n height: 32px;\n background-color: transparent;\n}\n\n.g9-tab-bar__cell-label {\n margin-top: 1px;\n text-align: center;\n text-overflow: ellipsis;\n font-family: var(--g9-font-text);\n}\n\n/* Sculpted (MAUI 1.4.0): the chrome and FAB SVGs carry their shadows past their boxes; the FAB box is a transparent\n tap target around the flat primary disc; menu cells use the opaque bar surface, sub-menu accents are solid primary. */\n.g9-tab-bar--sculpted .g9-tab-bar__chrome,\n.g9-tab-bar--sculpted .g9-tab-bar__fab {\n overflow: visible;\n}\n\n.g9-tab-bar--sculpted .g9-tab-bar__fab {\n background-color: transparent;\n border-width: 0;\n}\n\n.g9-tab-bar--sculpted .g9-tab-bar__submenu-cell,\n.g9-tab-bar--sculpted .g9-tab-bar__overflow-item {\n background-color: var(--g9-card-background);\n}\n\n.g9-tab-bar--sculpted .g9-tab-bar__overflow-item--selected {\n background-color: var(--g9-primary);\n}\n\n.g9-tab-bar--sculpted .g9-tab-bar__submenu-cell .g9-tab-bar__cell-accent {\n background-color: var(--g9-primary);\n}\n\n.g9-tab-bar__icon-box {\n display: flex;\n position: relative;\n align-items: center;\n justify-content: center;\n}\n\n.g9-tab-bar__badge {\n position: absolute;\n top: -5px;\n}\n\n/* the reading direction, explicit: Lynx does not inherit `direction`, so a logical property inside a page reads LTR */\n.g9-tab-bar__badge--ltr {\n right: -10px;\n}\n\n.g9-tab-bar__badge--rtl {\n left: -10px;\n}\n\n/* The flat bar (2.5.6): a transparent band on top for the raised disc, then the full-width surface bar. */\n.g9-tab-flat {\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n width: 100%;\n}\n\n.g9-tab-flat__bar {\n display: flex;\n align-items: flex-start;\n padding-top: 8px;\n border-top-width: 1px;\n border-top-style: solid;\n border-top-color: var(--g9-outline-variant);\n background-color: var(--g9-surface);\n}\n\n.g9-tab-flat__item {\n display: flex;\n flex-direction: column;\n align-items: center;\n flex-grow: 1;\n flex-shrink: 1;\n flex-basis: 0px;\n min-width: 0px;\n}\n\n.g9-tab-flat__pill {\n display: flex;\n position: relative;\n align-items: center;\n justify-content: center;\n}\n\n.g9-tab-flat__pill--on {\n background-color: var(--g9-primary-container);\n}\n\n.g9-tab-flat__badge {\n position: absolute;\n top: -2px;\n}\n\n.g9-tab-flat__badge--ltr {\n right: 4px;\n}\n\n.g9-tab-flat__badge--rtl {\n left: 4px;\n}\n\n.g9-tab-flat__disc {\n display: flex;\n align-items: center;\n justify-content: center;\n border-style: solid;\n border-color: var(--g9-surface);\n background-color: var(--g9-primary);\n}\n\n.g9-tab-flat__disc--on {\n border-color: var(--g9-primary-container);\n}\n\n.g9-tab-flat__label {\n margin-top: 4px;\n font-size: 11px;\n line-height: 14px;\n font-family: var(--g9-font-text-500);\n font-weight: 500;\n color: var(--g9-text-secondary);\n}\n\n.g9-tab-flat__label--on {\n font-family: var(--g9-font-text-700);\n font-weight: 700;\n color: var(--g9-on-primary-container);\n}\n"],"sourceRoot":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab-bar.d.ts","sourceRoot":"","sources":["../../src/tab-bar/tab-bar.tsx"],"names":[],"mappings":"AACA,OAAO,eAAe,CAAC;AACvB,OAAO,mBAAmB,CAAC;AAE3B,OAAO,EAAE,KAAK,SAAS,EAA+B,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"tab-bar.d.ts","sourceRoot":"","sources":["../../src/tab-bar/tab-bar.tsx"],"names":[],"mappings":"AACA,OAAO,eAAe,CAAC;AACvB,OAAO,mBAAmB,CAAC;AAE3B,OAAO,EAAE,KAAK,SAAS,EAA+B,MAAM,gBAAgB,CAAC;AAgB7E,OAAO,EAEL,KAAK,aAAa,EAInB,MAAM,WAAW,CAAC;AACnB,OAAO,EAIL,KAAK,0BAA0B,EAC/B,KAAK,YAAY,EACjB,KAAK,iCAAiC,EA0BvC,MAAM,SAAS,CAAC;AAQjB,iCAAiC;AACjC,MAAM,WAAW,aAAa;IAC5B,uFAAuF;IACvF,QAAQ,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,CAAC;IACxC,wEAAwE;IACxE,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;IAChD,6FAA6F;IAC7F,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,4DAA4D;IAC5D,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;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AOG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,SAAS,CAGxD"}
|
package/dist/tab-bar/tab-bar.jsx
CHANGED
|
@@ -10,6 +10,7 @@ import { G9Badge } from "../display/status.jsx";
|
|
|
10
10
|
import { useG9Back } from "../host/hooks.jsx";
|
|
11
11
|
import { G9Icon } from "../icon/icon.jsx";
|
|
12
12
|
import { useG9Diagnostics, useG9Direction, useG9SafeInsets, useG9Strings, useG9Theme, useG9Window } from "../provider/hooks.jsx";
|
|
13
|
+
import { G9FlatTabBar } from "./flat.jsx";
|
|
13
14
|
import { easeOutBackCss, g9TabBarMetrics, g9TabBarStyleMetrics } from "./metrics.jsx";
|
|
14
15
|
import { TAB_LABEL_MIN_FONT_SIZE, fitLabelFontSize, initialTabBarState, overflowColumnLayout, reconcileTabBarState, resolveTabBarFabIndex, subMenuRowLayout, tabBarBackdropTap, tabBarChromeSvg, tabBarFabCenterX, tabBarFabPlusSvg, tabBarFabShadowSvg, tabBarFabTap, tabBarHasOverflow, tabBarIndicatorSlot, tabBarItemTap, tabBarOverflowIndices, tabBarOverflowItemTap, tabBarOverflowSlot, tabBarOverflowTriggerTap, tabBarReservedHeight, tabBarSlotCenterX, tabBarSlots, tabBarSubMenuTap } from "./model.jsx";
|
|
15
16
|
const LABEL_SIDE_ROOM = 5;
|
|
@@ -26,6 +27,9 @@ const PRESS = Object.freeze({
|
|
|
26
27
|
}
|
|
27
28
|
});
|
|
28
29
|
function G9TabBar(props) {
|
|
30
|
+
return 'flat' === props.barStyle ? <G9FlatTabBar {...props}/> : <ChromeTabBar {...props}/>;
|
|
31
|
+
}
|
|
32
|
+
function ChromeTabBar(props) {
|
|
29
33
|
var _props_subMenuItems, _props_fabIndex, _props_resetCenterOnMenuSelection, _props_defaultSelectedIndex, _props_className, _items_fab_text;
|
|
30
34
|
const items = props.items;
|
|
31
35
|
const insets = useG9SafeInsets();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab-view.d.ts","sourceRoot":"","sources":["../../src/tabs/tab-view.tsx"],"names":[],"mappings":"AACA,OAAO,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"tab-view.d.ts","sourceRoot":"","sources":["../../src/tabs/tab-view.tsx"],"names":[],"mappings":"AACA,OAAO,YAAY,CAAC;AAEpB,OAAO,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAEpE,OAAO,EAAE,KAAK,SAAS,EAAwC,MAAM,gBAAgB,CAAC;AAWtF,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,SAAS,EAEd,KAAK,UAAU,EAOhB,MAAM,SAAS,CAAC;AAEjB,kCAAkC;AAClC,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,cAAc,GAAG,IAAI,CAAC;IAC/D,2FAA2F;IAC3F,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,6GAA6G;IAC7G,QAAQ,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,CAAC;IACrC,sGAAsG;IACtG,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,uDAAuD;IACvD,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IACvC,sEAAsE;IACtE,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACrD,iDAAiD;IACjD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,iHAAiH;IACjH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,2GAA2G;IAC3G,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,iGAAiG;IACjG,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC;IAC1B,uCAAuC;IACvC,QAAQ,CAAC,WAAW,CAAC,EAAE,gBAAgB,CAAC;IACxC,2DAA2D;IAC3D,QAAQ,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC;IAC/B,wGAAwG;IACxG,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,uFAAuF;IACvF,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,oFAAoF;IACpF,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACpC,uHAAuH;IACvH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;IACrD,4GAA4G;IAC5G,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,4FAA4F;IAC5F,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,SAAS,CAmM1D"}
|
package/dist/tabs/tab-view.jsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { g9FontFamilyFor } from "@g9tm/lynxcontrols-foundation/tokens";
|
|
2
2
|
import "./tabs.css";
|
|
3
|
+
import { G9HorizontalStripContext } from "../anchor/context.jsx";
|
|
3
4
|
import "../provider/keep-alive.css";
|
|
4
5
|
import { ViewPager } from "@lynx-js/lynx-ui-view-pager";
|
|
5
6
|
import { useEffect, useMemo, useRef, useState } from "@lynx-js/react";
|
|
@@ -199,7 +200,10 @@ function TabBarStrip(props) {
|
|
|
199
200
|
return null != (_cellRefs_current_index = cellRefs.current[index]) ? _cellRefs_current_index : null;
|
|
200
201
|
},
|
|
201
202
|
scrollerId: null,
|
|
202
|
-
layer: 'page'
|
|
203
|
+
layer: 'page',
|
|
204
|
+
...fixed ? {} : {
|
|
205
|
+
inScrolledStrip: true
|
|
206
|
+
}
|
|
203
207
|
}));
|
|
204
208
|
return ()=>{
|
|
205
209
|
for (const off of offs)off();
|
|
@@ -207,7 +211,8 @@ function TabBarStrip(props) {
|
|
|
207
211
|
}, [
|
|
208
212
|
registry,
|
|
209
213
|
props.anchorId,
|
|
210
|
-
cellKeys
|
|
214
|
+
cellKeys,
|
|
215
|
+
fixed
|
|
211
216
|
]);
|
|
212
217
|
useEffect(()=>{
|
|
213
218
|
var _cellRefs_current_effective;
|
|
@@ -279,7 +284,9 @@ function TabBarStrip(props) {
|
|
|
279
284
|
{slider}
|
|
280
285
|
{cells}
|
|
281
286
|
</view> : <scroll-view className="g9-tabs__scroller" scroll-orientation="horizontal">
|
|
282
|
-
<view className="g9-tabs__cells g9-tabs__cells--scrollable">
|
|
287
|
+
<view className="g9-tabs__cells g9-tabs__cells--scrollable">
|
|
288
|
+
<G9HorizontalStripContext.Provider value={true}>{cells}</G9HorizontalStripContext.Provider>
|
|
289
|
+
</view>
|
|
283
290
|
</scroll-view>}
|
|
284
291
|
</view>;
|
|
285
292
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/toast/service.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/toast/service.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AASrB,OAAO,EAAE,KAAK,YAAY,EAAW,MAAM,kBAAkB,CAAC;AAW9D,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,YAAY,EACZ,KAAK,WAAW,EAEjB,MAAM,SAAS,CAAC;AAEjB,+FAA+F;AAC/F,eAAO,MAAM,cAAc;;;;EAAsE,CAAC;AAElG,mDAA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AAwE;IACxE,UAAU,IAAI,IAAI,CAAC;IACnB,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;CAC9B;AA2SD,oEAAoE;AACpE,wBAAgB,cAAc,CAAC,IAAI,EAAE,YAAY,GAAG,cAAc,CAGjE;AAED,kHAAkH;AAClH,wBAAgB,WAAW,IAAI,cAAc,CAE5C;AAED,wGAAwG;AACxG,wBAAgB,QAAQ,IAAI,cAAc,CAEzC"}
|
package/dist/toast/service.jsx
CHANGED
|
@@ -5,6 +5,7 @@ import { g9RowStyle } from "../base/control.jsx";
|
|
|
5
5
|
import { useG9Press } from "../base/press.jsx";
|
|
6
6
|
import { startTimer, stopTimer } from "../base/timers.jsx";
|
|
7
7
|
import { G9ActivityIndicator } from "../display/activity-indicator.jsx";
|
|
8
|
+
import { bottomOverlaysOf } from "../host/bottom-overlays.jsx";
|
|
8
9
|
import { useG9Host, useG9HostInsets } from "../host/hooks.jsx";
|
|
9
10
|
import { g9Hosts } from "../host/registry.jsx";
|
|
10
11
|
import { G9IconSlot } from "../icon/slot.jsx";
|
|
@@ -235,6 +236,12 @@ function createToastService(host) {
|
|
|
235
236
|
setBottomOverlay: (key, height)=>store.setBottomOverlay(key, height),
|
|
236
237
|
dismissAll: ()=>store.dismissAll()
|
|
237
238
|
};
|
|
239
|
+
const overlays = bottomOverlaysOf(host);
|
|
240
|
+
for (const [key, height] of overlays.heights)store.setBottomOverlay(key, height);
|
|
241
|
+
overlays.listeners.add((key, height)=>{
|
|
242
|
+
store.setBottomOverlay(key, height);
|
|
243
|
+
store.refreshBottomInsets();
|
|
244
|
+
});
|
|
238
245
|
host.attachFeature(FEATURE, state);
|
|
239
246
|
host.registerLayerItem('feedback', {
|
|
240
247
|
key: FEATURE,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chip-group.d.ts","sourceRoot":"","sources":["../../src/toggle/chip-group.tsx"],"names":[],"mappings":"AACA,OAAO,cAAc,CAAC;AACtB,OAAO,EAIL,KAAK,q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AQ,CAAC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IACtC,oCAAoC;IACpC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,kBAAkB;IAClB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,qCAAqC;IACrC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,kFAAkF;IAClF,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5C,2DAA2D;IAC3D,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,qBAAqB,CAAC;IAC5C;;;OAGG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,yDAAyD;IACzD,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,uEAAuE;IACvE,QAAQ,CAAC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAC1C;;;OAGG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC;CAC9E;AAID;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,SAAS,CAgK9D"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { g9FontFamilyFor } from "@g9tm/lynxcontrols-foundation/tokens";
|
|
2
2
|
import "./toggle.css";
|
|
3
3
|
import { G9Metrics, G9StringKey, buildSolidOrGradient, fillToCss, formatColor, mix, tryParseColor } from "@g9tm/lynxcontrols-foundation";
|
|
4
|
+
import { G9HorizontalStripContext } from "../anchor/context.jsx";
|
|
4
5
|
import { g9ChildId, g9IdProps, g9RowStyle, useG9Control } from "../base/control.jsx";
|
|
5
6
|
import { useG9Press } from "../base/press.jsx";
|
|
6
7
|
import { selectionKey } from "../base/selection-item.jsx";
|
|
@@ -113,7 +114,7 @@ function G9ChipGroup(props) {
|
|
|
113
114
|
const scroll = 'singleLineScroll' === props.layoutMode;
|
|
114
115
|
return scroll ? <scroll-view className={`${control.className} g9-chip-group--scroll`} {...control.idProps} style={control.rootStyle()} scroll-orientation="horizontal">
|
|
115
116
|
<view className="g9-chip-group__line" style={g9RowStyle(control.direction)}>
|
|
116
|
-
{chips}
|
|
117
|
+
<G9HorizontalStripContext.Provider value={true}>{chips}</G9HorizontalStripContext.Provider>
|
|
117
118
|
</view>
|
|
118
119
|
</scroll-view> : <view className={`${control.className} g9-chip-group--wrap`} {...control.idProps} style={control.rootStyle(g9RowStyle(control.direction))}>
|
|
119
120
|
{chips}
|