@bacon-pos/ui 0.1.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/LICENSE +21 -0
- package/README.md +236 -0
- package/lib/commonjs/components/Avatar/Avatar.js +96 -0
- package/lib/commonjs/components/Avatar/Avatar.js.map +1 -0
- package/lib/commonjs/components/Avatar/Avatar.stories.js +87 -0
- package/lib/commonjs/components/Avatar/Avatar.stories.js.map +1 -0
- package/lib/commonjs/components/Avatar/Avatar.test.js +63 -0
- package/lib/commonjs/components/Avatar/Avatar.test.js.map +1 -0
- package/lib/commonjs/components/Avatar/index.js +13 -0
- package/lib/commonjs/components/Avatar/index.js.map +1 -0
- package/lib/commonjs/components/Button/Button.js +201 -0
- package/lib/commonjs/components/Button/Button.js.map +1 -0
- package/lib/commonjs/components/Button/Button.stories.js +139 -0
- package/lib/commonjs/components/Button/Button.stories.js.map +1 -0
- package/lib/commonjs/components/Button/Button.test.js +64 -0
- package/lib/commonjs/components/Button/Button.test.js.map +1 -0
- package/lib/commonjs/components/Button/index.js +13 -0
- package/lib/commonjs/components/Button/index.js.map +1 -0
- package/lib/commonjs/components/Card/Card.js +129 -0
- package/lib/commonjs/components/Card/Card.js.map +1 -0
- package/lib/commonjs/components/Card/Card.stories.js +87 -0
- package/lib/commonjs/components/Card/Card.stories.js.map +1 -0
- package/lib/commonjs/components/Card/Card.test.js +51 -0
- package/lib/commonjs/components/Card/Card.test.js.map +1 -0
- package/lib/commonjs/components/Card/index.js +13 -0
- package/lib/commonjs/components/Card/index.js.map +1 -0
- package/lib/commonjs/components/Checkbox/Checkbox.js +75 -0
- package/lib/commonjs/components/Checkbox/Checkbox.js.map +1 -0
- package/lib/commonjs/components/Checkbox/Checkbox.stories.js +69 -0
- package/lib/commonjs/components/Checkbox/Checkbox.stories.js.map +1 -0
- package/lib/commonjs/components/Checkbox/Checkbox.test.js +62 -0
- package/lib/commonjs/components/Checkbox/Checkbox.test.js.map +1 -0
- package/lib/commonjs/components/Checkbox/index.js +13 -0
- package/lib/commonjs/components/Checkbox/index.js.map +1 -0
- package/lib/commonjs/components/Chip/Chip.js +119 -0
- package/lib/commonjs/components/Chip/Chip.js.map +1 -0
- package/lib/commonjs/components/Chip/Chip.stories.js +112 -0
- package/lib/commonjs/components/Chip/Chip.stories.js.map +1 -0
- package/lib/commonjs/components/Chip/Chip.test.js +63 -0
- package/lib/commonjs/components/Chip/Chip.test.js.map +1 -0
- package/lib/commonjs/components/Chip/ChipGroup.js +54 -0
- package/lib/commonjs/components/Chip/ChipGroup.js.map +1 -0
- package/lib/commonjs/components/Chip/ChipGroup.stories.js +78 -0
- package/lib/commonjs/components/Chip/ChipGroup.stories.js.map +1 -0
- package/lib/commonjs/components/Chip/ChipGroup.test.js +70 -0
- package/lib/commonjs/components/Chip/ChipGroup.test.js.map +1 -0
- package/lib/commonjs/components/Chip/index.js +20 -0
- package/lib/commonjs/components/Chip/index.js.map +1 -0
- package/lib/commonjs/components/CodeInput/CodeInput.js +163 -0
- package/lib/commonjs/components/CodeInput/CodeInput.js.map +1 -0
- package/lib/commonjs/components/CodeInput/CodeInput.stories.js +98 -0
- package/lib/commonjs/components/CodeInput/CodeInput.stories.js.map +1 -0
- package/lib/commonjs/components/CodeInput/CodeInput.test.js +74 -0
- package/lib/commonjs/components/CodeInput/CodeInput.test.js.map +1 -0
- package/lib/commonjs/components/CodeInput/index.js +13 -0
- package/lib/commonjs/components/CodeInput/index.js.map +1 -0
- package/lib/commonjs/components/Icon/Icon.js +32 -0
- package/lib/commonjs/components/Icon/Icon.js.map +1 -0
- package/lib/commonjs/components/Icon/Icon.stories.js +94 -0
- package/lib/commonjs/components/Icon/Icon.stories.js.map +1 -0
- package/lib/commonjs/components/Icon/Icon.test.js +38 -0
- package/lib/commonjs/components/Icon/Icon.test.js.map +1 -0
- package/lib/commonjs/components/Icon/icons.generated.js +179 -0
- package/lib/commonjs/components/Icon/icons.generated.js.map +1 -0
- package/lib/commonjs/components/Icon/index.js +20 -0
- package/lib/commonjs/components/Icon/index.js.map +1 -0
- package/lib/commonjs/components/IconButton/IconButton.js +139 -0
- package/lib/commonjs/components/IconButton/IconButton.js.map +1 -0
- package/lib/commonjs/components/IconButton/IconButton.stories.js +119 -0
- package/lib/commonjs/components/IconButton/IconButton.stories.js.map +1 -0
- package/lib/commonjs/components/IconButton/IconButton.test.js +55 -0
- package/lib/commonjs/components/IconButton/IconButton.test.js.map +1 -0
- package/lib/commonjs/components/IconButton/index.js +13 -0
- package/lib/commonjs/components/IconButton/index.js.map +1 -0
- package/lib/commonjs/components/Input/Input.js +176 -0
- package/lib/commonjs/components/Input/Input.js.map +1 -0
- package/lib/commonjs/components/Input/Input.stories.js +116 -0
- package/lib/commonjs/components/Input/Input.stories.js.map +1 -0
- package/lib/commonjs/components/Input/Input.test.js +103 -0
- package/lib/commonjs/components/Input/Input.test.js.map +1 -0
- package/lib/commonjs/components/Input/index.js +13 -0
- package/lib/commonjs/components/Input/index.js.map +1 -0
- package/lib/commonjs/components/LinkButton/LinkButton.js +95 -0
- package/lib/commonjs/components/LinkButton/LinkButton.js.map +1 -0
- package/lib/commonjs/components/LinkButton/LinkButton.stories.js +91 -0
- package/lib/commonjs/components/LinkButton/LinkButton.stories.js.map +1 -0
- package/lib/commonjs/components/LinkButton/LinkButton.test.js +61 -0
- package/lib/commonjs/components/LinkButton/LinkButton.test.js.map +1 -0
- package/lib/commonjs/components/LinkButton/index.js +13 -0
- package/lib/commonjs/components/LinkButton/index.js.map +1 -0
- package/lib/commonjs/components/ProductCard/ProductCard.js +167 -0
- package/lib/commonjs/components/ProductCard/ProductCard.js.map +1 -0
- package/lib/commonjs/components/ProductCard/ProductCard.stories.js +118 -0
- package/lib/commonjs/components/ProductCard/ProductCard.stories.js.map +1 -0
- package/lib/commonjs/components/ProductCard/ProductCard.test.js +69 -0
- package/lib/commonjs/components/ProductCard/ProductCard.test.js.map +1 -0
- package/lib/commonjs/components/ProductCard/index.js +13 -0
- package/lib/commonjs/components/ProductCard/index.js.map +1 -0
- package/lib/commonjs/components/QuantityStepper/QuantityStepper.js +135 -0
- package/lib/commonjs/components/QuantityStepper/QuantityStepper.js.map +1 -0
- package/lib/commonjs/components/QuantityStepper/QuantityStepper.stories.js +90 -0
- package/lib/commonjs/components/QuantityStepper/QuantityStepper.stories.js.map +1 -0
- package/lib/commonjs/components/QuantityStepper/QuantityStepper.test.js +100 -0
- package/lib/commonjs/components/QuantityStepper/QuantityStepper.test.js.map +1 -0
- package/lib/commonjs/components/QuantityStepper/index.js +13 -0
- package/lib/commonjs/components/QuantityStepper/index.js.map +1 -0
- package/lib/commonjs/components/Radio/Radio.js +59 -0
- package/lib/commonjs/components/Radio/Radio.js.map +1 -0
- package/lib/commonjs/components/Radio/Radio.stories.js +60 -0
- package/lib/commonjs/components/Radio/Radio.stories.js.map +1 -0
- package/lib/commonjs/components/Radio/Radio.test.js +46 -0
- package/lib/commonjs/components/Radio/Radio.test.js.map +1 -0
- package/lib/commonjs/components/Radio/index.js +13 -0
- package/lib/commonjs/components/Radio/index.js.map +1 -0
- package/lib/commonjs/components/Surface/Surface.js +84 -0
- package/lib/commonjs/components/Surface/Surface.js.map +1 -0
- package/lib/commonjs/components/Surface/Surface.stories.js +97 -0
- package/lib/commonjs/components/Surface/Surface.stories.js.map +1 -0
- package/lib/commonjs/components/Surface/Surface.test.js +58 -0
- package/lib/commonjs/components/Surface/Surface.test.js.map +1 -0
- package/lib/commonjs/components/Surface/index.js +13 -0
- package/lib/commonjs/components/Surface/index.js.map +1 -0
- package/lib/commonjs/components/Switch/Switch.js +109 -0
- package/lib/commonjs/components/Switch/Switch.js.map +1 -0
- package/lib/commonjs/components/Switch/Switch.stories.js +89 -0
- package/lib/commonjs/components/Switch/Switch.stories.js.map +1 -0
- package/lib/commonjs/components/Switch/Switch.test.js +46 -0
- package/lib/commonjs/components/Switch/Switch.test.js.map +1 -0
- package/lib/commonjs/components/Switch/index.js +13 -0
- package/lib/commonjs/components/Switch/index.js.map +1 -0
- package/lib/commonjs/components/Text/Text.js +39 -0
- package/lib/commonjs/components/Text/Text.js.map +1 -0
- package/lib/commonjs/components/Text/Text.stories.js +47 -0
- package/lib/commonjs/components/Text/Text.stories.js.map +1 -0
- package/lib/commonjs/components/Text/index.js +13 -0
- package/lib/commonjs/components/Text/index.js.map +1 -0
- package/lib/commonjs/components/_internal/Labeled.js +50 -0
- package/lib/commonjs/components/_internal/Labeled.js.map +1 -0
- package/lib/commonjs/components/brand/Flag.js +45 -0
- package/lib/commonjs/components/brand/Flag.js.map +1 -0
- package/lib/commonjs/components/brand/Flag.stories.js +59 -0
- package/lib/commonjs/components/brand/Flag.stories.js.map +1 -0
- package/lib/commonjs/components/brand/Logo.js +30 -0
- package/lib/commonjs/components/brand/Logo.js.map +1 -0
- package/lib/commonjs/components/brand/Logo.stories.js +59 -0
- package/lib/commonjs/components/brand/Logo.stories.js.map +1 -0
- package/lib/commonjs/components/brand/brand.test.js +39 -0
- package/lib/commonjs/components/brand/brand.test.js.map +1 -0
- package/lib/commonjs/components/brand/generated/FlagBr.js +95 -0
- package/lib/commonjs/components/brand/generated/FlagBr.js.map +1 -0
- package/lib/commonjs/components/brand/generated/FlagUs.js +82 -0
- package/lib/commonjs/components/brand/generated/FlagUs.js.map +1 -0
- package/lib/commonjs/components/brand/generated/Mastercard.js +42 -0
- package/lib/commonjs/components/brand/generated/Mastercard.js.map +1 -0
- package/lib/commonjs/components/brand/generated/Visa.js +99 -0
- package/lib/commonjs/components/brand/generated/Visa.js.map +1 -0
- package/lib/commonjs/components/brand/index.js +27 -0
- package/lib/commonjs/components/brand/index.js.map +1 -0
- package/lib/commonjs/components/brand/registry.js +36 -0
- package/lib/commonjs/components/brand/registry.js.map +1 -0
- package/lib/commonjs/components/index.js +193 -0
- package/lib/commonjs/components/index.js.map +1 -0
- package/lib/commonjs/index.js +28 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/theme/ThemeProvider.js +52 -0
- package/lib/commonjs/theme/ThemeProvider.js.map +1 -0
- package/lib/commonjs/theme/ThemeProvider.test.js +65 -0
- package/lib/commonjs/theme/ThemeProvider.test.js.map +1 -0
- package/lib/commonjs/theme/index.js +101 -0
- package/lib/commonjs/theme/index.js.map +1 -0
- package/lib/commonjs/theme/palette.js +94 -0
- package/lib/commonjs/theme/palette.js.map +1 -0
- package/lib/commonjs/theme/spacing.js +39 -0
- package/lib/commonjs/theme/spacing.js.map +1 -0
- package/lib/commonjs/theme/themes.js +171 -0
- package/lib/commonjs/theme/themes.js.map +1 -0
- package/lib/commonjs/theme/typography.js +65 -0
- package/lib/commonjs/theme/typography.js.map +1 -0
- package/lib/module/components/Avatar/Avatar.js +92 -0
- package/lib/module/components/Avatar/Avatar.js.map +1 -0
- package/lib/module/components/Avatar/Avatar.stories.js +83 -0
- package/lib/module/components/Avatar/Avatar.stories.js.map +1 -0
- package/lib/module/components/Avatar/Avatar.test.js +62 -0
- package/lib/module/components/Avatar/Avatar.test.js.map +1 -0
- package/lib/module/components/Avatar/index.js +4 -0
- package/lib/module/components/Avatar/index.js.map +1 -0
- package/lib/module/components/Button/Button.js +197 -0
- package/lib/module/components/Button/Button.js.map +1 -0
- package/lib/module/components/Button/Button.stories.js +135 -0
- package/lib/module/components/Button/Button.stories.js.map +1 -0
- package/lib/module/components/Button/Button.test.js +63 -0
- package/lib/module/components/Button/Button.test.js.map +1 -0
- package/lib/module/components/Button/index.js +4 -0
- package/lib/module/components/Button/index.js.map +1 -0
- package/lib/module/components/Card/Card.js +125 -0
- package/lib/module/components/Card/Card.js.map +1 -0
- package/lib/module/components/Card/Card.stories.js +83 -0
- package/lib/module/components/Card/Card.stories.js.map +1 -0
- package/lib/module/components/Card/Card.test.js +50 -0
- package/lib/module/components/Card/Card.test.js.map +1 -0
- package/lib/module/components/Card/index.js +4 -0
- package/lib/module/components/Card/index.js.map +1 -0
- package/lib/module/components/Checkbox/Checkbox.js +71 -0
- package/lib/module/components/Checkbox/Checkbox.js.map +1 -0
- package/lib/module/components/Checkbox/Checkbox.stories.js +65 -0
- package/lib/module/components/Checkbox/Checkbox.stories.js.map +1 -0
- package/lib/module/components/Checkbox/Checkbox.test.js +61 -0
- package/lib/module/components/Checkbox/Checkbox.test.js.map +1 -0
- package/lib/module/components/Checkbox/index.js +4 -0
- package/lib/module/components/Checkbox/index.js.map +1 -0
- package/lib/module/components/Chip/Chip.js +115 -0
- package/lib/module/components/Chip/Chip.js.map +1 -0
- package/lib/module/components/Chip/Chip.stories.js +108 -0
- package/lib/module/components/Chip/Chip.stories.js.map +1 -0
- package/lib/module/components/Chip/Chip.test.js +62 -0
- package/lib/module/components/Chip/Chip.test.js.map +1 -0
- package/lib/module/components/Chip/ChipGroup.js +50 -0
- package/lib/module/components/Chip/ChipGroup.js.map +1 -0
- package/lib/module/components/Chip/ChipGroup.stories.js +74 -0
- package/lib/module/components/Chip/ChipGroup.stories.js.map +1 -0
- package/lib/module/components/Chip/ChipGroup.test.js +69 -0
- package/lib/module/components/Chip/ChipGroup.test.js.map +1 -0
- package/lib/module/components/Chip/index.js +5 -0
- package/lib/module/components/Chip/index.js.map +1 -0
- package/lib/module/components/CodeInput/CodeInput.js +161 -0
- package/lib/module/components/CodeInput/CodeInput.js.map +1 -0
- package/lib/module/components/CodeInput/CodeInput.stories.js +94 -0
- package/lib/module/components/CodeInput/CodeInput.stories.js.map +1 -0
- package/lib/module/components/CodeInput/CodeInput.test.js +73 -0
- package/lib/module/components/CodeInput/CodeInput.test.js.map +1 -0
- package/lib/module/components/CodeInput/index.js +4 -0
- package/lib/module/components/CodeInput/index.js.map +1 -0
- package/lib/module/components/Icon/Icon.js +28 -0
- package/lib/module/components/Icon/Icon.js.map +1 -0
- package/lib/module/components/Icon/Icon.stories.js +90 -0
- package/lib/module/components/Icon/Icon.stories.js.map +1 -0
- package/lib/module/components/Icon/Icon.test.js +37 -0
- package/lib/module/components/Icon/Icon.test.js.map +1 -0
- package/lib/module/components/Icon/icons.generated.js +175 -0
- package/lib/module/components/Icon/icons.generated.js.map +1 -0
- package/lib/module/components/Icon/index.js +5 -0
- package/lib/module/components/Icon/index.js.map +1 -0
- package/lib/module/components/IconButton/IconButton.js +135 -0
- package/lib/module/components/IconButton/IconButton.js.map +1 -0
- package/lib/module/components/IconButton/IconButton.stories.js +115 -0
- package/lib/module/components/IconButton/IconButton.stories.js.map +1 -0
- package/lib/module/components/IconButton/IconButton.test.js +54 -0
- package/lib/module/components/IconButton/IconButton.test.js.map +1 -0
- package/lib/module/components/IconButton/index.js +4 -0
- package/lib/module/components/IconButton/index.js.map +1 -0
- package/lib/module/components/Input/Input.js +174 -0
- package/lib/module/components/Input/Input.js.map +1 -0
- package/lib/module/components/Input/Input.stories.js +112 -0
- package/lib/module/components/Input/Input.stories.js.map +1 -0
- package/lib/module/components/Input/Input.test.js +103 -0
- package/lib/module/components/Input/Input.test.js.map +1 -0
- package/lib/module/components/Input/index.js +4 -0
- package/lib/module/components/Input/index.js.map +1 -0
- package/lib/module/components/LinkButton/LinkButton.js +91 -0
- package/lib/module/components/LinkButton/LinkButton.js.map +1 -0
- package/lib/module/components/LinkButton/LinkButton.stories.js +87 -0
- package/lib/module/components/LinkButton/LinkButton.stories.js.map +1 -0
- package/lib/module/components/LinkButton/LinkButton.test.js +60 -0
- package/lib/module/components/LinkButton/LinkButton.test.js.map +1 -0
- package/lib/module/components/LinkButton/index.js +4 -0
- package/lib/module/components/LinkButton/index.js.map +1 -0
- package/lib/module/components/ProductCard/ProductCard.js +163 -0
- package/lib/module/components/ProductCard/ProductCard.js.map +1 -0
- package/lib/module/components/ProductCard/ProductCard.stories.js +114 -0
- package/lib/module/components/ProductCard/ProductCard.stories.js.map +1 -0
- package/lib/module/components/ProductCard/ProductCard.test.js +68 -0
- package/lib/module/components/ProductCard/ProductCard.test.js.map +1 -0
- package/lib/module/components/ProductCard/index.js +4 -0
- package/lib/module/components/ProductCard/index.js.map +1 -0
- package/lib/module/components/QuantityStepper/QuantityStepper.js +131 -0
- package/lib/module/components/QuantityStepper/QuantityStepper.js.map +1 -0
- package/lib/module/components/QuantityStepper/QuantityStepper.stories.js +86 -0
- package/lib/module/components/QuantityStepper/QuantityStepper.stories.js.map +1 -0
- package/lib/module/components/QuantityStepper/QuantityStepper.test.js +99 -0
- package/lib/module/components/QuantityStepper/QuantityStepper.test.js.map +1 -0
- package/lib/module/components/QuantityStepper/index.js +4 -0
- package/lib/module/components/QuantityStepper/index.js.map +1 -0
- package/lib/module/components/Radio/Radio.js +55 -0
- package/lib/module/components/Radio/Radio.js.map +1 -0
- package/lib/module/components/Radio/Radio.stories.js +56 -0
- package/lib/module/components/Radio/Radio.stories.js.map +1 -0
- package/lib/module/components/Radio/Radio.test.js +45 -0
- package/lib/module/components/Radio/Radio.test.js.map +1 -0
- package/lib/module/components/Radio/index.js +4 -0
- package/lib/module/components/Radio/index.js.map +1 -0
- package/lib/module/components/Surface/Surface.js +80 -0
- package/lib/module/components/Surface/Surface.js.map +1 -0
- package/lib/module/components/Surface/Surface.stories.js +93 -0
- package/lib/module/components/Surface/Surface.stories.js.map +1 -0
- package/lib/module/components/Surface/Surface.test.js +57 -0
- package/lib/module/components/Surface/Surface.test.js.map +1 -0
- package/lib/module/components/Surface/index.js +4 -0
- package/lib/module/components/Surface/index.js.map +1 -0
- package/lib/module/components/Switch/Switch.js +105 -0
- package/lib/module/components/Switch/Switch.js.map +1 -0
- package/lib/module/components/Switch/Switch.stories.js +85 -0
- package/lib/module/components/Switch/Switch.stories.js.map +1 -0
- package/lib/module/components/Switch/Switch.test.js +45 -0
- package/lib/module/components/Switch/Switch.test.js.map +1 -0
- package/lib/module/components/Switch/index.js +4 -0
- package/lib/module/components/Switch/index.js.map +1 -0
- package/lib/module/components/Text/Text.js +35 -0
- package/lib/module/components/Text/Text.js.map +1 -0
- package/lib/module/components/Text/Text.stories.js +43 -0
- package/lib/module/components/Text/Text.stories.js.map +1 -0
- package/lib/module/components/Text/index.js +4 -0
- package/lib/module/components/Text/index.js.map +1 -0
- package/lib/module/components/_internal/Labeled.js +46 -0
- package/lib/module/components/_internal/Labeled.js.map +1 -0
- package/lib/module/components/brand/Flag.js +41 -0
- package/lib/module/components/brand/Flag.js.map +1 -0
- package/lib/module/components/brand/Flag.stories.js +55 -0
- package/lib/module/components/brand/Flag.stories.js.map +1 -0
- package/lib/module/components/brand/Logo.js +26 -0
- package/lib/module/components/brand/Logo.js.map +1 -0
- package/lib/module/components/brand/Logo.stories.js +55 -0
- package/lib/module/components/brand/Logo.stories.js.map +1 -0
- package/lib/module/components/brand/brand.test.js +38 -0
- package/lib/module/components/brand/brand.test.js.map +1 -0
- package/lib/module/components/brand/generated/FlagBr.js +90 -0
- package/lib/module/components/brand/generated/FlagBr.js.map +1 -0
- package/lib/module/components/brand/generated/FlagUs.js +76 -0
- package/lib/module/components/brand/generated/FlagUs.js.map +1 -0
- package/lib/module/components/brand/generated/Mastercard.js +37 -0
- package/lib/module/components/brand/generated/Mastercard.js.map +1 -0
- package/lib/module/components/brand/generated/Visa.js +94 -0
- package/lib/module/components/brand/generated/Visa.js.map +1 -0
- package/lib/module/components/brand/index.js +6 -0
- package/lib/module/components/brand/index.js.map +1 -0
- package/lib/module/components/brand/registry.js +31 -0
- package/lib/module/components/brand/registry.js.map +1 -0
- package/lib/module/components/index.js +20 -0
- package/lib/module/components/index.js.map +1 -0
- package/lib/module/index.js +10 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/theme/ThemeProvider.js +46 -0
- package/lib/module/theme/ThemeProvider.js.map +1 -0
- package/lib/module/theme/ThemeProvider.test.js +64 -0
- package/lib/module/theme/ThemeProvider.test.js.map +1 -0
- package/lib/module/theme/index.js +8 -0
- package/lib/module/theme/index.js.map +1 -0
- package/lib/module/theme/palette.js +90 -0
- package/lib/module/theme/palette.js.map +1 -0
- package/lib/module/theme/spacing.js +34 -0
- package/lib/module/theme/spacing.js.map +1 -0
- package/lib/module/theme/themes.js +166 -0
- package/lib/module/theme/themes.js.map +1 -0
- package/lib/module/theme/typography.js +61 -0
- package/lib/module/theme/typography.js.map +1 -0
- package/lib/typescript/commonjs/components/Avatar/Avatar.d.ts +31 -0
- package/lib/typescript/commonjs/components/Avatar/Avatar.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Avatar/index.d.ts +2 -0
- package/lib/typescript/commonjs/components/Avatar/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Button/Button.d.ts +40 -0
- package/lib/typescript/commonjs/components/Button/Button.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Button/index.d.ts +2 -0
- package/lib/typescript/commonjs/components/Button/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Card/Card.d.ts +32 -0
- package/lib/typescript/commonjs/components/Card/Card.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Card/index.d.ts +2 -0
- package/lib/typescript/commonjs/components/Card/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Checkbox/Checkbox.d.ts +25 -0
- package/lib/typescript/commonjs/components/Checkbox/Checkbox.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Checkbox/index.d.ts +2 -0
- package/lib/typescript/commonjs/components/Checkbox/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Chip/Chip.d.ts +40 -0
- package/lib/typescript/commonjs/components/Chip/Chip.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Chip/ChipGroup.d.ts +49 -0
- package/lib/typescript/commonjs/components/Chip/ChipGroup.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Chip/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Chip/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/CodeInput/CodeInput.d.ts +41 -0
- package/lib/typescript/commonjs/components/CodeInput/CodeInput.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/CodeInput/index.d.ts +2 -0
- package/lib/typescript/commonjs/components/CodeInput/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Icon/Icon.d.ts +19 -0
- package/lib/typescript/commonjs/components/Icon/Icon.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Icon/icons.generated.d.ts +171 -0
- package/lib/typescript/commonjs/components/Icon/icons.generated.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Icon/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Icon/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/IconButton/IconButton.d.ts +34 -0
- package/lib/typescript/commonjs/components/IconButton/IconButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/IconButton/index.d.ts +2 -0
- package/lib/typescript/commonjs/components/IconButton/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Input/Input.d.ts +38 -0
- package/lib/typescript/commonjs/components/Input/Input.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Input/index.d.ts +2 -0
- package/lib/typescript/commonjs/components/Input/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/LinkButton/LinkButton.d.ts +31 -0
- package/lib/typescript/commonjs/components/LinkButton/LinkButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/LinkButton/index.d.ts +2 -0
- package/lib/typescript/commonjs/components/LinkButton/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/ProductCard/ProductCard.d.ts +31 -0
- package/lib/typescript/commonjs/components/ProductCard/ProductCard.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/ProductCard/index.d.ts +2 -0
- package/lib/typescript/commonjs/components/ProductCard/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/QuantityStepper/QuantityStepper.d.ts +36 -0
- package/lib/typescript/commonjs/components/QuantityStepper/QuantityStepper.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/QuantityStepper/index.d.ts +2 -0
- package/lib/typescript/commonjs/components/QuantityStepper/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Radio/Radio.d.ts +23 -0
- package/lib/typescript/commonjs/components/Radio/Radio.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Radio/index.d.ts +2 -0
- package/lib/typescript/commonjs/components/Radio/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Surface/Surface.d.ts +31 -0
- package/lib/typescript/commonjs/components/Surface/Surface.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Surface/index.d.ts +2 -0
- package/lib/typescript/commonjs/components/Surface/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Switch/Switch.d.ts +26 -0
- package/lib/typescript/commonjs/components/Switch/Switch.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Switch/index.d.ts +2 -0
- package/lib/typescript/commonjs/components/Switch/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Text/Text.d.ts +21 -0
- package/lib/typescript/commonjs/components/Text/Text.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Text/index.d.ts +2 -0
- package/lib/typescript/commonjs/components/Text/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/_internal/Labeled.d.ts +27 -0
- package/lib/typescript/commonjs/components/_internal/Labeled.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/brand/Flag.d.ts +14 -0
- package/lib/typescript/commonjs/components/brand/Flag.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/brand/Logo.d.ts +15 -0
- package/lib/typescript/commonjs/components/brand/Logo.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/brand/generated/FlagBr.d.ts +4 -0
- package/lib/typescript/commonjs/components/brand/generated/FlagBr.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/brand/generated/FlagUs.d.ts +4 -0
- package/lib/typescript/commonjs/components/brand/generated/FlagUs.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/brand/generated/Mastercard.d.ts +4 -0
- package/lib/typescript/commonjs/components/brand/generated/Mastercard.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/brand/generated/Visa.d.ts +4 -0
- package/lib/typescript/commonjs/components/brand/generated/Visa.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/brand/index.d.ts +4 -0
- package/lib/typescript/commonjs/components/brand/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/brand/registry.d.ts +33 -0
- package/lib/typescript/commonjs/components/brand/registry.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/index.d.ts +19 -0
- package/lib/typescript/commonjs/components/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +8 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/theme/ThemeProvider.d.ts +29 -0
- package/lib/typescript/commonjs/theme/ThemeProvider.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/index.d.ts +6 -0
- package/lib/typescript/commonjs/theme/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/palette.d.ts +89 -0
- package/lib/typescript/commonjs/theme/palette.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/spacing.d.ts +34 -0
- package/lib/typescript/commonjs/theme/spacing.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/themes.d.ts +93 -0
- package/lib/typescript/commonjs/theme/themes.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/typography.d.ts +60 -0
- package/lib/typescript/commonjs/theme/typography.d.ts.map +1 -0
- package/lib/typescript/module/components/Avatar/Avatar.d.ts +31 -0
- package/lib/typescript/module/components/Avatar/Avatar.d.ts.map +1 -0
- package/lib/typescript/module/components/Avatar/index.d.ts +2 -0
- package/lib/typescript/module/components/Avatar/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Button/Button.d.ts +40 -0
- package/lib/typescript/module/components/Button/Button.d.ts.map +1 -0
- package/lib/typescript/module/components/Button/index.d.ts +2 -0
- package/lib/typescript/module/components/Button/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Card/Card.d.ts +32 -0
- package/lib/typescript/module/components/Card/Card.d.ts.map +1 -0
- package/lib/typescript/module/components/Card/index.d.ts +2 -0
- package/lib/typescript/module/components/Card/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Checkbox/Checkbox.d.ts +25 -0
- package/lib/typescript/module/components/Checkbox/Checkbox.d.ts.map +1 -0
- package/lib/typescript/module/components/Checkbox/index.d.ts +2 -0
- package/lib/typescript/module/components/Checkbox/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Chip/Chip.d.ts +40 -0
- package/lib/typescript/module/components/Chip/Chip.d.ts.map +1 -0
- package/lib/typescript/module/components/Chip/ChipGroup.d.ts +49 -0
- package/lib/typescript/module/components/Chip/ChipGroup.d.ts.map +1 -0
- package/lib/typescript/module/components/Chip/index.d.ts +3 -0
- package/lib/typescript/module/components/Chip/index.d.ts.map +1 -0
- package/lib/typescript/module/components/CodeInput/CodeInput.d.ts +41 -0
- package/lib/typescript/module/components/CodeInput/CodeInput.d.ts.map +1 -0
- package/lib/typescript/module/components/CodeInput/index.d.ts +2 -0
- package/lib/typescript/module/components/CodeInput/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Icon/Icon.d.ts +19 -0
- package/lib/typescript/module/components/Icon/Icon.d.ts.map +1 -0
- package/lib/typescript/module/components/Icon/icons.generated.d.ts +171 -0
- package/lib/typescript/module/components/Icon/icons.generated.d.ts.map +1 -0
- package/lib/typescript/module/components/Icon/index.d.ts +3 -0
- package/lib/typescript/module/components/Icon/index.d.ts.map +1 -0
- package/lib/typescript/module/components/IconButton/IconButton.d.ts +34 -0
- package/lib/typescript/module/components/IconButton/IconButton.d.ts.map +1 -0
- package/lib/typescript/module/components/IconButton/index.d.ts +2 -0
- package/lib/typescript/module/components/IconButton/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Input/Input.d.ts +38 -0
- package/lib/typescript/module/components/Input/Input.d.ts.map +1 -0
- package/lib/typescript/module/components/Input/index.d.ts +2 -0
- package/lib/typescript/module/components/Input/index.d.ts.map +1 -0
- package/lib/typescript/module/components/LinkButton/LinkButton.d.ts +31 -0
- package/lib/typescript/module/components/LinkButton/LinkButton.d.ts.map +1 -0
- package/lib/typescript/module/components/LinkButton/index.d.ts +2 -0
- package/lib/typescript/module/components/LinkButton/index.d.ts.map +1 -0
- package/lib/typescript/module/components/ProductCard/ProductCard.d.ts +31 -0
- package/lib/typescript/module/components/ProductCard/ProductCard.d.ts.map +1 -0
- package/lib/typescript/module/components/ProductCard/index.d.ts +2 -0
- package/lib/typescript/module/components/ProductCard/index.d.ts.map +1 -0
- package/lib/typescript/module/components/QuantityStepper/QuantityStepper.d.ts +36 -0
- package/lib/typescript/module/components/QuantityStepper/QuantityStepper.d.ts.map +1 -0
- package/lib/typescript/module/components/QuantityStepper/index.d.ts +2 -0
- package/lib/typescript/module/components/QuantityStepper/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Radio/Radio.d.ts +23 -0
- package/lib/typescript/module/components/Radio/Radio.d.ts.map +1 -0
- package/lib/typescript/module/components/Radio/index.d.ts +2 -0
- package/lib/typescript/module/components/Radio/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Surface/Surface.d.ts +31 -0
- package/lib/typescript/module/components/Surface/Surface.d.ts.map +1 -0
- package/lib/typescript/module/components/Surface/index.d.ts +2 -0
- package/lib/typescript/module/components/Surface/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Switch/Switch.d.ts +26 -0
- package/lib/typescript/module/components/Switch/Switch.d.ts.map +1 -0
- package/lib/typescript/module/components/Switch/index.d.ts +2 -0
- package/lib/typescript/module/components/Switch/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Text/Text.d.ts +21 -0
- package/lib/typescript/module/components/Text/Text.d.ts.map +1 -0
- package/lib/typescript/module/components/Text/index.d.ts +2 -0
- package/lib/typescript/module/components/Text/index.d.ts.map +1 -0
- package/lib/typescript/module/components/_internal/Labeled.d.ts +27 -0
- package/lib/typescript/module/components/_internal/Labeled.d.ts.map +1 -0
- package/lib/typescript/module/components/brand/Flag.d.ts +14 -0
- package/lib/typescript/module/components/brand/Flag.d.ts.map +1 -0
- package/lib/typescript/module/components/brand/Logo.d.ts +15 -0
- package/lib/typescript/module/components/brand/Logo.d.ts.map +1 -0
- package/lib/typescript/module/components/brand/generated/FlagBr.d.ts +4 -0
- package/lib/typescript/module/components/brand/generated/FlagBr.d.ts.map +1 -0
- package/lib/typescript/module/components/brand/generated/FlagUs.d.ts +4 -0
- package/lib/typescript/module/components/brand/generated/FlagUs.d.ts.map +1 -0
- package/lib/typescript/module/components/brand/generated/Mastercard.d.ts +4 -0
- package/lib/typescript/module/components/brand/generated/Mastercard.d.ts.map +1 -0
- package/lib/typescript/module/components/brand/generated/Visa.d.ts +4 -0
- package/lib/typescript/module/components/brand/generated/Visa.d.ts.map +1 -0
- package/lib/typescript/module/components/brand/index.d.ts +4 -0
- package/lib/typescript/module/components/brand/index.d.ts.map +1 -0
- package/lib/typescript/module/components/brand/registry.d.ts +33 -0
- package/lib/typescript/module/components/brand/registry.d.ts.map +1 -0
- package/lib/typescript/module/components/index.d.ts +19 -0
- package/lib/typescript/module/components/index.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +8 -0
- package/lib/typescript/module/index.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/theme/ThemeProvider.d.ts +29 -0
- package/lib/typescript/module/theme/ThemeProvider.d.ts.map +1 -0
- package/lib/typescript/module/theme/index.d.ts +6 -0
- package/lib/typescript/module/theme/index.d.ts.map +1 -0
- package/lib/typescript/module/theme/palette.d.ts +89 -0
- package/lib/typescript/module/theme/palette.d.ts.map +1 -0
- package/lib/typescript/module/theme/spacing.d.ts +34 -0
- package/lib/typescript/module/theme/spacing.d.ts.map +1 -0
- package/lib/typescript/module/theme/themes.d.ts +93 -0
- package/lib/typescript/module/theme/themes.d.ts.map +1 -0
- package/lib/typescript/module/theme/typography.d.ts +60 -0
- package/lib/typescript/module/theme/typography.d.ts.map +1 -0
- package/package.json +116 -0
- package/src/components/Avatar/Avatar.tsx +111 -0
- package/src/components/Avatar/index.ts +1 -0
- package/src/components/Button/Button.tsx +216 -0
- package/src/components/Button/index.ts +6 -0
- package/src/components/Card/Card.tsx +145 -0
- package/src/components/Card/index.ts +1 -0
- package/src/components/Checkbox/Checkbox.tsx +86 -0
- package/src/components/Checkbox/index.ts +1 -0
- package/src/components/Chip/Chip.tsx +126 -0
- package/src/components/Chip/ChipGroup.tsx +88 -0
- package/src/components/Chip/index.ts +2 -0
- package/src/components/CodeInput/CodeInput.tsx +200 -0
- package/src/components/CodeInput/index.ts +1 -0
- package/src/components/Icon/Icon.tsx +32 -0
- package/src/components/Icon/icons.generated.ts +174 -0
- package/src/components/Icon/index.ts +2 -0
- package/src/components/IconButton/IconButton.tsx +156 -0
- package/src/components/IconButton/index.ts +7 -0
- package/src/components/Input/Input.tsx +230 -0
- package/src/components/Input/index.ts +1 -0
- package/src/components/LinkButton/LinkButton.tsx +118 -0
- package/src/components/LinkButton/index.ts +6 -0
- package/src/components/ProductCard/ProductCard.tsx +176 -0
- package/src/components/ProductCard/index.ts +1 -0
- package/src/components/QuantityStepper/QuantityStepper.tsx +162 -0
- package/src/components/QuantityStepper/index.ts +5 -0
- package/src/components/Radio/Radio.tsx +76 -0
- package/src/components/Radio/index.ts +1 -0
- package/src/components/Surface/Surface.tsx +99 -0
- package/src/components/Surface/index.ts +6 -0
- package/src/components/Switch/Switch.tsx +110 -0
- package/src/components/Switch/index.ts +1 -0
- package/src/components/Text/Text.tsx +51 -0
- package/src/components/Text/index.ts +1 -0
- package/src/components/_internal/Labeled.tsx +72 -0
- package/src/components/brand/Flag.tsx +41 -0
- package/src/components/brand/Logo.tsx +23 -0
- package/src/components/brand/generated/FlagBr.tsx +8 -0
- package/src/components/brand/generated/FlagUs.tsx +7 -0
- package/src/components/brand/generated/Mastercard.tsx +4 -0
- package/src/components/brand/generated/Visa.tsx +4 -0
- package/src/components/brand/index.ts +3 -0
- package/src/components/brand/registry.ts +27 -0
- package/src/components/index.ts +19 -0
- package/src/index.tsx +7 -0
- package/src/theme/ThemeProvider.tsx +66 -0
- package/src/theme/index.ts +31 -0
- package/src/theme/palette.ts +89 -0
- package/src/theme/spacing.ts +37 -0
- package/src/theme/themes.ts +248 -0
- package/src/theme/typography.ts +37 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ProductCard, type ProductCardProps } from './ProductCard';
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TextInput,
|
|
3
|
+
View,
|
|
4
|
+
type StyleProp,
|
|
5
|
+
type TextStyle,
|
|
6
|
+
type ViewStyle,
|
|
7
|
+
} from 'react-native';
|
|
8
|
+
import { useTheme, textStyle } from '../../theme';
|
|
9
|
+
import type { TypographyVariant } from '../../theme/typography';
|
|
10
|
+
import { IconButton, type IconButtonSize } from '../IconButton/IconButton';
|
|
11
|
+
import { Text } from '../Text/Text';
|
|
12
|
+
|
|
13
|
+
export type QuantityStepperSize = 'sm' | 'md' | 'lg';
|
|
14
|
+
|
|
15
|
+
/** Removes the browser's default focus outline on web (no-op on native). */
|
|
16
|
+
const WEB_NO_OUTLINE = { outlineStyle: 'none', outlineWidth: 0 } as unknown as TextStyle;
|
|
17
|
+
|
|
18
|
+
export interface QuantityStepperProps {
|
|
19
|
+
/** Current quantity. */
|
|
20
|
+
value: number;
|
|
21
|
+
/** Called with the next clamped value. */
|
|
22
|
+
onChange: (value: number) => void;
|
|
23
|
+
/**
|
|
24
|
+
* Minimum value. Defaults to 1: the `−` button hides at the minimum so the
|
|
25
|
+
* quantity can't go lower. Set `min={0}` to allow decreasing back to 0.
|
|
26
|
+
*/
|
|
27
|
+
min?: number;
|
|
28
|
+
/** Maximum value. Defaults to no limit. */
|
|
29
|
+
max?: number;
|
|
30
|
+
/** Control size: `sm` = 40px, `md` = 48px, `lg` = 58px buttons. Defaults to `lg`. */
|
|
31
|
+
size?: QuantityStepperSize;
|
|
32
|
+
/** Disable interaction and apply disabled tokens. */
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
/** Let the quantity be typed on a numeric keyboard (for large amounts). */
|
|
35
|
+
editable?: boolean;
|
|
36
|
+
/** Accessibility labels. */
|
|
37
|
+
addLabel?: string;
|
|
38
|
+
decrementLabel?: string;
|
|
39
|
+
incrementLabel?: string;
|
|
40
|
+
quantityLabel?: string;
|
|
41
|
+
/** Override the container style. */
|
|
42
|
+
style?: StyleProp<ViewStyle>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const SIZES: Record<
|
|
46
|
+
QuantityStepperSize,
|
|
47
|
+
{ button: IconButtonSize; gap: number; text: TypographyVariant; minWidth: number }
|
|
48
|
+
> = {
|
|
49
|
+
sm: { button: 'sm', gap: 8, text: 'bodySmall', minWidth: 32 },
|
|
50
|
+
md: { button: 'md', gap: 8, text: 'bodyMedium', minWidth: 40 },
|
|
51
|
+
lg: { button: 'lg', gap: 12, text: 'bodyMedium', minWidth: 40 },
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Quantity stepper — faithful to the Bacon POS Figma "Input qty". At 0 it shows
|
|
56
|
+
* a single lime "+" (add); at the minimum it shows `value +` (no `−`, so it
|
|
57
|
+
* can't go lower); above the minimum it shows `− value +`. Controlled via
|
|
58
|
+
* `value`/`onChange`; set `editable` to type the amount on a numeric keyboard.
|
|
59
|
+
*/
|
|
60
|
+
export function QuantityStepper({
|
|
61
|
+
value,
|
|
62
|
+
onChange,
|
|
63
|
+
min = 1,
|
|
64
|
+
max = Number.POSITIVE_INFINITY,
|
|
65
|
+
size = 'lg',
|
|
66
|
+
disabled = false,
|
|
67
|
+
editable = false,
|
|
68
|
+
addLabel = 'Add',
|
|
69
|
+
decrementLabel = 'Decrease quantity',
|
|
70
|
+
incrementLabel = 'Increase quantity',
|
|
71
|
+
quantityLabel = 'Quantity',
|
|
72
|
+
style,
|
|
73
|
+
}: QuantityStepperProps) {
|
|
74
|
+
const theme = useTheme();
|
|
75
|
+
const cfg = SIZES[size];
|
|
76
|
+
|
|
77
|
+
const clamp = (n: number) => Math.max(min, Math.min(max, n));
|
|
78
|
+
const decrement = () => onChange(clamp(value - 1));
|
|
79
|
+
const increment = () => onChange(clamp(value + 1));
|
|
80
|
+
|
|
81
|
+
if (value <= 0) {
|
|
82
|
+
return (
|
|
83
|
+
<IconButton
|
|
84
|
+
icon="plus"
|
|
85
|
+
variant="default"
|
|
86
|
+
size={cfg.button}
|
|
87
|
+
accessibilityLabel={addLabel}
|
|
88
|
+
disabled={disabled}
|
|
89
|
+
onPress={increment}
|
|
90
|
+
/>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const valueColor = disabled ? theme.colors.text.tertiary : theme.colors.text.primary;
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<View
|
|
98
|
+
style={[
|
|
99
|
+
{
|
|
100
|
+
alignSelf: 'flex-start',
|
|
101
|
+
flexDirection: 'row',
|
|
102
|
+
alignItems: 'center',
|
|
103
|
+
gap: cfg.gap,
|
|
104
|
+
padding: 8,
|
|
105
|
+
borderRadius: theme.radii.pill,
|
|
106
|
+
borderWidth: 1,
|
|
107
|
+
borderColor: disabled ? theme.colors.disabled.border : theme.colors.border.default,
|
|
108
|
+
backgroundColor: disabled
|
|
109
|
+
? theme.colors.disabled.background
|
|
110
|
+
: theme.colors.background.default,
|
|
111
|
+
boxShadow: [
|
|
112
|
+
{ inset: true, offsetX: 0, offsetY: 2, blurRadius: 4, spreadDistance: 0, color: 'rgba(0,0,0,0.05)' },
|
|
113
|
+
] as ViewStyle['boxShadow'],
|
|
114
|
+
},
|
|
115
|
+
style,
|
|
116
|
+
]}
|
|
117
|
+
>
|
|
118
|
+
{value > min ? (
|
|
119
|
+
<IconButton
|
|
120
|
+
icon="minus"
|
|
121
|
+
variant="default"
|
|
122
|
+
size={cfg.button}
|
|
123
|
+
accessibilityLabel={decrementLabel}
|
|
124
|
+
disabled={disabled}
|
|
125
|
+
onPress={decrement}
|
|
126
|
+
/>
|
|
127
|
+
) : null}
|
|
128
|
+
|
|
129
|
+
{editable ? (
|
|
130
|
+
<TextInput
|
|
131
|
+
value={String(value)}
|
|
132
|
+
onChangeText={(text) => {
|
|
133
|
+
const digits = text.replace(/[^0-9]/g, '');
|
|
134
|
+
onChange(clamp(digits === '' ? min : parseInt(digits, 10)));
|
|
135
|
+
}}
|
|
136
|
+
keyboardType="number-pad"
|
|
137
|
+
editable={!disabled}
|
|
138
|
+
selectTextOnFocus
|
|
139
|
+
accessibilityLabel={quantityLabel}
|
|
140
|
+
style={[
|
|
141
|
+
textStyle(theme, cfg.text, 'regular'),
|
|
142
|
+
{ minWidth: cfg.minWidth, textAlign: 'center', color: valueColor, paddingVertical: 0 },
|
|
143
|
+
WEB_NO_OUTLINE,
|
|
144
|
+
]}
|
|
145
|
+
/>
|
|
146
|
+
) : (
|
|
147
|
+
<Text variant={cfg.text} color={valueColor} align="center" style={{ minWidth: cfg.minWidth }}>
|
|
148
|
+
{value}
|
|
149
|
+
</Text>
|
|
150
|
+
)}
|
|
151
|
+
|
|
152
|
+
<IconButton
|
|
153
|
+
icon="plus"
|
|
154
|
+
variant="default"
|
|
155
|
+
size={cfg.button}
|
|
156
|
+
accessibilityLabel={incrementLabel}
|
|
157
|
+
disabled={disabled || value >= max}
|
|
158
|
+
onPress={increment}
|
|
159
|
+
/>
|
|
160
|
+
</View>
|
|
161
|
+
);
|
|
162
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { View, type StyleProp, type ViewStyle } from 'react-native';
|
|
2
|
+
import { useTheme } from '../../theme';
|
|
3
|
+
import { Labeled, type LabelPosition } from '../_internal/Labeled';
|
|
4
|
+
|
|
5
|
+
export interface RadioProps {
|
|
6
|
+
/** Selected state. */
|
|
7
|
+
selected: boolean;
|
|
8
|
+
/** Called when pressed (selecting this radio). */
|
|
9
|
+
onChange: () => void;
|
|
10
|
+
/** Disable and dim the control. */
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
/** Optional label. */
|
|
13
|
+
label?: string;
|
|
14
|
+
/** Where the label sits: top / bottom / left / right. Defaults to `right`. */
|
|
15
|
+
labelPosition?: LabelPosition;
|
|
16
|
+
/** Override the container style. */
|
|
17
|
+
style?: StyleProp<ViewStyle>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Radio button — faithful to the Bacon POS Figma "Form controls". A 20px circle:
|
|
22
|
+
* unselected (outlined), selected (dark ring + dot). Usually rendered as a group;
|
|
23
|
+
* standalone or with a positionable label.
|
|
24
|
+
*/
|
|
25
|
+
export function Radio({
|
|
26
|
+
selected,
|
|
27
|
+
onChange,
|
|
28
|
+
disabled = false,
|
|
29
|
+
label,
|
|
30
|
+
labelPosition,
|
|
31
|
+
style,
|
|
32
|
+
}: RadioProps) {
|
|
33
|
+
const theme = useTheme();
|
|
34
|
+
|
|
35
|
+
const borderColor = disabled
|
|
36
|
+
? theme.colors.disabled.border
|
|
37
|
+
: selected
|
|
38
|
+
? theme.colors.text.primary
|
|
39
|
+
: theme.colors.border.strong;
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<Labeled
|
|
43
|
+
label={label}
|
|
44
|
+
labelPosition={labelPosition}
|
|
45
|
+
disabled={disabled}
|
|
46
|
+
onPress={onChange}
|
|
47
|
+
accessibilityRole="radio"
|
|
48
|
+
accessibilityState={{ selected, disabled }}
|
|
49
|
+
style={style}
|
|
50
|
+
>
|
|
51
|
+
<View
|
|
52
|
+
style={{
|
|
53
|
+
width: 20,
|
|
54
|
+
height: 20,
|
|
55
|
+
borderRadius: 10,
|
|
56
|
+
borderWidth: selected ? 2 : 1.5,
|
|
57
|
+
borderColor,
|
|
58
|
+
backgroundColor: theme.colors.background.default,
|
|
59
|
+
alignItems: 'center',
|
|
60
|
+
justifyContent: 'center',
|
|
61
|
+
}}
|
|
62
|
+
>
|
|
63
|
+
{selected ? (
|
|
64
|
+
<View
|
|
65
|
+
style={{
|
|
66
|
+
width: 8,
|
|
67
|
+
height: 8,
|
|
68
|
+
borderRadius: 4,
|
|
69
|
+
backgroundColor: disabled ? theme.colors.disabled.foreground : theme.colors.text.primary,
|
|
70
|
+
}}
|
|
71
|
+
/>
|
|
72
|
+
) : null}
|
|
73
|
+
</View>
|
|
74
|
+
</Labeled>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Radio, type RadioProps } from './Radio';
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { useMemo, type ReactNode } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Pressable,
|
|
4
|
+
View,
|
|
5
|
+
type PressableStateCallbackType,
|
|
6
|
+
type StyleProp,
|
|
7
|
+
type ViewStyle,
|
|
8
|
+
} from 'react-native';
|
|
9
|
+
import { useTheme } from '../../theme';
|
|
10
|
+
import type { RadiusToken } from '../../theme/spacing';
|
|
11
|
+
|
|
12
|
+
export type SurfaceVariant = 'elevated' | 'outlined' | 'filled';
|
|
13
|
+
export type SurfacePadding = 'none' | 'sm' | 'md' | 'lg';
|
|
14
|
+
|
|
15
|
+
export interface SurfaceProps {
|
|
16
|
+
/** Surface style. Defaults to `elevated`. */
|
|
17
|
+
variant?: SurfaceVariant;
|
|
18
|
+
/** Inner padding. Defaults to `md` (16). */
|
|
19
|
+
padding?: SurfacePadding;
|
|
20
|
+
/** Corner radius token. Defaults to `xl` (16). */
|
|
21
|
+
radius?: RadiusToken;
|
|
22
|
+
/** When provided, the surface becomes pressable (adds button semantics). */
|
|
23
|
+
onPress?: () => void;
|
|
24
|
+
/** Dim and block presses (only meaningful with `onPress`). */
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
/** Content. */
|
|
27
|
+
children?: ReactNode;
|
|
28
|
+
/** Override the container style. */
|
|
29
|
+
style?: StyleProp<ViewStyle>;
|
|
30
|
+
/** Accessibility label (recommended when pressable). */
|
|
31
|
+
accessibilityLabel?: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const PADDING: Record<SurfacePadding, number> = {
|
|
35
|
+
none: 0,
|
|
36
|
+
sm: 12,
|
|
37
|
+
md: 16,
|
|
38
|
+
lg: 24,
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Generic surface container built from design-system tokens. Use it to group
|
|
43
|
+
* content (panels, tiles, list rows). `elevated` adds a soft shadow, `outlined`
|
|
44
|
+
* a hairline border, `filled` a subtle background. For the selectable
|
|
45
|
+
* design-system card, use `Card`.
|
|
46
|
+
*/
|
|
47
|
+
export function Surface({
|
|
48
|
+
variant = 'elevated',
|
|
49
|
+
padding = 'md',
|
|
50
|
+
radius = 'xl',
|
|
51
|
+
onPress,
|
|
52
|
+
disabled = false,
|
|
53
|
+
children,
|
|
54
|
+
style,
|
|
55
|
+
accessibilityLabel,
|
|
56
|
+
}: SurfaceProps) {
|
|
57
|
+
const theme = useTheme();
|
|
58
|
+
|
|
59
|
+
const baseStyle = useMemo<ViewStyle>(() => {
|
|
60
|
+
const common: ViewStyle = {
|
|
61
|
+
padding: PADDING[padding],
|
|
62
|
+
borderRadius: theme.radii[radius],
|
|
63
|
+
backgroundColor:
|
|
64
|
+
variant === 'filled' ? theme.colors.background.subtle : theme.colors.background.default,
|
|
65
|
+
};
|
|
66
|
+
if (variant === 'outlined') {
|
|
67
|
+
common.borderWidth = 1;
|
|
68
|
+
common.borderColor = theme.colors.border.default;
|
|
69
|
+
}
|
|
70
|
+
if (variant === 'elevated') {
|
|
71
|
+
common.boxShadow = [
|
|
72
|
+
{ offsetX: 0, offsetY: 1, blurRadius: 3, spreadDistance: 0, color: 'rgba(16, 18, 20, 0.10)' },
|
|
73
|
+
{ offsetX: 0, offsetY: 1, blurRadius: 2, spreadDistance: 0, color: 'rgba(16, 18, 20, 0.06)' },
|
|
74
|
+
];
|
|
75
|
+
}
|
|
76
|
+
return common;
|
|
77
|
+
}, [theme, variant, padding, radius]);
|
|
78
|
+
|
|
79
|
+
if (!onPress) {
|
|
80
|
+
return <View style={[baseStyle, style]}>{children}</View>;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return (
|
|
84
|
+
<Pressable
|
|
85
|
+
accessibilityRole="button"
|
|
86
|
+
accessibilityLabel={accessibilityLabel}
|
|
87
|
+
accessibilityState={{ disabled }}
|
|
88
|
+
disabled={disabled}
|
|
89
|
+
onPress={onPress}
|
|
90
|
+
style={({ pressed }: PressableStateCallbackType) => [
|
|
91
|
+
baseStyle,
|
|
92
|
+
{ opacity: pressed && !disabled ? 0.96 : 1 },
|
|
93
|
+
style,
|
|
94
|
+
]}
|
|
95
|
+
>
|
|
96
|
+
{children}
|
|
97
|
+
</Pressable>
|
|
98
|
+
);
|
|
99
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
import { Animated, Easing, type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
import { useTheme } from '../../theme';
|
|
4
|
+
import { palette } from '../../theme/palette';
|
|
5
|
+
import { Labeled, type LabelPosition } from '../_internal/Labeled';
|
|
6
|
+
|
|
7
|
+
export type SwitchSize = 'sm' | 'md';
|
|
8
|
+
|
|
9
|
+
export interface SwitchProps {
|
|
10
|
+
/** On/off state. */
|
|
11
|
+
value: boolean;
|
|
12
|
+
/** Called with the next value when toggled. */
|
|
13
|
+
onValueChange: (value: boolean) => void;
|
|
14
|
+
/** Control size: `sm` = 40×24, `md` = 52×32. Defaults to `md`. */
|
|
15
|
+
size?: SwitchSize;
|
|
16
|
+
/** Disable and dim the control. */
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/** Optional label. */
|
|
19
|
+
label?: string;
|
|
20
|
+
/** Where the label sits: top / bottom / left / right. Defaults to `right`. */
|
|
21
|
+
labelPosition?: LabelPosition;
|
|
22
|
+
/** Override the container style. */
|
|
23
|
+
style?: StyleProp<ViewStyle>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const BORDER = 1.5;
|
|
27
|
+
const SIZES: Record<SwitchSize, { width: number; height: number; handle: number; padding: number }> = {
|
|
28
|
+
sm: { width: 40, height: 24, handle: 18, padding: 3 },
|
|
29
|
+
md: { width: 52, height: 32, handle: 24, padding: 4 },
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Switch — faithful to the Bacon POS Figma "Form controls". A 52×32 pill:
|
|
34
|
+
* off (gray outline + gray handle), on (dark track + white handle). The handle
|
|
35
|
+
* slides and the track/handle colors cross-fade between states.
|
|
36
|
+
*/
|
|
37
|
+
export function Switch({
|
|
38
|
+
value,
|
|
39
|
+
onValueChange,
|
|
40
|
+
size = 'md',
|
|
41
|
+
disabled = false,
|
|
42
|
+
label,
|
|
43
|
+
labelPosition,
|
|
44
|
+
style,
|
|
45
|
+
}: SwitchProps) {
|
|
46
|
+
const theme = useTheme();
|
|
47
|
+
const cfg = SIZES[size];
|
|
48
|
+
const travel = cfg.width - 2 * BORDER - 2 * cfg.padding - cfg.handle;
|
|
49
|
+
const anim = useRef(new Animated.Value(value ? 1 : 0)).current;
|
|
50
|
+
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
Animated.timing(anim, {
|
|
53
|
+
toValue: value ? 1 : 0,
|
|
54
|
+
duration: 180,
|
|
55
|
+
easing: Easing.out(Easing.ease),
|
|
56
|
+
useNativeDriver: false, // interpolating colors
|
|
57
|
+
}).start();
|
|
58
|
+
}, [value, anim]);
|
|
59
|
+
|
|
60
|
+
const trackColor = anim.interpolate({
|
|
61
|
+
inputRange: [0, 1],
|
|
62
|
+
outputRange: [theme.colors.background.default, theme.colors.text.primary],
|
|
63
|
+
});
|
|
64
|
+
const borderColor = anim.interpolate({
|
|
65
|
+
inputRange: [0, 1],
|
|
66
|
+
outputRange: [palette.neutral[500], theme.colors.text.primary],
|
|
67
|
+
});
|
|
68
|
+
const handleColor = anim.interpolate({
|
|
69
|
+
inputRange: [0, 1],
|
|
70
|
+
outputRange: [palette.neutral[500], theme.colors.background.default],
|
|
71
|
+
});
|
|
72
|
+
const translateX = anim.interpolate({ inputRange: [0, 1], outputRange: [0, travel] });
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<Labeled
|
|
76
|
+
label={label}
|
|
77
|
+
labelPosition={labelPosition}
|
|
78
|
+
disabled={disabled}
|
|
79
|
+
onPress={() => onValueChange(!value)}
|
|
80
|
+
accessibilityRole="switch"
|
|
81
|
+
accessibilityState={{ checked: value, disabled }}
|
|
82
|
+
style={style}
|
|
83
|
+
>
|
|
84
|
+
<Animated.View
|
|
85
|
+
style={{
|
|
86
|
+
width: cfg.width,
|
|
87
|
+
height: cfg.height,
|
|
88
|
+
borderRadius: cfg.height / 2,
|
|
89
|
+
borderWidth: BORDER,
|
|
90
|
+
paddingHorizontal: cfg.padding,
|
|
91
|
+
flexDirection: 'row',
|
|
92
|
+
alignItems: 'center',
|
|
93
|
+
backgroundColor: trackColor,
|
|
94
|
+
borderColor,
|
|
95
|
+
opacity: disabled ? 0.5 : 1,
|
|
96
|
+
}}
|
|
97
|
+
>
|
|
98
|
+
<Animated.View
|
|
99
|
+
style={{
|
|
100
|
+
width: cfg.handle,
|
|
101
|
+
height: cfg.handle,
|
|
102
|
+
borderRadius: cfg.handle / 2,
|
|
103
|
+
backgroundColor: handleColor,
|
|
104
|
+
transform: [{ translateX }],
|
|
105
|
+
}}
|
|
106
|
+
/>
|
|
107
|
+
</Animated.View>
|
|
108
|
+
</Labeled>
|
|
109
|
+
);
|
|
110
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Switch, type SwitchProps } from './Switch';
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Text as RNText,
|
|
4
|
+
type TextProps as RNTextProps,
|
|
5
|
+
type TextStyle,
|
|
6
|
+
} from 'react-native';
|
|
7
|
+
import { useTheme, textStyle } from '../../theme';
|
|
8
|
+
import type { TypographyVariant, FontWeightToken } from '../../theme/typography';
|
|
9
|
+
|
|
10
|
+
type TextColorToken = keyof ReturnType<typeof useTheme>['colors']['text'];
|
|
11
|
+
|
|
12
|
+
export interface TextProps extends RNTextProps {
|
|
13
|
+
/** Type-scale variant from the design system. Defaults to `bodyMedium`. */
|
|
14
|
+
variant?: TypographyVariant;
|
|
15
|
+
/** Font weight token. Defaults to `regular`. */
|
|
16
|
+
weight?: FontWeightToken;
|
|
17
|
+
/** Semantic text color token, or any raw color string. Defaults to `primary`. */
|
|
18
|
+
color?: TextColorToken | (string & {});
|
|
19
|
+
/** Horizontal text alignment. */
|
|
20
|
+
align?: TextStyle['textAlign'];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Themed text primitive. Every string of copy in the app should render through
|
|
25
|
+
* this component so type scale, weight and color stay consistent.
|
|
26
|
+
*/
|
|
27
|
+
export function Text({
|
|
28
|
+
variant = 'bodyMedium',
|
|
29
|
+
weight = 'regular',
|
|
30
|
+
color = 'primary',
|
|
31
|
+
align,
|
|
32
|
+
style,
|
|
33
|
+
...rest
|
|
34
|
+
}: TextProps) {
|
|
35
|
+
const theme = useTheme();
|
|
36
|
+
|
|
37
|
+
const resolvedStyle = useMemo<TextStyle>(() => {
|
|
38
|
+
const textColor =
|
|
39
|
+
color in theme.colors.text
|
|
40
|
+
? theme.colors.text[color as TextColorToken]
|
|
41
|
+
: (color as string);
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
...textStyle(theme, variant, weight),
|
|
45
|
+
color: textColor,
|
|
46
|
+
...(align ? { textAlign: align } : null),
|
|
47
|
+
};
|
|
48
|
+
}, [theme, variant, weight, color, align]);
|
|
49
|
+
|
|
50
|
+
return <RNText style={[resolvedStyle, style]} {...rest} />;
|
|
51
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Text, type TextProps } from './Text';
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Pressable,
|
|
4
|
+
type AccessibilityRole,
|
|
5
|
+
type AccessibilityState,
|
|
6
|
+
type StyleProp,
|
|
7
|
+
type ViewStyle,
|
|
8
|
+
} from 'react-native';
|
|
9
|
+
import { Text } from '../Text/Text';
|
|
10
|
+
|
|
11
|
+
/** Where the label sits relative to the control. */
|
|
12
|
+
export type LabelPosition = 'top' | 'bottom' | 'left' | 'right';
|
|
13
|
+
|
|
14
|
+
export interface LabeledProps {
|
|
15
|
+
/** Optional label. When omitted the control is standalone. */
|
|
16
|
+
label?: string;
|
|
17
|
+
/** Where the label sits. Defaults to `right`. */
|
|
18
|
+
labelPosition?: LabelPosition;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/** Fired when the control (or its label) is pressed. */
|
|
21
|
+
onPress?: () => void;
|
|
22
|
+
/** Gap between control and label. Defaults to 8. */
|
|
23
|
+
gap?: number;
|
|
24
|
+
accessibilityRole?: AccessibilityRole;
|
|
25
|
+
accessibilityState?: AccessibilityState;
|
|
26
|
+
accessibilityLabel?: string;
|
|
27
|
+
style?: StyleProp<ViewStyle>;
|
|
28
|
+
/** The control visual. */
|
|
29
|
+
children: ReactNode;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Wraps a form control with an optional, positionable label and makes the whole
|
|
34
|
+
* row/column pressable. Shared by Checkbox, Radio and Switch.
|
|
35
|
+
*/
|
|
36
|
+
export function Labeled({
|
|
37
|
+
label,
|
|
38
|
+
labelPosition = 'right',
|
|
39
|
+
disabled = false,
|
|
40
|
+
onPress,
|
|
41
|
+
gap = 8,
|
|
42
|
+
accessibilityRole,
|
|
43
|
+
accessibilityState,
|
|
44
|
+
accessibilityLabel,
|
|
45
|
+
style,
|
|
46
|
+
children,
|
|
47
|
+
}: LabeledProps) {
|
|
48
|
+
const vertical = labelPosition === 'top' || labelPosition === 'bottom';
|
|
49
|
+
const controlFirst = labelPosition === 'right' || labelPosition === 'bottom';
|
|
50
|
+
const labelNode = label ? (
|
|
51
|
+
<Text variant="bodyMedium" color={disabled ? 'tertiary' : 'primary'}>
|
|
52
|
+
{label}
|
|
53
|
+
</Text>
|
|
54
|
+
) : null;
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<Pressable
|
|
58
|
+
onPress={onPress}
|
|
59
|
+
disabled={disabled}
|
|
60
|
+
accessibilityRole={accessibilityRole}
|
|
61
|
+
accessibilityState={accessibilityState}
|
|
62
|
+
accessibilityLabel={accessibilityLabel ?? label}
|
|
63
|
+
style={[
|
|
64
|
+
{ flexDirection: vertical ? 'column' : 'row', alignItems: 'center', gap, alignSelf: 'flex-start' },
|
|
65
|
+
style,
|
|
66
|
+
]}
|
|
67
|
+
>
|
|
68
|
+
{controlFirst ? children : labelNode}
|
|
69
|
+
{controlFirst ? labelNode : children}
|
|
70
|
+
</Pressable>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { View } from 'react-native';
|
|
2
|
+
import { graphics } from './registry';
|
|
3
|
+
|
|
4
|
+
/** Supported country flags. */
|
|
5
|
+
export type FlagCountry = 'us' | 'br';
|
|
6
|
+
|
|
7
|
+
export interface FlagProps {
|
|
8
|
+
/** Country flag to render. */
|
|
9
|
+
country: FlagCountry;
|
|
10
|
+
/** Diameter of the round flag chip in px. Defaults to 24. */
|
|
11
|
+
size?: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const KEY: Record<FlagCountry, 'flag-us' | 'flag-br'> = {
|
|
15
|
+
us: 'flag-us',
|
|
16
|
+
br: 'flag-br',
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Country flag rendered as a round chip (Figma "Flags"). The artwork is wider
|
|
21
|
+
* than tall, scaled to fill the circle and cropped. Multicolor, not tinted.
|
|
22
|
+
*/
|
|
23
|
+
export function Flag({ country, size = 24 }: FlagProps) {
|
|
24
|
+
const graphic = graphics[KEY[country]];
|
|
25
|
+
if (!graphic) return null;
|
|
26
|
+
const { Component } = graphic;
|
|
27
|
+
return (
|
|
28
|
+
<View
|
|
29
|
+
style={{
|
|
30
|
+
width: size,
|
|
31
|
+
height: size,
|
|
32
|
+
borderRadius: size / 2,
|
|
33
|
+
overflow: 'hidden',
|
|
34
|
+
alignItems: 'center',
|
|
35
|
+
justifyContent: 'center',
|
|
36
|
+
}}
|
|
37
|
+
>
|
|
38
|
+
<Component width={size * graphic.aspect} height={size} />
|
|
39
|
+
</View>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { graphics } from './registry';
|
|
2
|
+
|
|
3
|
+
/** Payment brand marks. */
|
|
4
|
+
export type LogoName = 'visa' | 'mastercard';
|
|
5
|
+
|
|
6
|
+
export interface LogoProps {
|
|
7
|
+
/** Brand mark to render. */
|
|
8
|
+
name: LogoName;
|
|
9
|
+
/** Rendered height in px; width follows the mark's aspect ratio. Defaults to 24. */
|
|
10
|
+
height?: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Multicolor payment brand logo (Visa, Mastercard). Rendered at its natural
|
|
15
|
+
* aspect ratio via a real react-native-svg component and NOT tinted — brand
|
|
16
|
+
* colors are preserved.
|
|
17
|
+
*/
|
|
18
|
+
export function Logo({ name, height = 24 }: LogoProps) {
|
|
19
|
+
const graphic = graphics[name];
|
|
20
|
+
if (!graphic) return null;
|
|
21
|
+
const { Component } = graphic;
|
|
22
|
+
return <Component width={height * graphic.aspect} height={height} />;
|
|
23
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import Svg, { G, Rect, Mask, Path, Circle } from "react-native-svg";
|
|
2
|
+
import type { SvgProps } from "react-native-svg";
|
|
3
|
+
const FlagBr = (props: SvgProps) => <Svg viewBox="0 0 33.5997 23.9998" fill="none" {...props}><G id="BR"><Rect id="Mask" x={0.0000243634} width={33.5997} height={23.9998} rx={1.71429} fill="white" /><Mask id="mask0_8024_16514" style={{
|
|
4
|
+
maskType: "luminance"
|
|
5
|
+
}} maskUnits="userSpaceOnUse" x={0} y={0} width={34} height={24}><Rect id="Mask_2" x={0.0000243634} width={33.5997} height={23.9998} rx={1.71429} fill="white" /></Mask><G mask="url(#mask0_8024_16514)"><Rect id="Mask Copy" x={0.0000243634} width={33.5997} height={23.9998} fill="#05AB41" /><Path id="Rectangle 60" fillRule="evenodd" clipRule="evenodd" d="M3.94146 12.4798C3.59346 12.2546 3.59346 11.7454 3.94146 11.5203L16.4895 3.40095C16.6784 3.27872 16.9214 3.27872 17.1103 3.40095L29.6583 11.5203C30.0063 11.7454 30.0063 12.2546 29.6583 12.4798L17.1103 20.5991C16.9214 20.7213 16.6784 20.7213 16.4895 20.5991L3.94146 12.4798Z" fill="#FDD216" /><G id="Oval 2"><Circle id="Mask_3" cx={16.7999} cy={12} r={5.59995} fill="#053087" /><Mask id="mask1_8024_16514" style={{
|
|
6
|
+
maskType: "luminance"
|
|
7
|
+
}} maskUnits="userSpaceOnUse" x={11} y={6} width={12} height={12}><Circle id="Mask_4" cx={16.7999} cy={12} r={5.59995} fill="white" /></Mask><G mask="url(#mask1_8024_16514)"><Path id="Line" d="M10.536 10.5361C11.4153 9.82406 14.2525 10.4985 16.9009 11.205C19.5494 11.9115 22.3116 13.3923 23.0149 14.2608" stroke="white" strokeWidth={1.14286} strokeLinecap="square" /></G></G></G></G></Svg>;
|
|
8
|
+
export default FlagBr;
|