@g9tm/lynxcontrols 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/bin/g9lynx.mjs +103 -0
- package/bin/g9lynx.test.mjs +80 -0
- package/catalog/cards/DateTimeSheetBody.md +17 -0
- package/catalog/cards/G9ActionRow.md +11 -0
- package/catalog/cards/G9ActionSheet.md +14 -0
- package/catalog/cards/G9Activity.md +11 -0
- package/catalog/cards/G9ActivityIndicator.md +14 -0
- package/catalog/cards/G9AllocationInput.md +17 -0
- package/catalog/cards/G9Anchor.md +17 -0
- package/catalog/cards/G9AnimatedCheck.md +13 -0
- package/catalog/cards/G9AppBar.md +17 -0
- package/catalog/cards/G9AppShell.md +17 -0
- package/catalog/cards/G9Art.md +13 -0
- package/catalog/cards/G9Avatar.md +16 -0
- package/catalog/cards/G9Badge.md +15 -0
- package/catalog/cards/G9Bento.md +13 -0
- package/catalog/cards/G9Button.md +17 -0
- package/catalog/cards/G9CameFromMark.md +9 -0
- package/catalog/cards/G9Card.md +17 -0
- package/catalog/cards/G9CascadePanel.md +17 -0
- package/catalog/cards/G9CheckBox.md +17 -0
- package/catalog/cards/G9Chip.md +17 -0
- package/catalog/cards/G9ChipGroup.md +17 -0
- package/catalog/cards/G9ChoiceList.md +17 -0
- package/catalog/cards/G9Columns.md +13 -0
- package/catalog/cards/G9ComboBox.md +17 -0
- package/catalog/cards/G9CommandPalette.md +15 -0
- package/catalog/cards/G9Confetti.md +15 -0
- package/catalog/cards/G9ConnectionBanner.md +15 -0
- package/catalog/cards/G9ContextMenu.md +15 -0
- package/catalog/cards/G9CornerBadge.md +15 -0
- package/catalog/cards/G9CultureDateTimeLabel.md +16 -0
- package/catalog/cards/G9DateTimePicker.md +17 -0
- package/catalog/cards/G9DayStepper.md +17 -0
- package/catalog/cards/G9DeferredContent.md +17 -0
- package/catalog/cards/G9Delta.md +17 -0
- package/catalog/cards/G9DesignNode.md +13 -0
- package/catalog/cards/G9DesignScope.md +11 -0
- package/catalog/cards/G9DragList.md +15 -0
- package/catalog/cards/G9EdgePanel.md +17 -0
- package/catalog/cards/G9Editor.md +17 -0
- package/catalog/cards/G9EmptyState.md +17 -0
- package/catalog/cards/G9ErrorBoundary.md +13 -0
- package/catalog/cards/G9Expander.md +17 -0
- package/catalog/cards/G9FloatingOrb.md +17 -0
- package/catalog/cards/G9FormField.md +15 -0
- package/catalog/cards/G9HScroll.md +16 -0
- package/catalog/cards/G9HeaderActionButton.md +17 -0
- package/catalog/cards/G9HoldButton.md +17 -0
- package/catalog/cards/G9Host.md +17 -0
- package/catalog/cards/G9Icon.md +16 -0
- package/catalog/cards/G9IconButton.md +17 -0
- package/catalog/cards/G9IconRail.md +15 -0
- package/catalog/cards/G9IconSlot.md +17 -0
- package/catalog/cards/G9Image.md +17 -0
- package/catalog/cards/G9InlineMessage.md +16 -0
- package/catalog/cards/G9KeepAlive.md +11 -0
- package/catalog/cards/G9Keycap.md +13 -0
- package/catalog/cards/G9Kpi.md +17 -0
- package/catalog/cards/G9KpiGrid.md +12 -0
- package/catalog/cards/G9ListRow.md +17 -0
- package/catalog/cards/G9LiveBadge.md +11 -0
- package/catalog/cards/G9LiveDot.md +12 -0
- package/catalog/cards/G9LoadState.md +13 -0
- package/catalog/cards/G9LoadableSheetContent.md +17 -0
- package/catalog/cards/G9LockOverlay.md +15 -0
- package/catalog/cards/G9Menu.md +17 -0
- package/catalog/cards/G9MenuList.md +12 -0
- package/catalog/cards/G9NavCard.md +17 -0
- package/catalog/cards/G9NumPad.md +13 -0
- package/catalog/cards/G9NumberEntry.md +17 -0
- package/catalog/cards/G9OutlinedField.md +17 -0
- package/catalog/cards/G9OverlayRoot.md +12 -0
- package/catalog/cards/G9Page.md +17 -0
- package/catalog/cards/G9PageLoadingOverlay.md +12 -0
- package/catalog/cards/G9Pager.md +16 -0
- package/catalog/cards/G9Photo.md +17 -0
- package/catalog/cards/G9Picker.md +17 -0
- package/catalog/cards/G9PinEntry.md +17 -0
- package/catalog/cards/G9Place.md +17 -0
- package/catalog/cards/G9PlaceScroll.md +13 -0
- package/catalog/cards/G9PlusButton.md +17 -0
- package/catalog/cards/G9Popover.md +17 -0
- package/catalog/cards/G9PopupDragHandle.md +10 -0
- package/catalog/cards/G9PopupView.md +15 -0
- package/catalog/cards/G9Pressable.md +17 -0
- package/catalog/cards/G9ProcessingSheetContent.md +13 -0
- package/catalog/cards/G9ProgressBar.md +17 -0
- package/catalog/cards/G9ProgressRing.md +17 -0
- package/catalog/cards/G9Provider.md +17 -0
- package/catalog/cards/G9PullToRefresh.md +13 -0
- package/catalog/cards/G9RadioGroup.md +17 -0
- package/catalog/cards/G9RangeSlider.md +17 -0
- package/catalog/cards/G9RatingInput.md +17 -0
- package/catalog/cards/G9RevealText.md +15 -0
- package/catalog/cards/G9SafeButton.md +17 -0
- package/catalog/cards/G9SafeIconButton.md +17 -0
- package/catalog/cards/G9SaveBar.md +16 -0
- package/catalog/cards/G9ScaleInput.md +17 -0
- package/catalog/cards/G9ScrollSpyBar.md +12 -0
- package/catalog/cards/G9ScrollerScope.md +10 -0
- package/catalog/cards/G9SearchEntry.md +17 -0
- package/catalog/cards/G9Section.md +16 -0
- package/catalog/cards/G9SectionHeader.md +14 -0
- package/catalog/cards/G9Segmented.md +17 -0
- package/catalog/cards/G9Separator.md +17 -0
- package/catalog/cards/G9SettingsGroup.md +13 -0
- package/catalog/cards/G9Sheet.md +13 -0
- package/catalog/cards/G9SheetBackdropScope.md +10 -0
- package/catalog/cards/G9SheetFooter.md +10 -0
- package/catalog/cards/G9SheetFooterBar.md +11 -0
- package/catalog/cards/G9SheetFrame.md +17 -0
- package/catalog/cards/G9SheetHeader.md +11 -0
- package/catalog/cards/G9SheetScrollIndicator.md +10 -0
- package/catalog/cards/G9SheetScrollRegion.md +11 -0
- package/catalog/cards/G9SheetSkeleton.md +13 -0
- package/catalog/cards/G9ShimmerBand.md +10 -0
- package/catalog/cards/G9ShortcutList.md +11 -0
- package/catalog/cards/G9ShortcutsSheet.md +15 -0
- package/catalog/cards/G9SideNav.md +16 -0
- package/catalog/cards/G9Skeleton.md +13 -0
- package/catalog/cards/G9SkeletonPage.md +13 -0
- package/catalog/cards/G9SkeletonRows.md +13 -0
- package/catalog/cards/G9SplitPane.md +17 -0
- package/catalog/cards/G9StatusPill.md +17 -0
- package/catalog/cards/G9StepSlider.md +16 -0
- package/catalog/cards/G9StepTracker.md +13 -0
- package/catalog/cards/G9Stepper.md +17 -0
- package/catalog/cards/G9SuccessHeader.md +14 -0
- package/catalog/cards/G9Swatch.md +13 -0
- package/catalog/cards/G9SwipeGroup.md +11 -0
- package/catalog/cards/G9SwipeView.md +17 -0
- package/catalog/cards/G9Switch.md +17 -0
- package/catalog/cards/G9SwitchGroup.md +15 -0
- package/catalog/cards/G9SwitchRow.md +17 -0
- package/catalog/cards/G9TabBar.md +17 -0
- package/catalog/cards/G9TabView.md +17 -0
- package/catalog/cards/G9Tag.md +14 -0
- package/catalog/cards/G9TagEntry.md +16 -0
- package/catalog/cards/G9TextEntry.md +17 -0
- package/catalog/cards/G9ThemePreviewCard.md +15 -0
- package/catalog/cards/G9TimeEntry.md +17 -0
- package/catalog/cards/G9TimeSpanPicker.md +17 -0
- package/catalog/cards/G9TitleWithLine.md +13 -0
- package/catalog/cards/G9TopBar.md +13 -0
- package/catalog/cards/G9UnsavedBar.md +16 -0
- package/catalog/cards/G9UpdateBar.md +15 -0
- package/catalog/cards/G9VerticalIconTextButton.md +15 -0
- package/catalog/cards/G9VirtualList.md +17 -0
- package/catalog/cards/G9Wave.md +15 -0
- package/catalog/cards/G9WheelColumn.md +17 -0
- package/catalog/cards/PickerField.md +14 -0
- package/catalog/cards/PickerSheetHeader.md +12 -0
- package/catalog/cards/PopupFrame.md +15 -0
- package/catalog/cards/PopupInputForm.md +11 -0
- package/catalog/cards/SelectionValueIcon.md +12 -0
- package/catalog/cards/TimeSpanSheetBody.md +16 -0
- package/catalog/catalog.json +47916 -0
- package/catalog/index.md +159 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/anchor/index.d.ts +1 -1
- package/dist/anchor/index.d.ts.map +1 -1
- package/dist/anchor/registry.d.ts +5 -0
- package/dist/anchor/registry.d.ts.map +1 -1
- package/dist/base/base.css +1 -0
- package/dist/base/base.css.map +1 -1
- package/dist/button/button-variants.css +4 -0
- package/dist/button/button-variants.css.map +1 -1
- package/dist/button/button.css +12 -5
- package/dist/button/button.css.map +1 -1
- package/dist/button/variant-css.d.ts.map +1 -1
- package/dist/button/variant-css.jsx +2 -1
- package/dist/cascade/cascade.css +2 -1
- package/dist/cascade/cascade.css.map +1 -1
- package/dist/commands/commands.css +12 -6
- package/dist/commands/commands.css.map +1 -1
- package/dist/design/design.d.ts +39 -0
- package/dist/design/design.d.ts.map +1 -0
- package/dist/design/design.jsx +54 -0
- package/dist/design/index.d.ts +3 -0
- package/dist/design/index.d.ts.map +1 -0
- package/dist/design/index.jsx +2 -0
- package/dist/design/probe.d.ts +62 -0
- package/dist/design/probe.d.ts.map +1 -0
- package/dist/design/probe.jsx +141 -0
- package/dist/display/data-uri.d.ts +9 -0
- package/dist/display/data-uri.d.ts.map +1 -0
- package/dist/display/data-uri.jsx +56 -0
- package/dist/display/display.css +10 -3
- package/dist/display/display.css.map +1 -1
- package/dist/display/extras.css +8 -2
- package/dist/display/extras.css.map +1 -1
- package/dist/display/figures.css +28 -7
- package/dist/display/figures.css.map +1 -1
- package/dist/display/figures.d.ts +10 -0
- package/dist/display/figures.d.ts.map +1 -1
- package/dist/display/figures.jsx +28 -5
- package/dist/display/image.d.ts +9 -2
- package/dist/display/image.d.ts.map +1 -1
- package/dist/display/image.jsx +20 -6
- package/dist/display/keycap.css +1 -0
- package/dist/display/keycap.css.map +1 -1
- package/dist/display/motion-figures.css +4 -1
- package/dist/display/motion-figures.css.map +1 -1
- package/dist/display/separator.d.ts.map +1 -1
- package/dist/display/separator.jsx +1 -1
- package/dist/display/status.css +5 -0
- package/dist/display/status.css.map +1 -1
- package/dist/display/theme-preview.css +6 -3
- package/dist/display/theme-preview.css.map +1 -1
- package/dist/edge-panel/edge-panel.css +6 -3
- package/dist/edge-panel/edge-panel.css.map +1 -1
- package/dist/effects/effects.css +4 -2
- package/dist/effects/effects.css.map +1 -1
- package/dist/expander/expander.css +2 -1
- package/dist/expander/expander.css.map +1 -1
- package/dist/fields/extra-entries.css +14 -6
- package/dist/fields/extra-entries.css.map +1 -1
- package/dist/fields/fields.css +21 -10
- package/dist/fields/fields.css.map +1 -1
- package/dist/fields/text-entry.d.ts.map +1 -1
- package/dist/fields/text-entry.jsx +3 -0
- package/dist/guide/guide.css +17 -5
- package/dist/guide/guide.css.map +1 -1
- package/dist/header/header.css +6 -2
- package/dist/header/header.css.map +1 -1
- package/dist/icon/icon.d.ts +9 -2
- package/dist/icon/icon.d.ts.map +1 -1
- package/dist/icon/icon.jsx +26 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/layout/layout.css +15 -5
- package/dist/layout/layout.css.map +1 -1
- package/dist/layout/scrollers.d.ts +6 -0
- package/dist/layout/scrollers.d.ts.map +1 -1
- package/dist/layout/scrollers.jsx +5 -1
- package/dist/list/list.css +18 -8
- package/dist/list/list.css.map +1 -1
- package/dist/orb/orb.css +2 -1
- package/dist/orb/orb.css.map +1 -1
- package/dist/pickers/day-stepper.css +2 -1
- package/dist/pickers/day-stepper.css.map +1 -1
- package/dist/pickers/pickers.css +19 -9
- package/dist/pickers/pickers.css.map +1 -1
- package/dist/plus-button/plus-button.css +2 -1
- package/dist/plus-button/plus-button.css.map +1 -1
- package/dist/popover/popover.css +9 -4
- package/dist/popover/popover.css.map +1 -1
- package/dist/popup/popup.css +11 -5
- package/dist/popup/popup.css.map +1 -1
- package/dist/popup/service.d.ts.map +1 -1
- package/dist/popup/service.jsx +5 -1
- package/dist/provider/index.d.ts +1 -1
- package/dist/provider/index.d.ts.map +1 -1
- package/dist/provider/provider.css.map +1 -1
- package/dist/provider/provider.d.ts +25 -1
- package/dist/provider/provider.d.ts.map +1 -1
- package/dist/provider/provider.jsx +48 -12
- package/dist/range-slider/range-slider.css +9 -4
- package/dist/range-slider/range-slider.css.map +1 -1
- package/dist/selection/selection.css +10 -5
- package/dist/selection/selection.css.map +1 -1
- package/dist/sheet/frame.d.ts +6 -0
- package/dist/sheet/frame.d.ts.map +1 -1
- package/dist/sheet/frame.jsx +5 -1
- package/dist/sheet/header.d.ts.map +1 -1
- package/dist/sheet/header.jsx +5 -2
- package/dist/sheet/service.d.ts +5 -0
- package/dist/sheet/service.d.ts.map +1 -1
- package/dist/sheet/service.jsx +9 -6
- package/dist/sheet/sheet.css +1 -0
- package/dist/sheet/sheet.css.map +1 -1
- package/dist/shell/shell.css +19 -8
- package/dist/shell/shell.css.map +1 -1
- package/dist/survey/survey.css +15 -7
- package/dist/survey/survey.css.map +1 -1
- package/dist/swipe/swipe.css +1 -0
- package/dist/swipe/swipe.css.map +1 -1
- package/dist/tab-bar/index.d.ts +1 -1
- package/dist/tab-bar/index.d.ts.map +1 -1
- package/dist/tab-bar/index.jsx +1 -1
- package/dist/tab-bar/model.d.ts +14 -0
- package/dist/tab-bar/model.d.ts.map +1 -1
- package/dist/tab-bar/model.jsx +19 -1
- package/dist/tab-bar/tab-bar.css +4 -1
- 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 +12 -8
- package/dist/tabs/tabs.css +3 -1
- package/dist/tabs/tabs.css.map +1 -1
- package/dist/toast/toast.css +9 -4
- package/dist/toast/toast.css.map +1 -1
- package/dist/toggle/choice.css +15 -6
- package/dist/toggle/choice.css.map +1 -1
- package/dist/toggle/toggle.css +12 -6
- package/dist/toggle/toggle.css.map +1 -1
- package/package.json +16 -4
- package/skills/g9-lynx-app/SKILL.md +42 -0
- package/skills/g9-lynx-app/references/adaptive-layout.md +10 -0
- package/skills/g9-lynx-app/references/anchors-guide.md +9 -0
- package/skills/g9-lynx-app/references/catalog-index.md +80 -0
- package/skills/g9-lynx-app/references/common-mistakes.md +12 -0
- package/skills/g9-lynx-app/references/components/anchor.md +30 -0
- package/skills/g9-lynx-app/references/components/barcode-qr.md +19 -0
- package/skills/g9-lynx-app/references/components/barcode.md +37 -0
- package/skills/g9-lynx-app/references/components/base.md +35 -0
- package/skills/g9-lynx-app/references/components/button.md +125 -0
- package/skills/g9-lynx-app/references/components/calendar.md +128 -0
- package/skills/g9-lynx-app/references/components/cascade.md +19 -0
- package/skills/g9-lynx-app/references/components/charts.md +193 -0
- package/skills/g9-lynx-app/references/components/chat.md +98 -0
- package/skills/g9-lynx-app/references/components/commands.md +45 -0
- package/skills/g9-lynx-app/references/components/commerce.md +69 -0
- package/skills/g9-lynx-app/references/components/datagrid.md +19 -0
- package/skills/g9-lynx-app/references/components/deferred.md +19 -0
- package/skills/g9-lynx-app/references/components/design.md +27 -0
- package/skills/g9-lynx-app/references/components/display-1.md +193 -0
- package/skills/g9-lynx-app/references/components/display-2.md +196 -0
- package/skills/g9-lynx-app/references/components/display-3.md +122 -0
- package/skills/g9-lynx-app/references/components/edge-panel.md +19 -0
- package/skills/g9-lynx-app/references/components/effects.md +46 -0
- package/skills/g9-lynx-app/references/components/expander.md +19 -0
- package/skills/g9-lynx-app/references/components/fields.md +174 -0
- package/skills/g9-lynx-app/references/components/header.md +19 -0
- package/skills/g9-lynx-app/references/components/host.md +32 -0
- package/skills/g9-lynx-app/references/components/icon.md +64 -0
- package/skills/g9-lynx-app/references/components/intro-carousel.md +19 -0
- package/skills/g9-lynx-app/references/components/layout-1.md +188 -0
- package/skills/g9-lynx-app/references/components/layout-2.md +18 -0
- package/skills/g9-lynx-app/references/components/list.md +116 -0
- package/skills/g9-lynx-app/references/components/map.md +19 -0
- package/skills/g9-lynx-app/references/components/media.md +115 -0
- package/skills/g9-lynx-app/references/components/orb.md +37 -0
- package/skills/g9-lynx-app/references/components/pickers.md +185 -0
- package/skills/g9-lynx-app/references/components/pilot.md +40 -0
- package/skills/g9-lynx-app/references/components/plus-button.md +19 -0
- package/skills/g9-lynx-app/references/components/popover.md +94 -0
- package/skills/g9-lynx-app/references/components/popup.md +56 -0
- package/skills/g9-lynx-app/references/components/provider.md +43 -0
- package/skills/g9-lynx-app/references/components/range-slider.md +36 -0
- package/skills/g9-lynx-app/references/components/route.md +19 -0
- package/skills/g9-lynx-app/references/components/sheet.md +134 -0
- package/skills/g9-lynx-app/references/components/shell.md +98 -0
- package/skills/g9-lynx-app/references/components/survey.md +55 -0
- package/skills/g9-lynx-app/references/components/swipe.md +31 -0
- package/skills/g9-lynx-app/references/components/tab-bar.md +19 -0
- package/skills/g9-lynx-app/references/components/tabs.md +19 -0
- package/skills/g9-lynx-app/references/components/toggle.md +161 -0
- package/skills/g9-lynx-app/references/lists.md +13 -0
- package/skills/g9-lynx-app/references/localization-rtl.md +13 -0
- package/skills/g9-lynx-app/references/navigation-route.md +21 -0
- package/skills/g9-lynx-app/references/overlays.md +27 -0
- package/skills/g9-lynx-app/references/pilot.md +10 -0
- package/skills/g9-lynx-app/references/platform-rules.md +42 -0
- package/skills/g9-lynx-app/references/provider-and-host.md +37 -0
- package/skills/g9-lynx-app/references/theming.md +18 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# `@g9tm/lynxcontrols/toggle` (generated)
|
|
2
|
+
|
|
3
|
+
# G9CheckBox
|
|
4
|
+
|
|
5
|
+
`import { G9CheckBox } from '@g9tm/lynxcontrols/toggle';`
|
|
6
|
+
|
|
7
|
+
Tri-state check box (MAUI `G9CheckBox`, ADR-0028): tap toggles, indeterminate → checked, never into indeterminate.
|
|
8
|
+
|
|
9
|
+
Props:
|
|
10
|
+
- `text?`: string
|
|
11
|
+
- `checked?`: boolean
|
|
12
|
+
- `onPress?`: (checked: boolean) => void
|
|
13
|
+
- `disabled?`: boolean = false
|
|
14
|
+
- `onCheckedChange?`: (checked: boolean) => void
|
|
15
|
+
- `onIndeterminateChange?`: (indeterminate: boolean) => void
|
|
16
|
+
- `defaultChecked?`: boolean
|
|
17
|
+
- `defaultIndeterminate?`: boolean
|
|
18
|
+
|
|
19
|
+
Example: `<G9CheckBox text="I agree" checked={agree} onCheckedChange={setAgree} />`
|
|
20
|
+
|
|
21
|
+
# G9Chip
|
|
22
|
+
|
|
23
|
+
`import { G9Chip } from '@g9tm/lynxcontrols/toggle';`
|
|
24
|
+
|
|
25
|
+
One chip (SAC Chip, G9Hub Chip, ShopManager chip): a filter, a choice, a removable tag.
|
|
26
|
+
|
|
27
|
+
Props:
|
|
28
|
+
- `text`: string
|
|
29
|
+
- `selected?`: boolean
|
|
30
|
+
- `size?`: 'sm' | 'md' | 'lg' = "md"
|
|
31
|
+
- `icon?`: icon
|
|
32
|
+
- `onPress?`: () => void
|
|
33
|
+
- `disabled?`: boolean = false
|
|
34
|
+
- `tone?`: 'primary' | 'info' | 'success' | 'warning' | 'error' | 'accent' | 'neutral' = "primary"
|
|
35
|
+
- `onRemove?`: () => void
|
|
36
|
+
|
|
37
|
+
Example: `<G9Chip text="Label" />`
|
|
38
|
+
|
|
39
|
+
# G9ChipGroup
|
|
40
|
+
|
|
41
|
+
`import { G9ChipGroup } from '@g9tm/lynxcontrols/toggle';`
|
|
42
|
+
|
|
43
|
+
Chip group (MAUI `G9ChipGroup`): single or multi selection by item identity, wrap or single-line scroll, colour transition (140 ms) and check mark (120 ms) in CSS, press pulse 0.94 on the main thread.
|
|
44
|
+
|
|
45
|
+
Props:
|
|
46
|
+
- `items`: object[]
|
|
47
|
+
- `disabled?`: boolean = false
|
|
48
|
+
- `selectionMode?`: 'multiSelection' | 'singleSelection' = "multiSelection"
|
|
49
|
+
- `onSelectedKeyChange?`: (key: string | null, item: G9SelectionItem<unknown> | null) => void
|
|
50
|
+
- `onSelectedKeysChange?`: (keys: readonly string[]) => void
|
|
51
|
+
- `onSelectionChange?`: (items: readonly G9SelectionItem<unknown>[]) => void
|
|
52
|
+
- `chipCornerRadius?`: number = 9
|
|
53
|
+
- `chipHeight?`: number = 36
|
|
54
|
+
|
|
55
|
+
Example: `<G9ChipGroup items={items} />`
|
|
56
|
+
|
|
57
|
+
# G9RadioGroup
|
|
58
|
+
|
|
59
|
+
`import { G9RadioGroup } from '@g9tm/lynxcontrols/toggle';`
|
|
60
|
+
|
|
61
|
+
One choice of several (G9Hub RadioGroup, mardomi Radio, payment and delivery options).
|
|
62
|
+
|
|
63
|
+
Props:
|
|
64
|
+
- `options`: object[]
|
|
65
|
+
- `value?`: string
|
|
66
|
+
- `onChange?`: (key: K) => void
|
|
67
|
+
- `disabled?`: boolean = false
|
|
68
|
+
- `appearance?`: 'list' | 'cards'
|
|
69
|
+
- `defaultValue?`: string
|
|
70
|
+
- `haptic?`: boolean | string | string | string | string | string | string | string | string | string
|
|
71
|
+
- `accessibilityLabel?`: string
|
|
72
|
+
|
|
73
|
+
Example: `<G9RadioGroup options={options} />`
|
|
74
|
+
|
|
75
|
+
# G9RatingInput
|
|
76
|
+
|
|
77
|
+
`import { G9RatingInput } from '@g9tm/lynxcontrols/toggle';`
|
|
78
|
+
|
|
79
|
+
Stars (ShopManager AfterDelivery Stars): each star a 44 dp target with its own label.
|
|
80
|
+
|
|
81
|
+
Props:
|
|
82
|
+
- `value?`: number
|
|
83
|
+
- `size?`: number
|
|
84
|
+
- `onChange?`: (value: number) => void
|
|
85
|
+
- `disabled?`: boolean = false
|
|
86
|
+
- `defaultValue?`: number
|
|
87
|
+
- `readOnly?`: boolean
|
|
88
|
+
- `haptic?`: boolean | string | string | string | string | string | string | string | string | string
|
|
89
|
+
- `labels?`: string[]
|
|
90
|
+
|
|
91
|
+
Example: `<G9RatingInput />`
|
|
92
|
+
|
|
93
|
+
# G9Segmented
|
|
94
|
+
|
|
95
|
+
`import { G9Segmented } from '@g9tm/lynxcontrols/toggle';`
|
|
96
|
+
|
|
97
|
+
A segmented control (SAC Seg + kit Segmented, ShopManager seg, G9Hub Segmented, Riskara Seg).
|
|
98
|
+
|
|
99
|
+
Props:
|
|
100
|
+
- `items`: object[]
|
|
101
|
+
- `value?`: string
|
|
102
|
+
- `size?`: 'sm' | 'md' | 'lg' = "md"
|
|
103
|
+
- `onChange?`: (key: K) => void
|
|
104
|
+
- `disabled?`: boolean = false
|
|
105
|
+
- `appearance?`: 'filled' | 'lift' | 'underline' = "lift"
|
|
106
|
+
- `defaultValue?`: string
|
|
107
|
+
- `fit?`: 'content' | 'equal'
|
|
108
|
+
|
|
109
|
+
Example: `<G9Segmented items={items} />`
|
|
110
|
+
|
|
111
|
+
# G9Stepper
|
|
112
|
+
|
|
113
|
+
`import { G9Stepper } from '@g9tm/lynxcontrols/toggle';`
|
|
114
|
+
|
|
115
|
+
− value + (SAC Stepper, ShopManager stepper and AddControl, mardomi Stepper), with an optional collapsed "add" state.
|
|
116
|
+
|
|
117
|
+
Props:
|
|
118
|
+
- `value?`: number
|
|
119
|
+
- `size?`: 'sm' | 'md' | 'lg' = "md"
|
|
120
|
+
- `onChange?`: (value: number) => void
|
|
121
|
+
- `disabled?`: boolean = false
|
|
122
|
+
- `format?`: (value: number) => void
|
|
123
|
+
- `block?`: boolean
|
|
124
|
+
- `defaultValue?`: number
|
|
125
|
+
- `collapsedAtMin?`: string | boolean | boolean
|
|
126
|
+
|
|
127
|
+
Example: `<G9Stepper />`
|
|
128
|
+
|
|
129
|
+
# G9Switch
|
|
130
|
+
|
|
131
|
+
`import { G9Switch } from '@g9tm/lynxcontrols/toggle';`
|
|
132
|
+
|
|
133
|
+
Switch (MAUI `G9Switch`): 56 × 32 track, 24 px thumb that stretches while travelling, 240 ms spring-like CSS transition, tick/dot track mark; RTL moves the "on" side to the left unless `toggles.switchMirrorInRtl` is fals
|
|
134
|
+
|
|
135
|
+
Props:
|
|
136
|
+
- `title?`: string
|
|
137
|
+
- `checked?`: boolean
|
|
138
|
+
- `disabled?`: boolean = false
|
|
139
|
+
- `onCheckedChange?`: (checked: boolean) => void
|
|
140
|
+
- `description?`: string
|
|
141
|
+
- `defaultChecked?`: boolean
|
|
142
|
+
- `isInFormRow?`: boolean = false
|
|
143
|
+
- `isRequired?`: boolean = false
|
|
144
|
+
|
|
145
|
+
Example: `<G9Switch isInFormRow title="Sync" checked={sync} onCheckedChange={setSync} />`
|
|
146
|
+
|
|
147
|
+
# G9SwitchGroup
|
|
148
|
+
|
|
149
|
+
`import { G9SwitchGroup } from '@g9tm/lynxcontrols/toggle';`
|
|
150
|
+
|
|
151
|
+
A vertical group of switches (MAUI `G9SwitchGroup`): counts its switches (nearest group only, as MAUI's direct children), optionally keeps one on and shows a live `active / total` status.
|
|
152
|
+
|
|
153
|
+
Props:
|
|
154
|
+
- `children?`: ReactNode
|
|
155
|
+
- `disabled?`: boolean = false
|
|
156
|
+
- `onActiveCountChange?`: (active: number, total: number) => void
|
|
157
|
+
- `minOneActive?`: boolean = false
|
|
158
|
+
- `showLiveStatus?`: boolean = false
|
|
159
|
+
- `accessibilityLabel?`: string
|
|
160
|
+
|
|
161
|
+
Example: `<G9SwitchGroup />`
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Lists
|
|
2
|
+
|
|
3
|
+
```tsx
|
|
4
|
+
<G9Page title="Orders" scroll={false}>
|
|
5
|
+
<G9VirtualList items={orders} getKey={(o) => o.id} renderItem={(o) => <G9ListRow title={o.name} />} />
|
|
6
|
+
</G9Page>
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
- **Long lists**: `G9VirtualList` (Lynx `<list>`, rows realized as they scroll); a short list is a plain column.
|
|
10
|
+
- **Rows**: `G9ListRow` (`title`, `subtitle`, `value`, `icon`, `trailing`, `onPress`), grouped in `G9SettingsGroup`.
|
|
11
|
+
- **Grids and tables**: `G9Columns` (columns from the layout class), `G9DataGrid` (`@g9tm/lynxcontrols-datagrid`).
|
|
12
|
+
- **Swipe actions**: `G9SwipeView` rows in a `G9SwipeGroup`; **pull to refresh**: `G9PullToRefresh`.
|
|
13
|
+
- Give each row a stable key and, where a test or a person acts on it, an `id`.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Localization, RTL, calendars and digits
|
|
2
|
+
|
|
3
|
+
- **Culture**: `createCultureStore('fa-IR')` (Persian → RTL, the Persian calendar, Persian digits); switch with
|
|
4
|
+
`useG9CultureStore().setCulture('en')`. Readers: `useG9Culture()`, `useG9Direction()`.
|
|
5
|
+
- **Direction**: every G9 control mirrors itself. Your own rows: `style={g9RowStyle(direction)}`; your own text
|
|
6
|
+
alignment: `g9TextStart(direction)`; a `--rtl` modifier class for anything else. Never rely on CSS `direction`.
|
|
7
|
+
- **Digits and numbers**: `formatNumber(value, culture)`, `toNativeDigits(text, 'persian')`. A G9 field stores ASCII
|
|
8
|
+
digits and draws the culture's; a Latin number inside Persian text is a finding of G9AppPilot's watch.
|
|
9
|
+
- **Words**: the library's own words (OK, Cancel, Search…) come from string tables: pass `g9BuiltInStringTables` in
|
|
10
|
+
the provider's `settings.strings.tables`; the app's own words come from its own tables or code.
|
|
11
|
+
- **Fonts**: an Arabic-script font goes in `shape.fonts.arabic`; Arabic script never gets letter spacing.
|
|
12
|
+
- **Calendars**: the date pickers and the calendar package use the culture's calendar; values stay Gregorian
|
|
13
|
+
`G9LocalDateTime`.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Navigation, the app shell, routes
|
|
2
|
+
|
|
3
|
+
```tsx
|
|
4
|
+
<G9AppShell id="App.Shell" destinations={destinations} value={screen} onChange={setScreen} topBar={{ title: 'App' }}>
|
|
5
|
+
{screens.map((key) => (
|
|
6
|
+
<G9KeepAlive key={key} active={key === screen}>
|
|
7
|
+
<G9Place segment={{ kind: key }} layer="root" active={key === screen}>
|
|
8
|
+
<Screen name={key} />
|
|
9
|
+
</G9Place>
|
|
10
|
+
</G9KeepAlive>
|
|
11
|
+
))}
|
|
12
|
+
</G9AppShell>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
- **`G9AppShell`**: a tab bar on a phone (extra destinations go to «More» with `phoneOverflow`), a rail on a tablet,
|
|
16
|
+
a side nav on a desktop. `G9KeepAlive` keeps a visited screen mounted (a tab switch is a style change).
|
|
17
|
+
- **A screen**: `G9Page` with a `G9AppBar` header (`large` and `safeTop` on a phone: the status bar's inset).
|
|
18
|
+
- **Routes**: `createG9Router({ catalogue: createCatalogue(places), context, language })` passed as
|
|
19
|
+
`services.route`; each screen declares itself with `G9Place`. Then deep links and G9AppPilot's `g9.where` / `g9.go`
|
|
20
|
+
reach every place.
|
|
21
|
+
- **Tabs inside a screen**: `G9TabView`; a bottom bar on its own: `G9TabBar`.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Overlays: sheets, popups, toasts, menus, the palette
|
|
2
|
+
|
|
3
|
+
All need a `G9Host` above them.
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
const sheets = useG9Sheets();
|
|
7
|
+
const handle = sheets.show(<FarmDetails />, { title: 'Farm', showCloseButton: true });
|
|
8
|
+
const { reason } = await handle!.result; // closed, overlayTap, drag, …
|
|
9
|
+
sheets.show(() => <HeavyList />, { loadingSkeleton: 'listRows' }); // the body built after the sheet rises
|
|
10
|
+
const pick = await showSelectionSheet(sheets, { title: 'Crop', items, selectedItems: [current] });
|
|
11
|
+
|
|
12
|
+
const popups = useG9Popups();
|
|
13
|
+
await popups.showSuccess('Saved');
|
|
14
|
+
if (await popups.showConfirm('Discard the draft?', { type: 'warning' })) discard();
|
|
15
|
+
const form = await popups.showInput({ title: 'Name', fields: [g9PopupInputField.text('name', 'Name')] });
|
|
16
|
+
|
|
17
|
+
const toasts = useG9Toasts();
|
|
18
|
+
toasts.showToast('Item deleted', 'warning', { actionText: 'Undo', action: undo });
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
- **Declarative**: `<G9Sheet open onOpenChange options={fitToContentSheetOptions()}>`;
|
|
22
|
+
`fullScreenModalSheetOptions(title)` for a full-screen editor.
|
|
23
|
+
- **Adaptive**: on a wide window a sheet presents as a dialog or a side panel; `G9Menu` (anchored by `anchorId`) is a
|
|
24
|
+
popover on a wide window and an action sheet on a phone (`G9ActionSheet` on its own); `G9ContextMenu` opens on a
|
|
25
|
+
long press; `G9CommandPalette` with `useG9Shortcut('mod+k', …)`.
|
|
26
|
+
- **Outside components**: `g9Sheets()`, `g9Popups()` reach the active host.
|
|
27
|
+
- **Back** closes the top overlay first. A popup's primary button stays at the reading end in both directions.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# G9AppPilot in an app
|
|
2
|
+
|
|
3
|
+
- `g9pilot.config.json` names the environments (`store`: nothing; `observe`: the watch, no transport; `support` /
|
|
4
|
+
`full`: the signed bridge). `G9_PILOT_ENV=<env>` selects one at build time; `pluginG9Pilot()`
|
|
5
|
+
(`@g9tm/lynxcontrols-pilot/rspeedy`) resolves it.
|
|
6
|
+
- Wrap the app inside its `G9Host` with `<G9PilotHost>`: in a store build it renders its children and costs nothing.
|
|
7
|
+
- The watch (`observe` and up) finds JS errors, controls without a name, translation keys on screen, controls cut by
|
|
8
|
+
the screen's edge, Latin digits in Persian text and long frames; on the web the page reads them through
|
|
9
|
+
`@g9tm/lynxcontrols-web` (`g9WebFindings`).
|
|
10
|
+
- A store build must never carry the bridge: `g9pilot-check` proves it on the bundle or the APK / IPA.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Lynx platform rules for an app
|
|
2
|
+
|
|
3
|
+
A ReactLynx app runs on Lynx, not in a browser — even when Lynx for Web draws it in one. These hold on every target
|
|
4
|
+
(Android, iOS, Windows, macOS, web).
|
|
5
|
+
|
|
6
|
+
## What does not exist
|
|
7
|
+
|
|
8
|
+
- **No `Intl`, `toLocale*`, `BigInt`, DOM, `window`, `document`, `localStorage` in the app's code.** Numbers, dates
|
|
9
|
+
and digits go through the culture (`formatNumber`, `toNativeDigits`, `useG9Culture`); preferences through the
|
|
10
|
+
provider's `services.preferences`.
|
|
11
|
+
- **No CSS `@media`.** A layout follows the provider's layout class (`useG9Layout`), which follows the LynxView's own
|
|
12
|
+
size, not the screen's.
|
|
13
|
+
- **Timers are identifiers of the bundle's scope** (`setTimeout(...)`), never `globalThis.setTimeout`; library code
|
|
14
|
+
uses `g9RuntimeTimers`. `lynx` is an identifier too, never `globalThis.lynx`.
|
|
15
|
+
|
|
16
|
+
## CSS on Lynx
|
|
17
|
+
|
|
18
|
+
- `direction` does not inherit, and some engines ignore it: a row mirrors through `g9RowStyle(direction)` or a
|
|
19
|
+
`--rtl` modifier class, text aligns with `g9TextStart`, never with `direction` alone.
|
|
20
|
+
- Prefer one class per selector; descendant selectors cost a match on every class change of an ancestor.
|
|
21
|
+
- Inline `var(--g9-…)` needs the build plugin: `plugins: [pluginReactLynx(), pluginG9Lynx()]` in `lynx.config.ts`
|
|
22
|
+
(`import { pluginG9Lynx } from '@g9tm/lynxcontrols/rspeedy'`).
|
|
23
|
+
- Import a stylesheet from the `.tsx` that renders it, never from a barrel file.
|
|
24
|
+
- A text does not inherit text styles from a `view`: set the font size, weight and colour on the text's own class.
|
|
25
|
+
- On Lynx Android the `flex: 1` shorthand may leave row children at their content width; give equal shares an
|
|
26
|
+
explicit `width`.
|
|
27
|
+
|
|
28
|
+
## Threads
|
|
29
|
+
|
|
30
|
+
ReactLynx renders the first screen on the main thread and hydrates on the background thread. A `'main thread'`
|
|
31
|
+
worklet calls only other `'main thread'` functions. Native modules (`NativeModules`) live on the background thread:
|
|
32
|
+
read them in effects or handlers, not during the first render.
|
|
33
|
+
|
|
34
|
+
## Fonts
|
|
35
|
+
|
|
36
|
+
A theme font (`shape.fonts`) must be a font the host has: register the font files (`@font-face` or the host's font
|
|
37
|
+
setup). Generic names (`serif`, `monospace`) are drawn in the default font on some Android engines.
|
|
38
|
+
|
|
39
|
+
## Evidence
|
|
40
|
+
|
|
41
|
+
A Node test compiles the code and paints nothing. After touching styles, layout, direction or timers, run the app on a
|
|
42
|
+
device, the desktop window or the browser, and look at the frames.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# The provider and the host
|
|
2
|
+
|
|
3
|
+
```tsx
|
|
4
|
+
import { G9Host } from '@g9tm/lynxcontrols/host';
|
|
5
|
+
import { G9Provider } from '@g9tm/lynxcontrols/provider';
|
|
6
|
+
import { createCultureStore } from '@g9tm/lynxcontrols-foundation/culture';
|
|
7
|
+
import { createThemeStore } from '@g9tm/lynxcontrols-foundation/theme';
|
|
8
|
+
|
|
9
|
+
const culture = createCultureStore('fa-IR');
|
|
10
|
+
const theme = createThemeStore({ mode: 'system' });
|
|
11
|
+
|
|
12
|
+
root.render(
|
|
13
|
+
<G9Provider services={services} culture={culture} theme={theme}>
|
|
14
|
+
<G9Host name="app">
|
|
15
|
+
<Shell />
|
|
16
|
+
</G9Host>
|
|
17
|
+
</G9Provider>,
|
|
18
|
+
);
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
- **One `G9Provider` per LynxView.** It carries the services, the culture, the theme, the layout class, the keyboard,
|
|
22
|
+
the safe-area insets and the shared safe executor. Pass stable objects (create stores once).
|
|
23
|
+
- **Services**: `clock`, `preferences`, `host` are required (a missing one throws `G9CapabilityMissingError`). On
|
|
24
|
+
Android, iOS and the web: `createNativeHostServices()` from `@g9tm/lynxcontrols-native` (`host`, `preferences`) and
|
|
25
|
+
`createSystemClock()`; in tests and the first render, `createMemoryPreferenceStore()` and a memory host. Optional
|
|
26
|
+
services (`speech`, `scanner`, `media`, `route`) unlock the features that ask for them.
|
|
27
|
+
- **One `G9Host` per page or app shell.** Sheets, popups, toasts, menus and the page-loading cover live in its layers;
|
|
28
|
+
`useG9Sheets()` / `useG9Popups()` / `useG9Toasts()` throw `host-missing` outside one. The back event (Android back,
|
|
29
|
+
desktop Escape) goes to the active host first: the top overlay closes, else the page's back stack, else
|
|
30
|
+
`services.host.exit()`.
|
|
31
|
+
- **Settings** (`settings` prop): string tables (`g9BuiltInStringTables` for the library's own words in Persian and
|
|
32
|
+
Arabic), sheet, popup, toast and field defaults, the back event's name.
|
|
33
|
+
- **Previews** (a design tool): `preview={{ layout, window, insets, keyboardHeight }}` forces what the platform
|
|
34
|
+
reports, for one provider.
|
|
35
|
+
- **Hooks**: `useG9Culture()`, `useG9Direction()`, `useG9Theme()`, `useG9Layout()`, `useG9Window()`,
|
|
36
|
+
`useG9SafeInsets()`, `useG9Keyboard()`, `useG9Preferences()`, `useG9Executor()`, `useG9CultureStore()` (switch the
|
|
37
|
+
culture: `setCulture('en')`).
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Theming
|
|
2
|
+
|
|
3
|
+
- **The palette**: 95 colour tokens (`--g9-primary`, `--g9-surface`, `--g9-text-primary`, …), their stock light and
|
|
4
|
+
dark values in the foundation catalog's `design.tokens`. In styles: `var(--g9-text-primary)`; in code:
|
|
5
|
+
`g9Token('Primary')`.
|
|
6
|
+
- **Mode**: `createThemeStore({ mode: 'system' })` (or `'light'`, `'dark'`); pass the platform's scheme to the
|
|
7
|
+
provider's `systemScheme`. A theme change repaints through CSS variables: no React render except `useG9Theme()`
|
|
8
|
+
readers.
|
|
9
|
+
- **A brand from one colour**: `createBrandPalette({ primary: '#2E7D32' }, 'light')`, or a theme definition with a
|
|
10
|
+
recipe (`tonal`, `neutral`, `tinted`, …; `stock` keeps the MAUI palettes and ignores the brand) applied with
|
|
11
|
+
`applyThemeDefinition(store, definition)`. Every brand recipe meets the contrast rules (`contrastFailures` checks a
|
|
12
|
+
palette).
|
|
13
|
+
- **A full palette from a server**: `store.apply(values)`; layers: `setPalettes`, `setOverrides`.
|
|
14
|
+
- **Shape** (`shape` prop or a definition's `shape`): `radii` by role, `heights` (sm / md / lg), the type scale,
|
|
15
|
+
`fonts` per script (`latin`, `arabic`, `mono`: every G9 text reads `--g9-font-text`), `density`
|
|
16
|
+
(`compact` / `regular` / `comfortable`), `touchTarget` (never under 44).
|
|
17
|
+
- **Your own components**: read colours from `useG9Theme().palette` and derive with `withAlpha`, `darken`, `mix`
|
|
18
|
+
once per theme change, never per frame. G9's look uses no shadows: elevation is surface tokens and borders.
|