@g9tm/lynxcontrols 2.5.5 → 2.5.7
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/G9CarryContexts.md +10 -0
- package/catalog/cards/G9CheckBox.md +1 -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/G9FormField.md +2 -2
- package/catalog/cards/G9IconSlot.md +1 -1
- package/catalog/cards/G9ListRow.md +1 -1
- package/catalog/cards/G9RangeSlider.md +2 -2
- package/catalog/cards/G9Stepper.md +1 -1
- package/catalog/cards/G9SwitchRow.md +1 -1
- package/catalog/cards/G9UpdateBar.md +2 -1
- package/catalog/catalog.json +2418 -650
- package/catalog/index.md +5 -3
- package/dist/.tsbuildinfo +1 -1
- package/dist/base/selection-item.d.ts +5 -0
- package/dist/base/selection-item.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/figures.d.ts +13 -0
- package/dist/display/figures.d.ts.map +1 -1
- package/dist/display/figures.jsx +53 -14
- package/dist/display/status.d.ts +1 -1
- package/dist/display/status.d.ts.map +1 -1
- package/dist/display/status.jsx +15 -3
- 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 +55 -1
- package/dist/fields/editor.d.ts.map +1 -1
- package/dist/fields/editor.jsx +3 -0
- package/dist/fields/extra-entries.d.ts +2 -1
- package/dist/fields/extra-entries.d.ts.map +1 -1
- package/dist/fields/extra-entries.jsx +51 -17
- package/dist/fields/fields.css +21 -0
- package/dist/fields/fields.css.map +1 -1
- package/dist/fields/outlined-field.d.ts +14 -0
- package/dist/fields/outlined-field.d.ts.map +1 -1
- package/dist/fields/outlined-field.jsx +6 -1
- package/dist/fields/pin-entry.d.ts.map +1 -1
- package/dist/fields/pin-entry.jsx +36 -3
- package/dist/fields/text-entry.d.ts +4 -0
- package/dist/fields/text-entry.d.ts.map +1 -1
- package/dist/fields/text-entry.jsx +33 -26
- package/dist/fields/use-text-input.d.ts +3 -2
- package/dist/fields/use-text-input.d.ts.map +1 -1
- package/dist/fields/use-text-input.jsx +3 -0
- package/dist/header/app-bar.d.ts +13 -1
- package/dist/header/app-bar.d.ts.map +1 -1
- package/dist/header/app-bar.jsx +31 -11
- package/dist/header/header.css +12 -0
- package/dist/header/header.css.map +1 -1
- package/dist/host/bottom-overlays.d.ts +5 -0
- package/dist/host/bottom-overlays.d.ts.map +1 -1
- package/dist/host/bottom-overlays.jsx +17 -1
- package/dist/host/carry-contexts.d.ts +28 -0
- package/dist/host/carry-contexts.d.ts.map +1 -0
- package/dist/host/carry-contexts.jsx +62 -0
- package/dist/host/host.d.ts.map +1 -1
- package/dist/host/host.jsx +5 -1
- package/dist/host/index.d.ts +2 -0
- package/dist/host/index.d.ts.map +1 -1
- package/dist/host/index.jsx +2 -0
- 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 +15 -10
- 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/containers.d.ts.map +1 -1
- package/dist/layout/containers.jsx +2 -1
- package/dist/layout/layout.css +5 -0
- package/dist/layout/layout.css.map +1 -1
- package/dist/layout/scroll-spy.d.ts.map +1 -1
- package/dist/layout/scroll-spy.jsx +4 -2
- 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 +28 -0
- package/dist/list/list.css.map +1 -1
- package/dist/list/rows.d.ts +13 -1
- package/dist/list/rows.d.ts.map +1 -1
- package/dist/list/rows.jsx +39 -20
- 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/direction-scope.d.ts +8 -0
- package/dist/provider/direction-scope.d.ts.map +1 -1
- package/dist/provider/direction-scope.jsx +13 -2
- package/dist/provider/index.d.ts +1 -1
- package/dist/provider/index.d.ts.map +1 -1
- package/dist/provider/provider.css +7 -0
- package/dist/provider/provider.css.map +1 -1
- package/dist/provider/settings.d.ts +14 -0
- package/dist/provider/settings.d.ts.map +1 -1
- package/dist/provider/settings.jsx +4 -1
- package/dist/range-slider/index.d.ts +1 -1
- package/dist/range-slider/index.d.ts.map +1 -1
- package/dist/range-slider/range-slider.css +69 -0
- package/dist/range-slider/range-slider.css.map +1 -1
- package/dist/range-slider/range-slider.d.ts +22 -0
- package/dist/range-slider/range-slider.d.ts.map +1 -1
- package/dist/range-slider/range-slider.jsx +34 -5
- package/dist/selection/selection-sheet.d.ts.map +1 -1
- package/dist/selection/selection-sheet.jsx +23 -10
- package/dist/selection/selection.css +16 -1
- package/dist/selection/selection.css.map +1 -1
- package/dist/shell/shell.css +7 -0
- package/dist/shell/shell.css.map +1 -1
- package/dist/shell/shell.d.ts +24 -3
- package/dist/shell/shell.d.ts.map +1 -1
- package/dist/shell/shell.jsx +12 -9
- package/dist/survey/survey.css +71 -0
- package/dist/survey/survey.css.map +1 -1
- package/dist/survey/survey.d.ts +15 -0
- package/dist/survey/survey.d.ts.map +1 -1
- package/dist/survey/survey.jsx +45 -2
- 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 +124 -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 +32 -6
- package/dist/tabs/tab-view.jsx +10 -3
- package/dist/tabs/tabs.css +5 -0
- package/dist/tabs/tabs.css.map +1 -1
- package/dist/toggle/checkbox.d.ts +5 -0
- package/dist/toggle/checkbox.d.ts.map +1 -1
- package/dist/toggle/checkbox.jsx +7 -2
- package/dist/toggle/choice.css +8 -0
- package/dist/toggle/choice.css.map +1 -1
- package/dist/toggle/choice.d.ts +11 -0
- package/dist/toggle/choice.d.ts.map +1 -1
- package/dist/toggle/choice.jsx +25 -14
- package/package.json +2 -2
- package/skills/g9-lynx-app/references/catalog-index.md +3 -3
- package/skills/g9-lynx-app/references/components/barcode.md +3 -3
- package/skills/g9-lynx-app/references/components/charts.md +1 -1
- package/skills/g9-lynx-app/references/components/commerce.md +5 -5
- package/skills/g9-lynx-app/references/components/display-1.md +2 -1
- package/skills/g9-lynx-app/references/components/fields.md +2 -2
- package/skills/g9-lynx-app/references/components/header.md +2 -2
- package/skills/g9-lynx-app/references/components/host.md +11 -0
- package/skills/g9-lynx-app/references/components/icon.md +1 -1
- package/skills/g9-lynx-app/references/components/list.md +2 -2
- package/skills/g9-lynx-app/references/components/map.md +19 -1
- package/skills/g9-lynx-app/references/components/range-slider.md +2 -2
- package/skills/g9-lynx-app/references/components/shell.md +6 -3
- 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 +2 -2
- package/skills/g9-lynx-app/references/provider-and-host.md +8 -0
package/dist/tab-bar/tab-bar.jsx
CHANGED
|
@@ -3,6 +3,7 @@ import "./tab-bar.css";
|
|
|
3
3
|
import "../base/press.css";
|
|
4
4
|
import { g9Ms } from "@g9tm/lynxcontrols-foundation";
|
|
5
5
|
import { useEffect, useRef, useState } from "@lynx-js/react";
|
|
6
|
+
import { useG9Anchor } from "../anchor/hooks.jsx";
|
|
6
7
|
import { useG9PressFeedback, usePressVisual } from "../base/press.jsx";
|
|
7
8
|
import { startTimer, stopTimer } from "../base/timers.jsx";
|
|
8
9
|
import { useControllableState } from "../base/use-controllable-state.jsx";
|
|
@@ -10,6 +11,7 @@ import { G9Badge } from "../display/status.jsx";
|
|
|
10
11
|
import { useG9Back } from "../host/hooks.jsx";
|
|
11
12
|
import { G9Icon } from "../icon/icon.jsx";
|
|
12
13
|
import { useG9Diagnostics, useG9Direction, useG9SafeInsets, useG9Strings, useG9Theme, useG9Window } from "../provider/hooks.jsx";
|
|
14
|
+
import { G9FlatTabBar } from "./flat.jsx";
|
|
13
15
|
import { easeOutBackCss, g9TabBarMetrics, g9TabBarStyleMetrics } from "./metrics.jsx";
|
|
14
16
|
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
17
|
const LABEL_SIDE_ROOM = 5;
|
|
@@ -26,6 +28,9 @@ const PRESS = Object.freeze({
|
|
|
26
28
|
}
|
|
27
29
|
});
|
|
28
30
|
function G9TabBar(props) {
|
|
31
|
+
return 'flat' === props.barStyle ? <G9FlatTabBar {...props}/> : <ChromeTabBar {...props}/>;
|
|
32
|
+
}
|
|
33
|
+
function ChromeTabBar(props) {
|
|
29
34
|
var _props_subMenuItems, _props_fabIndex, _props_resetCenterOnMenuSelection, _props_defaultSelectedIndex, _props_className, _items_fab_text;
|
|
30
35
|
const items = props.items;
|
|
31
36
|
const insets = useG9SafeInsets();
|
|
@@ -348,6 +353,19 @@ function TabBarSlot(props) {
|
|
|
348
353
|
const slotDir = useG9Direction();
|
|
349
354
|
const press = useG9PressFeedback(PRESS, false);
|
|
350
355
|
const { item, selected, hidden, revealPose, metrics } = props;
|
|
356
|
+
const anchor = useG9Anchor(item.automationId, {
|
|
357
|
+
kind: 'tab',
|
|
358
|
+
label: ()=>{
|
|
359
|
+
var _item_text;
|
|
360
|
+
return null != (_item_text = item.text) ? _item_text : null;
|
|
361
|
+
},
|
|
362
|
+
enabled: ()=>!hidden,
|
|
363
|
+
capabilities: {
|
|
364
|
+
activate: ()=>props.onTap()
|
|
365
|
+
}
|
|
366
|
+
}, item.automationId ? {
|
|
367
|
+
domId: item.automationId
|
|
368
|
+
} : {});
|
|
351
369
|
const sculpted = 'sculpted' === metrics.style;
|
|
352
370
|
const color = sculpted ? selected ? 'var(--g9-primary)' : 'var(--g9-text-secondary)' : selected ? 'var(--g9-on-primary-container)' : 'var(--g9-on-surface-variant)';
|
|
353
371
|
const icon = sculpted && selected && void 0 !== item.selectedIcon ? item.selectedIcon : null != (_item_icon = item.icon) ? _item_icon : 'check';
|
|
@@ -366,9 +384,7 @@ function TabBarSlot(props) {
|
|
|
366
384
|
transform: `translateY(${g9TabBarMetrics.selectedItemTranslationY}px) scale(1)`,
|
|
367
385
|
transition: `opacity ${g9TabBarMetrics.selectedReturnRevealDurationMs}ms ease-out, transform ${g9TabBarMetrics.selectedReturnRevealDurationMs}ms ease-out`
|
|
368
386
|
};
|
|
369
|
-
return <view className={`g9-tab-bar__slot${selected ? ' g9-tab-bar__slot--selected' : ''}${hidden ? ' g9-tab-bar__slot--hidden' : ''}${press.className}`} {...
|
|
370
|
-
id: item.automationId
|
|
371
|
-
} : {}} style={{
|
|
387
|
+
return <view className={`g9-tab-bar__slot${selected ? ' g9-tab-bar__slot--selected' : ''}${hidden ? ' g9-tab-bar__slot--hidden' : ''}${press.className}`} {...anchor.props} style={{
|
|
372
388
|
order: props.order,
|
|
373
389
|
width: `${props.share}%`
|
|
374
390
|
}} accessibility-element accessibility-traits="button" accessibility-label={item.badge && true !== item.badge ? `${null != (_item_text1 = item.text) ? _item_text1 : ''} (${item.badge})` : null != (_item_text2 = item.text) ? _item_text2 : ''} bindtap={hidden ? void 0 : props.onTap} {...press.props}>
|
|
@@ -402,6 +418,18 @@ function TabBarSlot(props) {
|
|
|
402
418
|
function MenuCell(props) {
|
|
403
419
|
var _props_item_text, _props_item_icon, _props_item_text1;
|
|
404
420
|
const [shown, setShown] = useState(false);
|
|
421
|
+
const anchor = useG9Anchor(props.item.automationId, {
|
|
422
|
+
kind: 'tab',
|
|
423
|
+
label: ()=>{
|
|
424
|
+
var _props_item_text;
|
|
425
|
+
return null != (_props_item_text = props.item.text) ? _props_item_text : null;
|
|
426
|
+
},
|
|
427
|
+
capabilities: {
|
|
428
|
+
activate: ()=>props.onTap()
|
|
429
|
+
}
|
|
430
|
+
}, props.item.automationId ? {
|
|
431
|
+
domId: props.item.automationId
|
|
432
|
+
} : {});
|
|
405
433
|
useEffect(()=>{
|
|
406
434
|
const t = startTimer(()=>setShown(true), 16);
|
|
407
435
|
return ()=>stopTimer(t);
|
|
@@ -413,9 +441,7 @@ function MenuCell(props) {
|
|
|
413
441
|
const bounce = easeOutBackCss(g9TabBarMetrics.fabPopBackCoefficient);
|
|
414
442
|
const color = props.selected ? 'var(--g9-on-primary)' : 'var(--g9-on-surface)';
|
|
415
443
|
const iconColor = props.onAccent ? 'var(--g9-on-primary)' : color;
|
|
416
|
-
return <view className={`${props.className}${press.className}${props.selected ? ` ${props.className}--selected` : ''}`} {...props.item.
|
|
417
|
-
id: props.item.automationId
|
|
418
|
-
} : {}} accessibility-element accessibility-traits="button" accessibility-label={null != (_props_item_text = props.item.text) ? _props_item_text : ''} style={{
|
|
444
|
+
return <view className={`${props.className}${press.className}${props.selected ? ` ${props.className}--selected` : ''}`} {...anchor.props} accessibility-element accessibility-traits="button" accessibility-label={null != (_props_item_text = props.item.text) ? _props_item_text : ''} style={{
|
|
419
445
|
left: `${props.left}px`,
|
|
420
446
|
bottom: `${props.bottom}px`,
|
|
421
447
|
width: `${props.size}px`,
|
package/dist/tabs/tab-view.jsx
CHANGED
|
@@ -280,11 +280,18 @@ function TabBarStrip(props) {
|
|
|
280
280
|
backgroundColor: null != (_props_background = props.background) ? _props_background : pill ? 'var(--g9-surface-container-low)' : 'transparent'
|
|
281
281
|
};
|
|
282
282
|
return <view className="g9-tabs__bar" style={barStyle}>
|
|
283
|
-
{
|
|
283
|
+
{}
|
|
284
|
+
{fixed ? <view className="g9-tabs__cells" style={{
|
|
285
|
+
direction: 'ltr'
|
|
286
|
+
}}>
|
|
284
287
|
{slider}
|
|
285
288
|
{cells}
|
|
286
|
-
</view> : <scroll-view className="g9-tabs__scroller" scroll-orientation="horizontal"
|
|
287
|
-
|
|
289
|
+
</view> : <scroll-view className="g9-tabs__scroller" scroll-orientation="horizontal" style={{
|
|
290
|
+
direction: 'ltr'
|
|
291
|
+
}}>
|
|
292
|
+
<view className={`g9-tabs__cells g9-tabs__cells--scrollable${'rtl' === direction ? ' g9-tabs__cells--end' : ''}`} style={{
|
|
293
|
+
direction: 'ltr'
|
|
294
|
+
}}>
|
|
288
295
|
<G9HorizontalStripContext.Provider value={true}>{cells}</G9HorizontalStripContext.Provider>
|
|
289
296
|
</view>
|
|
290
297
|
</scroll-view>}
|
package/dist/tabs/tabs.css
CHANGED
package/dist/tabs/tabs.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://./src/tabs/tabs.css"],"names":[],"mappings":"AACA;EAAE,sBAAsB;EACtB,WAAW;EACX,aAAa;AACf;;AAGA;EAAE,UAAU;AACZ;;AAGA;EAAE,cAAc;EACd,WAAW;EACX,kBAAkB;AACpB;;AAGA;EAAE,sBAAsB;EACtB,OAAO;EACP,aAAa;EACb,kBAAkB;EAClB,gBAAgB;AAClB;;AAGA;EAAE,uCAAuC;EACvC,0CAA0C;AAC5C;;AAGA;EAAE,mBAAmB;EACnB,YAAY;AACd;;AAGA;EAAE,eAAe;AACjB;;AAGA;EAAE,kBAAkB;AACpB;;AAGA;EAAE,mBAAmB;EACnB,WAAW;EACX,YAAY;EACZ,aAAa;EACb,kBAAkB;AACpB;;AAGA;EAAE,WAAW;AACb;;
|
|
1
|
+
{"version":3,"sources":["webpack://./src/tabs/tabs.css"],"names":[],"mappings":"AACA;EAAE,sBAAsB;EACtB,WAAW;EACX,aAAa;AACf;;AAGA;EAAE,UAAU;AACZ;;AAGA;EAAE,cAAc;EACd,WAAW;EACX,kBAAkB;AACpB;;AAGA;EAAE,sBAAsB;EACtB,OAAO;EACP,aAAa;EACb,kBAAkB;EAClB,gBAAgB;AAClB;;AAGA;EAAE,uCAAuC;EACvC,0CAA0C;AAC5C;;AAGA;EAAE,mBAAmB;EACnB,YAAY;AACd;;AAGA;EAAE,eAAe;AACjB;;AAGA;EAAE,kBAAkB;AACpB;;AAGA;EAAE,mBAAmB;EACnB,WAAW;EACX,YAAY;EACZ,aAAa;EACb,kBAAkB;AACpB;;AAGA;EAAE,WAAW;AACb;;AAIA;EADE,yBAAyB;EACzB,eAAe;AACjB;;AAIA;EADE,WAAW;EACX,YAAY;AACd;;AAIA;EADE,uBAAuB;EACvB,mBAAmB;EACnB,YAAY;EACZ,eAAe;EACf,aAAa;EACb,kBAAkB;AACpB;;AAIA;EADE,mBAAmB;EACnB,uBAAuB;EACvB,mBAAmB;EACnB,QAAQ;EACR,aAAa;AACf;;AAIA;EADE,eAAe;EACf,gCAAgC;AAClC;;AAIA;EADE,mCAAmC;EACnC,UAAU;EACV,kBAAkB;EAClB,SAAS;EACT,YAAY;EACZ,OAAO;AACT;;AAIA;EADE,kBAAkB;EAClB,uBAAuB;EACvB,mBAAmB;EACnB,eAAe;EACf,YAAY;EACZ,cAAc;EACd,aAAa;AACf;;AAIA;EADE,eAAe;EACf,oCAAoC;EACpC,yBAAyB;EACzB,gBAAgB;AAClB;;AAIA;EADE,oBAAoB;EACpB,UAAU;EACV,WAAW;AACb;;AAIA;EADE,mBAAmB;EACnB,uBAAuB;EACvB,aAAa;EACb,aAAa;EACb,kBAAkB;EAClB,SAAS;AACX;;AAIA;EADE,WAAW;EACX,aAAa;AACf;;AAKA;EAFE,kBAAkB;EAClB,SAAS;EACT,OAAO;AACT;;AAKA;EAFE,aAAa;EACb,kBAAkB;EAClB,QAAQ;EACR,WAAW;AACb;;AAKA;EAFE,6CAA6C;EAC7C,0CAA0C;EAC1C,mBAAmB;EACnB,WAAW;EACX,YAAY;AACd;;AAMA;EAHE,YAAY;EACZ,kBAAkB;EAClB,QAAQ;EACR,WAAW;EACX,OAAO;AACT;;AAMA;EAHE,sBAAsB;EACtB,OAAO;EACP,WAAW;EACX,aAAa;AACf;;AAMA;EAHE,OAAO;EACP,YAAY;AACd;;AAMA;EAHE,sBAAsB;EACtB,OAAO;EACP,WAAW;EACX,aAAa;AACf;;AAMA;EAHE,uBAAuB;EACvB,mBAAmB;EACnB,WAAW;EACX,gBAAgB;EAChB,aAAa;AACf","sourcesContent":["/* G9TabView (MAUI G9TabView): bar, sliding indicator, lazily realized bodies. No shadows (plan/specs/02 §2). */\n.g9-tabs {\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n\n.g9-tabs--header-only {\n flex: 0 0 auto;\n}\n\n.g9-tabs__bar {\n position: relative;\n width: 100%;\n flex-shrink: 0;\n}\n\n.g9-tabs__content {\n position: relative;\n flex: 1;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n}\n\n.g9-tabs--underlined .g9-tabs__bar {\n border-top: 1px solid var(--g9-divider);\n border-bottom: 1px solid var(--g9-divider);\n}\n\n.g9-tabs--pill .g9-tabs__bar {\n border-radius: 26px;\n padding: 4px;\n}\n\n.g9-tabs--pill.g9-tabs--top .g9-tabs__content {\n margin-top: 8px;\n}\n\n.g9-tabs--pill.g9-tabs--bottom .g9-tabs__content {\n margin-bottom: 8px;\n}\n\n.g9-tabs__cells {\n position: relative;\n display: flex;\n flex-direction: row;\n height: 100%;\n width: 100%;\n}\n\n.g9-tabs__cells--scrollable {\n width: auto;\n}\n\n/* RTL: cells that do not fill the bar sit at its right (its reading start); wider ones scroll as before (2.5.7). */\n.g9-tabs__cells--end {\n min-width: 100%;\n justify-content: flex-end;\n}\n\n.g9-tabs__scroller {\n height: 100%;\n width: 100%;\n}\n\n.g9-tabs__cell {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n padding: 0 14px;\n}\n\n.g9-tabs__cell-row {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n gap: 6px;\n}\n\n.g9-tabs__label {\n font-size: 14px;\n font-family: var(--g9-font-text);\n}\n\n.g9-tabs__separator {\n position: absolute;\n left: 0;\n top: 12px;\n bottom: 12px;\n width: 1px;\n background-color: var(--g9-divider);\n}\n\n.g9-tabs__badge {\n min-width: 18px;\n height: 18px;\n padding: 0 5px;\n border-radius: 9px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.g9-tabs__badge-text {\n font-size: 11px;\n font-family: var(--g9-font-text-600);\n font-weight: 600;\n color: var(--g9-on-error);\n}\n\n.g9-tabs__badge-dot {\n width: 7px;\n height: 7px;\n border-radius: 3.5px;\n}\n\n.g9-tabs__underline {\n position: absolute;\n bottom: 0;\n height: 2.5px;\n display: flex;\n flex-direction: row;\n justify-content: center;\n}\n\n.g9-tabs__underline-fill,\n.g9-tabs__cell-underline {\n height: 2.5px;\n width: 100%;\n}\n\n.g9-tabs__cell-underline {\n position: absolute;\n left: 0;\n bottom: 0;\n}\n\n.g9-tabs__pill {\n position: absolute;\n top: 2px;\n bottom: 2px;\n display: flex;\n}\n\n.g9-tabs__pill-fill,\n.g9-tabs__cell-pill {\n width: 100%;\n height: 100%;\n border-radius: 18px;\n background-color: var(--g9-primary-container);\n border: 1px solid var(--g9-primary-border);\n}\n\n.g9-tabs__cell-pill {\n position: absolute;\n top: 2px;\n bottom: 2px;\n left: 0;\n height: auto;\n}\n\n.g9-tabs__panel {\n display: flex;\n flex: 1;\n flex-direction: column;\n width: 100%;\n}\n\n.g9-tabs__pager {\n flex: 1;\n height: 100%;\n}\n\n.g9-tabs__page {\n flex: 1;\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n\n.g9-tabs__spinner {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 72px;\n width: 100%;\n}\n"],"sourceRoot":""}
|
|
@@ -41,6 +41,11 @@ export interface G9CheckBoxProps extends G9ControlBaseProps {
|
|
|
41
41
|
readonly onPress?: (checked: boolean) => void;
|
|
42
42
|
/** 48 px touch slot with the box at the top; false: a 20 px slot, box centred. Default true. */
|
|
43
43
|
readonly reserveTouchTarget?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Space between the box and the text in dp (G9Hub, 2.5.7). Default 2 with the 48 dp touch slot (the box's own margin
|
|
46
|
+
* makes it 16 visually), 8 without it.
|
|
47
|
+
*/
|
|
48
|
+
readonly labelGap?: number;
|
|
44
49
|
}
|
|
45
50
|
/** Imperative handle of {@link G9CheckBox}. */
|
|
46
51
|
export interface G9CheckBoxHandle {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../src/toggle/checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AACtB,OAAO,EAAe,KAAK,eAAe,EAA0B,MAAM,+BAA+B,CAAC;AAG1G,OAAO,EAAE,KAAK,kBAAkB,EAAyC,MAAM,iBAAiB,CAAC;AAOjG,iFAAiF;AACjF,eAAO,MAAM,iBAAiB;;;;;;;EAO5B,CAAC;AAEH,qCAAqC;AACrC,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,OAAO,EAAE,MAAM,C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,CAAC,EAAE,OAAO,CAAC;IACtC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,+CAA+C;AAC/C,MAAM,WAAW,gBAAgB;IAC/B,6DAA6D;IAC7D,MAAM,IAAI,IAAI,CAAC;CAChB;AAED;;;;GAIG;AACH,eAAO,MAAM,UAAU,8GA0ItB,CAAC"}
|
package/dist/toggle/checkbox.jsx
CHANGED
|
@@ -41,7 +41,7 @@ function checkBoxSvg(progress, morph, colors, disabled) {
|
|
|
41
41
|
return parts.join('');
|
|
42
42
|
}
|
|
43
43
|
const G9CheckBox = forwardRef(function(props, ref) {
|
|
44
|
-
var _props_defaultChecked, _props_defaultIndeterminate, _props_accessibilityLabel, _ref, _props_accessibilityLabel1;
|
|
44
|
+
var _props_defaultChecked, _props_defaultIndeterminate, _props_labelGap, _props_accessibilityLabel, _ref, _props_accessibilityLabel1;
|
|
45
45
|
const control = useG9Control(props, 'g9-checkbox', {
|
|
46
46
|
kind: 'toggle',
|
|
47
47
|
label: ()=>{
|
|
@@ -143,7 +143,12 @@ const G9CheckBox = forwardRef(function(props, ref) {
|
|
|
143
143
|
const reserve = false !== props.reserveTouchTarget;
|
|
144
144
|
const text1 = props.text && '' !== props.text.trim() ? props.text : null;
|
|
145
145
|
const state = indeterminate ? strings.get(G9StringKey.PartiallyChecked) : checked ? strings.get(G9StringKey.Checked) : strings.get(G9StringKey.NotChecked);
|
|
146
|
-
return <view className={`${control.className}${text1 ? ' g9-checkbox--labelled' : ''}`} {...control.idProps} style={control.rootStyle(
|
|
146
|
+
return <view className={`${control.className}${text1 ? ' g9-checkbox--labelled' : ''}`} {...control.idProps} style={control.rootStyle({
|
|
147
|
+
...g9RowStyle(control.direction),
|
|
148
|
+
...text1 ? {
|
|
149
|
+
columnGap: `${null != (_props_labelGap = props.labelGap) ? _props_labelGap : reserve ? 2 : 8}px`
|
|
150
|
+
} : {}
|
|
151
|
+
})} accessibility-element={true} accessibility-traits="button" accessibility-value={state} {...(null != (_props_accessibilityLabel = props.accessibilityLabel) ? _props_accessibilityLabel : text1) ? {
|
|
147
152
|
'accessibility-label': null != (_ref = null != (_props_accessibilityLabel1 = props.accessibilityLabel) ? _props_accessibilityLabel1 : text1) ? _ref : ''
|
|
148
153
|
} : {}} bindtap={press}>
|
|
149
154
|
<view className={`g9-checkbox__slot${reserve ? ' g9-checkbox__slot--reserve' : ''}`} style={{
|
package/dist/toggle/choice.css
CHANGED
|
@@ -87,6 +87,8 @@
|
|
|
87
87
|
flex-direction: row;
|
|
88
88
|
align-items: center;
|
|
89
89
|
column-gap: 5px;
|
|
90
|
+
min-width: 0;
|
|
91
|
+
max-width: 100%;
|
|
90
92
|
display: flex;
|
|
91
93
|
}
|
|
92
94
|
|
|
@@ -94,7 +96,11 @@
|
|
|
94
96
|
font-size: 14px;
|
|
95
97
|
font-family: var(--g9-font-text-500);
|
|
96
98
|
white-space: nowrap;
|
|
99
|
+
text-overflow: ellipsis;
|
|
100
|
+
flex-shrink: 1;
|
|
101
|
+
min-width: 0;
|
|
97
102
|
font-weight: 500;
|
|
103
|
+
overflow: hidden;
|
|
98
104
|
}
|
|
99
105
|
|
|
100
106
|
.g9-seg__label--on {
|
|
@@ -106,6 +112,8 @@
|
|
|
106
112
|
font-size: 11px;
|
|
107
113
|
font-family: var(--g9-font-text);
|
|
108
114
|
opacity: .8;
|
|
115
|
+
text-overflow: ellipsis;
|
|
116
|
+
max-width: 100%;
|
|
109
117
|
}
|
|
110
118
|
|
|
111
119
|
.g9-seg__count {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://./src/toggle/choice.css"],"names":[],"mappings":"AACA;EAAE,mBAAmB;EACnB,iBAAiB;EACjB,cAAc;EACd,sBAAsB;EACtB,mBAAmB;EACnB,eAAe;EACf,aAAa;AACf;;AAGA;EAAE,oBAAoB;AACtB;;AAGA;EAAE,mBAAmB;EACnB,gBAAgB;EAChB,oCAAoC;AACtC;;AAGA;EAAE,mBAAmB;EACnB,uBAAuB;EACvB,mBAAmB;EACnB,WAAW;EACX,YAAY;EACZ,aAAa;AACf;;AAGA;EAAE,kDAAkD;EAClD,oBAAoB;EACpB,YAAY;EACZ,aAAa;EACb,kBAAkB;AACpB;;AAGA;EAAE,0BAA0B;EAC1B,wBAAwB;EACxB,sCAAsC;EACtC,uBAAuB;EACvB,UAAU;AACZ;;AAGA;EAAE,oDAAoD;EACpD,kBAAkB;EAClB,QAAQ;EACR,WAAW;AACb;;AAGA;EAAE,mCAAmC;EACnC,mBAAmB;EACnB,iBAAiB;EACjB,uCAAuC;AACzC;;AAGA;EAAE,mCAAmC;AACrC;;AAGA;EAAE,sBAAsB;EACtB,OAAO;EACP,uBAAuB;EACvB,mBAAmB;EACnB,YAAY;EACZ,cAAc;EACd,aAAa;AACf;;AAGA;EAAE,UAAU;AACZ;;AAGA;EAAE,8BAA8B;AAChC;;AAKA;EAFE,YAAY;AACd;;AAKA;EAFE,mBAAmB;EACnB,mBAAmB;EACnB,eAAe;EACf,aAAa;AACf;;AAKA;EAFE,eAAe;EACf,oCAAoC;EACpC,mBAAmB;EACnB,gBAAgB;AAClB;;
|
|
1
|
+
{"version":3,"sources":["webpack://./src/toggle/choice.css"],"names":[],"mappings":"AACA;EAAE,mBAAmB;EACnB,iBAAiB;EACjB,cAAc;EACd,sBAAsB;EACtB,mBAAmB;EACnB,eAAe;EACf,aAAa;AACf;;AAGA;EAAE,oBAAoB;AACtB;;AAGA;EAAE,mBAAmB;EACnB,gBAAgB;EAChB,oCAAoC;AACtC;;AAGA;EAAE,mBAAmB;EACnB,uBAAuB;EACvB,mBAAmB;EACnB,WAAW;EACX,YAAY;EACZ,aAAa;AACf;;AAGA;EAAE,kDAAkD;EAClD,oBAAoB;EACpB,YAAY;EACZ,aAAa;EACb,kBAAkB;AACpB;;AAGA;EAAE,0BAA0B;EAC1B,wBAAwB;EACxB,sCAAsC;EACtC,uBAAuB;EACvB,UAAU;AACZ;;AAGA;EAAE,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Y;EACZ,aAAa;AACf;;AAMA;EAHE,+BAA+B;AACjC;;AAMA;EAHE,mCAAmC;EACnC,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;;AAMA;EAHE,sBAAsB;EACtB,OAAO;EACP,YAAY;EACZ,aAAa;AACf;;AAMA;EAHE,eAAe;EACf,gCAAgC;EAChC,6BAA6B;EAC7B,iBAAiB;AACnB;;AAMA;EAHE,eAAe;EACf,gCAAgC;EAChC,+BAA+B;EAC/B,iBAAiB;AACnB;;AAMA;EAHE,kDAAkD;EAClD,8BAA8B;EAC9B,sBAAsB;EACtB,mBAAmB;EACnB,aAAa;AACf;;AAMA;EAHE,mBAAmB;AACrB;;AAMA;EAHE,mCAAmC;EACnC,mBAAmB;EACnB,uBAAuB;EACvB,eAAe;EACf,eAAe;EACf,aAAa;AACf;;AAMA;EAHE,eAAe;EACf,oCAAoC;EACpC,2BAA2B;EAC3B,gBAAgB;AAClB;;AAMA;EAHE,uBAAuB;EACvB,mBAAmB;EACnB,aAAa;AACf;;AAMA;EAHE,YAAY;AACd;;AAOA;EAJE,6CAA6C;AAC/C;;AAOA;EAJE,mCAAmC;AACrC;;AAOA;EAJE,eAAe;EACf,oCAAoC;EACpC,qCAAqC;EACrC,gBAAgB;AAClB;;AAOA;EAJE,kBAAkB;EAClB,eAAe;EACf,eAAe;EACf,oCAAoC;EACpC,6BAA6B;EAC7B,gBAAgB;AAClB;;AAOA;EAJE,mBAAmB;EACnB,aAAa;AACf;;AAOA;EAJE,uBAAuB;EACvB,mBAAmB;EACnB,aAAa;AACf","sourcesContent":["/* G9Chip, G9Segmented, G9RadioGroup, G9Stepper, G9RatingInput. */\n.g9-chip2 {\n display: flex;\n align-items: center;\n align-self: flex-start;\n flex-shrink: 0;\n border-style: solid;\n border-width: 1px;\n column-gap: 5px;\n}\n\n.g9-chip2--dashed {\n border-style: dashed;\n}\n\n.g9-chip2__text {\n font-weight: 600;\n white-space: nowrap;\n font-family: var(--g9-font-text-600);\n}\n\n.g9-chip2__remove {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 22px;\n height: 22px;\n border-radius: 11px;\n}\n\n.g9-seg {\n display: flex;\n position: relative;\n align-items: stretch;\n padding: 3px;\n background-color: var(--g9-surface-container-high);\n}\n\n.g9-seg--underline {\n padding: 0px;\n background-color: transparent;\n border-bottom-width: 1px;\n border-bottom-style: solid;\n border-bottom-color: var(--g9-divider);\n}\n\n.g9-seg__indicator {\n position: absolute;\n top: 3px;\n bottom: 3px;\n transition: transform 220ms cubic-bezier(0.2, 0, 0, 1);\n}\n\n.g9-seg__indicator--lift {\n background-color: var(--g9-surface);\n border-width: 1px;\n border-style: solid;\n border-color: var(--g9-outline-variant);\n}\n\n.g9-seg__indicator--filled {\n background-color: var(--g9-primary);\n}\n\n.g9-seg__item {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n flex: 1;\n min-width: 0px;\n padding: 0px 8px;\n}\n\n.g9-seg__item--content {\n flex: 1 1 auto;\n}\n\n.g9-seg__item--underline {\n border-bottom-width: 2px;\n border-bottom-style: solid;\n border-bottom-color: transparent;\n}\n\n.g9-seg__item--disabled {\n opacity: 0.38;\n}\n\n.g9-seg__line {\n display: flex;\n flex-direction: row;\n align-items: center;\n column-gap: 5px;\n max-width: 100%;\n min-width: 0px;\n}\n\n.g9-seg__label {\n font-size: 14px;\n font-family: var(--g9-font-text-500);\n font-weight: 500;\n white-space: nowrap;\n /* a label longer than its segment ends in «…» instead of spilling into the next (G9Hub, 2.5.7) */\n flex-shrink: 1;\n min-width: 0px;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n\n.g9-seg__label--on {\n font-weight: 700;\n font-family: var(--g9-font-text-700);\n}\n\n.g9-seg__sub {\n font-size: 11px;\n font-family: var(--g9-font-text);\n opacity: 0.8;\n max-width: 100%;\n text-overflow: ellipsis;\n}\n\n.g9-seg__count {\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: 18px;\n height: 18px;\n padding: 0px 5px;\n border-radius: 9px;\n}\n\n.g9-seg__count-text {\n font-size: 11px;\n font-family: var(--g9-font-text-700);\n font-weight: 700;\n}\n\n.g9-radio-group {\n display: flex;\n flex-direction: column;\n}\n\n.g9-radio {\n display: flex;\n align-items: center;\n min-height: 48px;\n column-gap: 12px;\n padding: 6px 0px;\n}\n\n.g9-radio--card {\n padding: 12px 14px;\n border-radius: var(--g9-radius-card);\n border-width: 1px;\n border-style: solid;\n border-color: var(--g9-outline-variant);\n background-color: var(--g9-surface);\n}\n\n.g9-radio--card-on {\n border-width: 2px;\n border-color: var(--g9-primary);\n background-color: var(--g9-primary-container);\n}\n\n.g9-radio--disabled {\n opacity: 0.38;\n}\n\n.g9-radio__mark {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 22px;\n height: 22px;\n border-radius: 11px;\n border-width: 2px;\n border-style: solid;\n border-color: var(--g9-outline);\n flex-shrink: 0;\n}\n\n.g9-radio__mark--on {\n border-color: var(--g9-primary);\n}\n\n.g9-radio__dot {\n width: 10px;\n height: 10px;\n border-radius: 5px;\n background-color: var(--g9-primary);\n}\n\n.g9-radio__body {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-width: 0px;\n}\n\n.g9-radio__label {\n font-size: 15px;\n font-family: var(--g9-font-text);\n line-height: 24px;\n color: var(--g9-text-primary);\n}\n\n.g9-radio__desc {\n font-size: 12px;\n font-family: var(--g9-font-text);\n line-height: 20px;\n color: var(--g9-text-secondary);\n}\n\n.g9-stepper {\n display: flex;\n align-items: center;\n justify-content: space-between;\n align-self: flex-start;\n background-color: var(--g9-surface-container-high);\n}\n\n.g9-stepper--block {\n align-self: stretch;\n}\n\n.g9-stepper--add {\n display: flex;\n flex-direction: row;\n justify-content: center;\n padding: 0px 14px;\n column-gap: 6px;\n background-color: var(--g9-primary);\n}\n\n.g9-stepper__add-text {\n font-size: 14px;\n font-family: var(--g9-font-text-700);\n font-weight: 700;\n color: var(--g9-on-primary);\n}\n\n.g9-stepper__btn {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.g9-stepper__btn--off {\n opacity: 0.35;\n}\n\n/* the tray look (appearance 'tray'): the pill in the primary container, round surface buttons inside, a bold count */\n.g9-stepper--tray {\n background-color: var(--g9-primary-container);\n}\n\n.g9-stepper__btn--tray {\n background-color: var(--g9-surface);\n}\n\n.g9-stepper__value--tray {\n font-size: 17px;\n font-family: var(--g9-font-text-700);\n font-weight: 700;\n color: var(--g9-on-primary-container);\n}\n\n.g9-stepper__value {\n min-width: 28px;\n text-align: center;\n font-size: 15px;\n font-family: var(--g9-font-text-800);\n font-weight: 800;\n color: var(--g9-text-primary);\n}\n\n.g9-rating {\n display: flex;\n align-items: center;\n}\n\n.g9-rating__star {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n"],"sourceRoot":""}
|
package/dist/toggle/choice.d.ts
CHANGED
|
@@ -114,8 +114,19 @@ export interface G9StepperProps extends G9ControlBaseProps {
|
|
|
114
114
|
*/
|
|
115
115
|
readonly decreaseLabel?: string;
|
|
116
116
|
readonly increaseLabel?: string;
|
|
117
|
+
/** What − says when it would fold the stepper back (`collapsedAtMin`: its icon is a bin). Default `decreaseLabel`. */
|
|
118
|
+
readonly removeLabel?: string;
|
|
119
|
+
/**
|
|
120
|
+
* Below this value − folds the stepper back (its icon a bin): a quantity whose smallest amount is above one step (a
|
|
121
|
+
* 1 kg minimum in 0.5 kg steps). Default `min`.
|
|
122
|
+
*/
|
|
123
|
+
readonly collapseBelow?: number;
|
|
117
124
|
/** What the value says (`'۲ عدد پنیر سفید'`): a text, or one made from the value. Default the shown text. */
|
|
118
125
|
readonly valueLabel?: string | ((value: number) => string);
|
|
126
|
+
/** What the collapsed add button says (its words shown may be shorter: «افزودن» read as «افزودن پنیر»). */
|
|
127
|
+
readonly addLabel?: string;
|
|
128
|
+
/** Working (the cart is being updated): a spinner in place of the value, − and + do nothing. */
|
|
129
|
+
readonly busy?: boolean;
|
|
119
130
|
}
|
|
120
131
|
/** − value + (SAC Stepper, ShopManager stepper and AddControl, mardomi Stepper), with an optional collapsed "add" state. */
|
|
121
132
|
export declare function G9Stepper(props: G9StepperProps): ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"choice.d.ts","sourceRoot":"","sources":["../../src/toggle/choice.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,YAAY,EAAY,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,KAAK,kBAAkB,
|
|
1
|
+
{"version":3,"file":"choice.d.ts","sourceRoot":"","sources":["../../src/toggle/choice.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,YAAY,EAAY,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,KAAK,kBAAkB,EAA+D,MAAM,iBAAiB,CAAC;AAGvH,OAAO,EAAE,KAAK,MAAM,EAAc,MAAM,cAAc,CAAC;AAGvD,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAQxD,+BAA+B;AAC/B,MAAM,WAAW,WAAY,SAAQ,kBAAkB;IACrD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,sCAAsC;IACtC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC;IAC5B,qFAAqF;IACrF,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;IAC9D,iDAAiD;IACjD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,iDAAiD;IACjD,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,OAAO,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C,EAAE,MAAM,CAAC;IAC3B,gGAAgG;IAChG,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;CACzB;AAID,4HAA4H;AAC5H,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,SAAS,CAgI1D;AAID,sCAAsC;AACtC,MAAM,WAAW,kBAAmB,SAAQ,kBAAkB;IAC5D,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,iBAAiB;IACjB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,+CAA+C;IAC/C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,wDAAwD;IACxD,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG,KAAK,CAAC;CACxC;AAKD,4FAA4F;AAC5F,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,SAAS,CAgElE"}
|
package/dist/toggle/choice.jsx
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import "./choice.css";
|
|
2
2
|
import { g9Haptic } from "@g9tm/lynxcontrols-foundation";
|
|
3
3
|
import { memo } from "@lynx-js/react";
|
|
4
|
-
import { g9ChildId, g9IdProps, g9RowStyle, useG9Control } from "../base/control.jsx";
|
|
4
|
+
import { g9ChildId, g9IdProps, g9RowStyle, g9TextStart, useG9Control } from "../base/control.jsx";
|
|
5
5
|
import { useG9Press } from "../base/press.jsx";
|
|
6
6
|
import { useG9SharedHeights } from "../base/sizing.jsx";
|
|
7
7
|
import { toneColors } from "../base/tone.jsx";
|
|
8
8
|
import { useControllableState } from "../base/use-controllable-state.jsx";
|
|
9
|
+
import { G9ActivityIndicator } from "../display/activity-indicator.jsx";
|
|
9
10
|
import { G9Icon } from "../icon/icon.jsx";
|
|
10
11
|
const tick = (kind)=>{
|
|
11
12
|
if (false !== kind) g9Haptic(null != kind ? kind : 'tick');
|
|
@@ -161,7 +162,7 @@ const Segment = memo(function(p) {
|
|
|
161
162
|
}} accessibility-element={true} accessibility-traits="button" accessibility-label={p.item.label} accessibility-status={p.on ? 'selected' : ''} bindtap={press}>
|
|
162
163
|
<view className="g9-seg__line">
|
|
163
164
|
{p.item.icon ? <G9Icon icon={p.item.icon} size={15} color={fg}/> : null}
|
|
164
|
-
<text className={`g9-seg__label${p.on ? ' g9-seg__label--on' : ''}`} style={{
|
|
165
|
+
<text className={`g9-seg__label${p.on ? ' g9-seg__label--on' : ''}`} text-maxline="1" style={{
|
|
165
166
|
color: fg
|
|
166
167
|
}}>
|
|
167
168
|
{p.item.label}
|
|
@@ -176,7 +177,7 @@ const Segment = memo(function(p) {
|
|
|
176
177
|
</text>
|
|
177
178
|
</view> : null}
|
|
178
179
|
</view>
|
|
179
|
-
{p.item.sub ? <text className="g9-seg__sub" style={{
|
|
180
|
+
{p.item.sub ? <text className="g9-seg__sub" text-maxline="1" style={{
|
|
180
181
|
color: fg
|
|
181
182
|
}}>
|
|
182
183
|
{p.item.sub}
|
|
@@ -230,14 +231,18 @@ const RadioRow = memo(function(p) {
|
|
|
230
231
|
source: 'G9RadioGroup',
|
|
231
232
|
guardMs: 0
|
|
232
233
|
});
|
|
233
|
-
return <view className={`g9-radio${p.cards ? ' g9-radio--card' : ''}${p.cards && p.on ? ' g9-radio--card-on' : ''}${p.blocked ? ' g9-radio--disabled' : ''}`} {...g9IdProps(p.id)} style={g9RowStyle(p.direction)} accessibility-element={true} accessibility-traits="button" accessibility-label={p.option.label} accessibility-status={p.on ? 'selected' : ''} bindtap={press}>
|
|
234
|
+
return <view className={`g9-radio${p.cards ? ' g9-radio--card' : ''}${p.cards && p.on ? ' g9-radio--card-on' : ''}${p.blocked ? ' g9-radio--disabled' : ''}`} {...g9IdProps(p.id)} style={g9RowStyle(p.direction)} flatten={false} accessibility-element={true} accessibility-traits="button" accessibility-label={p.option.label} accessibility-status={p.on ? 'selected' : ''} bindtap={press}>
|
|
234
235
|
<view className={`g9-radio__mark${p.on ? ' g9-radio__mark--on' : ''}`}>
|
|
235
236
|
{p.on ? <view className="g9-radio__dot"/> : null}
|
|
236
237
|
</view>
|
|
237
238
|
{p.option.icon ? <G9Icon icon={p.option.icon} size={20} color="var(--g9-text-secondary)"/> : null}
|
|
238
239
|
<view className="g9-radio__body">
|
|
239
|
-
<text className="g9-radio__label"
|
|
240
|
-
|
|
240
|
+
<text className="g9-radio__label" style={g9TextStart(p.direction)}>
|
|
241
|
+
{p.option.label}
|
|
242
|
+
</text>
|
|
243
|
+
{p.option.description ? <text className="g9-radio__desc" style={g9TextStart(p.direction)}>
|
|
244
|
+
{p.option.description}
|
|
245
|
+
</text> : null}
|
|
241
246
|
</view>
|
|
242
247
|
</view>;
|
|
243
248
|
});
|
|
@@ -296,13 +301,16 @@ function G9Stepper(props) {
|
|
|
296
301
|
});
|
|
297
302
|
const collapsed = void 0 !== props.collapsedAtMin && false !== props.collapsedAtMin && value <= min;
|
|
298
303
|
const text1 = props.format ? props.format(value) : String(value);
|
|
304
|
+
const removes = !!props.collapsedAtMin && (void 0 !== props.collapseBelow ? value - step < props.collapseBelow - 1e-9 : value - step < min + 1e-9);
|
|
299
305
|
if (collapsed) {
|
|
300
|
-
var _props_increaseLabel1;
|
|
306
|
+
var _props_addLabel, _props_increaseLabel1;
|
|
301
307
|
return <view className={`${control.className} g9-stepper--add${props.block ? ' g9-stepper--block' : ''}`} {...control.idProps} style={control.rootStyle({
|
|
302
308
|
height: `${h}px`,
|
|
303
309
|
borderRadius: `${h / 2}px`
|
|
304
|
-
})} accessibility-element={true} accessibility-traits="button" accessibility-label={'string' == typeof props.collapsedAtMin ? props.collapsedAtMin : null != (_props_increaseLabel1 = props.increaseLabel) ? _props_increaseLabel1 : '+'}
|
|
305
|
-
|
|
310
|
+
})} accessibility-element={true} accessibility-traits="button" accessibility-label={null != (_props_addLabel = props.addLabel) ? _props_addLabel : 'string' == typeof props.collapsedAtMin ? props.collapsedAtMin : null != (_props_increaseLabel1 = props.increaseLabel) ? _props_increaseLabel1 : '+'} {...props.busy ? {
|
|
311
|
+
'accessibility-status': 'busy'
|
|
312
|
+
} : {}} bindtap={props.busy ? void 0 : plus}>
|
|
313
|
+
{props.busy ? <G9ActivityIndicator running={true} size={16} color="var(--g9-on-primary)"/> : <G9Icon icon="plus" size={16} color="var(--g9-on-primary)"/>}
|
|
306
314
|
{'string' == typeof props.collapsedAtMin ? <text className="g9-stepper__add-text">{props.collapsedAtMin}</text> : null}
|
|
307
315
|
</view>;
|
|
308
316
|
}
|
|
@@ -321,19 +329,22 @@ function G9Stepper(props) {
|
|
|
321
329
|
...tray ? {
|
|
322
330
|
borderRadius: `${btn / 2}px`
|
|
323
331
|
} : {}
|
|
324
|
-
}} accessibility-element={true} accessibility-traits="button" accessibility-label={null != (_props_decreaseLabel = props.decreaseLabel) ? _props_decreaseLabel : '−'} bindtap={minus}>
|
|
325
|
-
<G9Icon icon={
|
|
332
|
+
}} accessibility-element={true} accessibility-traits="button" accessibility-label={removes && void 0 !== props.removeLabel ? props.removeLabel : null != (_props_decreaseLabel = props.decreaseLabel) ? _props_decreaseLabel : '−'} bindtap={props.busy ? void 0 : minus}>
|
|
333
|
+
<G9Icon icon={removes ? 'delete' : 'minus'} size={16} color="var(--g9-text-primary)"/>
|
|
326
334
|
</view>
|
|
327
|
-
<text className={`g9-stepper__value${tray ? ' g9-stepper__value--tray' : ''}`} accessibility-label={'function' == typeof props.valueLabel ? props.valueLabel(value) : null != (_props_valueLabel = props.valueLabel) ? _props_valueLabel : text1}
|
|
328
|
-
|
|
335
|
+
<text className={`g9-stepper__value${tray ? ' g9-stepper__value--tray' : ''}`} accessibility-label={'function' == typeof props.valueLabel ? props.valueLabel(value) : null != (_props_valueLabel = props.valueLabel) ? _props_valueLabel : text1} {...props.busy ? {
|
|
336
|
+
'accessibility-status': 'busy'
|
|
337
|
+
} : {}}>
|
|
338
|
+
{props.busy ? '' : text1}
|
|
329
339
|
</text>
|
|
340
|
+
{props.busy ? <G9ActivityIndicator running={true} size={16} color="var(--g9-text-primary)" className="g9-stepper__busy"/> : null}
|
|
330
341
|
<view className={`g9-stepper__btn${tray ? ' g9-stepper__btn--tray' : ''}${value >= max ? ' g9-stepper__btn--off' : ''}`} {...g9IdProps(g9ChildId(props.id, 'Plus'))} style={{
|
|
331
342
|
width: `${btn}px`,
|
|
332
343
|
height: `${btn}px`,
|
|
333
344
|
...tray ? {
|
|
334
345
|
borderRadius: `${btn / 2}px`
|
|
335
346
|
} : {}
|
|
336
|
-
}} accessibility-element={true} accessibility-traits="button" accessibility-label={null != (_props_increaseLabel = props.increaseLabel) ? _props_increaseLabel : '+'} bindtap={plus}>
|
|
347
|
+
}} accessibility-element={true} accessibility-traits="button" accessibility-label={null != (_props_increaseLabel = props.increaseLabel) ? _props_increaseLabel : '+'} bindtap={props.busy ? void 0 : plus}>
|
|
337
348
|
<G9Icon icon="plus" size={16} color="var(--g9-text-primary)"/>
|
|
338
349
|
</view>
|
|
339
350
|
</view>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@g9tm/lynxcontrols",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.7",
|
|
4
4
|
"description": "ReactLynx controls and overlay infrastructure: provider/host, sheets, popups, toasts, fields, buttons, pickers, tab view, tab bar, edge panel, swipe rows.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -214,7 +214,7 @@
|
|
|
214
214
|
"build": "rslib build"
|
|
215
215
|
},
|
|
216
216
|
"dependencies": {
|
|
217
|
-
"@g9tm/lynxcontrols-foundation": "2.5.
|
|
217
|
+
"@g9tm/lynxcontrols-foundation": "2.5.7"
|
|
218
218
|
},
|
|
219
219
|
"peerDependencies": {
|
|
220
220
|
"@lynx-js/react": ">=0.129.3 <0.130.0",
|
|
@@ -39,7 +39,7 @@ Generated from the installed packages' catalogs (`<package>/catalog`): one line
|
|
|
39
39
|
- `@g9tm/lynxcontrols/expander`: G9Expander → `components/expander.md`
|
|
40
40
|
- `@g9tm/lynxcontrols/fields`: G9Editor, G9FormField, G9NumberEntry, G9NumPad, G9OutlinedField, G9PinEntry, G9SearchEntry, G9TagEntry, G9TextEntry, G9TimeEntry → `components/fields.md`
|
|
41
41
|
- `@g9tm/lynxcontrols/header`: G9AppBar → `components/header.md`
|
|
42
|
-
- `@g9tm/lynxcontrols/host`: G9Host, G9PageLoadingOverlay → `components/host.md`
|
|
42
|
+
- `@g9tm/lynxcontrols/host`: G9CarryContexts, G9Host, G9PageLoadingOverlay → `components/host.md`
|
|
43
43
|
- `@g9tm/lynxcontrols/icon`: G9Art, G9Icon, G9IconSlot, G9Swatch → `components/icon.md`
|
|
44
44
|
- `@g9tm/lynxcontrols/layout`: G9ActionRow, G9Bento, G9Card, G9Columns, G9HScroll, G9Page, G9PlaceScroll, G9SaveBar, G9ScrollSpyBar, G9Section, G9SectionHeader, G9SplitPane, G9UnsavedBar → `components/layout-1.md`, `components/layout-2.md`
|
|
45
45
|
- `@g9tm/lynxcontrols/list`: G9DragList, G9ListRow, G9Pager, G9PullToRefresh, G9SettingsGroup, G9SwitchRow, G9VirtualList → `components/list.md`
|
|
@@ -55,7 +55,7 @@ Generated from the installed packages' catalogs (`<package>/catalog`): one line
|
|
|
55
55
|
- `@g9tm/lynxcontrols/shell`: G9AppShell, G9ConnectionBanner, G9IconRail, G9SideNav, G9TopBar, G9UpdateBar → `components/shell.md`
|
|
56
56
|
- `@g9tm/lynxcontrols/survey`: G9AllocationInput, G9ChoiceList, G9ScaleInput → `components/survey.md`
|
|
57
57
|
- `@g9tm/lynxcontrols/swipe`: G9SwipeGroup, G9SwipeView → `components/swipe.md`
|
|
58
|
-
- `@g9tm/lynxcontrols/tab-bar`: G9TabBar → `components/tab-bar.md`
|
|
58
|
+
- `@g9tm/lynxcontrols/tab-bar`: G9FlatTabBar, G9TabBar → `components/tab-bar.md`
|
|
59
59
|
- `@g9tm/lynxcontrols/tabs`: G9TabView → `components/tabs.md`
|
|
60
60
|
- `@g9tm/lynxcontrols/toggle`: G9CheckBox, G9Chip, G9ChipGroup, G9RadioGroup, G9RatingInput, G9Segmented, G9Stepper, G9Switch, G9SwitchGroup → `components/toggle.md`
|
|
61
61
|
|
|
@@ -69,7 +69,7 @@ Generated from the installed packages' catalogs (`<package>/catalog`): one line
|
|
|
69
69
|
|
|
70
70
|
## @g9tm/lynxcontrols-map
|
|
71
71
|
|
|
72
|
-
- `@g9tm/lynxcontrols-map`: G9StaticMap → `components/map.md`
|
|
72
|
+
- `@g9tm/lynxcontrols-map`: G9Map, G9StaticMap → `components/map.md`
|
|
73
73
|
|
|
74
74
|
## @g9tm/lynxcontrols-media
|
|
75
75
|
|
|
@@ -28,10 +28,10 @@ Props:
|
|
|
28
28
|
- `headline`: string
|
|
29
29
|
- `height`: number
|
|
30
30
|
- `children?`: ReactNode
|
|
31
|
+
- `onPress?`: () => void
|
|
32
|
+
- `chipIcon?`: icon
|
|
33
|
+
- `offColor?`: color
|
|
31
34
|
- `pictureOpacity?`: number = 0.79
|
|
32
35
|
- `tone?`: string
|
|
33
|
-
- `bottomEnd?`: ReactNode
|
|
34
|
-
- `bottomStart?`: ReactNode
|
|
35
|
-
- `camera?`: ReactNode
|
|
36
36
|
|
|
37
37
|
Example: `<G9ScanCard headline="headline" height={1} />`
|
|
@@ -13,8 +13,8 @@ Props:
|
|
|
13
13
|
- `onPress`: () => void
|
|
14
14
|
- `total`: number
|
|
15
15
|
- `totalText?`: string
|
|
16
|
+
- `actionIcon?`: icon
|
|
16
17
|
- `bottomOffset?`: number
|
|
17
|
-
- `currency?`: string & {} | string | string
|
|
18
18
|
|
|
19
19
|
Example: `<G9MiniCartBar actionText="actionText" count={1} countText={countText} onPress={() => {}} total={1} />`
|
|
20
20
|
|
|
@@ -61,10 +61,10 @@ Props:
|
|
|
61
61
|
- `addText`: string
|
|
62
62
|
- `onChange`: (qty: number) => void
|
|
63
63
|
- `value`: number
|
|
64
|
-
- `size?`: 'sm' | 'md'
|
|
64
|
+
- `size?`: 'sm' | 'md' | 'lg' = "md"
|
|
65
65
|
- `disabled?`: boolean
|
|
66
|
-
- `
|
|
67
|
-
- `
|
|
68
|
-
- `
|
|
66
|
+
- `format?`: (qty: number) => void
|
|
67
|
+
- `onAdd?`: (origin: { readonly x: number; readonly y: number; }) => void
|
|
68
|
+
- `decreaseLabel?`: string
|
|
69
69
|
|
|
70
70
|
Example: `<G9QuantityControl addText="addText" onChange={() => {}} value={1} />`
|
|
@@ -24,11 +24,12 @@ A person: photo or initials in a tinted disc (SAC/ShopManager/Riskara Avatar, G9
|
|
|
24
24
|
Props:
|
|
25
25
|
- `name`: string
|
|
26
26
|
- `size?`: number | string | string | string | string | string = "md"
|
|
27
|
+
- `icon?`: icon
|
|
28
|
+
- `shape?`: 'circle' | 'squircle'
|
|
27
29
|
- `tone?`: 'primary' | 'info' | 'success' | 'warning' | 'error' | 'accent' | 'neutral'
|
|
28
30
|
- `gradient?`: boolean
|
|
29
31
|
- `image?`: string
|
|
30
32
|
- `ring?`: string
|
|
31
|
-
- `status?`: 'online' | 'busy' | 'away' | 'offline'
|
|
32
33
|
|
|
33
34
|
Example: `<G9Avatar name="name" />`
|
|
34
35
|
|
|
@@ -25,14 +25,14 @@ Example: `<G9Editor />`
|
|
|
25
25
|
A label above any control, a hint or an error below (SAC Field, G9Hub Field): for controls without a floating label.
|
|
26
26
|
|
|
27
27
|
Props:
|
|
28
|
-
- `label
|
|
28
|
+
- `label?`: string
|
|
29
29
|
- `children?`: ReactNode
|
|
30
30
|
- `hint?`: string
|
|
31
31
|
- `aside?`: ReactNode
|
|
32
32
|
- `error?`: string
|
|
33
33
|
- `required?`: boolean
|
|
34
34
|
|
|
35
|
-
Example: `<G9FormField
|
|
35
|
+
Example: `<G9FormField />`
|
|
36
36
|
|
|
37
37
|
# G9NumberEntry
|
|
38
38
|
|
|
@@ -12,8 +12,8 @@ Props:
|
|
|
12
12
|
- `subtitle?`: string
|
|
13
13
|
- `disabled?`: boolean = false
|
|
14
14
|
- `onBack?`: () => void
|
|
15
|
-
- `backLabel?`: string
|
|
15
|
+
- `backLabel?`: string
|
|
16
|
+
- `actionsGap?`: number = 2
|
|
16
17
|
- `align?`: 'start' | 'center'
|
|
17
|
-
- `actions?`: ReactNode
|
|
18
18
|
|
|
19
19
|
Example: `<G9AppBar />`
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# `@g9tm/lynxcontrols/host` (generated)
|
|
2
2
|
|
|
3
|
+
# G9CarryContexts
|
|
4
|
+
|
|
5
|
+
`import { G9CarryContexts } from '@g9tm/lynxcontrols/host';`
|
|
6
|
+
|
|
7
|
+
Carries React context into the nearest G9Host's layers: sheets, popups, toasts and menus then read `contexts` with their live values, though they render outside the page (SAC's tray sheet read «GuestContext missing» with
|
|
8
|
+
|
|
9
|
+
Props:
|
|
10
|
+
- `contexts`: object[]
|
|
11
|
+
|
|
12
|
+
Example: `<G9CarryContexts contexts={contexts} />`
|
|
13
|
+
|
|
3
14
|
# G9Host
|
|
4
15
|
|
|
5
16
|
`import { G9Host } from '@g9tm/lynxcontrols/host';`
|
|
@@ -30,7 +30,7 @@ Props:
|
|
|
30
30
|
- `onPress?`: () => void
|
|
31
31
|
- `disabled?`: boolean = false
|
|
32
32
|
- `iconTone?`: 'primary' | 'info' | 'success' | 'warning' | 'error' | 'accent' | 'neutral' = "neutral"
|
|
33
|
-
- `
|
|
33
|
+
- `pressFeedback?`: 'none' | 'tint' = "none"
|
|
34
34
|
|
|
35
35
|
Example: `<G9ListRow title="Label" />`
|
|
36
36
|
|
|
@@ -93,7 +93,7 @@ Props:
|
|
|
93
93
|
- `subtitle?`: string
|
|
94
94
|
- `disabled?`: boolean = false
|
|
95
95
|
- `iconTone?`: 'primary' | 'info' | 'success' | 'warning' | 'error' | 'accent' | 'neutral' = "neutral"
|
|
96
|
-
- `
|
|
96
|
+
- `pressFeedback?`: 'none' | 'tint' = "none"
|
|
97
97
|
|
|
98
98
|
Example: `<G9SwitchRow checked onCheckedChange={() => {}} title="Label" />`
|
|
99
99
|
|